Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Info

Help is available by sending an email to csf-support@mit.edu
Have any suggestion on how improve this wiki?  Please give us your feedback at csf-support@mit.edu

Quick

Links

to:

{

Panel
Wiki Markup
Table of Contents
:
minLevel
=
3
|
maxLevel
=
3
}
h3. *

Converting

an

OC4J

WAR

application

to

a

Tomcat

7

WAR

application

Panel
Wiki Markup
Warning

Any Maven project

* {warning} Any Maven project

who's

artifact

is

a

JAR

is

Tomcat

7

compatible

and

no

conversion

is

required.

   *The following instructions are for Maven project

  
The following instructions are for Maven project who's

artifact

is

a

WAR.

These

instructions

should

make

a

web

application

run

either

in

Tomcat

7

or

OC4J.

* {warning} # Run Eclipse and open the Maven project that you want to convert to a Tomcat 7 application. # Open your project's *decorators.xml* file for editing.  The decorators.xml file is located in your project's WEB-INF directory. Your decorator.xml should look similar to the following: {code}

  1. Run Eclipse and open the Maven project that you want to convert to a Tomcat 7 application.
  2. Open your project's decorators.xml file for editing.  The decorators.xml file is located in your project's WEB-INF directory.
    Your decorator.xml should look similar to the following:
    Code Block
    
    <decorators defaultdir="/WEB-INF/decorators">
        <decorator name="ajax" page="ajax.jsp">
            <pattern>/**/ajax/*</pattern>
        </decorator>
        <decorator name="ssb" page="ssb.jsp">
            <pattern>/**/*</pattern>
        </decorator>
    </decorators>
    
{code}
  1. In
  1. each
  1. of
  1. the
  1. <pattern>
  1. tags,
  1. remove
  1. the
  1. leading
*
  1. /
*\
  1. *
