Free Support Forum - aspose.com

License applied. Getting java.lang.IncompatibleClassChangeError

Hi there,

Just got a temporary license file from your Aspose sales department, put it in /tmp/ and testing very simple class function. Oracle 10g, Java 1.4.2. calling as a Java stored procedure. Latest Aspose.Words for Java 10.3.0

working version (producing 4 pages pdf with big red EVALUATION blah-blah...):

public static void DocxToPdf(String dir, String filename) throws Exception
{
Document doc = new Document(dir + filename + ".docx");
doc.save(dir + filename + ".pdf");
}

not working version:

public static void DocxToPdf(String dir, String filename) throws Exception
{
License license = new License();
license.setLicense("/tmp/Aspose.Words.lic");
Document doc = new Document(dir + filename + ".docx");
doc.save(dir + filename + ".pdf");
}

Java call terminated by uncaught Java exception: java.lang.IncompatibleClassChangeError

Any thoughts?

Thank you

Hi there,

Thanks for your inquiry.

Can you please try recompiling your application from scratch and seeing if this error still occurs then?

Thanks,

already did. I even dropped the jar and installed it again. Still getting the error

Hi

Thanks for your request. Could you please provide a full stack trace of the exception? Also please send your license to me for testing. You can safety send your license to us via e-mail as described here:

http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

Best regards,

how can I get a full stack trace from there calling this java stored procedure from an Oracle stored procedure?

Hi

Thank you for additional information. I checked your license on my side and it works fine.

You can catch the exception using try-catch block and then get stack trace of the exception. For example as described here:

http://www.roseindia.net/java/java-get-example/java-get-stack-trace-string.shtml

Best regards,

java.lang.IncompatibleClassChangeError
at com.aspose.words.wy.e(License.java:543)
at com.aspose.words.wy.b(License.java:273)
at com.aspose.words.wy.a(License.java:242)
at com.aspose.words.License.setLicense(License.java:143)
at xxDocx.DocxToPdf(xxDocx:40)

the procedure is:

public static void DocxToPdf(String dir, String filename) throws Exception
{
License license = new License();
license.setLicense("/tmp/Aspose.Words.Java/lib/Aspose.Words.lic");

Document doc = new Document(dir + filename + ".docx");
doc.save(dir + filename + ".pdf");

}

Hi

Thank you for additional information. The problem might occur because there are two versions of Java installed. I suppose you have a similar problem as discussed here:

https://forums.oracle.com/forums/thread.jspa?threadID=999437

Best regards,

thank you for the link. They suggesting to recompile a client side for 1.6. There is no client side where I can recompile it, it's all on the server with Oracle Applications 11i, Oracle 10g and Java 1.4.2 and if I even try to compile Aspose.Words 1.5 or 1.6 it's just not working, all classes are invalid. Only 1.4 works (which is expectable).

Besides I'm getting this Java incompatible class error in Oracle SQL Developer, which runs Java stored procedure on a LINUX SERVER, which means the Java server side compiler 1.4.2 involved on a SERVER side. There is no local JRE involved. Oracle Application installed on the server works on 1.4.2 and that's for sure.

I've just run java -version command from Windows Command Prompt on my machine just in case and it saying Java version "1.4.2_03".

Java Console which is in a tray oni my machine: Oracle JInitiator: Version 1.3.1.29
Using JRE version 1.3.1.29-internal Java HotSpot(TM) Client VM. Default Virtual Machine Version 1.6.0_03-b05. But it's used to get Oracle Applications and SQL Developer interface only, not a server side compilation...

Can it be a problem with a type of a license? Why only the License class fail? the rest of the package seems to work well...

What's the resume? We were so close to buy it cause it works well and easy to implement to Oracle...

P.S. Just recompiled this class and loaded in Linux environment, the same as I used to load Jar file. Still same error..

P.P.S. the class attached

Hi

Thanks for your request. Please try adding the following two lines of code:

import org.w3c.dom.*

import javax.xml.*

Please let me know if this helps.

Best regards,

-> javac -classpath Aspose.Words.Java/lib/Aspose.Words.jdk14.jar:classes12.jar xxDocx.java
xxDocx.java:3: package javax.xml does not exist
import javax.xml.*;

if I remove a string with javax then compiling OK but still there is java.lang.IncompatibleClassChangeError when I run the stored procedure

Hi

Thanks for your request. javax.xml should be available on your side. Maybe you should explicitly add reference to it:

http://download.oracle.com/javase/1.5.0/docs/api/javax/xml/package-summary.html

Best regards,

How can I do it?

btw we've got java 1.4, not 1.5

Hi

As I can see, it is also available in 1.4:

http://download.oracle.com/javase/1.4.2/docs/api/javax/xml/parsers/package-summary.html

Best regards,

yeah but why it says no such class then and producing that incompatible error? does it mean we've got some limited java?

another funny stuff I'm getting when run the command "java" :

Usage: gij [OPTION] ... CLASS [ARGS] ...
to invoke CLASS.main, or
gij -jar [OPTION] ... JARFILE [ARGS] ...
to execute a jar file

what should I do to run my application with no evaluation stuff affecting the output file?

Hi

Thanks for your request. Unfortunately, I am not quite familiar with Oracle 10g. But I am sure there is something in your environment, but not in Aspose.Words. We tested Aspose.Words for jdk1.4 in normal Java 1.4 environment and it works just perfectly. Have you tried to contact Oracle support?

You can see that javax.xml should be available in Oracle 10g:

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14293/toc.htm

So maybe there is some glitch in Oracle 10g or you should import each package separately, i.e.:

import javax.xml.parsers;

import javax.xml.transform;

import javax.xml.transform.dom;

import javax.xml.transform.sax;

import javax.xml.transform.stream;

Best regards,

-> java -version
java version "1.4.2"
gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-11)

Hi

Thank you for additional information. Have you tried adding imports as I suggested. Did it make any difference?

Best regards,

no, still "package javax.xml does not exist" (for each extra import string) if I compile it in a command line on a server side,

and compiling OK if I do it in SQL Developer on my machine BUT my class gets invaslid and "IncompatibleClassChangeError" pops up I run my class...

So we need javax.xml classes installed. I'll let you know if we get it done

Hi

Thank you for additional information. Have you tried to contact Oracle support? Maybe they already have a resolution of this weird issue.

Best regards,