• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis2 NoSuchMethodError

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I am kind of surprised of this mistake.

Following this tutorial: http://www.tidytutorials.com/2009/02/web-services-example-using-axis-2-and.html, I block at the client execution.



The function is called here into the axis2-kernel-1.5.1.jar package, we can successfully find org.apache.axis2.client, Stub.class and its method addAnonymousOperations().

http://img695.imageshack.us/img695/4306/preuvez.jpg
http://img695.imageshack.us/i/preuvez.jpg

Into my AXISCLASSPATH, I got axis2-kernel-1.5.1.jar included...


C:\remi\dev\Axis2TomcatHelloworldold\client_bin>echo %AXISCLASSPATH%
C:\remi\dev\ws\axis2-1.5.1\lib\wsdl4j-1.6.2.jar;C:\remi\dev\ws\axis2-1.5.1\lib\a
xis.jar;C:\remi\dev\ws\axis2-1.5.1\lib\commons-discovery-0.2.jar;C:\remi\dev\ws\
axis2-1.5.1\lib\commons-logging-1.1.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\jaxrpc.
jar;C:\remi\dev\ws\axis2-1.5.1\lib\saaj.jar;C:\remi\dev\ws\axis2-1.5.1\lib\log4j
-1.2.15.jar;C:\remi\dev\ws\axis2-1.5.1\lib\xml-apis-1.3.02.jar;C:\remi\dev\ws\ax
is2-1.5.1\lib\xercesImpl-2.6.6.jar;C:\axis2-1.1.1.jar;C:\remi\dev\ws\axis2-1.5.1
\lib\axis2-adb-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-adb-codegen-1.5.1.
jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-ant-plugin-1.5.1.jar;C:\remi\dev\ws\axi
s2-1.5.1\lib\axis2-clustering-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-cod
egen-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-corba-1.5.1.jar;C:\remi\dev\
ws\axis2-1.5.1\lib\axis2-fastinfoset-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\ax
is2-java2wsdl-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-jaxws-1.5.1.jar;C:\
remi\dev\ws\axis2-1.5.1\lib\axis2-jaxbri-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\li
b\axis2-jaxws-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-jibx-1.5.1.jar;C:\r
emi\dev\ws\axis2-1.5.1\lib\axis2-json-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\a
xis2-kernel-1.5.1.jar
;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-metadata-1.5.1.jar;C:
\remi\dev\ws\axis2-1.5.1\lib\axis2-mtompolicy-1.5.1.jar;C:\remi\dev\ws\axis2-1.5
.1\lib\axis2-saaj-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-spring-1.5.1.ja
r;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-transport-http-1.5.1.jar;C:\remi\dev\ws\a
xis2-1.5.1\lib\axis2-transport-local-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\ax
is2-xmlbeans-1.5.1.jar;C:\axiom.jar;C:\XmlSchema-1.4.6.jar


How can I think this ? thanks for help
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read the error message carefully: the class that's missing the addAnonymousOperations method is not Stub, but helloworld.Axis2TomcathelloworldStub.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Also , check the echo command output and the command by which you are running the client.

Please check whether D:\downloads\axis2-1.4.1-bin\axis2-1.4.1\lib exists? as i can see the echo command points to a diff axis path altogether.

Regards,
Amit
 
Remi Desreumaux
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know but despite that the function is called from helloworld.Axis2TomcathelloworldStub, it makes reference to an other class in a library.
Look at the code of helloworld.Axis2TomcathelloworldStub here : (in client_src)

http://codediaries.com/code/examples/Axis2TomcatHelloWorld.zip


 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The helloworld.Axis2TomcathelloworldStub class you posted neither has nor calls the addAnonymousOperations method. Somewhere you have mismatched class and/or library files (as is invariably the case when encountering NoSuchMethodError). Start by deleting all your class files and recompiling them. Make sure you're using the same Axis version for creating the stubs, compiling your code, and running your code (from your post it looks like you're mixing Axis2 1.4.1 and Axis2 1.5.1 - you can't do that).
 
