Wednesday, February 26, 2014

How to Deploy ADF application on Tomcat 7 application server

DEPLOY ADF FACES APPLICATION ON   TOMCAT 7.0


Oracle released a few days ago ADF Essentials, which is a free version of its Oracle ADF Framework.
Before we start, you should download the files:
ADF essentials of the required version.
Now the deployment can be divided into 2 stages:
Stage 1: Creating appropriate .war file of the application
Stage 2: Configure Tomcat server.


Stage 1: Create War file

Right click on the view controller part of the project and go to project properties.
Go to deployment and select new option.
Select the profile type as WAR file.

Now we have to make some changes in these options as follows:
Go to Library Dependencies and unselect all the libraries.

Go to platform and select Tomcat 6.x as the default platform.
Click ok.
This creates the deployment profile.









Now go to web.xml of the project. From applications go to “Web Application Listeners” and delete all the present listeners.      
 


Now go to filers and delete the JpsFilter.

Done then. Save all.
Right click on the view-controller and from deploy select the newly created deployment profile.

Select Deploy to WAR.
Wait for the deployment to finish.
Done. The WAR file would be created in %project%/view-controller/deploy/ folder.
Stage 2: Configure Tomcat Server:
Go to Application Module of the project. Go to configurations and click edit on the application and find the Jdbc URL :
Make sure that the connection type is JDBC DataSource in both the local application module and shared application module.
We require only the last part of the URL i.e here jdbc/dbconnDS.
Open the file %TOMCAT_HOME%\bin\catalina.bat (or .sh if you’re in linux environment) and add in the end of the line ‘set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%’ this -Xms1024m -Xmx1024m

Edit /config/context.xml file from tomcat server.
add resource link.
<ResourceLink global="jdbc/dbconnDS" name="jdbc/dbconnDS"
type="javax.sql.DataSource"/>

<Resource name="jdbc/dbconnDS" auth="Container"
              type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
                                                  url="jdbc:oracle:thin:enonew2/enonew2@192.168.10.172:1521:XE"
              maxActive="20" maxIdle="10"
              maxWait="-1"/>
           

Edit /conf/server.xml
Add data ressource node

 <GlobalNamingResources>
 <Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase" description="User database that can be
updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml"/>
<Resource name="jdbc/dbconnDS" auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
driverClassName="oracle.jdbc.driver.OracleDriver"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
url="jdbc:oracle:thin:@192.168.10.172:1521:XE" user="enonew2" password="enonew2" maxActive="20"
maxIdle="10" maxWait="-1"/>
 </GlobalNamingResources>


Add all the following libraries to %CATALINA_HOME%/lib folder:
Extract ADF Essentials zip file inside the %TOMCAT_HOME%\lib
Also add the remaining libraries.
The lib folder should contain the following jar files:
adf-controller-api.jar
adf-controller-rt-common.jar
adf-controller-schema.jar
adf-controller-security.jar
adf-controller.jar
adf-dt-at-rt.jar
adf-dynamic-faces.jar
adf-faces-changemanager-rt.jar
adf-faces-databinding-dt-core.jar
adf-faces-databinding-rt.jar
adf-faces-registration.jar
adf-faces-templating-dt-core.jar
adf-faces-templating-dtrt.jar
adf-pageflow-dtrt.jar
adf-pageflow-fwk.jar
adf-pageflow-impl.jar
adf-pageflow-rc.jar
adf-richclient-api-11.jar
adf-richclient-automation-11.jar
adf-richclient-impl-11.jar
adf-runtime-mbean.jar
adf-sec-idm-dc.jar
adf-share-base.jar
adf-share-ca.jar
adf-share-security.jar
adf-share-support.jar
adf-share-web.jar
adf-view-databinding-dt-core.jar
adf-view-unified-databinding-dt-core.jar
ojdl2.jar
oracle-el.jar
oracle.classloader_11.1.1.jar
oracle.external.jsf-ri-20.jar
oracle.http_client_11.1.1.jar
oracle.logging-utils_11.1.1.jar
 xml-apis-ext.jar
xmlef.jar
xmlparserv2_sans_jaxp_services.jar
xsqlserializers.jar
tomcat7-websocket.jar
trinidad-api.jar
trinidad-impl.jar
velocity-dep-1.4.jar
websocket-api.jar
wls-api.jar
xercesImpl.jar
mdsrt.jar
oc4j-ws-support.jar
oicons.jar
ojdbc6.jar
ojdbc6dms.jar
ojdl.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar
tomcat-jdbc.jar
tomcat-util.jar







