cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1141
Views
0
Helpful
7
Replies

AXL Java Newbie quesiton - error with script

kkhanis
Level 4
Level 4

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

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!

View solution in original post

7 Replies 7

Aaron Harrison
VIP Alumni
VIP Alumni

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!

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!

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!

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

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!

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!

No problem, good luck!

Regards

Aaron

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

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: