Java sql exception after moving openemm to a new machine

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

blue_asterisk
Posts: 7
Joined: Wed Sep 05, 2007 7:47 pm
Location: USA

Java sql exception after moving openemm to a new machine

Post by blue_asterisk »

Hi, I am in the process of moving my current openemm installation to a new machine. The old machine is CentOS 4.5 with mysql 4 and the new machine is running CentOS 4.5 with mysql 5 on newer hardware.

I followed the documentation to install a new fresh copy of openemm except I imported the mysql openemm database from the old machine.

I 'su' to openemm to start OpenEMM and then tried both the "8081" and "8080" address to log in but I get the following java exception displayed:

Code: Select all

Ein Fehler ist aufgetreten
Ursache:	javax.servlet.ServletException: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555) at com.mysql.jdbc.Connection.(Connection.java:1485) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2145) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.springframework.orm.hibernate3.HibernateTemplate$31.doInHibernate(HibernateTemplate.java:853) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366) at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:844) at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840) at _jsp._logon__jsp._jspService(_logon__jsp.java:63) at com.caucho.jsp.JavaPage.service(JavaPage.java:60) at com.caucho.jsp.Page.pageservice(Page.java:570) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:175) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:277) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106) at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96) at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:92) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at org.agnitas.web.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:47) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:389) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:507) at com.caucho.util.ThreadPool.run(ThreadPool.java:433) at java.lang.Thread.run(Thread.java:619) ** END NESTED EXCEPTION ** Last packet sent to the server was 1 ms ago.); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: java.net.ConnectException: Connection refused STACKTRACE: java.net.SocketException: java.net.ConnectException: Connection refused at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:284) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555) at com.mysql.jdbc.Connection.(Connection.java:1485) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540) at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561) at org.hibernate.loader.Loader.doQuery(Loader.java:661) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) at org.hibernate.loader.Loader.doList(Loader.java:2145) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) at org.hibernate.loader.Loader.list(Loader.java:2024) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) at org.springframework.orm.hibernate3.HibernateTemplate$31.doInHibernate(HibernateTemplate.java:853) at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366) at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:844) at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840) at _jsp._logon__jsp._jspService(_logon__jsp.java:63) at com.caucho.jsp.JavaPage.service(JavaPage.java:60) at com.caucho.jsp.Page.pageservice(Page.java:570) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:175) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:277) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106) at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96) at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:92) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at org.agnitas.web.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:47) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:389) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:507) at com.caucho.util.ThreadPool.run(ThreadPool.java:433) at java.lang.Thread.run(Thread.java:619) ** END NESTED EXCEPTION ** Last packet sent to the server was 1 ms ago.)
I know the firewall ports for openemm are open.
I can log in via terminal using the 'agnitas' user and password.
Can someone please help me figure out what's going on here?

I am using OpenEMM5.1.1-1 with the latest fullview bug patch.
blue_asterisk
Posts: 7
Joined: Wed Sep 05, 2007 7:47 pm
Location: USA

Bug posted and quick fix available

Post by blue_asterisk »

marton
Posts: 36
Joined: Wed Aug 09, 2006 2:51 pm

Post by marton »

hi,

i have exactly the same problem right now.
did you fix the problem with this workaround?


thanks in advance, marton
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Post by maschoff »

yes, blue_asterisk, please tell us. If it works I will add your info to the official install guide. Thank you!
OpenEMM Maintainer
marton
Posts: 36
Joined: Wed Aug 09, 2006 2:51 pm

Post by marton »

i was trying it yesterday.... but i didn´t work on my machine.

blue_asterisk?

regards,
marton
buggyboy
Posts: 8
Joined: Wed Oct 22, 2008 4:38 pm

Problem confirmed

Post by buggyboy »

This seems to be a very common poblems with 5.5.1 installations if you dare to have a look at the installation forum. A short search revealed at least the following posts from the near past:

http://www.openemm.org/forums/ftopic892.html
http://www.openemm.org/forums/ftopic893.html
http://www.openemm.org/forums/ftopic851.html
http://www.openemm.org/forums/ftopic682.html

I tried an openEMM install today myself and ran into the same problem. The host runs several mysql based web presences without problems. Using the database credentials I can log into the openemm database and do the test query without any problem. Nevertheless, OpenEMM reports that "connection refused" exception.

I need a working solution here within the next days, otherwise I'll have to use something else because my employer wont wait forever.
Admittedly I was slightly shocked by the fact that apparently the install guides dont cover topics like setting up a nonstandard database name or user by the slightest bit and that problems like the one above are apparently present in this forum for months without anyone posting a solution. Very unusual.
awilkin
Posts: 1
Joined: Thu Nov 27, 2008 5:42 pm
Location: Swindon, UK

Resolving problem?

Post by awilkin »

Hi There,

I know there are duplicate posts all over the shop, but I will only respond to this one. I experienced exactly the same problem, but got to the bottom of it on my installation, an issue with mysql configuration.

Assuming you can login to mysql using the username and password stored in the emm.properties, then it could be the problem I had.

First check to see that mysql is listening to network connections (because there are two ways to login - with sockets, and using the network).

netstat -an | grep 3306

If you get nothing back, here in lies your problem!

Find your my.cnf file (mine was under /etc/my.cnf), under the section for [mysqld] add:

bind-address=localhost

And COMMENT OUT...

#skip-networking

Then restart mysql:

service mysqld restart

Then a netstat -an should show port 3306, and hopefully it will work for you.


:lol:

Good luck!

Andy
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Post by maschoff »

Thanks for your valuable post!
OpenEMM Maintainer
Post Reply