You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Thomas Fischer <tf...@apache.org> on 2007/05/05 14:08:48 UTC

Avalon-Test complains about not being able to close a DataSource

When I build the runtime and the org.apache.torque.avalon.AvalonTest is 
run, an exception stacktrace is printed about a NuLlPointerException at
org.apache.commons.dbcp.datasources.SharedPoolDataSource.close(SharedPoolDataSource.java:64)
However, the test case succeeds. Is this something that needs looking 
into, or is this an expected behaviour ?

   Thomas

P.S. relevant part of log:
[DEBUG] Service Framework is up and running
[INFO] YaffiContainer ready.
[DEBUG] Disposing of container...
[INFO] Disposing all services
[DEBUG] Decommisioning the service TorqueComponent
[DEBUG] Disposable.dispose() for TorqueComponent
[DEBUG] dispose()
2007-05-05 13:58:35,138 [main] ERROR 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory  - Exception 
caught during close()
java.lang.NullPointerException
         at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.close(SharedPoolDataSource.java:64)
         at 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory.close(SharedPoolDataSourceFactory.java:113)
         at 
org.apache.torque.TorqueInstance.shutdown(TorqueInstance.java:716)
         at 
org.apache.torque.avalon.TorqueComponent.dispose(TorqueComponent.java:193)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceComponentImpl.dispose(ServiceComponentImpl.java:446)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.decommision(ServiceContainerImpl.java:502)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.decommision(ServiceContainerImpl.java:536)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.dispose(ServiceContainerImpl.java:287)
         at 
org.apache.fulcrum.testcontainer.YAAFIContainer.dispose(YAAFIContainer.java:129)
         at 
org.apache.fulcrum.testcontainer.BaseUnitTest.tearDown(BaseUnitTest.java:87)
         at junit.framework.TestCase.runBare(TestCase.java:130)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         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:585)
         at 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242)
         at 
org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216)
         at 
org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:126)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
         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:585)
         at 
org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
2007-05-05 13:58:35,142 [main] ERROR org.apache.torque.TorqueInstance  - 
Error while closing the DataSourceFactory turbine
org.apache.torque.TorqueException: java.lang.NullPointerException
         at 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory.close(SharedPoolDataSourceFactory.java:118)
         at 
org.apache.torque.TorqueInstance.shutdown(TorqueInstance.java:716)
         at 
org.apache.torque.avalon.TorqueComponent.dispose(TorqueComponent.java:193)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceComponentImpl.dispose(ServiceComponentImpl.java:446)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.decommision(ServiceContainerImpl.java:502)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.decommision(ServiceContainerImpl.java:536)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.dispose(ServiceContainerImpl.java:287)
         at 
org.apache.fulcrum.testcontainer.YAAFIContainer.dispose(YAAFIContainer.java:129)
         at 
org.apache.fulcrum.testcontainer.BaseUnitTest.tearDown(BaseUnitTest.java:87)
         at junit.framework.TestCase.runBare(TestCase.java:130)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         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:585)
         at 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242)
         at 
org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216)
         at 
org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:126)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
         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:585)
         at 
org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
Caused by: java.lang.NullPointerException
         at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.close(SharedPoolDataSource.java:64)
         at 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory.close(SharedPoolDataSourceFactory.java:113)
         ... 30 more
[ERROR] Error while stopping Torque
org.apache.torque.TorqueException: java.lang.NullPointerException
         at 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory.close(SharedPoolDataSourceFactory.java:118)
         at 
org.apache.torque.TorqueInstance.shutdown(TorqueInstance.java:716)
         at 
org.apache.torque.avalon.TorqueComponent.dispose(TorqueComponent.java:193)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceComponentImpl.dispose(ServiceComponentImpl.java:446)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.decommision(ServiceContainerImpl.java:502)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.decommision(ServiceContainerImpl.java:536)
         at 
org.apache.fulcrum.yaafi.framework.container.ServiceContainerImpl.dispose(ServiceContainerImpl.java:287)
         at 
org.apache.fulcrum.testcontainer.YAAFIContainer.dispose(YAAFIContainer.java:129)
         at 
org.apache.fulcrum.testcontainer.BaseUnitTest.tearDown(BaseUnitTest.java:87)
         at junit.framework.TestCase.runBare(TestCase.java:130)
         at junit.framework.TestResult$1.protect(TestResult.java:106)
         at junit.framework.TestResult.runProtected(TestResult.java:124)
         at junit.framework.TestResult.run(TestResult.java:109)
         at junit.framework.TestCase.run(TestCase.java:118)
         at junit.framework.TestSuite.runTest(TestSuite.java:208)
         at junit.framework.TestSuite.run(TestSuite.java:203)
         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:585)
         at 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242)
         at 
org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216)
         at 
org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:126)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
         at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
         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:585)
         at 
org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
Caused by: java.lang.NullPointerException
         at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.close(SharedPoolDataSource.java:64)
         at 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory.close(SharedPoolDataSourceFactory.java:113)
         ... 30 more
[DEBUG] All services are disposed
[INFO] YaffiContainer has been disposed.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Re: Avalon-Test complains about not being able to close a DataSource

Posted by Thomas Vandahl <tv...@apache.org>.
Thomas Fischer wrote:
> When I build the runtime and the org.apache.torque.avalon.AvalonTest is
> run, an exception stacktrace is printed about a NuLlPointerException at
> org.apache.commons.dbcp.datasources.SharedPoolDataSource.close(SharedPoolDataSource.java:64)
> 
> However, the test case succeeds. Is this something that needs looking
> into, or is this an expected behaviour ?
>
[...]
> java.lang.NullPointerException
>         at
> org.apache.commons.dbcp.datasources.SharedPoolDataSource.close(SharedPoolDataSource.java:64)

This is an unchecked null pointer to the DS.internal object pool in
commons-dbcp 1.2.1. This probably happens because this test does not
request a connection from the data source and thus no object pool is
created. The null check is present in 1.2.2.

Bye, Thomas.

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org