|
#1
|
|||
|
|||
|
Hi all
I'm not sure this is the right place, but I don't quite know to whom this issue might belong (beside me). I'm using quite a mix of things here: to make it simple I'm creating stateful jobs with Quartz. I'm attaching dynamic aspects to inject an Hibernate session, and to perform transaction demarcation. Everything goes along pretty well it seems, but I don't know why after some time I begin getting the following trace. Any comment? Code:
java.lang.NullPointerException at org.apache.commons.dbcp.PoolingConnection.toString(PoolingConnection.java:248) at java.lang.String.valueOf(String.java:2615) at java.lang.StringBuffer.append(StringBuffer.java:220) at org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnection.java:354) at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:246) at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:302) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505) at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547) at org.hibernate.loader.Loader.doQuery(Loader.java:673) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.loadCollection(Loader.java:1994) at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36) at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565) at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60) at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716) at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344) at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86) at org.hibernate.collection.PersistentSet.toArray(PersistentSet.java:171) at org.atalaya.isec.dashb.db.Hosts.getIp(Hosts.java:53) at org.atalaya.isec.appliance.nmap.NmapThread.prepare(NmapThread.java:49) at org.atalaya.isec.update.AScanTask.execute(AScanTask.java:62) at org.atalaya.isec.update.AScanTask$$FastClassByCGLIB$$f5924b97.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:695) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:54) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:630) at org.atalaya.isec.appliance.nmap.NmapThread$$EnhancerByCGLIB$$4386de9a.execute(<generated>) at org.atalaya.isec.update.scheduling.StatefulTaskAdapter.execute(StatefulTaskAdapter.java:32) at org.quartz.core.JobRunShell.run(JobRunShell.java:203) thanks everybody Francesco |
|
#2
|
|||
|
|||
|
I wonder why it tries to call toString() on the connection. Are you keen enough to look into the code? Maybe it's only an error in the logging (not handling null) AFTER another exception which would be your actual error.
Joerg
__________________
This post can contain insufficient information. |
|
#3
|
|||
|
|||
|
I've checked and the offending part is in
Code:
protected void checkOpen() throws SQLException {
if(_closed) {
throw new SQLException
("Connection " + _conn + " is closed.");
}
}
I don't know what was messing up, I've been running the same code since this post without problem. I've a slight feeling that the combination Maven+jetty plugin+debug+all the rest might have screwed up... Cheers F |
|
#4
|
|||
|
|||
|
__________________
This post can contain insufficient information. |
|
#5
|
|||
|
|||
|
Anyway, it was stated many times in this forum that C3P0 produces better results then DBCP (and my own experience confirms it).
Regards, Oleksandr Quote:
Last edited by al0; Sep 22nd, 2007 at 05:01 PM. Reason: Absolutely invalid statement was removed, sorry |
|
#7
|
|||
|
|||
|
Yeah, I'd go with this one. We made the same change when we experienced problems.
|
|
#8
|
|||
|
|||
|
Quote:
![]() My vein to Apache is obvious ![]() Joerg
__________________
This post can contain insufficient information. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|