Menu

Conversion of Peers into a Java Applet

Help
anirudh r
2011-06-21
2012-12-06
  • anirudh r

    anirudh r - 2011-06-21

    If I were to attempt conversion of Peers into an applet, would I face any major hurdles?

     
  • yohannmartineau

    yohannmartineau - 2011-06-21

    Hi,

    To make it short and simple: yes. For longer answers, take a look at previous forum posts.

    Thank you,

    yohann

     
  • anirudh r

    anirudh r - 2011-06-21

    Hi!
    I read through the posts, and couldn't find anything related to the conversion to applet. Would such an effort be futile. Could you please elucidate?

    Anirudh

     
  • yohannmartineau

    yohannmartineau - 2011-06-21

    take a look at forum / open discussion and tracker / feature request.

     
  • anirudh r

    anirudh r - 2011-06-23

    Hi Yohann!
    Great news, I have managed to convert peers into an applet. My code quality however is really bad. I'm fixing some issues, but I'm able to receive and make calls directly from the applet! (Voice quality is pretty good). Why does placing a call to oneself throw an exception? (Something to do with RTPListener?). Please tell me license limitations of using peers commercially.

    And also,  How do I submit a patch?

     
  • yohannmartineau

    yohannmartineau - 2011-06-23

    could you give more details about what's working?

    Did you try to call using a sip proxy registrar on the same pc? using an applet downloaded from a web server on your local pc or from a distant server?

    Could you send peers.log and transport.log and your modifications on peers?

    To send a patch, run svn diff > my.patch and send me the patch.

    Thanks

     
  • anirudh r

    anirudh r - 2011-06-23

    I will send a patch as soon as I remove all the hardcoded stuff, and make it function also as an application at the same time, and make it possible to feed values to the applet using javascript. I am not using an outbound proxy.

    I tested with a remote webserver and the applet loads, and I am able to call using an asterisk registrar on my local network.

     
  • yohannmartineau

    yohannmartineau - 2011-06-24

    Regarding commercial restrictions, peers license is GPL v3. It means that your users should be aware that peers is distributed under license GPL v3 showing a screenshot, using a menu or something else. License text file has to be distributed with your modified version. People have to know that there is no warranty about peers. You can use it in a commercial environment, but if you make any change to peers source code, if someone asks for source code, you have to make it available.

    As this is an applet, you can insert a link within the applet towards license. The text of this link has to contain GPL v3.

     
  • anirudh r

    anirudh r - 2011-06-24

    Hi!
    I have made a patch here
    and I am also including a modified peers (in case I missed something out in the patch).

    It functions as an applet only after signing, so, after the ant build, do execute the

     makeApplet.bat
    

    file in the applet directory before you execute the index.html (in the same directory.).

    Hope this can be integrated.
    Anirudh

     
  • anirudh r

    anirudh r - 2011-06-24

    Hi!
    The modified version would've thrown some build errors. I have updated it here. Sorry about that! Also, I have uploaded the functioning applet here.

     
  • yohannmartineau

    yohannmartineau - 2011-06-24

    thank you, unfortunately, I cannot download it for the moment because the proxy of my company is blocking file sharing web sites, but I'll take a look at it next week.

    thank you,

    yohann

     
  • Anonymous

    Anonymous - 2011-07-08

    Hi,

    A great effort indeed. It works fine when I run it form IDE but somehow can't make the applet work form browser.

    Here is what I get :

    load: class net.sourceforge.peers.gui.MainFrame not found.
    java.lang.ClassNotFoundException: net.sourceforge.peers.gui.MainFrame
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:687)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
    at java.lang.Thread.run(Thread.java:680)
    Exception: java.lang.ClassNotFoundException: net.sourceforge.peers.gui.MainFrame

    And Java sign reports following:

    sh-3.2# jarsigner -keystore compstore -storepass asdf123 -keypass asdf123 -signedjar peers_signed.jar peers.jar signFiles
    jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: net/sourceforge/peers/gui/green.png

    Any thoughts?

     
  • anirudh r

    anirudh r - 2011-07-08

    Hi!
    Your first error is being thrown because it is unable to find peers_signed.jar, which applet.html is configured to use. See source of applet.html.
    Now, both your problems will be fixed once the signing goes successfully. This should fix it… ->
    ->delete the build/applet directory
    ->run ant
    ->now run makeApplet.bat
    ->finally, run applet.html

     
  • anirudh r

    anirudh r - 2011-07-09

    I have updated the applet code, to use the  version of peers. I have also added sound alerts for incoming call, outgoing calls and hangup.

    The new sources can be downloaded here.
    Hope this helps someone… Good luck!

     
  • Lapeth

    Lapeth - 2011-11-23

    Beware that on systems with mutexed access to the sound lines, the event sounds will grab the device first, making the opening of the actual speaker & microphone lines fail, and in turn disable any voice data being passed through. I had to disable the event sounds to get it to work.

     
  • Gonçalo Azevedo

    Hello!

    I am under OSX and i am trying to put this applet working without any success! I already have tried to put this working under Windows without any success also.
    I have notice also that you have create an bat file where you create and assign the applet can i expor this to a script in osx, can you give some advice?

    When i try to run the applet i get this same error as a user before!
    load: class net.sourceforge.peers.gui.MainFrame not found.
    java.lang.ClassNotFoundException: net.sourceforge.peers.gui.MainFrame
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:252)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:687)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1498)
    at java.lang.Thread.run(Thread.java:680)
    Exception: java.lang.ClassNotFoundException: net.sourceforge.peers.gui.MainFrame

    Any ideas?
    Best regards

     
  • yohannmartineau

    yohannmartineau - 2012-05-02

    hi,

    a java web start version is now embedded in peers, in latest source version from subversion repository. This is not exactly an applet but it can be started from browser the same way. I don't know if java web start is supported in apple java version, but I think it should work as expected. You can check your java web start using oracle tutorial examples. Here is NotePad one.

     
  • Gonçalo Azevedo

    Hello again!

    I am having the same problem that i told above… i can not run the BAT file in windows and i cannot covert to a .sh script to run under macos….

    can anyone help me?

     
  • yohannmartineau

    yohannmartineau - 2012-09-20

    can you see another java applet in your browser?

    if so, please download peers latest source:

    svn co https://peers.svn.sourceforge.net/svnroot/peers/trunk peers
    mvn install
    

    try to extract peers-jws/target/peers-jws-bin.zip to a web server and connect to …/peers-jws/index.html

    thanks,

    yohann

     
  • Gonçalo Azevedo

    Yap i can see other java applets in the browser….

    Can you explain more detailed what i should do because i didn't understood!!!

    Sorry and thanks!

     
  • yohannmartineau

    yohannmartineau - 2012-09-20

    did you ever used maven? to get an applet, you need to compile peers, and to compile peers you need maven.
    peers maven project contains a parent project: peers, and several modules: peers-doc, peers-gui, peers-js, peers-jws, and peers-lib.

    Parent project and modules contains a file called pom.xml. This file gives more details about build procedure, dependencies, etc.

    You can find a very tiny help file about peers here.

    peers-jws contains files that will help you build an html page with a java web start link to launch peers as a java web start application. In this case, this is not a real applet. This is just a link to start peers from your browser.

    peers-js contains files that will help you build an html page with an hidden peers applet and an html link to invoke a peers javascript wrapper api. Thus you can use javascript to send "commands" to peers. In this case, peers is executed in an applet sandbox, within browser.

    For the moment, I didn't develop a "real" applet gui because I find them ugly and pretty useless.

    hope this helps,

    yohann

     
  • Gonçalo Azevedo

    lol i an not getting nothing about this conversation…
    No i never user maven and i don't really know what that is….
    I downloaded the version that anirudhrx posted some post above… and i can't put it together to work…
    The error i get was the one i put before…
    thanks very much for your help the the java web start will not help me because i need peers to be embedded somehow in the browser and with the java web start this will start like a pop up and no embedded right?

    so continuing to the applet can anyone help me?

     
  • Gonçalo Azevedo

    Any help?!?! someone? its really important…

     
  • Gonçalo Azevedo

    anirudhrx there are any way you can explain me some doubts i have with your applet?!?!?

    Email maybe?!?!

    Thanks!

     

Log in to post a comment.