marco tognoni

Greenhorn
+ Follow
since Jan 07, 2002
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by marco tognoni

I am trying using a socket, that binds a local port. When the socket is close, the program throws exception:
Java.net.SocketException: errno: 4114, error: Address already in use
How I can set the option setreuseaddress?
I use jdk 1.3!
thanks
When I try to connect to ftp url, it throws this exception:
java.net.SocketException: Malformed reply from SOCKS server
at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:74
at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:237)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:308)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
what is ?
I use this code:
import java.net.*;
import java.io.*;
import java.security.*;
import alibo.net.www.protocol.ftp.FtpURLConnection;
public class ProvaFtp {
public static void main(String args[])
{
System.getProperties().put( "http.proxySet","true");
System.getProperties().put( "http.proxyHost", "proxysar.saritel.it" );
System.getProperties().put( "http.proxyPort", "8080" );
System.getProperties().put( "ftp.ProxySet", "true" );
System.getProperties().put( "ftp.ProxyHost", "proxysar.saritel.it" );
System.getProperties().put( "ftp.ProxyPort", "8080" );
System.getProperties().put( "ftpProxySet", "true" );
System.getProperties().put( "ftpProxyHost", "proxysar.saritel.it" );
System.getProperties().put( "ftpProxyPort", "8080" );

try {
URL url=new URL(args[0]);
String protocol=url.getProtocol();
System.out.println(protocol);
if(protocol.compareTo("ftp")==0)
{
FtpURLConnection connection=new FtpURLConnection(url);
InputStream is=connection.getInputStream();
}
else
{
URLConnection connection=url.openConnection();
Permission allow=connection.getPermission();

if(allow!=null)
System.out.println(allow);

InputStream is=connection.getInputStream();
}

} catch(Exception e) {
e.printStackTrace();
}
}
}
it goes error like this:
java.net.NoRouteToHostException: No route to host: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
at java.net.Socket.<init>(Socket.java:290)
at java.net.Socket.<init>(Socket.java:118)
at alibo.net.NetworkClient.doConnect(NetworkClient.java:51)
at alibo.net.NetworkClient.openServer(NetworkClient.java:39)
at alibo.net.ftp.FtpClient.openServer(FtpClient.java:269)
at alibo.net.ftp.FtpClient.<init>(FtpClient.java:389)
at alibo.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.
java:84)
at alibo.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConn
ection.java:103)
at ProvaFtp.main(ProvaFtp.java:26)

why can't it find the host if I use proxy server ?
tell me something,
thanks a lot,
mauro
i want read a file text from my web site via FTP,
i open a URL connection, but when I try to open a InputStream pointing to Text file, causes this error:

java.io.IOException: Server returned HTTP response code: 500 for URL: ftp://ftp.supereva.it/prova/vocaboli.txt
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:691)
at java.net.URL.openStream(URL.java:955)
at vocabolario.FrameVocaboli.loadFromUrl(FrameVocaboli.java:67)
at vocabolario.FrameVocaboli.<init>(FrameVocaboli.java:40)
at vocabolario.Main.main(Main.java:6)
why ?
thanks in advance
I do what you told me,
but it goes error:
java.net.NoRouteToHostException: No route to host: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
at java.net.Socket.connect(Socket.java:425)
at java.net.Socket.connect(Socket.java:375)
19 years ago
hi,
I want to read a text file from URL,
how can I do it ?
thanks
19 years ago
hi,
how can it do left-fill with zeros a number ?
I.E I want use 4 like 0004.
thanks in advance
20 years ago
thanks,
but how can I access to the ejb container?
Is it generated by J2EE or is it a file of mine ?
hi all,
I am using a servlet in J2ee, when the servlet
lookup the bean in system.err it sees :
javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:34)
at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:400)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:324)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:373)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:351)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.sun.enterprise.naming.factory.IIOPObjectFactory.getObjectInstance(IIOPObjectFactory.java:42)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:307)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:158)
at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:58)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at client.ComputePiServlet.init(ComputePiServlet.java:22)

I can't understand what it is.
I correctly linked the objref to my bean in servlet, then what's matter?
thanks in advance
Hi all,
I don't find Api for the package com.sun.ejb.containers.
Precisly I want use the class om.sun.ejb.containers.EJBObjectImpl.
thanks in advance
It is ok now!!
Thanks for your exhaustive explanation.
It was not easy .... but ok.
20 years ago
again sorry,
I didn't understand. In the java.lang package there is the class String, not Array class.
I understood that Array class had property "length".
I don't know where to find this property.
20 years ago
sorry,
which package the array class stay in ?
I found no property for array, but maybe i looked for in the wrong package......
thanks
20 years ago
thanks, but in the documentation of JDK 1.3 I didn't find any explanation of string array property.
Where can I find some document to see string array properties ?
thanks in advance
20 years ago