Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NoSuchMethodError when Call.invoke is invoked in Axis2  RSS feed

 
sriraman seshadri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We are calling a web service over HTTPS , using axis 2.
We get the below error when call.invoke() method is invoked
This error is not occurring in our local machine where we have Weblogic 8 server with sun JRE.
This error is occuring in UAT/PROD machines where we have Weblogic 8 server with IBM jre.
Google says to upgrade to JAVA5. But we cant upgrade or endorse any jar files.
Currently we have axis jars (and our application's service.jar) in the EJB classpath
Is there any work around solution for this ?

java.lang.NoSuchMethodError: org.w3c.dom.Element: method getTextContent()Ljava/lang/String; not found
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:1902)
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which Axis 2 version are you using? 1.5 requires Java 5, where as 1.4 (and earlier) should run fine on Java 1.4.
 
sriraman seshadri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

Thanks for your speedy reply
We are currently using axis 1.2
We are not facing this issue when we use SUN JRE 1.4
We are facing this issue in UAT an PROD because in those environment we have IBM JRE 1.4.
IBM JRE 1.4 has a jar file named xml.jar which has Element.class which doesnt have this getTextContent() method.
But Sun JRE 1.4 doesnt have this xml.jar file in its lib folder.
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. Did you find a solution for this? If yes, then kindly post it. If not ...

Ok. Hold on a second ... How come you are using an IBM VM with Weblogic? Are the target UAT and PROD environments running AIX or something? And does this describe your issue? Anyway, some ideas for you to try out:
1. This may not be possible in your case ... but is it an option to install and run the Sun JRE with Weblogic?
2. In your case, you are developing using Axis2 which requires 1.5, but deploying in 1.4. Usually, you develop using the target JRE if possible to avoid such last minute issues ... blah blah but you knew that. Anyway, to resolve such jar conflicts, one common approach is to use parent class loading. Please see this related Weblogic document. Basically, the idea is to include your desired jars in your application's lib folder, and then have the server (Weblogic, Websphere App Server, etc.) first check your jars to resolve classes before it looks for them in the JRE jars. So you can go to findJar, search for jars containing org.w3c.dom.Element, see which of those jars is used by your app during development, and then include that jar in your lib path (package it with your application) if its not already there. If its already included, then that is good. But you need to ensure in the Weblogic settings that for your particular web application, it searches your application's libraries first before it looks in IBM VM's libraries. That should take care of it.

Please try it out if you still have the issue. I have done this with success in other servers, but not Weblogic, but its a standard strategy and should work out.

Best of luck!
 
sriraman seshadri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for your response.

Currently our prod and uat servers are maintained by IBM. IBm have installed a JRE in those servers and have created the weblogic domains with JAVA_HOME as IBM jre.
We are not using axis2. We are using axis1.2.
Ours is a struts based web application which connects to EJB which is deployed in a different (remote) weblogic server. The EJB uses axis 1.2 to connect to a third party (connects through SSL). The EJB is packaged as a jar file which has a META-INF folder (which has the manifest.mf and other xml files) and the other auxillary jars which is used by the EJB.
The exception is thrown from the EJB module. And this exception is thrown when call.invoke method is called. Once this method is called the control goes to the axis1.2.jar.
We dont have web.xml or weblogic.xml or weblogic-application.xml in the ejb module. We have only the META-INF folder and the ejb.jar in the domains/{domain-name}/applications folder of the weblogic server
Is there a way to set an option like prefer-webinf-classes settings in ejb xml files ? or is there a place in the ejb jar where we can set this setting ?
 
R Srini
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. If it is an option, when you request deployment, you could specify this in your deployment instructions, because this issue needs to be resolved at the app server level (where you ask it to search your libraries first) - not at the individual application level. Other than that, I don't know. Maybe someone with EJB deployment knowledge can help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!