Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7870789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:43:16+00:00 2026-06-03T01:43:16+00:00

I am running a test on Ubuntu with Oracle Java 7 Update 3. According

  • 0

I am running a test on Ubuntu with Oracle Java 7 Update 3. According to the release notes it has JAXB-2.2.4 included with it.

/home/ubuntu# update-alternatives --config java
There is only one alternative in link group java: /usr/lib/jvm/java-7-oracle/bin/java
Nothing to configure.

The machine says it has JAXB-2.2.4 on it:

$ wsimport -version
JAX-WS RI 2.2.4-b01

$ java -version

java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode)

However when I run my app which uses JAX-RS and marshalls some objects with JAXB I get the following error:

Apr 05, 2012 10:45:50 AM com.sun.jersey.api.json.JSONConfiguration natural
SEVERE: NATURAL JSON notation configured, but JAXB RI 2.1.10 not found. For the
recent builds to get this working correctly, you need even at least JAXB version
 2.1.12. Please add it to your classpath!
Apr 05, 2012 10:45:50 AM com.sun.jersey.core.spi.component.ProviderFactory __get
ComponentProvider
SEVERE: The provider class, class com.marketchorus.rest.config.JAXBContextResolv
er, could not be instantiated. Processing will continue but the class will not b
e utilized
java.lang.RuntimeException: NATURAL JSON notation configured, but JAXB RI 2.1.10
 not found. For the recent builds to get this working correctly, you need even a
t least JAXB version 2.1.12. Please add it to your classpath!

On the server side I got that same error initially so I installed metro-2.2-standalone into tomcat which fixed the issue. (Even though it was running in java 7).

On a windows client I was forced to add JAXB-2.2.5 api, impl, and jsr173 jars to my endorsed java directory to make it work (with Java 7 update 3 there as well).

When I try to do the jaxb trick under ubuntu I put the files under /usr/lib/jvm/java-7-oracle/jre/lib/endorsed I get a different error:

ERROR 10:55:44.694 taskScheduler-1 org.springframework.scheduling.support.TaskUt
ils$LoggingErrorHandler - Unexpected error occurred in scheduled task.
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.MXParser
Factory not found

I am initializing the JAX-RS/JAXB code in my class as follows:

config = new DefaultClientConfig();
config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
config.getClasses().add(JAXBContextResolver.class);
client = Client.create(config);
service = client.resource(UriBuilder.fromUri(proc.getUrl()).build());

I tried to compile it with source=1.7 and target=1.7 as it was still set for 1.6 and I was thinking maybe it was assuming the old version from the early 1.6 releases which was too old but that doesn’t solve the problem either.

I ran @andih’s test program and I still get the error. I am starting to think it is a VM issue:

ubuntu@ip-10-202-155-29:~/test$ java -cp jersey-client-1.12.jar:jersey-core-1.1
2.jar:jersery-fastinfoset-1.12.jar:jersey-json-1.12.jar:. TestNaturalJson
Apr 23, 2012 10:17:21 AM com.sun.jersey.api.json.JSONConfiguration natural
SEVERE: NATURAL JSON notation configured, but JAXB RI 2.1.10 not found. For the
recent builds to get this working correctly, you need even at least JAXB version
 2.1.12. Please add it to your classpath!
Exception in thread "main" java.lang.RuntimeException: NATURAL JSON notation con
figured, but JAXB RI 2.1.10 not found. For the recent builds to get this working
 correctly, you need even at least JAXB version 2.1.12. Please add it to your cl
asspath!
        at com.sun.jersey.api.json.JSONConfiguration.natural(JSONConfiguration.j
ava:447)
        at TestNaturalJson.main(TestNaturalJson.java:6)
ubuntu@ip-10-202-155-29:~/test$ java -version
java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode)

Looking back at the endorsed solution with JAXB-2.2.5 RI I installed the files:

jaxb-api.jar
jaxb-impl.jar
jsr173_1.0_api.jar

into the:

/usr/lib/jvm/java-7-oracle/jre/lib/endorsed

Directory. When I do that I get the above error from Spring the MXParser error. The wierd thing here is under windows this works, but not on Ubuntu. When I run @andhi’s test program below with the endorsed setup I get OK instead of the error. But for some reason it looks like Spring under Ubuntu isn’t picking up the JSR173 jar file that is installed in the endorsed dir (which is the STAX implementation).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T01:43:17+00:00Added an answer on June 3, 2026 at 1:43 am

    Well I appreciate all the comments on here, but no one managed to solve my problem, so I worked around it as follows. I installed Metro-2.2 into Tomcat 7. Then since my app is a Spring command line App I built a war out of it so it could run in the tomcat container. This involved putting all my libraries for my app in WEB-INF/lib my configuration files in WEB-INF/classes. In the WEB-INF dir I put a web.xml file that looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd">
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/classes/remote-scheduler-spring-config.xml</param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <session-config>
            <session-timeout>60</session-timeout>
        </session-config>
    </web-app>
    

    index.jsp is empty as there is no web facing component to this app. The spring-config parameter is my top level spring config file that would get loaded from the command line. My ant build then builds a war out of this app, and it runs great. So still not sure why my endorsed files in the jvm didn’t work as using the verbose:class flag as suggested showed them getting loaded, but by using tomcat as the container and loading the classes I need there, Jersey is happy and all the issues have gone away. Thanks again for all the help on this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am on Ubuntu x64 bit running: java version 1.6.0_18 OpenJDK Runtime Environment (IcedTea6
I have a process that is running as a java daemon on Ubuntu Linux.
I'm running Eclipse Helios Service Release 1, with Tomcat 7.0.12 in Linux Ubuntu Natty
I'm running ubuntu. I installed sqlite3 and java via the synaptic package manager, and
I'm using eclipse + android SDK on ubuntu, and running a test activity server
In my C# program, I have a thread that represents a running test, which
When running a test using the Tornado AsyncHTTPTestCase I'm getting a stack trace that
I am running a test on servers with the following line: Get-WmiObject Win32_Service -ComputerName
I'm running a test, and found that the file doesn't actually get written until
I have an automated test running on my program that generates some large MPG

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.