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

Free Support Forum - aspose.com

SAP WebDynpro Application AND java.lang.NoSuchMethodError: javax/xml/namespace/QName.getPrefix()Ljava/lang/String;

Hi,


I downloaded the trial version of the Apose.Cells (aspose-cells-7.4.0-java) to evaluate its compatibility in my WebDynpro Application. we used the libraries from the JDK 1.4.

The libraries and licenses are placed inside the META-INF and lib folders of our project.

However, when I deploy the application, I gives out the error:

java.lang.NoSuchMethodError: javax/xml/namespace/QName.getPrefix()Ljava/lang/String;
at com.aspose.cells.b.a.h.k.a(Unknown Source)
at com.aspose.cells.lV.a(Unknown Source)
at com.aspose.cells.mq.k(Unknown Source)
at com.aspose.cells.mq.a(Unknown Source)
at com.aspose.cells.mp.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)

any ideas?

thanks!

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Aspose.Cells for Java also require some other prerequisite libraries, which you should add in your classpath. Please get them from major download link: Aspose.Cells for Java 7.4.0

These are the following libraries, please see if it resolves your issue.

  1. bcprov-jdk16-146.jar
  2. dom4j-1.6.1.jar
  3. stax2-api-3.0.2.jar
  4. woodstox-core-asl-4.1.1.jar

Hi,


thanks for your prompt reply.

Actually, all those jars were already placed in the lib and META-INF folders of the application’s classpath. I also included the jar files: aspose-cells-7.4.0 and jsr173_1.0_api. Moreover, the licenses such as BouncyCastle_LICENSE, Dom4j_LICENSE,jsr173_LICENSE and Woodstox_LICENSE were included in the lib and META-INF folders of the applicaton’s classpath.

I still get the same error.

thanks!
Hi,

The required API (javax/xml/namespace/QName.getPrefix()) is in the jar jsr173_1.0_api.jar. We think the most possible reason for your issue is that there is another library of JSR173 which may be older but was loaded by your server prior to the newer one provided by the archive of aspose.cells.

Please check all the libraries your server uses, if you can find other jar files containing the class javax.xml.namespace.QName, please remove the existing jar or replace it with the jsr173_1.0_api.jar and try again.
will check on that.

thank you very much! :)

Hi again,


I have found that rt.jar file, which is imported in my application, also contains the required API (javax/xml/namespace/QName.getPrefix()). I tried replacing that file to jsr173_1.0_api but my application gives me error because the rt.jar is also required since its a part of the runtime java environment.

