NoClassDefFound error for com/aspose/pdf/BaseParagraph with aspose pdf 23.1 jdk17 jar in Eclipse - noclassdeffounderror

I am trying to work with aspose PDF jar and I am not able to get past the NoClassDefFound error for aspose pdf jar. I am using aspose imaging as well as aspose words jar. Both these do not have these, but only aspose PDF does.
Compilation is successful, but on run time I hit this issue.
I am using eclipse IDE
Any help is highly appreciated as I am running out of options to solve this issue.
**Steps tried : **
Switched workspace
Deleted the entire project
Made sure there is only one class with that name (essentially only one jar)
Classpath entries are fine in eclipse. Buildpath->libraries->add external jars. also order and export is selected.

Related

Eclipse not attaching source automatically

I am using Eclipse Oxygen. Everything was working fine until one day I imported a Spring Boot maven project which has problem in pom.xml saying that tools.jar is missing. In the process of trying to remove this error I messed around with build path and many things. Now Eclipse is no longer able to automatically attach sources and I have to manually attach the source. For example, see below image
The source jar file actually exist but eclipse is not able detect it.
I have to manually click the "Attach Source" and locate the source file, and then only the source code is attached. Eclipse should be doing this under the hood. I googled a lot but all solutions given were not working for me. Please help.

ClassNotFoundException: com.itextpdf.text.Element

Situation: I have a Java file in my project that uses the features of the iTextPDF library. The project compiles properly. I use JDK 1.7, Tomcat 7.45 and Eclipse Neon.3 Release (4.6.3).
Problem: While starting the server via Eclipse, I get an error:
java.lang.ClassNotFoundException: com.itextpdf.text.Element
What I've tried so far:
Ensured that only 1 version of iTextPdf 5.4.jar is available in the entire project. It's there in WEB-INF/lib folder. It's not there in any of the externally referenced libraries.
I updated my Eclipse.
Any help will be greatly appreciated.
Well, as a starting point- try and expanding the JAR, and see if you can search for or manually find com.itextpdf.text.Element class.
if it's not found there, you know there's nothing wrong with your eclipse or project settings, and nothing wrong with your jar imports.
You should then determine between 3 options:
Is the JAR even on the classpath? it's possible everything is present there, but the project does not even consider looking in it.
Should this class be in the JAR? is it available on other versions of this JAR?
Is this class neccesasry for you application? why is eclipse looking for it, where in the code it is referecened? can you live without it? or, can you manullay replace it with a class file you can find online? (this will take some debug time, and some more research on your part)

POI XSSF : javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found - Error

I'm having this problem in a RCP Aplication.
A little Introduccion.
My App is build with Eclispe Indigo 32 bits.
I have two projects, one is mainly a library container, and the other project is the main application, and it have a relation to the Library Project, all in one Elipse Workspace.
A few year ago, I was reading xls files, but now I need to read and write xlsx, and xlsm files.
So I downloaded all POI binary files (poi-bin-3.16-20170419).
I managed to add jar files in library Project, so the source filesgive me NO errors.
But when I run the application I get this error:
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
I try to reorder jar files in "Java Build Path"-> "Order and Export", but the error is the same.
I'll add some screen captures.
Here I try to put Stax-api-xx.jar first, because javax.xml.stream.FactoryFinder is in two libs, jre_1.6 and stax-api !
Where is the error ?
A sneak peak of my workspace:
Best regards
Delete the javax/xml folder from local repository and try building the project again.
This will solve the issue in some cases.

Eclipse not exporting libraries

(In Eclipse) When I right click export and export as a Jar file, it does not package the libraries into the Jar file. It was exporting the libraries a couple weeks ago and the libraries were going into the Jar file and I'm not sure what changed.
I figured it was Eclipse so I reinstalled the program and imported the workspace with no luck. I also tried on a completely different machine.
I've moved the libraries into a container in Eclipse and also tried external libraries and none of the libraries are exporting. The only thing it's exporting is the class files, .claspath, .project, and the manifest.
Any suggestions would be greatly appreciated!
Of course when you post a question you've been working on (for hours) you seem to find the answer 5 minutes later...
The file was not exporting correctly because I chose "JAR file" instead of "Runnable JAR File".

How can I use Sun's JAI-ImageIO with an Eclipse BIRT plugin?

I'm trying to write an extension (plug-in) for Eclipse BIRT reporting. It involves extracting images from a file according to database entries and displaying them.
I am using Sun's JAI-ImageIO to access TIFF file data and convert to PNG for display within the report. My code complies, but throws a NoClassDefFound runtime exception:
SEVERE: Error happened while running the report.
java.lang.NoClassDefFoundError: javax/media/jai/PlanarImage
at org.eclipse.birt.sample.reportitem.rotatedlabel.util.GraphicsUtil.createDocImage
(GraphicsUtil.java:66)
at org.eclipse.birt.sample.reportitem.rotatedlabel.RotatedLabelPresentationImpl.onRowSets
(RotatedLabelPresentationImpl.java:136)
at org.eclipse.birt.report.engine.extension.ReportItemPresentationBase.onRowSets
(ReportItemPresentationBase.java:218)
at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.
processExtendedContent(LocalizedContentVisitor.java:966)
...
I am using the PlanarImage.getAsBufferedImage() method, so it should convert to a more standard image object. I have placed the JAI jar files in my JRE and tested the same basic code outside of the Eclipse plugin environment -- that works fine. It appears to be a CLASSPATH problem, but I've verified that all JREs on my system contain the necessary jar and DLL files in the appropriate places.
For a new JDBC driver, you must place the jar(s) in a special sub-directory of plugins -- is there a special place to put other third-party jars so BIRT can use them?
This has been solved in Eclipse extension for opening TIFF type 4 images. Basically you just need to make a subdirectory and place all the JARs and DLLs in it, add the jars to your classpath and add the DLLs to the "plugin dependencies" under "required native libraries".