+ Start a Discussion
hokie_highhokie_high 

how to compile/run Enterprise Samples 4.0

Please bear with my noob question:

I installed Axis, import enterprise.wsdl, then I copied Samples.java from \EnterpriseSamples4_0\EnterpriseSamples\src\com\salesforce\samples to my working directory.

I try to compile Enterprise Samples4.0 using "javac Samples.java" and it went fine. I got "Samples.class" file but I can't run it. I got following error:

D:\My Documents\SalesForce>java Samples
Exception in thread "main" java.lang.NoClassDefFoundError: Samples (wrong name:
com/salesforce/samples/Samples)
        at java.lang.ClassLoader.defineClass0(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.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)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I appreciate for any comments.

BTW, I can run "QuickStart4_0" sample using the batch file, but if I compiles quickstart.java and try to run it, I got the same error.

 

adamgadamg
the file/class name is wrong - try com.salesforce.samples.Samples
hokie_highhokie_high

Thanks!!!

I'm a newbie to this java thingy but I finally got it work. thanks for the tip.

beta1beta.ax97beta1beta.ax97

Hello I am getting the same error, but somehow can not make the example run.

I tryed also from different location: the bin directory but I get this error instead.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ax
ault
        at java.lang.ClassLoader.defineClass0(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.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)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.ClassLoader.defineClass0(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.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)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I am new in Java, and I am not sure if I have missed something or maybe I am not declaring the classpath well. Where can I Start to check ?

Thanks for the help. I will appreciate a hand on this.

Regards

Sean_kSean_k
Hi I Just started working on sforce api.I downloaded the sforce 6.0 Java Samples for Axis 1.1 and JDK 1.4.
As explained in the README i unzipped and run the run.bat i got the following error.I thought this was because of the
classpath and added all the required jars in the class path still i was getting the same error.
Please explain me where iam doing wrong?
Same thing is happening with quick start samples also... :(

Thanks
Sean
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/AxisF
ault
at java.lang.ClassLoader.defineClass0(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.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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass0(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.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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Sean_kSean_k
Hi I am reposting this as i didn't get any solution for this.Could anybody help me to get started with sforce 6.0.
I appreciate your help..

**********Posted Message*********
Hi I Just started working on sforce api.I downloaded the sforce 6.0 Java Samples for Axis 1.1 and JDK 1.4.
As explained in the README i unzipped and run the run.bat i got the following error.I thought this was because of the
classpath and added all the required jars in the class path still i was getting the same error.
Please explain me where iam doing wrong?
Same thing is happening with quick start samples also...

Thanks
Sean
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/AxisFault
at java.lang.ClassLoader.defineClass0(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.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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass0(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.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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

*********************