Improved BTM integration with Tomcat and Jetty

Tomcat and Jetty integration has been improved in BTM 1.3.1. Integration is not anymore a clever hack but a clean integration with both container’s lifecyle.

This basically involved writing new classes that plugs in each container’s lifecycle, they are available in the distribution’s integration folder and are named btm-jetty6-lifecycle.jar and btm-tomcat55-lifecycle.jar for Jetty and Tomcat respectively.

Not only is that now working better than the previous way but I’ve finally found time to document this again for both Jetty and Tomcat. Following those instructions now allow you to get seamless integration of BTM and take advantage of JTA in those containers like you would in any full-blow application servers.

There is still a lot of work to do on the documentation level but things are slowly moving in the right direction. If there is something still unclear, poorly or not at all documented, I’d love to hear your comments.

This entry was posted in BTM. Bookmark the permalink.

3 Responses to Improved BTM integration with Tomcat and Jetty

  1. dragz says:

    Hi ludo,

    i try to use BTM on tomcat 6, and i follow the documentation on http://docs.codehaus.org/display/BTM/Tomcat13 to the letter but can not access datasource from my context.
    on tomcat side, the resources have been loaded
    – (catalina log)
    INFO: JVM unique ID:
    Oct 26, 2009 1:20:01 PM bitronix.tm.resource.ResourceLoader init
    INFO: reading resources configuration from d:\tomcat/conf/resources.properties
    Oct 26, 2009 1:20:03 PM bitronix.tm.recovery.Recoverer run
    INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 2 resource(s) [jdbc/converter_win, jdbc/converter_bill] (restricted to serverId ‘tomcat-btm-node0′)

    but jndi lookup raise error : no resource registered with uniqueName ‘jdbc/converter_bill’, available resources: []

    – context xml

    –web xml

    –snip–

    jdbc/converter_bill
    javax.sql.DataSource

    jdbc/converter_win
    javax.sql.DataSource

    – code
    Connection conn;
    try {
    Context initContext = new InitialContext();
    Context envContext = (Context)initContext.lookup(“java:/comp/env”);
    PoolingDataSource ds = (PoolingDataSource)envContext.lookup(“jdbc/converter_bill”);

    conn = ds.getConnection();

    conn.setAutoCommit(false);
    } catch (Exception e) {
    throw e;

    }

    any help would be appreciated.

    regards

    dragz

  2. admin says:

    You’d better post your problem on the mailing list (http://www.nabble.com/Bitronix-Transaction-Manager-f25701.html) than here, a blog isn’t a convenient tool for giving support.

  3. dragz says:

    hi again..

    it works when i add TransactionManagerServices.getResourceLoader().init(); to my initial class.
    but btm complian about already exists instance jdbc/** ( undestandable since tomcat should be the one loading the resource )

    when i remove the line, error again :)

    regards,

    dragz

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>