cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1976
Views
0
Helpful
5
Replies

demo.java error for CUCM 10

wisit_jan
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

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:

javasample.png

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. 

View solution in original post

5 Replies 5

npetrele
Cisco Employee
Cisco Employee

Try changing this...

public class Demo01 {

...to this...

public class Demo {

Let us know if it works!


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.

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:

javasample.png

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. 

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.

Hi Nicholas,

Thank you for your guidance.

I must export project to .jar file first and then I can run java class.