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