Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Question on using java_mod


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
i.mkmo at hotmail.com
Guest





PostPosted: Sun Nov 09, 2008 11:38 am    Post subject: [Freeswitch-users] Question on using java_mod Reply with quote

Hey,

I've been testing the usage of mod_java and reading Freeswitch documentation but been having some problems
which I think might even be something very simple which I've missed. Hope some could give a hint..
mod_java installation has gone through successfully and mod_java.so is compiled and installed.

Configuration files java.conf.xml and dialplan are configured as instructed in http://wiki.freeswitch.org/wiki/Java

Compilation of the Java example in the same page is successful (CLASSPATH included freeswtich.jar of course).
Problem comes when I try to initiate the script via dialplan - that is I'm trying to make a call to an extension which
then calls this example script (dialplan says: <action application="java" data="PhoneTest arg1 arg2 arg3"/>).

Error message gives me:

Exception in thread "Thread-1" java.lang.ClassNotFoundException: /usr/local/freeswitch/scripts/PhoneTest
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.freeswitch.Launcher.launch(Launcher.java:65)

I presume this means that the script is called invalid manner?

I've been trying to call the PhoneTest with full path, locating it together with freeswitch.jar, creating a directory PhoneTest just name it.Documentation does not say if the Java binary needs to be in certain location or not - is there amandatory location for it? What else am I doing wrong?

My system is running in CentOS 5, Java version JDK1.5.0_16 so the unstability described in Wiki should not be a reason.

Nic

Enrich your blog with Windows Live Writer. Windows Live Writer
Back to top
klaus.teller at gmx.net
Guest





PostPosted: Sun Nov 09, 2008 12:42 pm    Post subject: [Freeswitch-users] Question on using java_mod Reply with quote

You might want to specify not only the class name, but also its package name as well as the jar file that contains it.

<action application="java" data="/path/to/file.jar fully.qualified.class.name arg1 arg2 arg3"/>

Klaus.


-------- Original-Nachricht --------
Quote:
Datum: Sun, 9 Nov 2008 21:28:23 +0800
Von: I Ki <i.mkmo@hotmail.com>
An: freeswitch-users@lists.freeswitch.org
Betreff: [Freeswitch-users] Question on using java_mod

Quote:

Hey,

I've been testing the usage of mod_java and reading Freeswitch
documentation but been having some problems which I think might even be something very
simple which I've missed. Hope some could give a hint..
mod_java installation has gone through successfully and mod_java.so is
compiled and installed.

Configuration files java.conf.xml and dialplan are configured as
instructed in http://wiki.freeswitch.org/wiki/Java
Compilation of the Java example in the same page is successful (CLASSPATH
included freeswtich.jar of course). Problem comes when I try to initiate
the script via dialplan - that is I'm trying to make a call to an extension
which then calls this example script (dialplan says: <action
application="java" data="PhoneTest arg1 arg2 arg3"/>).

Error message gives me:

Exception in thread "Thread-1" java.lang.ClassNotFoundException:
/usr/local/freeswitch/scripts/PhoneTest at java.lang.Class.forName0(Native
Method) at java.lang.Class.forName(Class.java:242) at
org.freeswitch.Launcher.launch(Launcher.java:65)

I presume this means that the script is called invalid manner?

I've been trying to call the PhoneTest with full path, locating it
together with freeswitch.jar, creating a directory PhoneTest just name
it.Documentation does not say if the Java binary needs to be in certain location or
not - is there amandatory location for it? What else am I doing wrong?

My system is running in CentOS 5, Java version JDK1.5.0_16 so the
unstability described in Wiki should not be a reason.

Nic
_________________________________________________________________
Easily edit your photos like a pro with Photo Gallery.
http://get.live.com/photogallery/overview

--
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail

_______________________________________________
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
i.mkmo at hotmail.com
Guest





PostPosted: Mon Nov 10, 2008 8:18 am    Post subject: [Freeswitch-users] Question on using java_mod Reply with quote

Thanks Klaus,

Tried that as well, if I use a full path for PhoneTest then I get same error as earlier.

If I call only PhoneTest without any path (/usr/local/freeswitch/scripts/freeswitch.jar PhoneTest arg1 arg2..) then I get:

Exception in thread "Thread-2" 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 java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.freeswitch.Launcher.launch(Launcher.java:65)
It's a same error message if I leave the full path off from freeswitch.jar as well. There must be something what I have not understood about the documentation here..

N





You might want to specify not only the class name, but also its package name as well as the jar file that contains it.

<action application="java" data="/path/to/file.jar fully.qualified.class.name arg1 arg2 arg3"/>

Klaus.


From: i.mkmo@hotmail.com
To: freeswitch-users@lists.freeswitch.org
Subject: Question on using java_mod
Date: Sun, 9 Nov 2008 21:28:23 +0800

.ExternalClass .EC_hmmessage P {padding:0px;} .ExternalClass body.EC_hmmessage {font-size:10pt;font-family:Verdana;} Hey,

I've been testing the usage of mod_java and reading Freeswitch documentation but been having some problems
which I think might even be something very simple which I've missed. Hope some could give a hint..
mod_java installation has gone through successfully and mod_java.so is compiled and installed.

Configuration files java.conf.xml and dialplan are configured as instructed in http://wiki.freeswitch.org/wiki/Java

Compilation of the Java example in the same page is successful (CLASSPATH included freeswtich.jar of course).
Problem comes when I try to initiate the script via dialplan - that is I'm trying to make a call to an extension which
then calls this example script (dialplan says: <action application="java" data="PhoneTest arg1 arg2 arg3"/>).

Error message gives me:

Exception in thread "Thread-1" java.lang.ClassNotFoundException: /usr/lo! cal/freeswitch/scripts/PhoneTest
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.freeswitch.Launcher.launch(Launcher.java:65)

I presume this means that the script is called invalid manner?

I've been trying to call the PhoneTest with full path, locating it together with freeswitch.jar, creating a directory PhoneTest just name it.Documentation does not say if the Java binary needs to be in certain location or not - is there amandatory location for it? What else am I doing wrong?

My system is running in CentOS 5, Java version JDK1.5.0_16 so the unstability described in Wiki should not be a reason.

Nic


Enrich your blog with Windows Live Writer. Windows Live Writer
Make the most of what you can do on your PC and the Web, just the way you want. Windows Live
Back to top
klaus.teller at gmx.net
Guest





PostPosted: Mon Nov 10, 2008 8:51 am    Post subject: [Freeswitch-users] Question on using java_mod Reply with quote

Were is PhoneTest located? What is its the package and what is the containing jar file?

The jar file you need to specify is not the freeswitch.jar but yours. Freeswitch will find freeswitch.jar if it's in the default location.

Cheers,
Klaus.


-------- Original-Nachricht --------
Quote:
Datum: Mon, 10 Nov 2008 21:16:37 +0800
Von: I Ki <i.mkmo@hotmail.com>
An: freeswitch-users@lists.freeswitch.org
Betreff: Re: [Freeswitch-users] Question on using java_mod

Quote:

Thanks Klaus,

Tried that as well, if I use a full path for PhoneTest then I get same
error as earlier.

If I call only PhoneTest without any path
(/usr/local/freeswitch/scripts/freeswitch.jar PhoneTest arg1 arg2..) then I get:

Exception in thread "Thread-2" 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
java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native
Method) at java.lang.Class.forName(Class.java:242) at
org.freeswitch.Launcher.launch(Launcher.java:65)
It's a same error message if I leave the full path off from freeswitch.jar
as well. There must be something what I have not understood about the
documentation here..

N





You might want to specify not only the class name, but also its package
name as well as the jar file that contains it. <action application="java"
data="/path/to/file.jar fully.qualified.class.name arg1 arg2 arg3"/> Klaus.

