• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

java -jar fil.jar config.xml failing miserably

I'm executing the following, with the results as shown:

C:\jasper_mysql>java -jar jasper-mysql.jar configure.xml
java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl
        at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
        at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
        at net.sf.jasperreports.mysql.Daemon.loadConfig(Unknown Source)
        at net.sf.jasperreports.mysql.Daemon.main(Unknown Source)
Exception: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found
You probably enterd a bad filename.

I've ensured the paths are accurate (or I believe so)

can anyone assist in getting this .jar file running?

a
0
arpoodle
Asked:
arpoodle
  • 8
  • 7
  • 5
  • +2
1 Solution
 
CEHJCommented:
Try it like this


java -Dorg.xml.sax.driver=org.xml.sax.XMLReader -jar jasper-mysql.jar configure.xml
0
 
sciuriwareCommented:
You are missing some .jar's.
Look at 'jasper' for dependencies.

;JOOP!
0
 
objectsCommented:
Your setup to use a xml parser that is not available
try changing your default xml (sax) parser
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Giant2Commented:
try to see:
echo %classpath%
and see if all the jar are included
0
 
arpoodleAuthor Commented:
Giant2:

echo %classpath% returns:

C:\jasperreports-mysql-1.0.2>echo %CLASSPATH%
%CLASSPATH%

C:\jasperreports-mysql-1.0.2>

objects:
Without wanting to sound stupid, how do I change the XML parser. I don'r recall installing one, or is it part of the JDK?

sciuriware:
Ther's nothing in the jasper install info regarding any dependancies.

CEHJ: that command executed with exact same errors

0
 
Giant2Commented:
So you have no classpath declared.
Pass it in the commandline (-classpath....)
http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html

Bye, Giant.
0
 
arpoodleAuthor Commented:
where would the classpath normaly point?  to the JDK?

sorry.. I've done very little with Java apps,

a
0
 
arpoodleAuthor Commented:
I've executed

C:\>set CLASSPATH=C:\Program Files\Java\jdk1.5.0_06\lib

but it still gives the same error.

playing with the source build coughs these errors:

compile:
    [javac] Compiling 42 source files to C:\jasperreports-mysql-1.0.2\build\clas
ses

BUILD FAILED
C:\jasperreports-mysql-1.0.2\build.xml:61: Unable to find a javac compiler;
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK

Total time: 1 second


which does suggest a path issue.
0
 
CEHJCommented:
>>Without wanting to sound stupid, how do I change the XML parser.

By doing what i said. If the program ignores it, then you'll have to use the specified parser
0
 
Giant2Commented:
is your build.xml a correct xml?
Try to open it in a browser.
0
 
arpoodleAuthor Commented:
i'm using a precomiled .jar file, there's nowhere to set the XML parser, it was simply a JAR and WAR file to download.  the WAR gets deployed, and the JAR runs as a "poller" to connect to databases specified in the configure.xml

I've checked JAVA_HOME and CLASSPATH and still have the same result:

C:\jasper_mysql>echo %CLASSPATH%
C:\Program Files\Java\jdk1.5.0_06\lib;c:\crimson-1.1.3;C:\Program Files\Java\jre
1.5.0_06

C:\jasper_mysql>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.5.0_06

C:\jasper_mysql>java -jar jasper-mysql.jar configure.xml
java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl
        at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
        at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
        at net.sf.jasperreports.mysql.Daemon.loadConfig(Unknown Source)
        at net.sf.jasperreports.mysql.Daemon.main(Unknown Source)
Exception: SAX2 driver class org.apache.crimson.parser.XMLReaderImpl not found
You probably enterd a bad filename.

C:\jasper_mysql>
0
 
CEHJCommented:
>>I've checked JAVA_HOME and CLASSPATH and still have the same result:

It's nothing to do with that really. See my last two answers. You need to download the Crimson parser from the link I gave you and put it in your classpath
0
 
arpoodleAuthor Commented:
I've done that, CLASSPATH now includes it:

C:\Program Files\Java\jdk1.5.0_06\lib;C:\Program Files\Java\jre1.5.0_06;c:\crimson-1.1.3

but still the same error.

I can even compile from source now, but then can't run the jar it produces

a
0
 
Giant2Commented:
>can't run the jar it produces
you must create a correct manifest file
0
 
arpoodleAuthor Commented:
that aside, I shoud stil be able to run the app from the original, precomiled jar I downloaded, no?

a
0
 
Giant2Commented:
>from the original, precomiled jar I downloaded
Yes, if it's created in correct manner.
0
 
CEHJCommented:
Put that Crimson jar into the jre/lib/ext directory of your Java runtime
0
 
arpoodleAuthor Commented:
it was the crimson parser, or lack of that was the issue.

Thanks :D

still need to debug some output, and the config file, but at last it's trying to make a connection now :D

a
0
 
CEHJCommented:
:-)
0
 
CEHJCommented:
Just as a final remark, excuse the thing about the classpath from me:

>>and put it in your classpath

as i was forgetting you're running a jar. You can in fact get rid of that classpath as it's redundant and in fact incorrect (jar files need to be named explicitly, including the file name in a classpath, not just the directories)
0
 
arpoodleAuthor Commented:
thanks.

makes sense.

Just have to work out why Tomcat doesn't like a certain XML configuration file now

a
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 8
  • 7
  • 5
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now