Results 1 to 8 of 8
- 10-05-2012, 06:59 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 35
- Rep Power
- 0
how to resolve java.lang.NoClassDefFoundError?
Dear forum members,
I'm trying hard to set up this CheckOutExpress.java in order to make this paypal SOAP work.
However, after debugging, I get the following error from Netbean IDE:
java.lang.NoClassDefFoundError: org/apache/axis/encoding/AnyContentType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java :621)
at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$000(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
Caused by: java.lang.ClassNotFoundException: org.apache.axis.encoding.AnyContentType
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
... 12 more
Could not find the main class:
abc.servlet.SetExpressCheckoutService. Program will exit.
Exception in thread "main" Java Result: 1
I hope someone can advise me how to rectify the above error.
Many thanks!
- 10-05-2012, 09:44 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: how to resolve java.lang.NoClassDefFoundError?
The jar file containing this class:
org.apache.axis.encoding.AnyContentType
is not on the runtime classpath.Please do not ask for code as refusal often offends.
- 10-05-2012, 11:59 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 35
- Rep Power
- 0
Re: how to resolve java.lang.NoClassDefFoundError?
Hi Toll,
Thanks. I've added the axis.war file under the library as well.
Now, my problem is that I think I'm suppose to be able to right-click on my project's name, and the a Axis2 on Java will appear.
But, none can be found. The closer thing is Web Service and Web Service Client.
Can I know what steps I have to do in order to have Axis2 on Java appear on the list?
Many thanks.
- 10-05-2012, 12:04 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: how to resolve java.lang.NoClassDefFoundError?
I have no idea what you are talking about?
Please do not ask for code as refusal often offends.
- 10-05-2012, 12:51 PM #5
Member
- Join Date
- Aug 2009
- Posts
- 35
- Rep Power
- 0
Re: how to resolve java.lang.NoClassDefFoundError?
OK. Let me try again.
Here's the message:
asically, I have tried to use paypal SOAP Api which means using Web Services.
After including the Axis2.war file under the library folder of my project and setting things up including putting this line at the target location for the Axis2 .aar files:
C:\Program Files\NetBeans 6.8\apache-tomcat-6.0.20_base\ShoppingCart\axis2
According to the Axis2 Web Service by NetBean, I am suppose to be able to get this Axis2 Service from Java when I clicked on my project's name.
However, I can't find Axis2 Service from Java at all!
Hope someone can advise me on that and my next question is whether the above step will generate a client for WSDL and xsd files?
- 10-05-2012, 01:54 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: how to resolve java.lang.NoClassDefFoundError?
I have no idea how Netbeans does these things.
I tend to write my WSDL and generate the base project from that.Please do not ask for code as refusal often offends.
- 10-05-2012, 05:33 PM #7
Member
- Join Date
- Mar 2011
- Posts
- 93
- Rep Power
- 0
Re: how to resolve java.lang.NoClassDefFoundError?
Is the org/apache/axis/encoding/AnyContentType file something you have already written.
If it is a project/class you have already written, you can add it to the Library of your current project by right-clicking the Project Library (in NetBeans Properties/projects window) and selecting "Add Project", "Add Library", or "Add JAR/Folder".
You then also need an import statement referencing the org/apache/axis/encoding/AnyContentType
thing in your code.
I'm having a similar problem. See separate post.
- 10-07-2012, 06:03 PM #8
Member
- Join Date
- Aug 2009
- Posts
- 35
- Rep Power
- 0
Similar Threads
-
java.lang.NoClassDefFoundError
By BoomPony in forum New To JavaReplies: 8Last Post: 01-05-2011, 05:36 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum New To JavaReplies: 5Last Post: 06-02-2010, 01:05 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum Advanced JavaReplies: 3Last Post: 06-01-2010, 03:01 PM -
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String)
By baltimore in forum New To JavaReplies: 2Last Post: 09-18-2008, 07:30 AM -
java.lang.NoClassDefFoundError
By fred in forum Advanced JavaReplies: 3Last Post: 08-01-2007, 05:00 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks