Link to home
Start Free TrialLog in
Avatar of arpoodle
arpoodle

asked on

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
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Try it like this


java -Dorg.xml.sax.driver=org.xml.sax.XMLReader -jar jasper-mysql.jar configure.xml
Avatar of sciuriware
sciuriware

You are missing some .jar's.
Look at 'jasper' for dependencies.

;JOOP!
Your setup to use a xml parser that is not available
try changing your default xml (sax) parser
try to see:
echo %classpath%
and see if all the jar are included
Avatar of arpoodle

ASKER

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

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.
where would the classpath normaly point?  to the JDK?

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

a
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.
>>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
is your build.xml a correct xml?
Try to open it in a browser.
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>
>>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
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
>can't run the jar it produces
you must create a correct manifest file
that aside, I shoud stil be able to run the app from the original, precomiled jar I downloaded, no?

a
>from the original, precomiled jar I downloaded
Yes, if it's created in correct manner.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
:-)
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)
thanks.

makes sense.

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

a