Invoke WEB SERVICE Generated By WORKSHOP failed with java.lang.NoClassDefFoundError (Doc ID 827994.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle Workshop for Weblogic - Version: 10.3 to 10.3
This problem can occur on any platform.

Symptoms

I use workshop to generate web service client to invoke the web service that develop in workshop and deployed to WebLogic Server. But I cannot invoke success, any if I invoke another web service which created use Oracle Web Service or Axis2, this will be OK.

Step to reproduce:

1. Create a Web Service Project in Workshop
2. Create a WebLogic Web Service, Simple create a hello world web service, or copy the source from
the HelloWorld sample in the WebLogic's sample fold.
3. Deploy the Web Service and test the web service in WebLogic, that's all OK.
4. Use "ClientGen Web Service Client" wizard to generate the Web Service Client.
5. Write the Client code to invoke the Web Service
public class HelloWorldClient {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String url = "http://localhost:7001/HelloWorld_WS/HelloWorldService?WSDL";
try {
HelloWorldService service = new HelloWorldService_Impl(url);
HelloWorld port = service.getHelloWorldSoapPort();
String greeting = port.getGreeting("Oracle");
System.out.println(greeting);
} catch (Exception e) {
e.printStackTrace();
}
}
}
6. Run the client app, the Exception throws:
Exception in thread "Main Thread" java.lang.NoClassDefFoundError:
weblogic/j2ee/descriptor/ServiceRefHandlerBean
at weblogic.wsee.jaxrpc.HandlerRegistryImpl.<init>(HandlerRegistryImpl.java:32)
at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:88)
at com.hand.HelloWorldService_Impl.<init>(Unknown Source)
at com.hand.HelloWorldService_Impl.<init>(Unknown Source)
at com.hand.services.HelloWorldClient.main(HelloWorldClient.java:14)
7. I try to find the classpath, and make true that ServiceRefHandlerBean is in classpath, But run
always with the exception.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms