Hi, sorry but my computer is a confusion because i had some problems when
developing my application and i had to get an older version.
That error does not appear anymore, however i have a new exception. Do you
have an ideia about this?
The application continues to run perfectly in localhost and the adress that
i use to run the applet is http://phc:8000/aplicServ where aplicServ is a
servlet wich dispays the applet. This applet will then try to communicate
with other servlets like http://phc:8000/main for example, all servlets are
running in this server.... And i acess this servlet's through the browser
with this adresses...
This only occurs when i run my application from another machine, in
localhost it communicates perfectly
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
Richard Yee
Sent: sexta-feira, 21 de Setembro de 2001 23:52
To: [EMAIL PROTECTED]
Subject: Re: java.net.ConnectException in applet connection to servlet
Hugo,
This error seems to indicate that your web server is not listening on port
8000. What is the url that you use in your browser to retrieve the page
that contains the applet?
-Richard
At 10:22 AM 9/20/01 +0100, you wrote:
>Hi, if you remember my previous e-mails, i'm connecting an applet to a
>servlet with URLConnection and serialized objects.
>Before i got a java.security.AccessControlException, but now and without a
>reason, this exception does not appear an the applet run in localhost and
in
>anothers machines.
>
>However when i try to retrieve some data from the servlet and connect to
him
>it gives me the following exception:
>
>java.net.ConnectException: Connection refused: connect
>at java.net.PlainSocketImpl.socketConnect(Native Method)
>at java.net.PlainSocketImpl.doConnect(Unknown Source)
>at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
>at java.net.PlainSocketImpl.connect(Unknown Source)
>at java.net.Socket.<init>(Unknown Source)
>at java.net.Socket.<init>(Unknown Source)
>at sun.net.NetworkClient.doConnect(Unknown Source)
>at sun.plugin.protocol.jdk12.http.HttpClient.doConnect(Unknown Source)
>at sun.net.www.http.HttpClient.openServer(Unknown Source)
>at sun.net.www.http.HttpClient.openServer(Unknown Source)
>at sun.net.www.http.HttpClient.<init>(Unknown Source)
>at sun.net.www.http.HttpClient.<init>(Unknown Source)
>at sun.plugin.protocol.jdk12.http.HttpClient.<init>(Unknown Source)
>at sun.plugin.protocol.jdk12.http.HttpClient.New(Unknown Source)
>at sun.plugin.protocol.jdk12.http.HttpURLConnection.privBlock(Unknown
>Source)
>at
>sun.plugin.protocol.jdk12.http.HttpURLConnection$PrivilegedBlockAction.run(
U
>nknown Source)
>at java.security.AccessController.doPrivileged(Native Method)
>at sun.plugin.protocol.jdk12.http.HttpURLConnection.connect(Unknown Source)
>at sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown
>Source)
>at Veiculos_Panel.getFromServlet(Veiculos_Panel.java:711)
>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)
>
>
>My cliente source code is:
>public Object getFromServlet(String opcao, String
>am){
>
> Object obj = null;
>
> try{
> 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