View previous topic :: View next topic |
Author |
Message |
brian at freeswitch.org Guest
|
Posted: Mon Apr 13, 2009 8:16 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
You should update to SVN trunk and try again.
/b
On Apr 13, 2009, at 8:09 AM, Baskar wrote:
Quote: | Hi,
I have loaded the java module in freeswitch. But when i run freeswitch in console i get this error.
2009-04-13 17:38:33 [NOTICE] modjava.c:244 mod_java_load() Java Framework Loading...
2009-04-13 17:38:33 [ERR] modjava.c:133 load_config() Error loading /usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-13 17:38:33 [CRIT] switch_loadable_module.c:839 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
Can any one specify what is the error. I am using Freeswitch 1.0.2 in CentOS 5.2.
Thanks in advance.
|
Brian West
brian@freeswitch.org (brian@freeswitch.org)
-- Meet us at ClueCon! http://www.cluecon.com |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Mon Apr 13, 2009 8:25 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Hi,
I have loaded the java module in freeswitch. But when i run freeswitch in console i get this error.
2009-04-13 17:38:33 [NOTICE] modjava.c:244 mod_java_load() Java Framework Loading...
2009-04-13 17:38:33 [ERR] modjava.c:133 load_config() Error loading /usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-13 17:38:33 [CRIT] switch_loadable_module.c:839 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
Can any one specify what is the error. I am using Freeswitch 1.0.2 in CentOS 5.2.
Thanks in advance.
--
Warm Regards,
N.Baskar |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Tue Apr 14, 2009 2:34 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Hi Brian West, I have installed the latest SVN Freeswitch trunk but still i get the same error. How can i over come this problem.
2009-04-14 12:44:26 [NOTICE] modjava.c:244 mod_java_load() Java Framework Loading...
2009-04-14 12:44:26 [ERR] modjava.c:133 load_config() Error loading /usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-14 12:44:26 [CRIT] switch_loadable_module.c:871 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:889 switch_loadable_module_load_file() Successfully Loaded [mod_lua]
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:248 switch_loadable_module_process() Adding Application 'lua'
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:270 switch_loadable_module_process() Adding API Function 'luarun'
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:270 switch_loadable_module_process() Adding API Function 'lua'
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:889 switch_loadable_module_load_file() Successfully Loaded [mod_say_en]
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:395 switch_loadable_module_process() Adding Say interface 'en'
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:120 switch_loadable_module_runtime() Starting runtime thread for CORE_SOFTTIMER_MODULE
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:120 switch_loadable_module_runtime() Starting runtime thread for mod_event_socket
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898 switch_load_network_lists() Created ip list dl-candidates default (allow)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 10.0.0.0/8 (deny) to list dl-candidates
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 172.16.0.0/12 (deny) to list dl-candidates
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 192.168.0.0/16 (deny) to list dl-candidates
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898 switch_load_network_lists() Created ip list rfc1918 default (deny)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 10.0.0.0/8 (allow) to list rfc1918
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 172.16.0.0/12 (allow) to list rfc1918
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 192.168.0.0/16 (allow) to list rfc1918
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898 switch_load_network_lists() Created ip list lan default (allow)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 192.168.42.0/24 (deny) to list lan
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 192.168.42.42/32 (allow) to list lan
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898 switch_load_network_lists() Created ip list strict default (deny)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981 switch_load_network_lists() Adding 208.102.123.124/32 (allow) to list strict
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898 switch_load_network_lists() Created ip list domains default (deny)
2009-04-14 12:44:26 [NOTICE] switch_core.c:965 switch_load_network_lists() Adding brian@192.168.1.140 (brian@192.168.1.140)] to list domains
2009-04-14 12:44:26 [CONSOLE] switch_core.c:1322 switch_core_init_and_modload()
FreeSWITCH Version 1.0.trunk (13013M) Started.
Crash Protection [Disabled]
Max Sessions[1000]
Session Rate[30]
SQL [Enabled]
Specify what is the error why i cant able to load Mod_java.
--
Warm Regards,
N.Baskar
|
|
Back to top |
|
|
solko at gcdf.pl Guest
|
Posted: Tue Apr 14, 2009 3:08 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Baskar pisze:
Quote: | *Hi Brian West,*
* I have installed the latest SVN Freeswitch trunk but still i get the
same error. How can i over come this problem.
2009-04-14 12:44:26 [NOTICE] modjava.c:244 mod_java_load() Java
Framework Loading...
2009-04-14 12:44:26 [ERR] modjava.c:133 load_config() Error loading
/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
|
First of all do you have java installed in that path? If not edit configuration path.
I do not use java mod for some time but I had no problem to load them, only reloading was a problem.
Quote: | 2009-04-14 12:44:26 [CRIT] switch_loadable_module.c:871
switch_loadable_module_load_file() Error Loading module
/usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
*2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:889
switch_loadable_module_load_file() Successfully Loaded [mod_lua]
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:248
switch_loadable_module_process() Adding Application 'lua'
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:270
switch_loadable_module_process() Adding API Function 'luarun'
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:270
switch_loadable_module_process() Adding API Function 'lua'
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:889
switch_loadable_module_load_file() Successfully Loaded [mod_say_en]
2009-04-14 12:44:26 [NOTICE] switch_loadable_module.c:395
switch_loadable_module_process() Adding Say interface 'en'
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:120
switch_loadable_module_runtime() Starting runtime thread for
CORE_SOFTTIMER_MODULE
2009-04-14 12:44:26 [CONSOLE] switch_loadable_module.c:120
switch_loadable_module_runtime() Starting runtime thread for
mod_event_socket
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898
switch_load_network_lists() Created ip list dl-candidates default (allow)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 10.0.0.0/8 <http://10.0.0.0/8> (deny)
to list dl-candidates
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 172.16.0.0/12 <http://172.16.0.0/12>
(deny) to list dl-candidates
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 192.168.0.0/16
<http://192.168.0.0/16> (deny) to list dl-candidates
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898
switch_load_network_lists() Created ip list rfc1918 default (deny)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 10.0.0.0/8 <http://10.0.0.0/8>
(allow) to list rfc1918
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 172.16.0.0/12 <http://172.16.0.0/12>
(allow) to list rfc1918
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 192.168.0.0/16
<http://192.168.0.0/16> (allow) to list rfc1918
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898
switch_load_network_lists() Created ip list lan default (allow)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 192.168.42.0/24
<http://192.168.42.0/24> (deny) to list lan
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 192.168.42.42/32
<http://192.168.42.42/32> (allow) to list lan
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898
switch_load_network_lists() Created ip list strict default (deny)
2009-04-14 12:44:26 [NOTICE] switch_core.c:981
switch_load_network_lists() Adding 208.102.123.124/32
<http://208.102.123.124/32> (allow) to list strict
2009-04-14 12:44:26 [CONSOLE] switch_core.c:898
switch_load_network_lists() Created ip list domains default (deny)
2009-04-14 12:44:26 [NOTICE] switch_core.c:965
switch_load_network_lists() Adding 192.0.2.0/24 <http://192.0.2.0/24>
(allow) [brian@192.168.1.140 <mailto:brian@192.168.1.140>] to list domains
2009-04-14 12:44:26 [CONSOLE] switch_core.c:1322
switch_core_init_and_modload()
*FreeSWITCH Version 1.0.trunk (13013M) Started.
Crash Protection [Disabled]
Max Sessions[1000]
Session Rate[30]
SQL [Enabled]
Specify what is the error why i cant able to load Mod_java.
--
Warm Regards,
N.Baskar
*
------------------------------------------------------------------------
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Tue Apr 14, 2009 4:53 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Hi,
I have installed latest java version jdk1.6.0 in this path /usr/java/jdk1.6.0_04/bin
I have reconfigured FS ./configure --with-java=/usr/java/jdk1.6.0_04/bin, make, make install
But when i run freeswitch in console i get this error.
2009-04-14 15:00:22 [ERR] modjava.c:133 load_config() Error loading /usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-14 15:00:22 [CRIT] switch_loadable_module.c:871 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
I cant able to load mod_java. Can any one specify what is the error. Thanks in advance.
--
Warm Regards,
N.Baskar
|
|
Back to top |
|
|
solko at gcdf.pl Guest
|
Posted: Tue Apr 14, 2009 5:40 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Baskar pisze:
Quote: | *Hi,
I have installed latest java version jdk1.6.0 in this path
/usr/java/jdk1.6.0_04/bin
I have reconfigured FS ./configure
--with-java=/usr/java/jdk1.6.0_04/bin, make, make install
But when i run freeswitch in console i get this error.
| Exactly, configure java module in config file
conf/autoload_configs/java.conf.xml
This is runtime configuration not build configuration. Set right javavm path.
It must point to your libjvm.so file.
<javavm path="/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so"/>
Quote: | 2009-04-14 15:00:22 [ERR] modjava.c:133 load_config() Error loading
/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-14 15:00:22 [CRIT] switch_loadable_module.c:871
switch_loadable_module_load_file() Error Loading module
/usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
I cant able to load mod_java. Can any one specify what is the error.
Thanks in advance.
--
Warm Regards,
N.Baskar
*
------------------------------------------------------------------------
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Tue Apr 14, 2009 7:04 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Hi,
My Java.conf.xml
<configuration name="java.conf" description="Java Plug-Ins">
<!-- Path to the Java 1.6 virtual machine to use -->
<javavm path="/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so"/>
<!-- Options to pass to Java -->
<options>
<!-- Your class path (make sure freeswitch.jar is on it) -->
<option value="-Djava.class.path=$${base_dir}/scripts/freeswitch.jar"/>
<!-- Enable remote debugging -->
<option value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:8000"/>
</options>
</configuration>
This is runtime configuration not build configuration. Set right javavm path.
It must point to your libjvm.so file.
But still i have the same error .
2009-04-14 17:18:56 [ERR] modjava.c:133 load_config() Error loading /usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-14 17:18:56 [CRIT] switch_loadable_module.c:871 switch_loadable_module_load_file() Error Loading module /usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
How to over come this problem. Some one help me to solve it.
--
Warm Regards,
N.Baskar |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Tue Apr 14, 2009 7:17 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Hi,
I have notice While reinstalling the Freeswitch i get this message While both make and make install commands
making all mod_java Note: src/org/freeswitch/Launcher.java uses unchecked or unsafe operations.Note: Recompile with -Xlint:unchecked for details.
I am using CentOS 5.2 with Latest Freeswitch trunk
can any one guide to resolve the problem. Thanks in advance.
--
Warm Regards,
N.Baskar
|
|
Back to top |
|
|
solko at gcdf.pl Guest
|
Posted: Tue Apr 14, 2009 7:19 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Baskar pisze:
Quote: | Hi,
My Java.conf.xml
<configuration name="java.conf" description="Java Plug-Ins">
<!-- Path to the Java 1.6 virtual machine to use -->
<javavm path="/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so"/>
<!-- Options to pass to Java -->
<options>
<!-- Your class path (make sure freeswitch.jar is on it) -->
<option value="-Djava.class.path=$${base_dir}/scripts/freeswitch.jar"/>
<!-- Enable remote debugging -->
<option
value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:8000
<http://127.0.0.1:8000>"/>
</options>
</configuration>
*This is runtime configuration not build configuration. Set right javavm
path.
It must point to your libjvm.so file.*
But still i have the same error .
| You wrote that Java is installed in
/usr/java/jdk1.6.0_04/bin
so make this config file to point to it. Don't you see you are pointing wrong directory ?
<javavm path="/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so"/>
Find libjvm.so and put path to it in that tag. I did not gave you right configuration I just wanted to show you where to put this
config value.
Where is you libjvm.so located?
Quote: | 2009-04-14 17:18:56 [ERR] modjava.c:133 load_config() Error loading
/usr/java/jdk1.6.0/jre/lib/i386/client/libjvm.so
2009-04-14 17:18:56 [CRIT] switch_loadable_module.c:871
switch_loadable_module_load_file() Error Loading module
/usr/local/freeswitch/mod/mod_java.so
**Module load routine returned an error**
How to over come this problem. Some one help me to solve it.
--
Warm Regards,
N.Baskar
------------------------------------------------------------------------
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
|
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Tue Apr 14, 2009 7:31 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Hi,
I have not edited the java.conf.xml
my libjvm.so file is loacted in this paths
[localhost ~]# locate libjvm.so /usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so/usr/java/jdk1.6.0_04/jre/lib/i386/server/libjvm.so /usr/lib/gcj-4.1.1/libjvm.so/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/i386/client/libjvm.so /usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/i386/server/libjvm.so
In the above libjvm.so file which path should i specify it in the java.conf.xml
Guide me where i am wrong.
--
Warm Regards,
N.Baskar |
|
Back to top |
|
|
solko at gcdf.pl Guest
|
Posted: Tue Apr 14, 2009 7:33 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Baskar pisze:
Quote: | *Hi,
I have notice While reinstalling the Freeswitch i get this message While
both make and make install commands
making all mod_java
Note: src/org/freeswitch/Launcher.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I am using CentOS 5.2 with Latest Freeswitch trunk
| Don't worry about that, this is just warning. New syntax for generics in Java, but this should not lead to any problems.
Quote: | can any one guide to resolve the problem. Thanks in advance.
| This is not your main issue.
Szymon Olko
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
solko at gcdf.pl Guest
|
Posted: Tue Apr 14, 2009 8:18 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Baskar pisze:
Quote: | *Hi,
I have not edited the java.conf.xml
*
*my libjvm.so file is loacted in this paths*
* [localhost ~]# locate libjvm.so
/usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so
/usr/java/jdk1.6.0_04/jre/lib/i386/server/libjvm.so
/usr/lib/gcj-4.1.1/libjvm.so
/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/i386/client/libjvm.so
/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/i386/server/libjvm.so*
*
In the above libjvm.so file which path should i specify it in the
java.conf.xml
Guide me where i am wrong.
| Try this one first:
/usr/java/jdk1.6.0_04/jre/lib/i386/client/libjvm.so
if it will not work then try the one with server.
This is sun Java implementation, don't sure if it will work with gcj, so don't try tem if you don't have to.
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
yudha2008 at gmail.com Guest
|
Posted: Wed Apr 15, 2009 2:26 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
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: PhoneTestCaused 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
|
|
Back to top |
|
|
solko at gcdf.pl Guest
|
Posted: Wed Apr 15, 2009 2:51 am Post subject: [Freeswitch-users] Mod_java loading error |
|
|
Baskar pisze:
Quote: | *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.
| I think you need some extra training about Java.
First of all to run Java application you need to add all classes in classpath, so in your first method you forgot to adde
PhoneTest.jar to it, it is wrong, You did not mention that you pack it to jar I assume you did it.
Second method is good but does PhoneTest.java have main method? If you wanted to run it in freeswitch then it does not have main
method so it cannot be started as standalone application.
Why are you trying to run it as standalone application?
What are you trying to do? Why did you pick Java for it? Next time attach java files to mails (of course if they are not to huge).
Szymon
_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org |
|
Back to top |
|
|
|