adf.constants.jar
adfbcsvc-client.jar
adfbcsvc-registration.jar
adfbcsvc-share.jar
adfbcsvc.jar
adfdt_common.jar
adflibfilter.jar
adflibrary.jar
adflogginghandler.jar
adfm-debugger.jar
adfm-sqldc.jar
adfm.jar
adfmportlet.jar
adfmweb.jar
adfsharembean.jar
adftags.jar
adftransactionsdt.jar
annotations-api.jar
batik-anim.jar
batik-awt-util.jar
batik-bridge.jar
batik-codec.jar
batik-css.jar
batik-dom.jar
batik-ext.jar
batik-extension.jar
batik-gui-util.jar
batik-gvt.jar
batik-parser.jargroovy-all-1.6.4.jar
identitystore.jar
inspect4.jar
jasper-el.jar
jasper.jar
javamodel-rt.jar
javatools-nodeps.jar
javax.management.j2ee_1.0.jar
javax.transaction-1.0.0.0_1-1.jar
jdev-cm.jar
jewt4.jar
jms-jmx.jar
jmxdc.jar
jmxframework.jar
jmxspi.jar
jps-api.jar
jps-common.jar
jps-ee.jar
jps-internal.jar
jps-unsupported-api.jar
jrf-api.jar
jr_dav.jar
jsf-api.jar
jsf-impl.jar
jsp-api.jar
jsp-el-api.jar
jstl.jar
jta.jar
log4j-1.2.17.jar
mail.jar
mds-dc.jar


batik-script.jar
batik-svg-dom.jar
batik-svggen.jar
batik-swing.jar
batik-transcoder.jar
batik-util.jar
batik-xml.jar
bc4j-mbeans.jar
bc4jhtml.jar
bc4jimdomains.jar
bc4jsyscat.jar
bundleresolver.jar
cache.jar
catalina-ant.jar
catalina-ha.jar
catalina-tribes.jar
catalina.jar
commons-el.jar
datatags.jar
db-ca.jar
dms.jar
dvt-basemaps.jar
dvt-databinding-dt-core.jar
dvt-databindings-mds.jar
dvt-databindings.jar
dvt-faces.jar
dvt-facesbindings.jar
dvt-jclient.jar
dvt-trinidad.jar
dvt-utils.jar
ecj-4.2.2.jar
el-api.jar
facesconfigmodel.jar
fmw_audit.jar
glassfish.jstl_1.2.0.1.jar oracle.web-common_11.1.1.jar
oracle.xdb_11.1.0.jar
oraclepki.jar
oraclexsql.jar
orai18n-mapping.jar
ordhttp.jar ordim.jar
org.apache.bcel_5.1.jar
org.apache.commons.beanutils_1.6.jar
org.apache.commons.beanutils_1.8.3.jar
org.apache.commons.logging_1.0.4.jar
org.apache.commons.logging_1.1.1.jar
osdt_cert.jar
osdt_core.jar
prefuse.jar
rcs-adflib-rt.jar
rcsrt.jar
regexp.jar
resourcebundle.jar
servlet-api.jar
share.jar
standard.jar
taglib.jar
tomcat-api.jar
tomcat-coyote.jar



After all these steps copy the WAR file of the project to WEBAPPS folder in Tomcat.
And start the server.



Note:
Some solved exceptions:
1)If on deploying the first time it gives exceptions like :
ADFLifeCycle Exceptions
Or some type cast exception



Then put/remove a unused file into the war file (say a blank document) and let the tomcat environment automatically redeploy the WAR file again.










2)If deployment gives the following Exception:
SEVERE : error FilterStart

Then go to the  %CATALINA_HOME%\webapps\%WAR_FILE_NAME%\WEB-INF
Edit web.xml
And remove the filter tags and filter-mapping tags containing “JpsFilter”


Reference: Praful Kamat

