javax.xml.stream.util.XMLEventAllocator not found by Aspose_Word


#1

I am trying to convert HTML to DOC in Aspose 18.6 version through HtmlLoadOptions loadOptions = new HtmlLoadOptions();

and

LoadOptions options = new LoadOptions();

Document doc1 = new Document(LICENSE_DIR+html_to_doc_file_name+".html" , loadOptions);

and document i am using like above , but in both the casess i am getting below exception :slight_smile:

Caused by: java.lang.ClassNotFoundException: javax.xml.stream.util.XMLEventAllocator not found by Aspose_Word [514]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(Unknown Source)

===============
Can you please let me know the reason


Convert HTML to DOCX
#2

@subrata.mettle,

We suggest you please upgrade to the latest version of Aspose.Words for Java i.e. 18.11 and see how it goes on your end? Hope, this helps.

In case the problem still remains, please ZIP and upload your input HTML file you are getting this problem with here for testing. We will then investigate the issue on our end and provide you more information.


#3

Hi Awais,

Thanks for quick response .

when I am updating the version , it’s giving me below exception in line where i have used the set-licence…

Caused by: java.lang.ClassNotFoundException: javax.xml.stream.XMLStreamException not found by com.aspose.words [515]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(Unknown Source)

===================================

Below is the HTML …

Strength our global network

As you position yourselves for expansion and growth in the ever-changing [INDUSTRY NAME] industry, it is important to have the strength and consistency of our global network working for you at all times. In-country specialists have deep industry experience and understand the issues you confront. To dig into topics, in-country specialists will proactively schedule meetings with you to discuss issues and explore ideas. Our global team understands the importance of providing insights and sharing leading practices on an ongoing basis with both management and the audit committee.

This is BBBBBB - Local

FATCA assistance - Local

This content discusses in a one –page summary, the details related to the FATCA assistance can perform, including a Assessment.

Recommend placing this content behind an Appendix.

This is Business Expansion Advisory - Global

Offshore jurisdictions - Global

We recommend placing this content within and not as a stand-alone section. Coming soon – Ireland, British Virgin Islands, and India.

==========================


#4

Just to give you additional information when I am trying to conver whole html files to docs.

i am using builder.insertHtml, it’s generating the doc file.
but if the html having a image tag thn getting the exception.

any other way to transfer whole HTML file to DOC in one go.

in the demo version i have tried
Document doc = new Document(dataDir + “Test_DOC.html”);
doc.save(dataDir + “Test_DOC.doc”);

but same above one is not working in license version hence tried with builder.insertHtml which is working fine, but issue is only with image tag if it’s present in html.

kindly suggest.


#5

@subrata.mettle,

Please ZIP and attach your input HTML document along with images here for testing. We will investigate the issue on our side and provide you more information.


#6

Hi Tahir,

PFA image and HTML,

where i have tried to builder1.insertHtml with whole HTML content.
as it’s having an img tag hence getting below error .

+++++++++++++++++++++++++

java.lang.NoClassDefFoundError: javax/xml/stream/util/XMLEventAllocator
at asposewobfuscated.zz29.zzR(Unknown Source)
at asposewobfuscated.zz3E.(Unknown Source)
at asposewobfuscated.zz3E.(Unknown Source)
at asposewobfuscated.zz9P.zzZ(Unknown Source)
at asposewobfuscated.zzP.(Unknown Source)
at com.aspose.words.zzZE9.(Unknown Source)
at com.aspose.words.zzZE9.(Unknown Source)
at com.aspose.words.zzFZ.zzSW(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)

Caused by: java.lang.ClassNotFoundException: javax.xml.stream.util.XMLEventAllocator not found by Aspose_Word [518]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)Aspose_Html_to_Doc_documentbuilder.zip (11.8 KB)


#7

@subrata.mettle,

I am afraid, the following code does not cause any exception when using the latest version of Aspose.Words for Java i.e. 18.11 on our end.

Document doc = new Document("D:\\temp\\Banner-retro.html");
doc.save("D:\\temp\\awjava-18.11.doc");

See output .doc file: awjava-18.11.zip (13.1 KB)

So, please upgrade to the latest version of Aspose.Words for Java. Hope, this helps.


#8

Hi Awais,

That’s the question I have asked already , above approach I have tried with 18.11 version in Demo.

but when I have implemented the code with the license one for 18.11 version I am getting below error in line where I have written “lic.setLicense

