On 15/03/2012 01:08, pricyber wrote:
> I did nothing in the xml files, but in the embedded tomcat I did this
> instead.
> 
> connector = embedded.createConnector((String)null, port,
> Http11NioProtocol.class.getName());

OK.

1. Can you set the address field manually, rather than letting the
defaults run?

Also, can you please log "InetAddress.toString()" immediately before you
do the above line?  I suspect Inet4 v Inet6 is the culprit.


2. Unless you subsequently modify the connector you are setting the
default value for the socket traffic class for the NIO connector, from:

  org.apache.tomcat.util.net.SocketProperties

which is:

  protected int soTrafficClass = 0x04 | 0x08 | 0x010;


The other thread reports a similar error, in:

 org.apache.catalina.tribes.transport.nio.NioReceiver

where the default is from

  org.apache.catalina.tribes.transport.ReceiverBase

and is also:

 private int soTrafficClass = 0x04 | 0x08 | 0x010;


3. Side note:

The two stacktraces are _not_ identical with regard the internals of the
JVM (note the line numbers):

java.net.SocketException: Invalid argument: no further information
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Net.java:279)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:175)
at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:296)
at sun.nio.ch.SocketAdaptor.setTrafficClass(SocketAdaptor.java:396)


java.net.SocketException: Invalid argument: no further information
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Net.java:279)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:175)
at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:300)
at sun.nio.ch.SocketAdaptor.setTrafficClass(SocketAdaptor.java:400)



4. The Tomcat 7 documentation states:

 
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html#Java_TCP_socket_attributes

"Note: On some JDK versions, setting soTrafficClass causes a problem. A
work around for this is to add the -Djava.net.preferIPv4Stack=true value
to your JVM options."


p


> --
> View this message in context: 
> http://tomcat.10.n6.nabble.com/Java-7-Tomcat-6-0-35-Win2k3-Problem-tp4566739p4619650.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


-- 

[key:62590808]

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to