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 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 init
    INFO: reading resources configuration from d:\tomcat/conf/
    Oct 26, 2009 1:20:03 PM 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




    – 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();

    } catch (Exception e) {
    throw e;


    any help would be appreciated.



  2. admin says:

    You’d better post your problem on the mailing list ( 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 :)



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>