From: Thomas F. <tfo...@us...> - 2005-01-27 15:01:30
|
On Thu, 2005-01-27 at 12:23 +0100, seb...@ph... wrote: > Building the jar with JDK 1.4.2 has solved the version issue. > However the original problem is not solved. I tried with mysql on my machine, and it seems to work ok (well, mostly ok, except that the workflow user isn't added, due to not-null constraints; that's not critical, though). On my box: mysql-server --> version 4.1.9-1 libmysql-java (jdbc driver) --> version 3.0.9-1 tomcat4 --> version 4.1.31-2 So, not exactly the same version as you, but close enough, I'd think. I will, however, try with the mysql-connector-java-3.0.16-ga-bin.jar driver. My guess is that this is where the problem lies. I've spent some time looking at what could have gone wrong. I think I see what's happening, but I cannot figure out why it's happening. Here's what seems to be going on... this is where it starts to look interesting: > ... > > net.sf.hibernate.exception.GenericJDBCException: Could not execute query > at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90) > at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79) > at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30) > at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4110) > at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1556) > at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1530) > at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1522) > at net.sf.hibernate.util.HibernateUtil.find(HibernateUtil.java:354) > at za.org.coefficient.util.common.Roles.getAllRoles(Roles.java:49) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:324) > at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252) > at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:198) > at za.org.coefficient.invokers.base.BaseInvoker.invokeMethodOnService(BaseInvoker.java:138) > at za.org.coefficient.util.ejb.DataLoaderUtil.createDefaultRolesIfNeeded(DataLoaderUtil.java:163) > ... > Caused by: java.sql.SQLException: No operations allowed after connection closed. This occurs when the dataloader tries to load the default roles. It first does a a "find" on the existing roles (the call to HibernateUtil.find above). This call, however, fails (because the connection was previously closed; it seems that the mysql driver "remembers" that you closed the connection, probably by creating a new Throwable() and holding a reference to it internally). The "find" call failing results in the roles list being null, hence the NPE here: > java.lang.NullPointerException > at za.org.coefficient.util.ejb.DataLoaderUtil.createDefaultRolesIfNeeded(DataLoaderUtil.java:165) > at za.org.coefficient.util.ejb.DataLoaderUtil.initializeDataIfNeeded(DataLoaderUtil.java:140) Then, because the roles don't exist, we cannot add the default users (due to not-null constraints): > 10616 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:266 | operation: user registration | username: admin | fullname: Site Administrato > r > 10626 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:266 | operation: save | on: za.org.coefficient.authentication.CoefficientUser | to > String: Site Administrator > 10636 [Thread-5] ERROR ejb.DataLoaderUtil - at: DataLoaderUtil.java:266 | operation: persistence exception on update | exception type: net.sf.hiberna > te.PropertyValueException | exception message: not-null property references a null or transient value: za.org.coefficient.authentication.CoefficientUs > er.systemRole > net.sf.hibernate.PropertyValueException: not-null property references a null or transient value: za.org.coefficient.authentication.CoefficientUser.sys > temRole > at net.sf.hibernate.impl.SessionImpl.checkNullability(SessionImpl.java:1286) > at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:937) However, all the other data seems to load fine: (this I find odd. why would the roles operations fail, but these work ok?) > 10676 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:299 | operation: save | on: za.org.coefficient.core.ProjectAttribute | toString: z > a.org.coefficient.core.ProjectAttribute@118abfe > 10756 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:308 | operation: save | on: za.org.coefficient.core.ProjectAttributeData | toStrin > g: za.org.coefficient.core.ProjectAttributeData@94b318 > 10756 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:308 | operation: save | on: za.org.coefficient.core.ProjectAttributeData | toStrin > g: za.org.coefficient.core.ProjectAttributeData@f84b0a > 10756 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:308 | operation: save | on: za.org.coefficient.core.ProjectAttributeData | toStrin > g: za.org.coefficient.core.ProjectAttributeData@106b56a > 10766 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:308 | operation: save | on: za.org.coefficient.core.ProjectAttributeData | toStrin > g: za.org.coefficient.core.ProjectAttributeData@1705316 > 10766 [Thread-5] INFO ejb.DataLoaderUtil - at: DataLoaderUtil.java:308 | operation: save | on: za.org.coefficient.core.ProjectAttributeData | toStrin > ... And here, when the system tries to run the default configuration screen, we fail because there are no users/roles: > java.lang.NullPointerException > at za.org.coefficient.modules.configuration.Configuration.canExecuteForRole(Configuration.java:68) > at za.org.coefficient.invokers.base.BaseInvoker.invokeOpOnModule(BaseInvoker.java:177) > at za.org.coefficient.interceptors.ConfigurationInterceptor.handleInvoke(ConfigurationInterceptor.java:45) > at za.org.coefficient.core.CoefficientInterceptor.invoke(CoefficientInterceptor.java:79) > at za.org.coefficient.core.CoefficientInterceptor.invoke_aroundBody0(CoefficientInterceptor.java:90) > ... > As I mentioned, I'll test with the 3.0.16 driver as well, and get back to you. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks transtec Computers for their support. |