Thursday, February 10, 2011

GWT Tomcat Integration - Making Google Web toolkit work with Apache Tomcat

This is my quick and easy way to make GWT work with Tomcat.

Ingredients:
  • GWT on Eclipse
  • Apache Tomcat (I have 5.5.26)
Lets create a new GWT Project called "test".

Also download and copy the "tomcat-gwt.xml" to the "test" Project directory.
Edit the tomcat-gwt.xml files and add your project specific settings.

    <property name="tomcat.webapps" value="C:\apache-tomcat-5.5.26\webapps" />
    <property name="project.name" value="test" />   

Change the above settings to your specific settings.

Now add this builder to your project.
Right Click Project ("test") >>  Properties >> Builders
Select import to add the XML.

Make sure the tasks are selected as displayed below.


The application is deployed to tomcat everytime you do a "CLEAN".

Contents of "tomcat-gwt.xml"

<?xml version="1.0" encoding="UTF-8"?>
<project name="Tomcat-GWT" default="copy" basedir=".">
    <property name="tomcat.webapps" value="C:\apache-tomcat-5.5.26\webapps" />
    <property name="project.name" value="test" />       
    <property name="source.dir" value="${basedir}\war" />
    <target name="copyx">
        <echo>${source.dir}</echo>
        <echo>${tomcat.webapps}</echo>
    </target>
    <target name="copy">
        <mkdir dir="${tomcat.webapps}\${project.name}" />
        <copy todir="${tomcat.webapps}\${project.name}">
            <fileset dir="${source.dir}" includes="**/**" />
        </copy>
    </target>
</project>

Friday, January 28, 2011

Websphere - XA Transaction Error

Problem
[1/28/11 18:26:02:109 EST] 00000014 XARminst      E   WTRN0037W: The transaction service encountered an error on an xa_recover operation. The resource was com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl@51ef51ef. The error code was XAER_RMERR. The exception stack trace follows: javax.transaction.xa.XAException
    at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:526)
    at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.recover(WSRdbXaResourceImpl.java:962)
    at com.ibm.ws.Transaction.JTA.XARminst.recover(XARminst.java:137)
    at com.ibm.ws.Transaction.JTA.XARecoveryData.recover(XARecoveryData.java:690)
    at com.ibm.ws.Transaction.JTA.PartnerLogTable.recover(PartnerLogTable.java:512)
    at com.ibm.ws.Transaction.JTA.RecoveryManager.resync(RecoveryManager.java:1949)
    at com.ibm.ws.Transaction.JTA.RecoveryManager.run(RecoveryManager.java:2457)
    at java.lang.Thread.run(Thread.java:832)


Solution


http://www.coderanch.com/t/414861/EJB-JEE/java/Help-XAException
http://www.ibm.com/developerworks/websphere/library/techarticles/0407_woolf/0407_woolf.html