Howto deploy a ADFBC app developed to Tomcat6.0.14 and MySQL 5.0

Posted: April 22, 2008 in ADFBC, HowTo, Java, MySQL, Oracle, Tips, WebProgramming
Tags: , , , ,

Source: OTN JDeveloper Forum

All

Just successfully deployed a JSF/ADF-BC4J app developed in Jdev 10.1.3.3 to Tomcat-6.0.14 and MySQL 5.0

Thought I would share since i could not find anything out there that gave me the steps for this configuration combo.

Assumptions:
1. install MySQL 5.0 database with some tables.
2. install Tomcat-6.0.14 (http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.14/bin/) probably any 6.x build would be same
3. Application Modules developed in Jdev are currently configured to run on MySQL (SQL92 flavor / Java type mappings)
4. This is for ADF-BC4J only. TopLink would require add’l steps, though I assume the only difference would be add’l jar files

I did all development in Jdev using the internal OC4J and a local MySQL before deploying to Tomcat.

Steps:
1. copy following jars from <JDEV_INSTALL> to <TOMCAT_HOME>\lib\
(Note that ‘Tools -> ADF Runtime Installer’ does not work for Tomcat 6.x, so this has to be manual)

\BC4J\lib\adfcm.jar
\BC4J\lib\adfm.jar
\BC4J\lib\adfmweb.jar
\BC4J\lib\adfshare.jar
\BC4J\lib\bc4jct.jar
\BC4J\lib\bc4jctejb.jar
\BC4J\lib\bc4jdomorcl.jar
\BC4J\lib\bc4jimdomains.jar
\BC4J\lib\bc4jmt.jar
\BC4J\lib\bc4jmtejb.jar
\BC4J\lib\collections.jar
\BC4J\jlib\bc4jdomgnrc.jar
\BC4J\jlib\adfmtl.jar
\BC4J\jlib\adfui.jar
\jlib\commons-cli-1.0.jar
\jlib\xmlef.jar
\jlib\share.jar
\mds\lib\mdsrt.jar
\mds\lib\concurrent.jar
\diagnostics\lib\ojdl.jar
\jlib\jdev-cm.jar
\jlib\commons-el.jar
\jlib\oracle-el.jar
\jlib\jsp-el-api.jar
\toplink\jlib\toplink.jar
\toplink\jlib\antlr.jar
\BC4J\lib\adfbinding.jar
\lib\xmlparserv2.jar
\lib\xml.jar
\lib\xsqlserializers.jar
\lib\xsu12.jar
\ord\jlib\ordhttp.jar
\ord\jlib\ordim.jar
\sqlj\lib\runtime12.jar
\sqlj\lib\translator.jar
\jdbc\lib\ojdbc14.jar
\jdbc\lib\ojdbc14dms.jar
\lib\dms.jar
\javacache\lib\cache.jar
\BC4J\jlib\dc-adapters.jar
\BC4J\jlib\adf-connections.jar
\webservices\lib\wsdl.jar
\webservices\lib\orajaxr.jar
\webservices\lib\orawsrm.jar
\webservices\lib\wsclient.jar
\webservices\lib\orasaaj.jar
\webservices\lib\xsdlib.jar
\webservices\lib\mdds.jar
\webservices\lib\wssecurity.jar
\webservices\lib\orawsdl.jar
\jlib\osdt_core.jar
\jlib\osdt_cert.jar
\jlib\osdt_xmlsec.jar
\jlib\osdt_wss.jar
\jlib\osdt_saml.jar
\jlib\ojpse.jar
\jlib\oraclepki.jar
\j2ee\home\jazncore.jar
\j2ee\home\lib\http_client.jar

2. copy <JDEV_INSTALL>\BC4J\redist\webapp.war to <TOMCAT_HOME>\webapps\webapp.war

3. in your application’s webroot, create a META-INF folder containing a single file, named ‘context.xml’, with the following (enter your appropriate values as usual):

<?xml version=”1.0″ encoding=”UTF-8″?>
<Context
antiJARLocking=”true”
antiResourceLocking=”true”
reloadable=”true”>
<Resource
auth=”Container”
name=”jdbc/MySqlDS”
type=”com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource”
factory=”com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory”
driverClassName=”com.mysql.jdbc.Driver”
maxIdle=”2″
maxWait=”5000″
url=”jdbc:mysql://<HOSTNAME>:<PORT>/<DATABASE>?&ultraDevHack=true&capitalizeTypeNames=true&pedantic=true”
user=”<USERNAME>”
password=”<PASSWORD>”
databaseName=”<DATABASE>”
port=”<PORT>”
maxActive=”10″/>
<Manager
className=”org.apache.catalina.session.PersistentManager”
saveOnRestart=”false”/>
</Context>

4. in all Application Modules, set the Configuration to use a ‘JDBC Datasource’ with the name set to the named datasource in the context.xml created above, e.g.: ‘java:comp/env/jdbc/MySqlDS’

5. create a deployment profile with ‘Platform -> target connection’ set to the Tomcat instance (need to create an entry in ‘Connections -> Application Server’ for it to show up) make sure to include the correct mysql-connector.jar in the ‘WEB-INF/lib’ contributors.
Right-click -> Deploy to your tomcat

6. Make sure MySQL is on and fire up Tomcat, and youre set.

Hope it helps
Sami

Comments
  1. grorsdeep says:

    Hello my friends🙂 😉

  2. Archean says:

    Somehow i missed the point. Probably lost in translation🙂 Anyway … nice blog to visit.

    cheers, Archean.

  3. oldlight says:

    Thank you, Archean, for encouraging me…

    Hope you find something interest…

    Cheers, Minh Tran

  4. faizal says:

    how if i’m using oracle xe database, deploy on tomcat installed in my laptop.tq

  5. oldlight says:

    Hi Faizal,

    You need to package Oracle JDBC Thin driver with your war or making it work within Tomcat as normal.

    Happy programming.

    Minh Tran

  6. Isaac says:

    I’ve managed to run ADF app over tomcat 6 . I’ve take advantage on this great video . But I have some problmes when I try to use dvt components from ADF 11g Does any body have the solution to this? also I was tried adding all libraries included here but even that is not a solution.

  7. you’re truly a just right webmaster. The web site loading pace is amazing. It sort of feels that you’re doing
    any unique trick. Moreover, The contents are masterpiece.
    you have done a fantastic job in this matter!

  8. Florida says:

    I really love your blog.. Excellent colors & theme. Did you develop this website yourself?
    Please reply back as I’m trying to create my own website
    and want to learn where you got this from or exactly what the theme is called.
    Kudos!

  9. Sean says:

    This web page can be a walk-

    by means of for all the info you

    wished about this and didn’t know who to ask.
    Glimpse right here, and also you’ll

    undoubtedly uncover it.1
    There is noticeably a bundle to learn about this. I assume you
    made

    certain nice factors in features also.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s