[Freeswitch-users] Mod_java loading error

Baskar yudha2008 at gmail.com
Wed Apr 15 00:15:52 PDT 2009


*Hi,

   Now i can able to load the mod_java in the freeswitch console.

After that i have followed these method to run the PhoneTest.java

*

*1) verified my classpath in the java.conf.xml:  <option
value="-Djava.class.path=/usr/local/freeswitch/scripts/freeswitch.jar"/>*

*2)my PhoneTest.class is located in /usr/local/freeswitch/script -
directory, same as where freeswitch.jar is located*

*3) I created PhoneTest.jar file from PhoneTest.class*

*4)changed my dialplan to: <action application="java"
data="/usr/local/freeswitch/scripts/PhoneTest.jar PhoneTest arg1 arg2
arg3"/>*
*
Then i have complied and Run the PhoneTest.java  by this methods

**Method1:
**[localhost scripts]# javac -cp freeswitch.jar PhoneTest.java
[localhost scripts]# java -cp freeswitch.jar PhoneTest
Exception in thread "main" java.lang.NoClassDefFoundError: PhoneTest
Caused by: java.lang.ClassNotFoundException: PhoneTest
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

**Method2:
**[localhost scripts]# javac -cp PhoneTest.jar:freeswitch.jar PhoneTest.java
[localhost scripts]# java -cp PhoneTest.jar:freeswitch.jar PhoneTest
Exception in thread "main" java.lang.NoSuchMethodError: main

But I get these above errors .So Please Correct me where i am wrong and
assist me how to compile and run the PhoneTest.java.

-- 
Warm Regards,
N.Baskar

*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090415/fe93adb2/attachment-0002.html 


More information about the FreeSWITCH-users mailing list