From: i.mkmo@hotmail.comTo: freeswitch-users@lists.freeswitch.orgSubject:
Question on using java_modDate: Sun, 9 Nov 2008 21:28:23 +0800

Hey, I've been testing the usage of mod_java and reading Freeswitch
documentation but been having some problems which I think might even be something
very simple which I've missed. Hope some could give a hint..mod_java
installation has gone through successfully and mod_java.so is compiled and
installed. Configuration files java.conf.xml and dialplan are configured as
instructed in http://wiki.freeswitch.org/wiki/JavaCompilation of the Java
example in the same page is successful (CLASSPATH included freeswtich.jar of
course). Problem comes when I try to initiate the script via dialplan - that
is I'm trying to make a call to an extension which then calls this example
script (dialplan says: <action application="java" data="PhoneTest arg1 arg2
arg3"/>). Error message gives me: Exception in thread "Thread-1"
java.lang.ClassNotFoundException: /usr/local/freeswitch/scripts/PhoneTest at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:242) at org.freeswitch.Launcher.launch(Launcher.java:65)
I presume this means that the script is called invalid manner? I've been
trying to call the PhoneTest with full path, locating it together with
freeswitch.jar, creating a directory PhoneTest just name it.Documentation does
not say if the Java binary needs to be in certain location or not - is
there amandatory location for it? What else am I doing wrong? My system
is running in CentOS 5, Java version JDK1.5.0_16 so the unstability
described in Wiki should not be a reason. Nic

Enrich your blog with Windows Live Writer. Windows Live Writer
_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all

--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

_______________________________________________
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
damjan at ecntelecoms.com
Guest





PostPosted: Mon Nov 10, 2008 8:56 am    Post subject: [Freeswitch-users] Question on using java_mod Reply with quote

No, not the path to *freeswitch.jar*, use the path to *your* JAR
containing the class.

Bye
Damjan

Quote:

Thanks Klaus,

Tried that as well, if I use a full path for PhoneTest then I get same
error as earlier.

If I call only PhoneTest without any path
(/usr/local/freeswitch/scripts/freeswitch.jar PhoneTest arg1 arg2..) then
I get:

Exception in thread "Thread-2" 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
java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:242) at
org.freeswitch.Launcher.launch(Launcher.java:65)
It's a same error message if I leave the full path off from freeswitch.jar
as well. There must be something what I have not understood about the
documentation here..

N





You might want to specify not only the class name, but also its package
name as well as the jar file that contains it. <action application="java"
data="/path/to/file.jar fully.qualified.class.name arg1 arg2 arg3"/>
Klaus.

From: i.mkmo@hotmail.comTo: freeswitch-users@lists.freeswitch.orgSubject:
Question on using java_modDate: Sun, 9 Nov 2008 21:28:23 +0800

Hey, I've been testing the usage of mod_java and reading Freeswitch
documentation but been having some problems which I think might even be
something very simple which I've missed. Hope some could give a
hint..mod_java installation has gone through successfully and mod_java.so
is compiled and installed. Configuration files java.conf.xml and dialplan
are configured as instructed in
http://wiki.freeswitch.org/wiki/JavaCompilation of the Java example in the
same page is successful (CLASSPATH included freeswtich.jar of course).
Problem comes when I try to initiate the script via dialplan - that is I'm
trying to make a call to an extension which then calls this example script
(dialplan says: <action application="java" data="PhoneTest arg1 arg2
arg3"/>). Error message gives me: Exception in thread "Thread-1"
java.lang.ClassNotFoundException: /usr/local/freeswitch/scripts/PhoneTest
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:242) at
org.freeswitch.Launcher.launch(Launcher.java:65) I presume this means that
the script is called invalid manner? I've been trying to call the
PhoneTest with full path, locating it together with freeswitch.jar,
creating a directory PhoneTest just name it.Documentation does not say if
the Java binary needs to be in certain location or not - is there
amandatory location for it? What else am I doing wrong? My system is
running in CentOS 5, Java version JDK1.5.0_16 so the unstability described
in Wiki should not be a reason. Nic

