Seam On Resin Deployment

From Resin 4.0 Wiki

Jump to: navigation, search

Cookbook-48.pngShare-48.pngWeb-48.png

Contents

Focus on: deploying seam-booking example application in Resin server

Software Prerequisites


Preparing seam-booking

  • Unzip seam-3.1.0.Fiinal.jar
  • Change into seam-3.1.0.Final/examples/seam-booking directory
  • Issue mvn install command
  • Copy expanded seam-booking directory into Resin's webapps directory
  • Edit WEB-INF/classes/META-INF/persistence.xml (see below)
  • Add "WEB-INF/resin-web.xml to add a datasource (see below)
  • Copy the required libraries into webapp-jars directory (see list of libraries below)

WEB-INF/classes/META-INF/persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
                     version="2.0">
   <persistence-unit name="booking">
       <jta-data-source>java:comp/env/jdbc/booking</jta-data-source>
       <properties>
           <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
           <property name="eclipselink.ddl-generation.output-mode" value="database"/>
       </properties>
   </persistence-unit>
</persistence>

WEB-INF/resin-web.xml

<web-app xmlns="http://caucho.com/ns/resin">
  <database>
    <jndi-name>jdbc/booking</jndi-name>
    <driver type="org.hsqldb.jdbc.JDBCDriver">
      <url>jdbc:hsqldb:file:/tmp/seambooking</url>
      <user>SA</user>
      <password></password>
    </driver>
    <prepared-statement-cache-size>8</prepared-statement-cache-size>
    <max-connections>8</max-connections>
    <max-idle-time>30s</max-idle-time>
    <spy/>
  </database>
</web-app>


List of jar files that need to be copied into webapp-jars

  • change into seam-3.1.0.Final/lib
  • copy the following files into Resin's webapp-jars directory
drools-api.jar
drools-compiler.jar
drools-core.jar
hibernate-core-4.0.0.Final.jar
hibernate-validator-4.2.0.Final.jar
hsql.jar
javassist.jar
jtds.jar
portal-service.jar
portlet.jar
saxpath.jar
Personal tools
TOOLBOX
LANGUAGES