=============

java.lang.NoClassDefFoundError: javax/xml/namespace/NamespaceContext
at com.aspose.words.zzZLO.zzV(Unknown Source)
at com.aspose.words.zzZLO.zzW(Unknown Source)
at com.aspose.words.zzZLO.zzY(Unknown Source)
at com.aspose.words.License.setLicense(Unknown Source)


Caused by: java.lang.ClassNotFoundException: javax.xml.namespace.NamespaceContext not found by com.aspose.words [519]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 119 common frames omitted

===========================================


#9

@subrata.mettle,

Are you getting this problem when setting license?

If that is the case, then please post your license file via private message. In order to send a private message with attachments, please click on my name and find “Message” button. (see steps ). We will then investigate the issue on our end and provide you more information. Please do not share your license file publicly in this thread.


#10

Hi Awais,

Thanks for your quick response, sending the license file will be data bridge issue.
Can you please tell us exactly which field you want to check in the license file so that we can provide that data only.

Thanks and Regards,
Subrata


#11

@subrata.mettle,

Can you please try setting the license from File or Stream or including the License file as an Embedded Resource?
https://docs.aspose.com/display/wordsjava/License+Aspose.Words#LicenseAspose.Words-ApplyLicenseusingFileorStreamObject


#12

Thanks Awais, for all your support.

whatever option you have mentioned I have tried with 18.11 version with licence .
but getting same exception on setlicence method :

==========
Caused by: java.lang.ClassNotFoundException: javax.xml.namespace.NamespaceContext not found by com.aspose.words [519]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
at java.lang.ClassLoader.loadClass(Unknown Source)

Can we have short call where I can show you how we are implementing the code, you can point me whatever stuff I did wrong which required to be change.

or in any case can you give me a license file which I will use in my code to test .

Many Thanks !

Thanks and Regards,
Subrata


#13

@subrata.mettle,

Unfortunately, we do not provide technical support over the phone. Phone support is only available for sales and purchase questions.

Please post your license file via private message. In order to send a private message with attachments, please click on my name and find “Message” button. (see steps ). We will then investigate the problem with your license file on our end and provide you more information. Please do not share your license file publicly in this thread.

Thanks for your understanding.


#14

@subrata.mettle,

Please also try to upgrade your current JDK to the latest version and see if the issue disappears on your end if another JDK version is used?

Please also provide the exact OS version and its architecture x64 or x86 (32-bit or 64-bit etc). What Java version are you currently using on your end? Any other special environment configurations on your end?

We would also be needing simplified piece of code to reproduce the issue on our end. Thanks for your cooperation.


#15

Hi Awais,

Hope you have received the file.

Below are the few additional details :

==============
java version “1.8.0_181”
Java™ SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot™ 64-Bit Server VM (build 25.181-b13, mixed mode)

Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T00:03:14+05:30)
Maven home: C:\apache-maven-3.5.4-bin\apache-maven-3.5.4\bin…
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_181\jre
Default locale: en_IN, platform encoding: Cp1252
OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”

=================================
OS I am using Windows 10, 64 bit OS

====================================

We are inlcuding the Aspose JAR into AEM from there we are using the Aspose API.
we have included the proper dependency in the Maven file also.

com.aspose aspose-words 18.11 jdk16 com.aspose aspose-words 18.11 javadoc

Please let me know is any additional details you require from my side or not.

Thanks and Regards
Subrata


#16

@subrata.mettle,

Thank you for sharing license file via Private message.

We have logged your problem in our issue tracking system. Your ticket number is WORDSJAVA-1949. We will further look into the details of this problem and will keep you updated on the status of the linked issue.


#17

Hi Awais,

Hope you are doing well .

Any update on this issue, kindly let me know the progress .
we are eagerly waiting for the +ve response.

Many Thanks !

Regards,
Subrata


#18

@subrata.mettle,

We have recorded your concerns in our issue tracking system.

Unfortunately, this issue is currently pending for analysis and is in the queue. We will inform you via this thread as soon as this issue is resolved or any further updates are available. We apologize for your inconvenience.


#19

Hi Awais,

Thanks for all your support, can you please expedite the process as it’s a critical requirement for us to append Image in the document.

Any additional information from your side will also help us.

Thanks and Regards,
Subrata


#20

@subrata.mettle,

We have recorded your concerns in our issue tracking system. We will keep you posted on any further updates.