GeeCON Prague 2014*
The moose likes Web Services and the fly likes NoSuchMethodError. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "NoSuchMethodError." Watch "NoSuchMethodError." New topic
Author

NoSuchMethodError.

Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
I'm completely stumped on the cause of this error. Well not completely, I'm on to it but very confused.
I've got to daisy chain two services.
someclient->>ServiceA->>ServiceB->>Oracle

SeviceB is up and working. I write clients to it all day long no problem. Junit tested the crap out of it and it's behaving.

When I deployed ServiceA, whose only purpose is to pass the message along, that's where I run into trouble. The problem I believe is with ServiceA.

Service A is a client of serviceB. ServiceA is also a web service itself. I can invoke the ServiceA's client code (client code to serviceB) with a MAIN method on serviceA and get back successful messages. However when I deploy ServiceA and write a test client to serviceA I'm getting the following error.


ServiceA is dying when it tries to get the port so it can communicate with serviceB. I checked the logs for serviceB and nothing shows so the request isn't making it there.

Here's what I know, the missing method, messageName(), is indeed not there. The question I have is why?
I check the library inside of netbeans and the method is not there. I'm using the metro library. However, when I browse to that jar (C:\Program Files\NetBeans 6.9.1\enterprise\modules\ext\metro\webservices-api.jar) and decompile the class, the method is there. My question is how can Netbeans 6.9.1 be pulling the incorrect jar into my application?

I'm running tomcat 6.0. I searched my entire hard drive and found the jar here, C:\Sun\AppServer\lib\endorsed\webservices-api.jar, which doesn't have that method either so I renamed it with a .old extension and put what I believed the correct version would be in its place but I"m having the same issue.

Suggestions?



Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Well, whatever is part of the NetBeans installation has no impact on Tomcat at runtime.

And "C:\Sun\AppServer" doesn't sound like it has anything to do with Tomcat, either.

If you're using Java 6, then that comes with its own version of JAX-WS (and thus javax.xml.ws.WebFault), which in all likelihood is older than the Metro version you're using, and possibly incompatible. See "Running latest JAXWS RI on JDK6" in http://weblogs.java.net/blog/vivekp/archive/2006/12/webservices_in.html for how to fix that.
Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
Well, whatever is part of the NetBeans installation has no impact on Tomcat at runtime.


I guess that means Tomcat is giving me the jdk version of the jar and not the one I packaged with the war file?
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
It's a possibility; the JRE version would take precedence over the war file unless the described fix was applied.
Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
Lester,

I went through the information on that link. The Endorsed Directory Mechanism link is broken however
I looked at a few other pages that talked about this and although not directly related to this specific jar, they all seemed to suggest that the new version of the jar needs to be placed in the following directory.
C:\Program Files\Java\jdk1.6.0_16\jre\lib\endorsed
So as per what I read, I gave that the ole college try. I'm experiencing the exact same issue. You wouldn't happen to have another link to the Endorsed Directory Mechanism would you?

Kevin Eddy
Ranch Hand

Joined: Feb 24, 2010
Posts: 74
YAY!! I got it going. I needed to put the lib in the tomcat endorsed directory! Thanks Lester for getting me pointed in the right direction! Most appreciated.

Kevin.
Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
Hi people,

I'm facing the same problem, but the folder "jdk1.6.0_26\jre\lib" has no "endorsed" folder inside. Should I create one?


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Rogerio, Never put anything in the jdk/jre libs. One of more updates and you're toast.

The poster referred to tomcat/lib/endorsed (JBoss has something similar too).

That's where you would place trusted jars for access by all webapps.

Pat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoSuchMethodError.