Author Topic: Client-Server-Applet-HTML  (Read 3891 times)

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Client-Server-Applet-HTML
« on: April 28, 2011, 09:57:04 pm »
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.

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Client-Server-Applet-HTML
« Reply #1 on: April 28, 2011, 09:59:15 pm »
The applet is already signed.
Firewall disabled.
Jar's all in the same directory.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Client-Server-Applet-HTML
« Reply #2 on: April 28, 2011, 11:21:06 pm »
Maybe the router blocks that port? Just a guess...

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Client-Server-Applet-HTML
« Reply #3 on: April 28, 2011, 11:52:33 pm »
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. = /

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Client-Server-Applet-HTML
« Reply #4 on: April 29, 2011, 12:00:32 am »
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.

Offline Alexey

  • int
  • **
  • Posts: 50
    • View Profile
Re: Client-Server-Applet-HTML
« Reply #5 on: April 29, 2011, 12:15:06 am »
java console show any exception?

Offline MegasXLS

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Client-Server-Applet-HTML
« Reply #6 on: April 30, 2011, 12:01:31 am »
No, java console not show anyone message.

Offline Alexey

  • int
  • **
  • Posts: 50
    • View Profile
Re: Client-Server-Applet-HTML
« Reply #7 on: April 30, 2011, 01:36:58 am »
С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?

Offline Hrolf

  • int
  • **
  • Posts: 84
    • View Profile
Re: Client-Server-Applet-HTML
« Reply #8 on: April 30, 2011, 06:36:05 pm »
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.