cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Exception

felipe
Champ in-the-making
Champ in-the-making
Hello,
I'm using Alfresco 1.3 RC in order to have access to some functions allowed by this version.
I've an exception raised in the web Client when ???? I don't know

javax.faces.el.EvaluationException: Exception while invoking expression #{BrowseBean.clickSpace}

caused by:
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed:

caused by:
org.hibernate.TransactionException: JDBC begin failed:

caused by:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Software caused connection abort: recv failed STACKTRACE: java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(Unknown Source) at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113) at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160) at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188) at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1902) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666) at com.mysql.jdbc.Connection.execSQL(Connection.java:2988) at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4913) at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:781) at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1290) at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:520) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:282) at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:225) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy15.getType(Unknown Source) at org.alfresco.web.bean.BrowseBean.clickSpace(BrowseBean.java:1091) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129) at javax.faces.component.UICommand.broadcast(UICommand.java:86) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164) at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:105) at org.alfresco.web.app.servlet.AlfrescoFacesServlet.service(AlfrescoFacesServlet.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago.


Anyone has an an idea.

Thanks.
3 REPLIES 3

derek
Star Contributor
Star Contributor
Hi,

Please describe your particular environment, i.e. database, server specs, java version, app server version, etc.

Your database connection is unavailable for some reason.  If it happened after a period of successful activity (it looks like it did), then I would recommend putting a connection tester in the connection pool.  Go to http://dev.mysql.com/doc/refman/5.0/en/cj-news-3-1-8.html and search for MysqlConnectionTester.
See the WIKI notes on overriding beans to override the dataSource bean.
Once set up, you will have to pull your JDBC driver into the alfresco/WEB-INF/lib folder if you are using Tomcat.

But first, examine why the connection is gone in the first place.  It is possible that the connection pool has a dud connection from a previous connection failure of some sort.

Regards

felipe
Champ in-the-making
Champ in-the-making
Thanks for your reply,

Environment:
MySQL version 4.1.10
Tomcat 5.5.16
Java 5.0

Is it Mysql that is too old, and if it is, how to change properly the version of MySQL. There are some people using Alfresco actually!

Regards

derek
Star Contributor
Star Contributor
Hi,

What about server specs.  They really are relevant, particularly since you are having "Communications link failure" problems.
    What machines are you running Tomcat on?
    What version of Java are you using.  5.0 obviously or the server wouldn't even start, but which one?
    Where is the database sitting and what lies between the server and the database?
I take it the changes I suggested didn't work and rebooting the server makes no difference, then.

I am not aware of any compatibility issues with 4.x versions of MySQL.  Have you searched for others having problems with Hibernate and your particular setup?  That being said, you should ensure that your JDBC connector is compatible with the particular version of MySQL you are running.  If it isn't, then change the JConnector version.  But I don't think that is the issue.  You got as far as org.alfresco.web.bean.BrowseBean.clickSpace so the system must have bootstrapped and that implies that the connections were good.  And it IS just a JDBC connection that is being made to MySQL with both the JDBC connector and MySQL being supplied by the same company.

So, what happens when you implement the connection suggestions I made and restart the server?  If the failure occurs in the same place each time, then turn SQL logging on in Hibernate.

As a paying customer, you can get priority support via our support email address as well.  I recommend notifying us of your Forum login name so that we can follow up more swiftly in future.

Regards