<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Ah, so I should not compile the PhoneTest.java to PhoneTest.class only but jar-file instead?</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>This is what I did:</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>- verified my classpath in the java.conf.xml: <option value="-Djava.class.path=/usr/local/freeswitch/scripts/freeswitch.jar"/></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>- my PhoneTest.class is located in /usr/local/freeswitch/script - directory, same as where freeswitch.jar is located</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>- I created PhoneTest.jar file from PhoneTest.class</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>- changed my dialplan to: <action application="java" data="/usr/local/freeswitch/scripts/PhoneTest.jar PhoneTest arg1 arg2 arg3"/></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt">- 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.</P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt">Thanks a million, would have never figured it out by myself.</P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt">Is there any technical reason why class-file cannot be called as an binary directly?</P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> Nic</P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>------------------</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3></FONT> </P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>No, not the path to *freeswitch.jar*, use the path to *your* JAR containing the class.</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Bye</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Damjan</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Thanks Klaus,</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Tried that as well, if I use a full path for PhoneTest then I get same </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> error as earlier.</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> If I call only PhoneTest without any path </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> (/usr/local/freeswitch/scripts/freeswitch.jar PhoneTest arg1 arg2..) </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> then I get:</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Exception in thread "Thread-2" java.lang.ClassNotFoundException: PhoneTest</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>><SPAN style="mso-spacerun: yes"> </SPAN>at java.net.URLClassLoader$1.run(URLClassLoader.java:200)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.security.AccessController.doPrivileged(Native Method)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.net.URLClassLoader.findClass(URLClassLoader.java:188)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.ClassLoader.loadClass(ClassLoader.java:306)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.ClassLoader.loadClass(ClassLoader.java:251)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.Class.forName0(Native Method)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.Class.forName(Class.java:242)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> org.freeswitch.Launcher.launch(Launcher.java:65)</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> It's a same error message if I leave the full path off from </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> freeswitch.jar as well. There must be something what I have not </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> understood about the documentation here..</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>><SPAN style="mso-spacerun: yes"> </SPAN>N</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> You might want to specify not only the class name, but also its </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> package name as well as the jar file that contains it. <action application="java"</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> data="/path/to/file.jar fully.qualified.class.name arg1 arg2 arg3"/> </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Klaus.</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> From: i.mkmo@hotmail.comTo: freeswitch-users@lists.freeswitch.orgSubject:</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Question on using java_modDate: Sun, 9 Nov 2008 21:28:23 +0800</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Hey, I've been testing the usage of mod_java and reading Freeswitch </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> documentation but been having some problems which I think might even </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> be something very simple which I've missed. Hope some could give a </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> hint..mod_java installation has gone through successfully and </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> mod_java.so is compiled and installed.<SPAN style="mso-spacerun: yes"> </SPAN>Configuration files </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.conf.xml and dialplan are configured as instructed in </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> </FONT><A href="http://wiki.freeswitch.org/wiki/JavaCompilation"><FONT face="Times New Roman" size=3>http://wiki.freeswitch.org/wiki/JavaCompilation</FONT></A><FONT face="Times New Roman" color=#000000 size=3> of the Java example in </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> the same page is successful (CLASSPATH included freeswtich.jar of course).</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Problem comes when I try to initiate the script via dialplan - that is </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> I'm trying to make a call to an extension which then calls this </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> example script (dialplan says: <action application="java" </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> data="PhoneTest arg1 arg2 arg3"/>). Error message gives me: Exception in thread "Thread-1"</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.ClassNotFoundException: /usr/local/freeswitch/scripts/PhoneTest</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>><SPAN style="mso-spacerun: yes"> </SPAN>at java.lang.Class.forName0(Native Method)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> java.lang.Class.forName(Class.java:242)<SPAN style="mso-spacerun: yes"> </SPAN>at</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> org.freeswitch.Launcher.launch(Launcher.java:65) I presume this means </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> that the script is called invalid manner?<SPAN style="mso-spacerun: yes"> </SPAN>I've been trying to call </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> the PhoneTest with full path, locating it together with </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> freeswitch.jar, creating a directory PhoneTest just name </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> it.Documentation does not say if the Java binary needs to be in certain location or not - is there</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> amandatory location for it? What else am I doing wrong?<SPAN style="mso-spacerun: yes"> </SPAN>My system is</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> running in CentOS 5, Java version JDK1.5.0_16 so the unstability described</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> in Wiki should not be a reason.<SPAN style="mso-spacerun: yes"> </SPAN>Nic</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Enrich your blog with Windows Live Writer. Windows Live Writer </FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> _________________________________________________________________</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> NEW! Get Windows Live FREE.</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> </FONT><A href="http://www.get.live.com/wl/all________________________________________"><FONT face="Times New Roman" size=3>http://www.get.live.com/wl/all________________________________________</FONT></A></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> _______</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> Freeswitch-users mailing list</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> </FONT><A href="mailto:Freeswitch-users@lists.freeswitch.org"><FONT face="Times New Roman" size=3>Freeswitch-users@lists.freeswitch.org</FONT></A></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> </FONT><A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><FONT face="Times New Roman" size=3>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</FONT></A></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-use</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> rs</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>> </FONT><A href="http://www.freeswitch.org/"><FONT face="Times New Roman" size=3>http://www.freeswitch.org</FONT></A></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT color=#000000><FONT size=3><FONT face="Times New Roman">><o:p> </o:p></FONT></FONT></FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" color=#000000 size=3> </FONT></o:p></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>_______________________________________________</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>Freeswitch-users mailing list</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><A href="mailto:Freeswitch-users@lists.freeswitch.org"><FONT face="Times New Roman" size=3>Freeswitch-users@lists.freeswitch.org</FONT></A></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><A href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"><FONT face="Times New Roman" size=3>http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</FONT></A></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" color=#000000 size=3>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users</FONT></P>
<P class=MsoPlainText style="MARGIN: 0in 0in 0pt"><A href="http://www.freeswitch.org/"><FONT face="Times New Roman" size=3>http://www.freeswitch.org</FONT></A></P><RTE_TEXT></RTE_TEXT><br /><hr />Enrich your blog with Windows Live Writer. <a href='http://get.live.com/writer/overview' target='_new'>Windows Live Writer</a></body>
</html>