Highlighted
anikzad Absent Member.
Absent Member.
926 views

NoClassDefFoundError in loginRequest

I am working on an application that is supposed to send a login request to a GroupWise server and use the response information to proceed. I use the libraries provided on Novell website but I face the runtime error "java.lang.NoClassDefFoundError: com/sun/xml/rpc/client/BasicService" while initiating a GroupwiseService_Impl object. The details of my code and the error log are as follows.

I send a login request similar to "code example 1" on this page:
http://www.programcreek.com/java-api-examples/index.php?api=javax.xml.rpc.Stub
Which is similar to the example provided by Novell in the zip file on this page:
https://www.novell.com/developer/ndk/groupwise/groupwise_web_service_%28soap%29.html

also, as of libraries, I am importing "gwws.jar" from the zip file in the latter link and "javax.xml.rpc-api-1.1.jar". (The compilation is successful.)

This is my code snippet:
GroupwiseService_Impl service = new GroupwiseService_Impl();
GroupWisePortType gwPortType = service.getGroupwiseSOAPPort();
Stub clientStub = (Stub)(gwPortType);

And I get this error log on the first line (initiating a GroupwiseService_Impl object):
"Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/rpc/client/BasicService
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
"

I would appreciate any help to resolve this error.
In addition, I am suspicious of the cast of GroupWisePortType to a Stub (In the sample codes)
It would be great if you could provide an explanation on why the cast is necessary.
Labels (1)
0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

Re: NoClassDefFoundError in loginRequest

If you are trying to use the gwws.jar file, you have to use java 1.5.
If you using a newer java version, you will have to build your own gwws.jar
file.
The gwws.jar file is using an old version of the webservices.
For example, in the latest client I use now, I use java 1.8 and metro
webservices.

Preston

>>>


> I am working on an application that is supposed to send a login request
> to a GroupWise server and use the response information to proceed. I use
> the libraries provided on Novell website but I face the runtime error
> "java.lang.NoClassDefFoundError: com/sun/xml/rpc/client/BasicService"
> while initiating a GroupwiseService_Impl object. The details of my code
> and the error log are as follows.
>
> I send a login request similar to "code example 1" on this page:
>

http://www.programcreek.com/java‑api‑examples/index.php?api=javax.xml.rp
c.
> Stub
> Which is similar to the example provided by Novell in the zip file on
> this page:
> https://www.novell.com/developer/ndk/groupwise/groupwise_web_service_%28
> soap%29.html
>
> also, as of libraries, I am importing "gwws.jar" from the zip file in
> the latter link and "javax.xml.rpc‑api‑1.1.jar". (The compilation is
> successful.)
>
> This is my code snippet:
> GroupwiseService_Impl service = new GroupwiseService_Impl();
> GroupWisePortType gwPortType = service.getGroupwiseSOAPPort();
> Stub clientStub = (Stub)(gwPortType);
>
> And I get this error log on the first line (initiating a
> GroupwiseService_Impl object):
> "Exception in thread "main" java.lang.NoClassDefFoundError:
> com/sun/xml/rpc/client/BasicService
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$100(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)"
>
> I would appreciate any help to resolve this error.
> In addition, I am suspicious of the cast of GroupWisePortType to a Stub
> (In the sample codes)
> It would be great if you could provide an explanation on why the cast is
> necessary.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.