I tried not including your jsr173_1.0_api jar fille but it also gives me error, as follows:
java.lang.NoClassDefFoundError: javax.xml.stream.XMLStreamConstants
------------------------- Loader Info -------------------------
ClassLoader name: [sap.com.fes.tdc/custupld]
Parent loader name: [Frame ClassLoader]
References:
common:service:http;service:servlet_jsp
service:ejb
common:service:iiop;service:naming;service:p4;service:ts
service:jmsconnector
library:jsse
library:servlet
common:library:IAIKSecurity;library:activation;library:mail;library:tc~sec~ssl
library:ejb20
library:j2eeca
library:jms
library:opensql
common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:signature_lib;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:tc~lm~nzdm~crrsrv;service:userstore
interface:resourcecontext_api
interface:webservices
interface:cross
interface:ejbserialization
sap.com/tc~wd~dispwda
sap.com/tc~wd~corecomp
service:webdynpro
service:sld
library:tc~ddic~ddicservices
library:com.sap.aii.proxy.framework
library:tc~graphics~igs
library:com.sap.mw.jco
library:com.sap.lcr.api.cimclient
library:sapxmltoolkit
library:com.sap.aii.util.rb
library:com.sap.util.monitor.jarm
library:tc~ddic~ddicruntime
library:com.sap.aii.util.xml
library:com.sap.aii.util.misc
library:tc~cmi
Resources:
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/META-INF/dom4j-1.6.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/META-INF/woodstox-core-asl-4.1.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/dom4j-1.6.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/woodstox-core-asl-4.1.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/META-INF/bcprov-jdk14-146.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/META-INF/stax2-api-3.0.2.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/bcprov-jdk14-146.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/stax2-api-3.0.2.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/META-INF/aspose-cells-7.4.0.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/aspose-cells-7.4.0.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.test.test/testcustupld/webdynpro/public/lib/app.jar
Loading model: {parent,references,local}
---------------------------------------------------------------
The error occurred while trying to load “com.aspose.cells.b.a.h.j”.
------------------------- Loader Info -------------------------
ClassLoader name: [sap.com.test.test/testcustupld]
Parent loader name: [Frame ClassLoader]
References:
common:service:http;service:servlet_jsp
service:ejb
common:service:iiop;service:naming;service:p4;service:ts
service:jmsconnector
library:jsse
library:servlet
common:library:IAIKSecurity;library:activation;library:mail;library:tc~sec~ssl
library:ejb20
library:j2eeca
library:jms
library:opensql
common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:signature_lib;library:webservices_lib;service:adminadapter;service:basicadmin;service:com.sap.security.core.ume.service;service:configuration;service:connector;service:dbpool;service:deploy;service:jmx;service:jmx_notification;service:keystore;service:security;service:tc~lm~nzdm~crrsrv;service:userstore
interface:resourcecontext_api
interface:webservices
interface:cross
interface:ejbserialization
sap.com/tc~wd~dispwda
sap.com/tc~wd~corecomp
service:webdynpro
service:sld
library:tc~ddic~ddicservices
library:com.sap.aii.proxy.framework
library:tc~graphics~igs
library:com.sap.mw.jco
library:com.sap.lcr.api.cimclient
library:sapxmltoolkit
library:com.sap.aii.util.rb
library:com.sap.util.monitor.jarm
library:tc~ddic~ddicruntime
library:com.sap.aii.util.xml
library:com.sap.aii.util.misc
library:tc~cmi
Resources:
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/META-INF/dom4j-1.6.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/META-INF/woodstox-core-asl-4.1.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/dom4j-1.6.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/woodstox-core-asl-4.1.1.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/META-INF/bcprov-jdk14-146.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/META-INF/stax2-api-3.0.2.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/bcprov-jdk14-146.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/stax2-api-3.0.2.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/META-INF/aspose-cells-7.4.0.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/aspose-cells-7.4.0.jar
/usr/sap/IE5/JC00/j2ee/cluster/server0/apps/sap.com.fes.tdc/custupld/webdynpro/public/lib/app.jar
Loading model: {parent,references,local}
---------------------------------------------------------------
The error occurred while trying to load “com.aspose.cells.b.a.h.k”.
at com.sap.engine.frame.core.load.ReferencedLoader.loadClass(ReferencedLoader.java:401)
at com.aspose.cells.a.c.z.a(Unknown Source)
at com.aspose.cells.rt.a(Unknown Source)
at com.aspose.cells.mq.a(Unknown Source)
at com.aspose.cells.mq.k(Unknown Source)
at com.aspose.cells.mq.a(Unknown Source)
at com.aspose.cells.mp.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at sap.com.test.test.UploadItemsView.insertUploadAsposeData(TestUploadItemsView.java:303)
at sap.com.test.test.UploadItemsView.onActionUploadItems(TestUploadItemsView.java:387)
at sap.com.test.test.wdp.InternalUploadItemsView.wdInvokeEventHandler(InternalTestUploadItemsView.java:227)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:333)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:741)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:694)
at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:253)
at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1060)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(AccessController.java:219)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
thanks! :)
Hi,

Thanks for your posting and using Aspose.Cells for Java.

Do you get the same error of "java.lang.NoSuchMethodError: javax/xml/namespace/QName.getPrefix()Ljava/lang/String;" if you place jsr173_1.0.jar back to your lib?

There are two possible reasons for your issue:

1. The QName in rt.jar is some old version and the getPrefix() method is different than the one required by our component. You can try to remove it from rt.jar and if you get other such kind of conflicts of classes in rt.jar and jsr173_1.0.jar, remove them from rt.jar two and try again(please backup rt.jar first in case of other error caused by such kind of operation).
2. We think another possibility is that there is another QName class in other jar files which has no such a method but was loaded prior to rt.jar and jsr173_1.0.jar. If so, you will still get the same error even if you removed all duplicated classes in rt.jar. In such situation you will have to search your library to find it out and remove it. And same with the solution for possibility 1, if there is no signature for the jar for integrity, you can just remove the duplicated classes and keep other classes in the jar.
Also there is a possible solution for both possibilityies, if your server allows you to change the sequence of loaded classes, you can let jsr173_1.0.jar be loaded prior to other jars so the classes in it can take effect. And you can try to put this jar into the server’s global library to check whether it can work.

Hi,


I have tried two options, which resulted to different errors.

1. I have deleted the QName.class from the rt.jar and maintained the QName.class in jsr173_1.0_api.jar. This option gave me the same error as the first one: java.lang.NoSuchMethodError: javax/xml/namespace/QName.getPrefix()Ljava/lang/String;

2. I have deleted QName.class in both rt.jar and jsr173_1.0_api.jar. During deployment, my application aborted and this is the new error that I encountered:

Result
=> deployment aborted : file:/C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/temp51432sap.com.test.test~testcustupld.ear
Aborted: development component ‘testcustupld’/‘sap.com.test.test’/‘LOKAL’/‘0.2013.02.13.12.40.10’/‘0’:Caught exception during application deployment from SAP J2EE Engine’s deploy service:java.rmi.RemoteException: Cannot deploy application sap.com.test.test/testcustupld… Reason: Webservices common deployment exception! The reason is: Error occurred, trying to update web services for application sap.com.test.test/testcustupld. Unable to collect web services update information. . Additional info: {1}; nested exception is: java.lang.Exception: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occurred, trying to update web services for application sap.com.test.test/testcustupld. Unable to collect web services update information. . Additional info: {1} at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.updateWebServices(WSUpdateProcessor.java:80) at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateManager.makeUpdate(WSUpdateManager.java:52) at com.sap.engine.services.webservices.server.deploy.WSDeployer.makeUpdate(WSDeployer.java:274) at com.sap.engine.services.deploy.server.application.UpdateTransaction.makeComponents(UpdateTransaction.java:402) at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:325) at com.sap.engine.services.deploy.server.application.UpdateTransaction.begin(UpdateTransaction.java:166) at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:292) at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:326) at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:3241) at com.sap.engine.services.deploy.server.DeployServiceImpl.update(DeployServiceImpl.java:677) at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:1278) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:330) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:201) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:137) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(AccessController.java:219) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)Caused by: com.sap.engine.interfaces.webservices.server.deploy.WSDeploymentException: Webservices common deployment exception! The reason is: Error occurred, trying to load web services location information for module /usr/sap/IE5/JC00/j2ee/cluster/server0/./temp/deploy/work/deploying/reader1360730571989/jsr173_1.0_api.jar. . Additional info: {1} at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.loadWSArchiveLocationWrappers(WSDefinitionFactory.java:381) at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.loadWSArchiveLocationWrappers(WSDefinitionFactory.java:359) at com.sap.engine.services.webservices.server.deploy.ws.update.WSUpdateProcessor.updateWebServices(WSUpdateProcessor.java:71) … 19 moreCaused by: java.util.zip.ZipException: Error opening zip file /usr/sap/IE5/JC00/j2ee/cluster/server0/./temp/deploy/work/deploying/reader1360730571989/jsr173_1.0_api.jar at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:162) at java.util.jar.JarFile.(JarFile.java:164) at java.util.jar.JarFile.(JarFile.java:129) at com.sap.engine.services.webservices.server.deploy.util.jar.JarUtil.hasEntry(JarUtil.java:68) at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.containsWSDeploymentDescriptor(WSDefinitionFactory.java:1591) at com.sap.engine.services.webservices.server.deploy.ws.WSDefinitionFactory.loadWSArchiveLocationWrappers(WSDefinitionFactory.java:373) … 21 more (message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).REMEXC)

Deployment exception : The deployment of at least one item aborted

thanks! :slight_smile:

Hi,

Thanks for your further input.

We have logged your feedback in our database. We will look into your issue and advise you asap.

Once, there is some update for you, we will let you know.

This issue has been logged as CELLSJAVA-40443.

Hi,

Firstly, now that you still get the same error even if you have deleted the QName.class from both jars(rt.jar and jsr173_1.0_api.jar), it is sure that there must be another jar which contains QName.class and this class has no getPrefix() method. So we are afraid you still have to searched the jar and remove it or remove QName.class from it.
For the error you got when removed the jsr173_1.0_api.jar, from the stacktraces you gave it seems that your server still try to load information of jsr173_1.0_api.jar. Maybe you should clean the application configurations before deployment to let the server know the deletion of that jar.

Hi,

Thanks for using Aspose.Cells for Java.

We have implemented our xml parser and remove the dependency of woodstox
and jsr libraries. You would never get such kind of issue with the new
versions/fixes.

Please download and try the latest version: Aspose.Cells for Java 7.5.0.