15 comments:

  1. Thanks Rohit..This post was really helpful..

    ReplyDelete
  2. Thanks Rohit for this wonderful and useful post!!!!! It helps me a lot!!!

    ReplyDelete
  3. very helpful, i deployed succesfully adf faces+model essentials 11.1.2.3 .
    but adf faces+model essentials 12.1.2 not works

    ReplyDelete
  4. Rohit, have you tried using JDeveloper 12.1.2 or the latest 12.1.3 ?

    ReplyDelete
    Replies
    1. Hi Alexandru,
      I have not tried JDeveloper latest versions. In another question you mentioned whether i can provide source code or not, I am sorry i can not provide source code as its little bit confidential but you can follow same above steps i am sure it will work, i have tried deploying other applications as well. For glass Fish deployment, there is video tutorial available in youtube you can search for that. most of the references are taken from https://blogs.oracle.com/dana/entry/how_to_deploy_a_11g_adf_applic_1 link

      Delete
  5. Could you provide the source code of a ADF web application that works for you ? Many thanks.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. I have also put in Tomcat lib folder the following file:
    C:\Oracle\Middleware\Oracle_Home213\oracle_common\modules\javax.mail_2.0.0.0_1-4-4.jar

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. I've successfully deployed an ADF application created with JDeveloper 12.1.3 on Tomcat 7.0.35 (using JDK 1.7.0.55). Without a connection to any database so far but it's promising of course to see the application running

    I took by trial and error jar files from EAR file and WA file created for GlassFish deployment and noticed whether Tomcat starts or fails.

    I have removed the jms-jmx.jar, jmxdc.jar, jmxframework.jar,jmxspi.jar

    Here is my list of jar files that I put in Tomcat lib folder:
    adf.constants
    adfbcsvc
    adfbcsvc-client
    adfbcsvc-registration
    adfbcsvc-share
    adf-businesseditor-model
    adf-businesseditor-objects
    adf-businesseditor-settings
    adf-controller
    adf-controller-api
    adf-controller-rt-common
    adf-controller-schema
    adf-controller-security
    adf-customizationset-ui
    adfdt_common
    adf-dt-at-rt
    adf-dt-at-rt-wizards
    adf-dynamic-faces
    adf-faces-changemanager-rt
    adf-faces-databinding-dt-core
    adf-faces-databinding-rt
    adf-faces-registration
    adf-faces-templating-dt-core
    adf-faces-templating-dtrt
    adflibfilter
    adflibrary
    adf-loc
    adflogginghandler
    adfm
    adfm-debugger
    adfmportlet
    adfm-sqldc
    adfmweb
    adf-pageflow-dtrt
    adf-pageflow-fwk
    adf-pageflow-impl
    adf-pageflow-rc
    adf-richclient-api-11
    adf-richclient-automation-11
    adf-richclient-bootstrap
    adf-richclient-impl-11
    adf-richclient-jmx
    adf-richclient-skin-editor
    adf-richclient-skin-repository
    adf-sec-idm-dc
    adf-share-base
    adf-share-ca
    adf-share-glassfish
    adfsharembean
    adf-share-security
    adf-share-support
    adf-share-web
    adf-stringeditor-api
    adftags
    adftransactionsdt
    adf-view-databinding-dt-core
    adf-view-unified-databinding-dt-core
    batik-anim
    batik-awt-util
    batik-bridge
    batik-codec
    batik-css
    batik-dom
    batik-ext
    batik-extension
    batik-gui-util
    batik-gvt
    batik-parser
    batik-script
    batik-svg-dom
    batik-svggen
    batik-swing
    batik-transcoder
    batik-util
    batik-xml
    bc4jhtml
    bc4jimdomains
    bc4j-mbeans
    bc4jsyscat
    bundleresolver
    com.bea.core.apache.commons.collections_1.0.0.0_3-2
    com.oracle.classloader.pcl_12.1.3
    com.oracle.http_client.http_client_12.1.3
    com.oracle.jrf.j2ee.web-common-schemas_12.1.3
    com.oracle.ojsp.globaltldcache_12.1.3
    com.oracle.ojsp.ojsp_12.1.3
    com.oracle.ojsp.web-common_12.1.3
    com.oracle.webservices.fmw.oc4j-ws-support-impl_12.1.3
    commons-el
    datatags
    db-ca
    dms
    dvt-as
    dvt-basemaps
    dvt-databinding-dt-core
    dvt-databindings
    dvt-databindings-mds
    dvt-faces
    dvt-facesbindings
    dvt-jclient
    dvt-jclient-adf
    dvt-shared-js
    dvt-trinidad
    dvt-utils
    facesconfigmodel
    glassfish.jstl_1.0.0.0_1-2-2-0
    groovy-all-2.1.6
    inspect4
    javamodel-rt
    javatools-nodeps
    javax.mail_2.0.0.0_1-4-4
    jdev-cm
    jewt4
    jr_dav
    jrf-api
    jsf-api
    jsf-impl
    jsf-ri-21.war
    jsp-el-api
    mds-dc
    mdsrt
    mobile-repository
    oicons
    ojdbc6dms
    ojdl
    ojdl2
    oracle.logging-utils_12.1.3
    oracle-el
    oracle-page-templates
    oraclexsql
    orai18n-mapping
    ordhttp
    ordim
    org.apache.bcel_5.1
    org.apache.commons.beanutils_1.6
    org.apache.commons.beanutils_1.8.3
    org.apache.commons.logging_1.0.4
    org.apache.commons.logging_1.1.1
    org.apache.http.components.httpclient-4.1.2
    org.apache.http.components.httpclient-cache-4.1.2
    org.apache.http.components.httpcore-4.1.2
    org.apache.http.components.httpmime-4.1.2
    prefuse
    rcs-adflib-rt
    rcsrt
    regexp
    resourcebundle
    share
    taglib
    trinidad-api
    trinidad-impl
    velocity-dep-1.4
    weld-integration
    xml-apis-ext
    xmlef
    xmlparserv2_sans_jaxp_services
    xsqlserializers

    ReplyDelete
  10. I have completed above steps. But finally i got SEVERE : error FilterStart
    So i went to the %CATALINA_HOME%\webapps\%WAR_FILE_NAME%\WEB-INF
    Edit web.xml to remove the filter tags and filter-mapping tags containing “JpsFilter”.
    But this tag is not present in web.xml. Still i got this error. Can you please help me on this.?

    ReplyDelete
  11. images on your blog don't appear.. please look up..

    ReplyDelete
  12. I have followed the same steps but I am getting one or the other error. Were you able to successfully build an end to end application(not a POC) on tomcat.

    ReplyDelete
  13. images on your blog don't appear.. please look up..

    ReplyDelete
  14. Iam so thrilled because of finding your alluring website here.Actually i was searching for Oracle ADF.Your blog is so astounding and informative too..Iam very happy to find such a creative blog. Iam also find another one by mistake while am searching the same topicOracle SOA.Thank you soo much..

    ReplyDelete