Java net SocketException Invalid argument create Socket.Java
Iam getting SocketException Error on connecting with mysql using jdbc also when connect to Activemq jms. Strange thing is this is only
happening on Windows Server(2008) and when i run the application as Windows service with 'jvm' (in-process) option. Program can Connect
when i run as Java 'exe' in the Windows Service.
Java JDK version - jdk1.6.0_26.
Thanks in advance, please let me know any more details needed.
-- mysql --
Java.net.SocketException
MESSAGE: Invalid argument: create
STACKTRACE:
java.net.SocketException: Invalid argument: create
at java.net.Socket.createImpl(Socket.java:397)
at java.net.Socket.<init>(Socket.java:371)
at java.net.Socket.<init>(Socket.java:189)
at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:124)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:225)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1779)
at com.mysql.jdbc.Connection.<init>(Connection.java:4 50)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:411)
at java.sql.DriverManager.getConnection(DriverManager .java:582)
at java.sql.DriverManager.getConnection(DriverManager .java:185)
at myapp.JDBCLoader.JDBCConnect(JDBCLoader.java:129)
----on activemq connect ---
javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616?connectionTimeout=0&keepAlive=true &wireFormat.maxInactivityDuration=0. Reason: java.net.SocketException: Invalid argument: create
at org.apache.activemq.util.JMSExceptionSupport.creat e(JMSExceptionSupport.java:35)
at org.apache.activemq.ActiveMQConnectionFactory.crea teActiveMQConnection(ActiveMQConnectionFactory.jav a:286)
at org.apache.activemq.ActiveMQConnectionFactory.crea teActiveMQConnection(ActiveMQConnectionFactory.jav a:230)
at org.apache.activemq.ActiveMQConnectionFactory.crea teQueueConnection(ActiveMQConnectionFactory.java:1 93)
at sen.connector.queue.ConnectionFactory.createQueueC onnection(ConnectionFactory.java:60)
at sen.connector.queue.ConnectionFactory.createQueueC onnection(ConnectionFactory.java:36)
at sen.connector.queue.HostConnection.connectToHost(H ostConnection.java:147)
at sen.connector.queue.HostConnection.run(HostConnect ion.java:127)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.SocketException: Invalid argument: create
at java.net.Socket.createImpl(Socket.java:397)
at java.net.Socket.connect(Socket.java:527)
at org.apache.activemq.transport.tcp.TcpTransport.con nect(TcpTransport.java:484)
at org.apache.activemq.transport.tcp.TcpTransport.doS tart(TcpTransport.java:447)
at org.apache.activemq.util.ServiceSupport.start(Serv iceSupport.java:53)
at org.apache.activemq.transport.InactivityMonitor.st art(InactivityMonitor.java:127)
at org.apache.activemq.transport.TransportFilter.star t(TransportFilter.java:58)
at org.apache.activemq.transport.WireFormatNegotiator .start(WireFormatNegotiator.java:72)
at org.apache.activemq.transport.TransportFilter.star t(TransportFilter.java:58)
at org.apache.activemq.transport.TransportFilter.star t(TransportFilter.java:58)
at org.apache.activemq.ActiveMQConnectionFactory.crea teActiveMQConnection(ActiveMQConnectionFactory.jav a:266)
Re: Java net SocketException Invalid argument create Socket.Java
So I guess you've decided not to show the code that's causing the error. That's a pity.
Re: Java net SocketException Invalid argument create Socket.Java
I had not given the code because it Works Fine when the Program runs as java exe mode on Windows Service. I given the connection URL iam using. I think it is setting issue not sure something is blocking the connection. It only happen when the Program runs in 'in-process' jvm.dll mode
on Windows.
Re: Java net SocketException Invalid argument create Socket.Java
And it happens when connect 'MySql' and also when connect JMS ActiveMQ.