03-12-2015 02:11 AM
I beginner for java and axl programming.
I copy axl demo.java from developer.cisco.com page. I use axl demo code with CUCM 10. I saw some error in demo.java and I change import com.cisco.axl.api._8 to com.cisco.axl.api._10.
I run java -cp . com.cisco.axl.demo.Demo but it's return error "Error: Could not find or load main class com.cisco.axl.demo.Demo"
Please suggest me for edit demo.java code and see code in attached file.
Solved! Go to Solution.
03-13-2015 07:15 AM
I think you're running into basic Java project issues. I assume you're using Eclipse? This picture should give you a basic idea of how an AXL project should look:
This assumes you created the proper AXL libraries from the WSDL using wsimport.
There are several Java/Eclipse tutorials on the web. Google "java eclipse tutorial" or something like that and you can probably find one that will help you with basic Java project construction.
03-12-2015 07:38 AM
Try changing this...
public class Demo01 {
...to this...
public class Demo {
Let us know if it works!
03-12-2015 11:21 PM
Hi Nicholas,
I changed Demo01 to Demo.
Basic java, I tried create new file demo.java.
package demo;
public class demo {
public static void main(String[] args) {
System.out.println("tity");
}
}
I run java demo have error
E:\>java demo
Exception in thread "main" java.lang.NoClassDefFoundError: demo (wrong name: dem
o/demo)
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)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
But if I delete "package demo;"
public class demo {
public static void main(String[] args) {
System.out.println("tity");
}
}
I can run java demo and printed.
how to resolve this problem.
03-13-2015 07:15 AM
I think you're running into basic Java project issues. I assume you're using Eclipse? This picture should give you a basic idea of how an AXL project should look:
This assumes you created the proper AXL libraries from the WSDL using wsimport.
There are several Java/Eclipse tutorials on the web. Google "java eclipse tutorial" or something like that and you can probably find one that will help you with basic Java project construction.
03-13-2015 07:32 AM
Hi Nicolas,
Thank you for you kind suggest.
When you coding completed usual you use run command on windows "cmd" right?
I do follow dev.cisco.com Cisco AXL. But I saw so many error.
03-13-2015 08:12 AM
Hi Nicholas,
Thank you for your guidance.
I must export project to .jar file first and then I can run java class.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide