Client-Server-Applet-HTML

Started by MegasXLS, April 28, 2011, 09:57:04 PM

Previous topic - Next topic

MegasXLS

Hello,

I have made ​​an application with the jpct for personal training.
My application is in the form of applets.
Use a server made ​​with a library called hn2n (library made
by a group at a university here in Brazil) that receives these two
customers via an IP and port.
When I try to connect clients to the server using netbeans IDE, the connection is made without problem.
netbeans, I get no problems.
But when I try to connect two clients through the browser (Internet
firefox, google chrome) believe that customers can not find the
server.

My html file is:

<html>
   <head>
      <title>Petrobras_Simulador</title>
   </head>
    <body>
      <body background="" bgcolor="black">
       <p align=center>
   <applet code="org.lwjgl.util.applet.AppletLoader"
            archive="lwjgl_util_applet.jar, lzma.jar" codebase="." width="800" height="600">
                <param name="al_title" value="dist">
                <param name="al_main" value="atep.GameAgente">
                <param name="al_logo" value="appletlogo.png">
                <param name="al_progressbar" value="appletprogress.gif">
                <param name="al_jars"
                    value="hn2n.jar,
                           ServerATEP.jar,
                           jpct.jar,
                           ATEP_Rodrigo.jar,
                           lwjgl.jar.pack.lzma,
                           jinput.jar.pack.lzma,
                           lwjgl_util.jar.pack.lzma,
                           res.jar.lzma">
                <param name="al_windows" value="windows_natives.jar.lzma">
                <param name="al_linux" value="linux_natives.jar.lzma">
                <param name="al_mac" value="macosx_natives.jar.lzma">
                <param name="al_solaris" value="solaris_natives.jar.lzma">
                <param name="al_version" value="1.0">
        </applet>
       </p>
    </body>
</html>

Remember that this same application in the form of applet, I could connect to my database through the netbeans IDE without problems. But when he tried the connection by the browser could not. Has anyone come across this problem or know how to solve?

Thanks in advance.

MegasXLS

The applet is already signed.
Firewall disabled.
Jar's all in the same directory.

EgonOlsen

Maybe the router blocks that port? Just a guess...

MegasXLS

I tried various ports but does not work. I think this is related to the file applet.policy. I do not know. It is very strange because the IDE they communicate often, but not by the browser. = /

EgonOlsen

It might be a better idea to ask this question in a "real" java forum (maybe javagaming.org) then. Albeit i'm doing a lot of server-side Java programming in my day job, i've dropped applets a few years ago and never tried to make them connect to anything but their own server.

Alexey

java console show any exception?

MegasXLS

No, java console not show anyone message.

Alexey

Сonsole show security troubles, then the problem is not in security. Do you work with applets before? What kind of connection do you use? Client-Server-Applet-HTML is not a real scheme,  what should make an applet and what data exchange will be between applet-server?

Hrolf

I have applets talking to servers with no problems.
DON'T disable your firewall unless you want trouble! Use TCPView (or a similar tool) to find which port hn2n is using & just open that port in your firewall. If you are using a router/modem you'll probably need to open the port in it's firewall as well.