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