need help - 'the jarfile jsr173_api.jar has no source attachment'

L

learner9

Hello,
I am using eclipse to run my code. I get the following error when I
compile my code.
I have already added jsr173_api.jar file to my project
properties/libraries. But I still get the below error.

Can some one please hlep me with.

**********************************************************
javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.MXParserFactory not found
at javax.xml.stream.FactoryFinder.newInstance
(FactoryFinder.java:72)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
at javax.xml.stream.XMLInputFactory.newInstance
(XMLInputFactory.java:136)
at EUtilParseExample.main(EUtilParseExample.java:20)
Exception in thread "main"

The source attachment does not contain source for the file
factoryFinder.class.

the jarfile jsr173_api.jar has no source attachment
*********************************************************************


Am I missing some thing here?

Thanks
-L
 
O

Oliver Wong

learner9 said:
Hello,
I am using eclipse to run my code. I get the following error when I
compile my code.
I have already added jsr173_api.jar file to my project
properties/libraries. But I still get the below error.

Can some one please hlep me with.

**********************************************************
javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.MXParserFactory not found
at javax.xml.stream.FactoryFinder.newInstance
(FactoryFinder.java:72)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:176)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
at javax.xml.stream.XMLInputFactory.newInstance
(XMLInputFactory.java:136)
at EUtilParseExample.main(EUtilParseExample.java:20)
Exception in thread "main"

The source attachment does not contain source for the file
factoryFinder.class.

the jarfile jsr173_api.jar has no source attachment
*********************************************************************


Am I missing some thing here?

"the jarfile jsr173_api.jar has no source attachment" is not part of the
error you're experiencing. What's happening is an exception is being thrown
(which usually means you've got problems). Eclipse tries to be helpful by
showing you information on the source code where the exception occured, but
in this case, since you don't have the source code for the relevant classes,
Eclipse is telling you it can't provide this help. This is a seperate matter
from the actual exception itself.

The key information is the first two lines, which I'll split up so that
it's clear where these lines are (since one of them is long and may be
word-wrapped):

<stacktraceSnippet>
<firstLine>
javax.xml.stream.FactoryConfigurationError: Provider
com.bea.xml.stream.MXParserFactory not found
</firstLine>
<secondLine>
at javax.xml.stream.FactoryFinder.newInstance (FactoryFinder.java:72)
</secondLine>
</stacktraceSnippet>

"javax.xml.stream.FactoryConfigurationError" tells you the name of the
exception that occured. If you look it up in the javadocs, you'll find:
http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/FactoryConfigurationError.html

<quote>
Thrown when a problem with configuration with the Parser Factories exists.
This error will typically be thrown when the class of a parser factory
specified in the system properties cannot be found or instantiated.
</quote>

The second part of the first line gives a "detailed" message further
explaining the exception. It reads "Provider
com.bea.xml.stream.MXParserFactory not found". So perhaps you have a system
property which refers to com.bea.xml.stream.MXParserFactory, but Java was
unable to find this class.

If that's still not enough information, another tactic is to look at the
method which threw the exception for more clues. The second line shows you
what method threw the exception; in this case, it's
javax.xml.stream.FactoryFinder.newInstance. Unfortunately, I couldn't find
documentation for this method, but it might be somewhere on your harddrive
and perhaps it came with the JAR you're using. At any rate, the API
documentation, if it's properly written, should have a section calls
"throws" which explain under what conditions the exception is thrown for
that particular method. For example, if you look at
http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#File(java.lang.String)
it says:

<quote>
Throws:
NullPointerException - If the pathname argument is null
</quote>

and you'll know that if you get a NullPointerException from the
specified method, it probably means that "pathname" was set to null.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top