10-06-2010 11:58 PM - edited 03-19-2019 01:42 AM
Hi guys,
I had posted it in the dev forum as well (http://developer.cisco.com/web/axl/forums/-/message_boards/message/2613625) but wanted to reach out to you guys as well to see if I can get some help.
I am a quite new with AXL and java and needed some help getting my head round an error im getting while running the following java script.
What it should do is take a device name reset that phone by taking arguements as follows:
Syntax: resetDevice.java {hostname[:port]} {userid:pwd} {devicename} {soft|Hard}
I have attached the Java file resetDevice.class here as well.
The error I see is as follows:
C:\em>java resetDevice cmp1-pub ccmadmin:password SEP001E13E63E09 soft
Exception in thread "main" java.lang.NoClassDefFoundError: axlPost
at resetDevice.main(resetDevice.java:39)
Caused by: java.lang.ClassNotFoundException: axlPost
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)
... 1 more
Any help would be greatly appreciated!!
Thanks in advance
Regards,
Kamran
Solved! Go to Solution.
10-07-2010 06:11 AM
Hi
What is your current problem?
The first post you couldn't find the main class, changing the command line to not use .class will get around that. If you have further problems you need to specify what they are.
The class you uploaded is not the whole program, you should also have an axlPost class.
Regards
Aaron
10-07-2010 12:12 AM
Hi Kamran
This isn't really a dev forum, but a few of us experiment to varying degrees. What you have here is a basic java issue, but...
Firstly, you should run a class like so (assuming here you don't need any other class folders or jars to run it);
java classname
(not no .class suffix - the java runtime looks for the 'main' class in a suitably named file, and runs that - the 'class' is assumed, unless you tell it that it's a .jar or whatever).
Secondly - if there are further problems with it beyond running the thing we can't tell you what to do unless you post the source.
Regards
Aaron
Please rate helpful posts...
10-07-2010 05:41 AM
10-07-2010 05:45 AM
Hi
I mean change your command line to launch it, not rename the file. Like so (second attempt launches but I didn't specify parameters):
C:\>java resetDevice.
Exception in thread "main" java.lang.NoClassDefFoundError: resetDevice/
Caused by: java.lang.ClassNotFoundException: resetDevice.
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)
Could not find the main class: resetDevice.. Program will exit.C:\>java resetDevice
resetDevice.java v040609Syntax: resetDevice.java {hostname[:port]} {userid:pwd} {devicename} {soft|Hard}
ERROR: Incorrect number of arguments in command lineC:\>
You can't edit a .class without decompiling it. You won't learn much without the source file for this app.
Regards
Aaron
10-07-2010 06:02 AM
10-07-2010 06:11 AM
Hi
What is your current problem?
The first post you couldn't find the main class, changing the command line to not use .class will get around that. If you have further problems you need to specify what they are.
The class you uploaded is not the whole program, you should also have an axlPost class.
Regards
Aaron
10-07-2010 07:06 AM
Hello,
I think you are right, thats exactly what the problem is. The axlPost class is missing!!
I got around finding the "main" class using ur method...i believe I will need to find the "axlPost" class.
Thanks for the help Aaron!
10-07-2010 07:08 AM
No problem, good luck!
Regards
Aaron
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