Enrich your blog with Windows Live Writer. Windows Live Writer
_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all_______________________________________________
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
i.mkmo at hotmail.com
Guest





PostPosted: Mon Nov 10, 2008 10:04 am    Post subject: [Freeswitch-users] Question on using java_mod Reply with quote

Ah, so I should not compile the PhoneTest.java to PhoneTest.class only but jar-file instead?

This is what I did:

- verified my classpath in the java.conf.xml: <option value="-Djava.class.path=/usr/local/freeswitch/scripts/freeswitch.jar"/>
- my PhoneTest.class is located in /usr/local/freeswitch/script - directory, same as where freeswitch.jar is located
- I created PhoneTest.jar file from PhoneTest.class
- changed my dialplan to: <action application="java" data="/usr/local/freeswitch/scripts/PhoneTest.jar PhoneTest arg1 arg2 arg3"/>
- and seems to be working!!! at least it was called this time and it initiated. Couple of small errors but I'm sure it's minor, will have a look at those later.

Thanks a million, would have never figured it out by myself.

Is there any technical reason why class-file cannot be called as an binary directly?


Nic


------------------

No, not the path to *freeswitch.jar*, use the path to *your* JAR containing the class.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Bye
Damjan

Quote:

Thanks Klaus,

Tried that as well, if I use a full path for PhoneTest then I get same
error as earlier.

If I call only PhoneTest without any path
(/usr/local/freeswitch/scripts/freeswitch.jar PhoneTest arg1 arg2..)
then I get:

Exception in thread "Thread-2" 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
java.lang.ClassLoader.loadClass(ClassLoader.java:251) at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:242) at
org.freeswitch.Launcher.launch(Launcher.java:65)
It's a same error message if I leave the full path off from
freeswitch.jar as well. There must be something what I have not
understood about the documentation here..

N





You might want to specify not only the class name, but also its
package name as well as the jar file that contains it. <action application="java"
data="/path/to/file.jar fully.qualified.class.name arg1 arg2 arg3"/>
Klaus.

From: i.mkmo@hotmail.comTo: freeswitch-users@lists.freeswitch.orgSubject:
Question on using java_modDate: Sun, 9 Nov 2008 21:28:23 +0800

Hey, I've been testing the usage of mod_java and reading Freeswitch
documentation but been having some problems which I think might even
be something very simple which I've missed. Hope some could give a
hint..mod_java installation has gone through successfully and
mod_java.so is compiled and installed. Configuration files
java.conf.xml and dialplan are configured as instructed in
http://wiki.freeswitch.org/wiki/JavaCompilation of the Java example in
the same page is successful (CLASSPATH included freeswtich.jar of course).
Problem comes when I try to initiate the script via dialplan - that is
I'm trying to make a call to an extension which then calls this
example script (dialplan says: <action application="java"
data="PhoneTest arg1 arg2 arg3"/>). Error message gives me: Exception in thread "Thread-1"
java.lang.ClassNotFoundException: /usr/local/freeswitch/scripts/PhoneTest
at java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:242) at
org.freeswitch.Launcher.launch(Launcher.java:65) I presume this means
that the script is called invalid manner? I've been trying to call
the PhoneTest with full path, locating it together with
freeswitch.jar, creating a directory PhoneTest just name
it.Documentation does not say if the Java binary needs to be in certain location or not - is there
amandatory location for it? What else am I doing wrong? My system is
running in CentOS 5, Java version JDK1.5.0_16 so the unstability described
in Wiki should not be a reason. Nic

Enrich your blog with Windows Live Writer. Windows Live Writer
_________________________________________________________________
NEW! Get Windows Live FREE.
http://www.get.live.com/wl/all________________________________________
_______
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-use
rs
http://www.freeswitch.org




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (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.orgEnrich your blog with Windows Live Writer. Windows Live Writer
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services