Yes, I agree. I am probably doing something wrong in setting the classpath or
java_home.
As far as the application, it's a web based application using django and
extjs, and in some part of it, it creates a report using IRE and uses fop to
convert it to pdf. I have not written the application, so I am not sure
about how exactly the fop part works, but I know that it is working on some
other computers at work.
Anyway, I don't think this is even related to the application. I tried
running fop from command line and I am getting same error.
When I said using export, I meant, export CLASSPATH=$CLATHPATH:full_path.
Also, I didn't have JAVA_HOME set, I did it, but it's not working! So I am
thinking maybe I am doing something definitely wrong.
Here's more info on what I did:
$locate fop.jar
/usr/local/fop-0.95/build/fop.jar
$which java
/usr/bin/java
#this is a soft link though, the actual address of java is :
/usr/lib/jvm/java-6-openjdk/jre/bin/java
Then, in /etc/environment I have:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
JAVA_HOME="/usr/lib/jvm/java-6-openjdk/jre"
CLASSPATH="/usr/local/fop-0.95/build: "
I have also tried JAVA_HOME="/usr/lib/jvm/java-6-openjdk",
When I try to run fop using command line and some test files:
$fop -xml /var/local/ims2/files/data.xml -xsl
/var/local/ims2/files/template.xsl -pdf /var/local/ims2/files/test.pdf
I also get the same error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/fop/cli/Main
Caused by: java.lang.ClassNotFoundException: org.apache.fop.cli.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.apache.fop.cli.Main. Program will exit.
Thank you very much for your help,
Rob Sargent-4 wrote:
>
> A little more info on your process and environment might be useful. I'm
> not sure what you mean by use export: maybe export
> CLASSPATH=full-path-to-fop.jar? Something later on in your process could
> be making a different classpath?
> Which application are "within"? And if within an app, why are you
> calling the cli code? Perhaps you app execs fop?
>
>
>
> On 04/26/2011 11:42 AM, code_expert wrote:
>> Hi, Thanks for your reply. I checked the classpath, and it was empty.
>> Then I
>> added the fop.jar to it, using export and also /etc/environment, but it
>> didn't make any changes. Any other idea?
>>
>>
>>
>> Rob Sargent-4 wrote:
>>> Your classpath is missing fop.jar?
>>>
>>> On 04/26/2011 10:43 AM, code_expert wrote:
>>>> Hi Guys,
>>>>
>>>> I have installed fop 0.95 (on ubuntu) and I am trying to use it within
>>>> an
>>>> application to create pdf files. I get the following error message
>>>> though. I
>>>> appreciate any help or idea, as I am not sure what causes this and how
>>>> to
>>>> fix it.
>>>>
>>>> Exception in thread "main" java.lang.NoClassDefFoundError:
>>>> org/apache/fop/cli/Main Caused by:
>>>> java.lang.ClassNotFoundException: org.apache.fop.cli.Main at
>>>> java.net.URLClassLoader$1.run(URLClassLoader.java: 217) at
>>>> java.security.AccessController.doPrivileged(Native Method) at
>>>> java.net.URLClassLoader.findClass(URLClassLoader.j ava:205) at
>>>> java.lang.ClassLoader.loadClass(ClassLoader.java:3 21) at
>>>> sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294) at
>>>> java.lang.ClassLoader.loadClass(ClassLoader.java:2 66) Could not find
>>>> the
>>>> main class:
>>>> org.apache.fop.cli.Main. Program will exit.
>>>>
>>>> Thanks,
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://old.nabble.com/FOP-does-not-create-PDF-file-tp31480120p31481974.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]