Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Samita Bhujbal
error java.net.ConnectException:Connection refused
February 7, 2012 1:24 AM
Answer

Samita Bhujbal

Rank: Regular Member

Posts: 120

Join Date: July 5, 2011

Recent Posts

Hiii,
My staging server getting following error suddenly.:-

java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:327)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:193)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:546)
at java.net.Socket.connect(Socket.java:495)
at java.net.Socket.<init>(Socket.java:392)
at java.net.Socket.<init>(Socket.java:235)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2744)
at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)


** END NESTED EXCEPTION **



Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2820)
at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)


Does anyone knows why this problem happens suddenly..
David H Nebinger
RE: error java.net.ConnectException:Connection refused
February 7, 2012 5:13 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7252

Join Date: September 1, 2006

Recent Posts

These are database connection failures, so your staging system cannot connect to the database. I'd check whether a) you're bleeding connections and so now the c3p0 connection pool is saturated, b) whether database connection is now blocked or limited from the staging system, ...
Hitoshi Ozawa
RE: error java.net.ConnectException:Connection refused
February 7, 2012 5:36 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

From your question, it seems your system was working before.
Seems your db connection pool is timing out. Try extending your timeout in portal-ext.properties
Try setting jdbc.default.maxIdleTime

Following thread is old but may give you an idea:
http://www.liferay.com/community/forums/-/message_boards/message/4539108
nitish tyagi
RE: error java.net.ConnectException:Connection refused
December 20, 2012 9:13 PM
Answer

nitish tyagi

Rank: New Member

Posts: 7

Join Date: October 23, 2012

Recent Posts

hi,
my server give this type exception and stop


java.lang.NullPointerException
at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1011)
at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1204)
at java.lang.Thread.run(Thread.java:619)
Dec 20, 2012 5:06:34 AM org.apache.coyote.http11.Http11NioProtocol start
INFO: Starting Coyote HTTP/1.1 on http-9090
Dec 20, 2012 5:06:34 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-9443
Dec 20, 2012 5:06:34 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8109
Dec 20, 2012 5:06:34 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63 config=null
Dec 20, 2012 5:06:34 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 126113 ms
Dec 20, 2012 5:09:29 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions
SEVERE:
java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
at org.apache.tomcat.util.net.NioEndpoint$NioBufferHandler.<init>(NioEndpoint.java:1958)
at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:996)
at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1204)
at java.lang.Thread.run(Thread.java:619)
Dec 20, 2012 5:11:35 AM org.apache.catalina.startup.Catalina stopServer
Hitoshi Ozawa
RE: error java.net.ConnectException:Connection refused
December 22, 2012 5:24 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7954

Join Date: March 23, 2010

Recent Posts

nitish, if you are not going to reply to the topic of this thread, please do not reply. If you have a new question, please create a new thread. It's the rule of this forum.
Sushil Saini
RE: error java.net.ConnectException:Connection refused
December 22, 2012 2:07 PM
Answer

Sushil Saini

Rank: Regular Member

Posts: 104

Join Date: July 27, 2011

Recent Posts

Hi nitish, ... your problem is different from the Samita's problem. your problem is related to memory space. You can increase the memory size by setting the following parameter. JAVA_OPTS= "%JAVA_OPTS% -Xms512m -Xmx1024m"