Amit ChaudhariC
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Remi,

I see no issues with the code .
I am sure the classpath and using proper versions for compiling and running the code with solve your issues.
To set the classpath correctly i suggest you refer the script provided under AXIS2_HOME/bin

Also in the classpath you mentioned , please check the section in the bold.

C:\remi\dev\Axis2TomcatHelloworldold\client_bin>echo %AXISCLASSPATH%
C:\remi\dev\ws\axis2-1.5.1\lib\wsdl4j-1.6.2.jar;C:\remi\dev\ws\axis2-1.5.1\lib\a
xis.jar;C:\remi\dev\ws\axis2-1.5.1\lib\commons-discovery-0.2.jar;C:\remi\dev\ws\
axis2-1.5.1\lib\commons-logging-1.1.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\jaxrpc.
jar;C:\remi\dev\ws\axis2-1.5.1\lib\saaj.jar;C:\remi\dev\ws\axis2-1.5.1\lib\log4j
-1.2.15.jar;C:\remi\dev\ws\axis2-1.5.1\lib\xml-apis-1.3.02.jar;C:\remi\dev\ws\ax
is2-1.5.1\lib\xercesImpl-2.6.6.jar;C:\axis2-1.1.1.jar;C:\remi\dev\ws\axis2-1.5.1
\lib\axis2-adb-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-adb-codegen-1.5.1.
jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-ant-plugin-1.5.1.jar;C:\remi\dev\ws\axi
s2-1.5.1\lib\axis2-clustering-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-cod
egen-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-corba-1.5.1.jar;C:\remi\dev\
ws\axis2-1.5.1\lib\axis2-fastinfoset-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\ax
is2-java2wsdl-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-jaxws-1.5.1.jar;C:\
remi\dev\ws\axis2-1.5.1\lib\axis2-jaxbri-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\li
b\axis2-jaxws-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-jibx-1.5.1.jar;C:\r
emi\dev\ws\axis2-1.5.1\lib\axis2-json-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\a
xis2-kernel-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-metadata-1.5.1.jar;C:
\remi\dev\ws\axis2-1.5.1\lib\axis2-mtompolicy-1.5.1.jar;C:\remi\dev\ws\axis2-1.5
.1\lib\axis2-saaj-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-spring-1.5.1.ja
r;C:\remi\dev\ws\axis2-1.5.1\lib\axis2-transport-http-1.5.1.jar;C:\remi\dev\ws\a
xis2-1.5.1\lib\axis2-transport-local-1.5.1.jar;C:\remi\dev\ws\axis2-1.5.1\lib\ax
is2-xmlbeans-1.5.1.jar;C:\axiom.jar;C:\XmlSchema-1.4.6.jar

Regards,
Amit
 
Remi Desreumaux
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is better but still something wrong :
thank you guys.






Alternative

http://127.0.0.1:8181/axis2/services/axis2tomcathelloworld.axis2tomcathelloworldHttpSoap12Endpoint/

<soapenv:Reason>

<soapenv:Text xml:lang="en-US">
The service cannot be found for the endpoint reference (EPR) /axis2/services/axis2tomcathelloworld.axis2tomcathelloworldHttpSoap12Endpoint/
</soapenv:Text>
</soapenv:Reason>



and if I do that :

original Axis2TomcathelloworldStub stub = new Axis2TomcathelloworldStub();
modified Axis2TomcathelloworldStub stub =
new Axis2TomcathelloworldStub("http://127.0.0.1:8081/axis2/services/axis2tomcathelloworld.axis2tomcathelloworldHttpSoap12Endpoint/");


and execution :


To me it does not sound that bad cause i se the xml response in my client but I dont hace what it is expected, namely hello back as the tuto said.




 
Remi Desreumaux
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess it works ! thank you so much
reply
    Bookmark Topic Watch Topic
  • New Topic