Here is how I tested in resin an application previously running in tomcat which uses Spring, JPA and Hibernate.
Download resin open source version from http://caucho.com/products/resin/download/gpl#download
If you use log4j in your application then replace catalina.home for the full local path in log4j.properties (if you use log4j) for example:
log4j.appender.logfile.File=/var/log/resin/app.log instead of: log4j.appender.logfile.File=${catalina.home}/logs/app.logConfigure resin to load external resources like app.properties. In /etc/resin/resin.xml:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/resin/resin.xml | |
<resin xmlns="http://caucho.com/ns/resin" | |
xmlns:resin="urn:java:com.caucho.resin"> | |
<class-loader> | |
<simple-loader path="/opt/tomcat/lib"/> | |
</class-loader> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cluster id="app"> | |
<server-default> | |
<jvm-arg-line>-Xmx1024m</jvm-arg-line> | |
<jvm-arg-line>-XX:MaxPermSize=512m</jvm-arg-line> | |
</server-default> |
If you are using special libraries loaded from the server container then copy them to resin lib directory:
cp -r /opt/tomcat/lib/jtds-1.2.4.jar /usr/local/share/resin-4.0.40/lib/ cp -r /opt/tomcat/lib/mysql-connector-java-5.1.26-bin.jar /usr/local/share/resin-4.0.40/lib/ cp -r /opt/tomcat/lib/tomcat-jdbc.jar /usr/local/share/resin-4.0.40/lib/ cp -r /opt/tomcat/bin/tomcat-juli.jar /usr/local/share/resin-4.0.40/lib/Restart resin and look into the logs:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resinctl restart | |
tail -10f /var/log/resin/jvm-app-0.log | |
tail -10f /var/log/resin/app.log |
cp /path/to/workspace/app/target/classes/com/sample/web/OfficeController.class /var/resin/webapps/app/WEB-INF/classes/com/sample/web/Resin is less permissive in terms of schema validations. Tomcat would allow "xsi:schemaLocation" in taglib tag to be all lowwer case. You can either correct taglibs or use the below in WEB-INF/resin-web.xml:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WEB-INF/resin-web.xml: | |
<pre> | |
<web-app xmlns="http://caucho.com/ns/resin"> | |
<jsp validate-taglib-schema='false'/> | |
</web-app> |
No comments:
Post a Comment