Peter Mount wrote:
Peter Gerstbach wrote:

I've generated with Axis-1.1 stubs for the Google-webservice and built a working client. Then I've built an EJB session bean in JBoss were I call the google-webservice. I use the same (copy-paste) methods in the bean as in the axis-client but every time I invoke the bean-method from an ejb client there is a NoSuchMethodError. The bean is working, because I'm able to invoke other methods without problems.

The exception always occured at this line:

   GoogleSearchService service = new GoogleSearchServiceLocator();
-> GoogleSearchPort port = service.getGoogleSearchPort();

I use jboss-3.2.6 and axis-1.1.
This ist the stack-trace in detail:

java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is:
java.rmi.ServerError: Unexpected Error:; nested exception is:
java.lang.NoSuchMethodError:
org.apache.axis.description.TypeDesc.<init>(Ljava/lang/Class;Z)V
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)


I've not (yet) tried to deploy a webservice under jboss (apart from migrating a legacy webapp to it), but over the last few weeks I've been hitting the same problem with various other jboss components. Every time it's been down to which classloader the components are located.

I've found the following link on the jboss site helpful: http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration

It may be a case that your webservice classes are either hidden away within a different class loader than your session bean, or are deployed after it. (I've hit that problem recently as well).

One way around it may be to place your webservice's classes in the same jar as the session bean. As the EJB's tend to be visible to webapps, the app (& if I remember correctly jboss deploys webservices in their own webapp), it will also still access them.

I'm just thinking of the top of my head at the moment, but would probably be hitting this problem sometime over the next couple of weeks myself, so it would be interesting to hear other peoples ideas on this one.

Peter

Yes, now it works. It was the class loading.

I had to put the axis-libs together with my ejb in the jar-file. Then I had to configure the class-loading in the jboss-app.xml in the ear-file:

<jboss-app>
  <loader-repository>
    own.test:loader=nameof.ear
        <loader-repository-config>
          java2ParentDelegation=false
        </loader-repository-config>
  </loader-repository>
</jboss-app>

Thanks a lot,
Peter

Reply via email to