\
  1. *
  1. so
  1. that
  1. the
  1. above
  1. now
  1. looks
  1. similar
  1. to
  1. the
  1. following:
{
  1. Code Block
}
  1. 
    <decorators defaultdir="/WEB-INF/decorators">
        <decorator name="ajax" page="ajax.jsp">
            <pattern>/*ajax*</pattern>
        </decorator>
        <decorator name="ssb" page="ssb.jsp">
            <pattern>/*</pattern>
        </decorator>
    </decorators>
    
{code}
  1. When
  1. you
  1. are
  1. satisfied
  1. that
  1. everything
  1. is
  1. correct,
*
  1. save
*
  1. the
  1. changes.
#
  1. Open
  1. your
  1. project's
  1. applicationContext
  1. xml
  1. that
  1. contains
  1. the
*
  1. mitsisDataSource
  1. bean
*.&nbsp;&nbsp;The *mitsisDataSource bean* should look similar to: {code}
  1. .  The mitsisDataSource bean should look similar to:
    Code Block
    
    <bean id="mitsisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="jdbc/MitsisDS" />
    </bean>
    
{code}
  1. Remember
  1. the
  1. value
  1. of
  1. the
*
  1. name
*
  1. property.
&nbsp;&nbsp;In this example the value is *
  1.   In this example the value is jdbc/MitsisDS
*
  1. (the
  1. default
  1. for
  1. most
  1. ES
  1. web
  1. apps).
&nbsp;&nbsp;This value will be the *Resource Definition name* used throughout the remainder of this page. Add a new property, *resourceRef*,to the bean definition: {code}
  1.   This value will be the Resource Definition name used throughout the remainder of this page.
    Add a new property, resourceRef,to the bean definition:
    Code Block
    
    <bean id="mitsisDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiName" value="jdbc/MitsisDS" />
       <property name="resourceRef" value="true" />
    </bean>
    
{code}
  1. Don't
  1. forget
  1. to
  1. use
  1. your
*
  1. Resource
  1. Definition
  1. name
*
  1. in
  1. place
  1. of
*
  1. jdbc/MitsisDS
*
  1. .

  1. When
  1. you
  1. are
  1. satisfied
  1. that
  1. everything
  1. is
  1. correct,
*
  1. save
*
  1. the
  1. changes.
#
  1. Open
  1. your
  1. project's
*
  1. log4j.xml
*
  1. for
  1. editing
  1. and
  1. find
  1. the
  1. 2
  1. lines
  1. similar
  1. to
  1. the
  1. following
  1. (
*
  1. att
*
  1. is
  1. the
  1. project's
  1. application
  1. context
  1. root):
{
  1. Code Block
}
  1. 
    <param name="File" value="log/att.log" />
    <param name="File" value="log/hbn-att.log" />
    
{code}
  1. and
  1. change
  1. them
  1. to:
{
  1. Code Block
}
  1. 
    <param name="File" value="${logs.dir}/att/att.log" />
    <param name="File" value="${logs.dir}/att/hbn-att.log" />
    
{code}
  1. When
  1. you
  1. are
  1. satisfied
  1. that
  1. everything
  1. is
  1. correct,
*
  1. save
*
  1. the
  1. changes.
#
  1. Open
  1. your
  1. project's
  1. web.xml
  1. for
  1. editing
  1. and
  1. add
  1. the
  1. following
  1. after
  1. the
  1. <servlet-mapping>
  1. tags
  1. and
  1. before
  1. the
  1. <welcome-file-list>
  1. tag.
{
  1. Code Block
}
  1. 
    <resource-ref>
        <description>Oracle Datasource</description>
        <res-ref-name>jdbc/MitsisDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>
    
{code}
  1. Don't
  1. forget
  1. to
  1. use
  1. your
*
  1. Resource
  1. Definition
  1. name
*
  1. in
  1. place
  1. of
*
  1. jdbc/MitsisDS
*
  1. .

  1. When
  1. you
  1. are
  1. satisfied
  1. that
  1. everything
  1. is
  1. correct,
*
  1. save
*
  1. the
  1. changes.
#
  1. Open
  1. your
  1. Tomcat
  1. 7
  1. server's
  1. context.xml,
  1. located
  1. at
  1. $
\
  1. {CATALINA_HOME}/conf/context.xml,
  1. and
  1. verify
  1. that
  1. a
*
  1. Resource
  1. Definition
*
  1. for
  1. your
  1. application
  1. exists.

  1. If
  1. the
  1. Resource
  1. Definition
  1. does
  1. not
  1. exits,
  1. add
  1. the
  1. following
  1. anywhere
  1. between
  1. the
  1. <context>
  1. and
  1. </context>
  1. tags:
{
  1. Code Block
}
  1. 
    <Resource name="jdbc/MitsisDS"
       auth="Container"
       type="javax.sql.DataSource"
       driverClassName="oracle.jdbc.OracleDriver"
       url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev11"
       username="XXXXXXXX"
       password="YYYYYYYY"
       maxActive="20"
       maxIdle="10"
       maxWait="-1"
       removeAbandoned="true"
       removeAbandonedTimeout="30"
       logAbandoned="true" />
    
    <ResourceLink global="jdbc/MitsisDS" name="jdbc/MitsisDS" type="javax.sql.DataSource"/>
    
{code}
  1. Don't
  1. forget
  1. to
  1. use
  1. your
*
  1. Resource
  1. Definition
  1. name
*
  1. in
  1. place
  1. of
*
  1. jdbc/MitsisDS
*
  1. .

  1. When
  1. you
  1. are
  1. satisfied
  1. that
  1. everything
  1. is
  1. correct,
*
  1. save
*
  1. the
  1. changes.
#
  1. Open
  1. the
  1. project's
  1. pom.xml
  1. and
  1. delete
  1. the
  1. following
  1. dependency:
{
  1. Code Block
}
  1. 
    <dependency>
        <groupId>oracle</groupId>
        <artifactId>ojdbc</artifactId>
        <version>1.4</version>
        <scope>test</scope>
    </dependency>
    
{code}
  1. and
  1. add
  1. the
  1. following
  1. dependency:
{
  1. Code Block
}
  1. 
    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11.2.0.3</version>
        <scope>test</scope>
    </dependency>
    
{code}
  1. When
  1. you
  1. are
  1. satisfied
  1. that
  1. everything
  1. is
  1. correct,
*
  1. save
*
  1. the
  1. changes.
#
  1. Search
  1. both
  1. Project
  1. Jar
  1. Dependencies
  1. and
  1. Project
  1. Test
  1. Jar
  1. Dependencies
  1. for
  1. any
  1. ojdbc-1.4.jar
  1. dependency
  1. and
  1. exclude
  1. the
  1. dependency.

  1. In
  1. Eclipse,
  1. this
  1. can
  1. be
  1. done
  1. by
  1. doing
  1. the
  1. following:
##
    1. Open
    1. a
*
    1. Project
    1. Explorer
    1. View
*
    1. ,
    1. right
    1. click
    1. on
    1. your
    1. project
    1. and
    1. select
*
    1. Maven
    1. >
    1. Update
    1. Dependencies...
* ## Expand *Maven Dependencies* and scroll through the dependencies until you find the
    1. Expand Maven Dependencies and scroll through the dependencies until you find the ojdbc-1.4.jar.
##
    1. Right
    1. click
    1. on
    1. the
    1. ojdbc-1.4.jar
    1. and
    1. select
*
    1. Maven
    1. >
    1. Exlude
    1. Maven
    1. Artifact...
*