cancel
Showing results for
Did you mean:
cancel
Announcements
942
Views
0
7
Replies
Enthusiast

## 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:

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)
... 1 more

Any help would be greatly appreciated!!

Regards,
Kamran

1 ACCEPTED SOLUTION

Accepted Solutions
Mentor

Hi

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

7 REPLIES 7
Mentor

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

Enthusiast

Hello Aaron,

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!

Mentor

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

Enthusiast

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

Mentor

Hi

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

Enthusiast

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!

Mentor

No problem, good luck!

Regards

Aaron