We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DocumentBuilder.insertHtml() fails with HTML containing text inside table tag (Oracle 11G DB)

P.S. This may be related to my other post

DocumentBuilder.insertHtml() fails with ExceptionInInitializerError/NullPointerException running in Oracle 11g JVM

Database Version: 11.2.0.4.0
JVM Version: 1.5 (within Oracle database).
Aspose version: 14.10 - this is the latest version that doesn’t have the issue in the above post AND that supports JVM 1.5, which is the version inside the database. This also fails for version 14.9

The test case (see below) works fine for Aspose.Words 13.10. It also works fine when run in Sun JVM on a Windows PC. See end of the test case for error produced.

It seems to be the fact that the html contains text inside a (
X
). without text, or lack of
in the HTML seems to work in the DB.

Referring to my other post, the theory was that there was a resource (font) missing from the jar file. Could this be a similar issue?

Could you please offer any advice?

Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.4.0
Connected as sc@scc

SQL> set serveroutput on
SQL> exec dbms_java.set_output(1000000);
PL/SQL procedure successfully completed
SQL> create or replace and compile java source named testasposewords as
2 import com.aspose.words.Document;
3 import com.aspose.words.DocumentBuilder;
4 import com.aspose.words.SaveFormat;
5 import java.io.ByteArrayOutputStream;
6 public class TestAsposeWords
7 {
8 public static void test(String html) throws Exception
9 {
10 System.out.println ("------------------------------------------------------------------------------------");
11 System.out.println (“html=”+html);
12 Document doc = new Document();
13 DocumentBuilder builder=new DocumentBuilder(doc);
14 System.out.println (“Before insertHtml()”);
15 builder.insertHtml (html);
16 System.out.println (“Before save()”);
17 ByteArrayOutputStream dstStream = new ByteArrayOutputStream();
18 doc.save(dstStream, SaveFormat.DOCX);
19 System.out.println (“After save()”);
20 }
21 }
22 /
create or replace and compile java source named testasposewords as
import com.aspose.words.Document;
import com.aspose.words.DocumentBuilder;
import com.aspose.words.SaveFormat;
import java.io.ByteArrayOutputStream;
public class TestAsposeWords
{
public static void test(String html) throws Exception
{
System.out.println ("------------------------------------------------------------------------------------");
System.out.println (“html=”+html);
Document doc = new Document();
DocumentBuilder builder=new DocumentBuilder(doc);
System.out.println (“Before insertHtml()”);
builder.insertHtml (html);
System.out.println (“Before save()”);
ByteArrayOutputStream dstStream = new ByteArrayOutputStream();
doc.save(dstStream, SaveFormat.DOCX);
System.out.println (“After save()”);
}
}
ORA-29553: class in use: SC.TestAsposeWords
SQL> create or replace procedure Test_Aspose_words (p_HTML IN VARCHAR2)
2 AS LANGUAGE JAVA
3 NAME ‘TestAsposeWords.test(java.lang.String)’;
4 /
Procedure created
SQL> exec Test_Aspose_words(‘IGNORE’);
------------------------------------------------------------------------------------
html=IGNORE
Before insertHtml()
Before save()
After save()
PL/SQL procedure successfully completed
SQL> exec Test_Aspose_words (‘

Hello

’);
------------------------------------------------------------------------------------
html=

Hello

Before insertHtml()
Before save()
After save()
PL/SQL procedure successfully completed
SQL> exec Test_Aspose_words (‘

Hello

’);
------------------------------------------------------------------------------------
html=

Hello

Before insertHtml()
Before save()
After save()
PL/SQL procedure successfully completed
SQL> exec Test_Aspose_words (’
’);
------------------------------------------------------------------------------------
html=
Before insertHtml()
Before save()
After save()
PL/SQL procedure successfully completed
SQL> exec Test_Aspose_words (’
’);
------------------------------------------------------------------------------------
html=
Before insertHtml()
Before save()
After save()
PL/SQL procedure successfully completed
SQL> exec Test_Aspose_words (‘
X
’);
------------------------------------------------------------------------------------
html=
X
Before insertHtml()
Exception in thread “Root Thread” java.lang.NoClassDefFoundError
at com.aspose.words.zz9X.zzZ(Unknown Source)
at asposewobfuscated.zzTD.zzZ(Unknown Source)
at asposewobfuscated.zzTD.zzZ(Unknown Source)
at asposewobfuscated.zzTD.zzZ(Unknown Source)
at com.aspose.words.zzZAV.zzZ(Unknown Source)
at com.aspose.words.zzZAV.zzZ(Unknown Source)
at com.aspose.words.zzZAV.zzZy(Unknown Source)
at com.aspose.words.zzYZ3.zzY(Unknown Source)
at com.aspose.words.zzYZ3.zzL(Unknown Source)
at com.aspose.words.zzYZ3.zzZ(Unknown Source)
at com.aspose.words.zzYZ3.zzZ91(Unknown Source)
at com.aspose.words.zzYZ3.zzZ93(Unknown Source)
at com.aspose.words.zzYZ3.zzZ94(Unknown Source)
at com.aspose.words.Table.zzZ9X(Unknown Source)
at com.aspose.words.zzZTE.zzZ(Unknown Source)
at com.aspose.words.zzZU1.zzZ(Unknown Source)
at com.aspose.words.zzZU1.zzP(Unknown Source)
at com.aspose.words.zzZU1.zzQ(Unknown Source)
at com.aspose.words.zzZU1.zzP(Unknown Source)
at com.aspose.words.zzZU1.zzQ(Unknown Source)
at com.aspose.words.zzZU1.zzP(Unknown Source)
at com.aspose.words.zzZU1.zzQ(Unknown Source)
at com.aspose.words.zzZU1.zzZ(Unknown Source)
at com.aspose.words.DocumentBuilder.zzZ(Unknown Source)
at com.aspose.words.DocumentBuilder.insertHtml(Unknown Source)
at TestAsposeWords.test(TESTASPOSEWORDS:14)
begin Test_Aspose_words (‘
X
’); end;
ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError
ORA-06512: at “SC.TEST_ASPOSE_WORDS”, line 1
ORA-06512: at line 1

SQL>

Hi Jonathan,

We are investigating the issue in detail and will update you soon. Sorry for the inconvenience.

Best Regards,

Hi Jonathan,

JDK 1.5 support has been dropped by Oracle so it is not supported by latest versions of Aspose.Words also. We are sorry to share that it will not be possible for us to resolve any issue for JDK 1.5.

The only possible solution at the moment is to upgrade to JDK 1.6 or later. We are sorry for the inconvenience.

Best Regards,