Search This Blog

Thursday, 2 April 2009

CYGWIN Script to copy ADF 11g JARS required for Tomcat

A work colleague told me he had to setup ADF 11g on tomcat 6.x and was lead to this link on what JAR files was required to be copied over to the %CATALINA_HOME%/lib folder.

http://blogs.oracle.com/dana/2009/01/how_to_deploy_a_11g_adf_applic_1.html

Here is a small script I wrote which will copy all those JAR files into a TEMP directory to save you time trying to find them one by one. This is a CYGWIN script as I don't know how to write BAT files.

1. Go into your JDeveloper 11g root directory as follows

papicell@papicell-au ~/d/jdev11g-boxer

2. Create a script as follows called "doCopyADF.sh"

#!/bin/sh
COPY_DIR=/cygdrive/d/temp/adf11g
export COPY_DIR;

cat adfjars.txt | while read filename
do
echo "Copying file $filename"
echo ""
find . -name "$filename" -exec cp {} $COPY_DIR \;
done


echo "All files copied.."

3. Now before you run it we need to create a list of ADF 11g JAR files it needs to find in a file called "adfjars.txt".

I simple used VI to create the list of files we need which we retrieved from the blog entry above.

adf-controller-api.jar
adf-controller-rt-common.jar
adf-controller.jar
adf-faces-databinding-rt.jar
adf-pageflow-dtrt.jar
adf-pageflow-fwk.jar
adf-pageflow-impl.jar
adf-pageflow-rc.jar
adf-richclient-api-11.jar
adf-richclient-impl-11.jar
adf-share-base.jar
adf-share-ca.jar
adf-share-support.jar
adflibfilter.jar
adflogginghandler.jar
adfm.jar
adfmweb.jar
cache.jar
commons-el.jar
db-ca.jar
dms.jar
dvt-faces.jar
dvt-jclient.jar
dvt-utils.jar
fmw_audit.jar
identitystore.jar
inspect4.jar
javatools-nodeps.jar
javax.management.j2ee_1.0.jar
jewt4.jar
jmxframework.jar
jmxspi.jar
jps-api.jar
jps-common.jar
jps-ee.jar
jps-internal.jar
jps-unsupported-api.jar
jsf-api.jar
jsf-ri.jar
jstl.jar
mdsrt.jar
ojdbc6.jar
oracle-el.jar
oraclepki.jar
org.apache.commons.beanutils_1.6.jar
org.apache.commons.collections_3.1.jar
org.apache.commons.logging_1.0.4.jar
osdt_cert.jar
osdt_core.jar
share.jar
standard.jar
trinidad-api.jar
trinidad-impl.jar
wls-api.jar
xercesImpl.jar
xmlef.jar
xmlparserv2.jar

4. Finally we need to edit the script to ensure we select a directory which exists to copy the JAR files into.

COPY_DIR=/cygdrive/d/temp/adf11g
export COPY_DIR;

5. Run as follows, ensuring you made it executable using "chmod +x doCopyADF.sh".

./doCopyADF.sh

Note: The list of required JAR files may not be 100% correct but with this script you can simple add/remove files from "adfjars.txt" to ensure you get the correct JAR files you need.

Example output.

papicell@papicell-au ~/d/jdev11g-boxer
$ ./doCopyADF.sh
Copying file adf-controller-api.jar

Copying file adf-controller-rt-common.jar

Copying file adf-controller.jar

Copying file adf-faces-databinding-rt.jar

Copying file adf-pageflow-dtrt.jar

Copying file adf-pageflow-fwk.jar

Copying file adf-pageflow-impl.jar

Copying file adf-pageflow-rc.jar

Copying file adf-richclient-api-11.jar

Copying file adf-richclient-impl-11.jar

Copying file adf-share-base.jar

Copying file adf-share-ca.jar

Copying file adf-share-support.jar

.....

1 comment:

Pas Apicella said...

Just to be 100% sure I wrote a simple FMW application and it run fine on tomcat. Couple of errors in the tomcat console log which I hope to look into a bit later down the track.