You were right, about the name server. The problem was that i was using an
older version of my file where i've already have changed the name of the
server.

However the problem persists in another way. In localhost it gives no error
but when i run my application in another computer it gives me now another
error.

Exception occurred during event dispatching:
java.security.AccessControlException: access denied
(java.net.SocketPermission phc:8000 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin.protocol.jdk12.http.HttpURLConnection.connectStep1(Unknown
Source)
at sun.plugin.protocol.jdk12.http.HttpURLConnection.connect(Unknown Source)
at Veiculos_Panel.getFromServlet(Veiculos_Panel.java:712)
at Veiculos_Panel.procuraButtonActionPerformed(Veiculos_Panel.java:615)
at Veiculos_Panel$5.actionPerformed(Veiculos_Panel.java:426)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)


And my java.policy file looks like this:

grant {
permission java.security.AllPermission;
};

Thanks for your help.

Hugo Malheiro


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Sohaila Roberts
Sent: quinta-feira, 20 de Setembro de 2001 15:10
To: [EMAIL PROTECTED]
Subject: Re: java.net.ConnectException in applet connection to servlet


try putting the actual server's name that the servlet is running on,
instead of localhost

>                         URL url = new
URL("http://localhost:8000/main?"+URLEncoder.encode("opcao")+
>
"="+URLEncoder.encode(opcao)+"&"+URLEncoder.encode("param")+
>
"="+URLEncoder.encode(param));
>                 URLConnection con = url.openConnection();
>                 con.setDoOutput( true );
>         con.setDoInput( true );
>         con.setUseCaches( false );
>         con.setDefaultUseCaches(false);
>                 InputStream in = con.getInputStream();
>                 ObjectInputStream objStream;
>                 objStream = new ObjectInputStream(in);
>                 obj = (Object)objStream.readObject();
>                 objStream.close();
>                 in.close();
>
>                 }catch(IOException o){o.printStackTrace();}
>                 catch(ClassNotFoundException c){c.printStackTrace();}
>
>
>                 return obj;
>         }
>
> (I return an object some that i can use the same function in diferent
> places)
>
> I've looked in the archives and in search engines for this exception, but
i
> did not find anything relevant. Some if anyone can help me i would
apreciate
> it.
>
> Thanks for you time.
>                                                 Hugo Malheiro
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to