Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

AXL Java Newbie quesiton - error with script

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

1 ACCEPTED SOLUTION

Accepted Solutions
Super Bronze

Re: AXL Java Newbie quesiton - error with script

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

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
7 REPLIES
Super Bronze

Re: AXL Java Newbie quesiton - error with script

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...

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
New Member

Re: AXL Java Newbie quesiton - error with script

Hello Aaron,

Thanks for the reply!

I tested the script without the .class and it comes back with the same errors...

I can edit the class using the class editor application. I have attached a summary of  what I see in there.. would that help?

Thanks again!

Super Bronze

Re: AXL Java Newbie quesiton - error with script

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                                                        v040609

Syntax: resetDevice.java {hostname[:port]} {userid:pwd} {devicename} {soft|Hard}


ERROR: Incorrect number of arguments in command line

C:\>

You can't edit a .class without decompiling it. You won't learn much without the source file for this app.

Regards

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
New Member

Re: AXL Java Newbie quesiton - error with script

Ah okay. Ive attached the Decompiled version of the class here now :-) Hope this is the right one now? Thanks!

Super Bronze

Re: AXL Java Newbie quesiton - error with script

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

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
New Member

Re: AXL Java Newbie quesiton - error with script

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!

Super Bronze

Re: AXL Java Newbie quesiton - error with script

No problem, good luck!

Regards

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!
748
Views
0
Helpful
7
Replies
CreatePlease to create content