I'm trying to convert an XML file to a PDF file using XSL-FO, I found the code in this example:
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java?view=markup
but I receive this Exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/xmlgraphics/image/loader/impl/ImageRawPNG
at org.apache.fop.render.pdf.PDFImageHandlerRawPNG.getSupportedImageClass(PDFImageHandlerRawPNG.java:51)
at org.apache.fop.render.ImageHandlerRegistry.addHandler(ImageHandlerRegistry.java:97)
at org.apache.fop.render.ImageHandlerRegistry.discoverHandlers(ImageHandlerRegistry.java:169)
at org.apache.fop.render.ImageHandlerRegistry.<init>(ImageHandlerRegistry.java:64)
at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:168)
at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:177)
at searchManagement.export.PdfExporter.main(PdfExporter.java:77)
Caused by: java.lang.ClassNotFoundException: org.apache.xmlgraphics.image.loader.impl.ImageRawPNG
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 7 more
Do you have some advices?
Thanks!
This error means that one of the classes you are using is trying to use the class org/apache/xmlgraphics/image/loader/impl/ImageRawPNG but can't find it.
What you need to do, is find the jar that contains that class and add it to the classpath.
Related
i'm using lucene 4.0 and i want to create a new indexWriter in this way:
IndexWriter index = LuceneUtils.createIndexWriter(indexPath, true);
(it worked using lucene 3.6)
where indexPath is a String with the path of the index. I got this error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/analysis/SimpleAnalyzer
at lucene.IndexCreator.<init>(IndexCreator.java:25)
at main.Main.main(Main.java:72)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.SimpleAnalyzer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 2 more
i have read that i need to add lucene-analyzers-common-4.0.0.jar to the project besides lucene-core-4.0.0.jar, but i get the same error.
as a matter of fact the path of SimpleAnalyzer.class inside lucene-analyzers-common-4.0.0.jar is not org.apache.lucene.analysis.SimpleAnalyzer but org.apache.lucene.analysis.core.SimpleAnalyzer.
It looks like you might have a 3.6 jar in your class path. Can you verify that an older version isn't being pulled in, possibly by transitive dependencies?
I'm trying to start local version of DynamoDB on the command line (OSX) using the following command as specified in the documentation:
java –Djava.library.path=. -jar DynamoDBLocal.jar
But getting the following errors:
Exception in thread "main" java.lang.NoClassDefFoundError: �Djava/library/path=/
Caused by: java.lang.ClassNotFoundException: �Djava.library.path=.
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Any ideas on how to resolve this issue?
The � shows that it may be a character, which looks like hyphen '-' . Please inspect this.
Also, whenever you are using -D option, its best practice to use a complete jar name (rather than wild card). This will make sure that you are missing nothing.
I am using BPM API to retrieve a list of task assigned to a particular user. But, While running the class file I am getting following error:--
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/j2ee/ws/common/jaxws/ServiceDelegateImpl
at oracle.bpm.client.BPMServiceClientFactory.<init>(BPMServiceClientFactory.java:102)
at oracle.bpm.client.BPMServiceClientFactory.getInstance(BPMServiceClientFactory.java:144)
at project3.Fixture.getBPMServiceClientFactory(Fixture.java:33)
at project3.Fixture.getBPMServiceClient(Fixture.java:49)
at project3.GetProcessInstances.testGetProcessInstances(GetProcessInstances.java:29)
at project3.GetProcessInstances.main(GetProcessInstances.java:24)
Caused by: java.lang.ClassNotFoundException: oracle.j2ee.ws.common.jaxws.ServiceDelegateImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
... 6 more
I have already added the following Jar file to my project:--
Oracle.bpm.runtime.jar
Oracle.bpm.client.jar
Bpm-services.jar
Wsclient.jar
But still the issue is not resolved..
Any Suggestion??????
Aside from the reason it is not working you should be using the TaskQueryService provided by Oracle out of the box.
java.lang.NoClassDefFoundError: gnu/trove/THashMap
i am using JGAP API for solving Load Distribution problem using Genetic Algorithm.
Problem i am facing right now is not really related to Jgap.
i am trying to create an object of class WeightedRoulleteSelector and i am getting ths exception :
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: gnu/trove/THashMap
at org.jgap.impl.WeightedRouletteSelector.<init>(WeightedRouletteSelector.java:48)
....
Caused by: java.lang.ClassNotFoundException: gnu.trove.THashMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Dont have an idea how to overcome this. do i need to add jar file for this??
please help out
You need to add trove library in your runtime classpath
I am trying to run the sample helloworld program for quartz scheduling given on roseindi.net
http://www.roseindia.net/quartz/quartz-scheduler-tutorial.shtml
I have both the classes given there exactly similar setup in my java projecy with quartz version 1.6 - all.jar in the project library.
When I try to run the application I get the following Exception
Exception in thread "main" java.lang.NoClassDefFoundError: javax/transaction/UserTransaction
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1104)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1355)
at oiaoerpdataconnector.HelloSchedule.HelloScheduleRun(HelloSchedule.java:25)
at oiaoerpdataconnector.HelloSchedule.main(HelloSchedule.java:37)
Caused by: java.lang.ClassNotFoundException: javax.transaction.UserTransaction
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 4 more
Java Result: 1
What am I missing here?
Thanks,
Priyank
What am I missing here?
jta.jar