[jira] (JETTY-1556) Closing resources does not work

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1556) Closing resources does not work

JIRA jira@codehaus.org
Issue Type: Bug Bug
Affects Versions: 8.1.7
Assignee: Unassigned
Components: Maven
Created: 04/Feb/13 3:31 AM
Description:

I'm trying to properly shutdown a datasource using a DataSourceCloser while running jetty under maven. When I Ctrl-C, I see that the servlets are propertly destroyed but not the various Destroyables I have registered (the method Destroyable.destroy() is never called).

My maven settings are very simple, <webAppXml> points to a file like:

<Configure id="wac" class="...webapp.WebAppContext">
<New class="...jndi.Resource">
<Arg>jdbc/DataSource</Arg>
<Arg>...</Arg>
</New>
<Ref id="wac">
<Call name="addBean">
<Arg>
<New class="...jndi.DataSourceCloser">...</New>
</Arg>
</Call>
</Ref>
</Configure>

I never run jetty outside maven so I can't be sure this is a problem strictly related to maven.

The reason I need the datasources to be properly destroyed is that my project has 2 webapp modules and when I do a full build with integration tests, the datasource of the first webapp will never be closed and will be reused by the second and my tests will fail.

Project: Jetty
Priority: Minor Minor
Reporter: Xavier Dury
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1556) Closing resources does not work

JIRA jira@codehaus.org
Xavier Dury commented on Bug JETTY-1556

I've implemented my own DataSourceCloser by extending AbstractLifeCycle (and overriding doStop()) instead of implementing Destroyable and it works now. Somehow, Destroyables hooks are not working anymore.

Maybe a better solution would be to have some kind of close method on <New> element, a bit like Tomcat does (see http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Resource_Definitions).

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

[jira] (JETTY-1556) Closing resources does not work

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org
Joakim Erdfelt commented on Bug JETTY-1556

File Jetty 7, 8, or 9 bugs at:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty

This is a deprecated issue tracker, only really left in place for Jetty 6.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email