We use a simple JSP page to show the classpath in Application Server.
<html>
<body>
<p>Show CLASSPATH: [<%= System.getProperty("java.class.path") %>]</p>
</body>
</html>
Show CLASSPATH: [oc4j.jar:
/opt/oracle/AS1012/j2ee/home/lib/ejb.jar:
/opt/oracle/AS1012/j2ee/home/lib/servlet.jar:
/opt/oracle/AS1012/j2ee/home/lib/ojsp.jar:
/opt/oracle/AS1012/j2ee/home/lib/jndi.jar:
/opt/oracle/AS1012/j2ee/home/lib/jdbc.jar:
/opt/oracle/AS1012/j2ee/home/iiop.jar:
/opt/oracle/AS1012/j2ee/home/iiop_gen_bin.jar:
/opt/oracle/AS1012/j2ee/home/lib/jms.jar:
/opt/oracle/AS1012/j2ee/home/lib/jta.jar:
/opt/oracle/AS1012/j2ee/home/lib/jmxri.jar:
/opt/oracle/AS1012/j2ee/home/lib/javax77.jar:
/opt/oracle/AS1012/j2ee/home/lib/javax88.jar:
/opt/oracle/AS1012/j2ee/home/../../opmn/lib/ons.jar:
/opt/oracle/AS1012/j2ee/home/../../opmn/lib/optic.jar:
/opt/oracle/AS1012/j2ee/home/../../lib/dms.jar:
/opt/oracle/AS1012/j2ee/home/../../dms/lib/dms.jar:
/opt/oracle/AS1012/j2ee/home/../../diagnostics/lib/ojdl.jar:
/opt/oracle/AS1012/j2ee/home/../../dms/diagnostics/lib/ojdl.jar:
/opt/oracle/AS1012/j2ee/home/lib/connector.jar:
/opt/oracle/AS1012/j2ee/home/lib/bcel.jar:
/opt/oracle/AS1012/j2ee/home/lib/cos.jar:
/opt/oracle/AS1012/j2ee/home/lib/jsse.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/lib/jsse.jar:
/opt/oracle/AS1012/j2ee/home/lib/jnet.jar:
/opt/oracle/AS1012/j2ee/home/lib/jcert.jar:
/opt/oracle/AS1012/j2ee/home/lib/activation.jar:
/opt/oracle/AS1012/j2ee/home/lib/mail.jar:
/opt/oracle/AS1012/j2ee/home/../../javavm/lib/jasper.zip:
/opt/oracle/AS1012/j2ee/home/../../lib/xmlparserv2.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/lib/xmlparserv2.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/orai18n.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/orai18n.jar:
/opt/oracle/AS1012/j2ee/home/lib/jaxp.jar:
/opt/oracle/AS1012/j2ee/home/lib/jaas.jar:
/opt/oracle/AS1012/j2ee/home/jazn.jar:
/opt/oracle/AS1012/j2ee/home/../../jdbc/lib/classes12dms.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jdbc/lib/classes12dms.jar:
/opt/oracle/AS1012/j2ee/home/../../jdbc/lib/nls_charset12.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jdbc/lib/nls_charset12.jar:
/opt/oracle/AS1012/j2ee/home/jaxb-rt-1.0-ea.jar:
/opt/oracle/AS1012/j2ee/home/../../soap/lib/soap.jar:
/opt/oracle/AS1012/j2ee/home/../../webservices/lib/wsserver.jar:
/opt/oracle/AS1012/j2ee/home/../../webservices/lib/wsdl.jar:
/opt/oracle/AS1012/j2ee/home/../../rdbms/jlib/aqapi.jar:
/opt/oracle/AS1012/j2ee/home/lib/jem.jar:
/opt/oracle/AS1012/j2ee/home/../../javacache/lib/cache.jar:
/opt/oracle/AS1012/j2ee/home/lib/http_client.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/jssl-1_1.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/jssl-1_1.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/repository.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/repository.jar:
/opt/oracle/AS1012/j2ee/home/lib/jaasmodules.jar:
/opt/oracle/AS1012/j2ee/home/../../sqlj/lib/runtime12ee.jar:
/opt/oracle/AS1012/j2ee/home/../../sqlj/lib/translator.jar:
/opt/oracle/AS1012/j2ee/home/lib/crimson.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpcs.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpcs.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpcp.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpcp.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpse.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpse.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpsmime.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpsmime.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpcms.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpcms.jar::
/opt/oracle/AS1012/j2ee/home/applib:
/opt/oracle/AS1012/jdbc/lib/classes12dms.jar:
/opt/oracle/AS1012/diagnostics/lib/ojdl.jar:
/opt/oracle/AS1012/jlib/oraclepki.jar:
/opt/oracle/AS1012/jlib/ojpse.jar:
/opt/oracle/AS1012/jlib/ldapjclnt10.jar:
/opt/oracle/AS1012/jlib/netcfg.jar:
/opt/oracle/AS1012/jlib/jssl-1_1.jar:
/opt/oracle/AS1012/jlib/javax-ssl-1_1.jar:
/opt/oracle/AS1012/jlib/orai18n.jar:
/opt/oracle/AS1012/owm/jlib/owm-3_0.jar:
/opt/oracle/apps/prodcomn/java:
/opt/oracle/apps/prodcomn/java/xmlparserv2.zip:
/opt/oracle/apps/prodcomn/java/ieoservers.zip:
/opt/oracle/apps/prodcomn/java/jbojdbcpatch.zip:
/opt/oracle/apps/prodcomn/java/cache.zip:
/opt/oracle/apps/prodcomn/java/bc4jdatum817.zip:
/opt/oracle/apps/prodcomn/java/jdev-rt.zip:
/opt/oracle/apps/prodcomn/java/fndoam.zip:
/opt/oracle/apps/prodcomn/java/nls_charset11.zip:
/opt/oracle/apps/prodcomn/java/jbodatum111.jar:
/opt/oracle/apps/prodcomn/java/aqapi.zip:
/opt/oracle/apps/prodcomn/java/ieoall.zip:
/opt/oracle/apps/prodcomn/java/xdoparser.zip:
/opt/oracle/apps/prodcomn/java/sax2.zip:
/opt/oracle/apps/prodcomn/java/appsborg.zip:
/opt/oracle/apps/prodcomn/java/F1J7Swing.jar:
/opt/oracle/apps/prodcomn/java/bipres.zip:
/opt/oracle/apps/prodcomn/java/jdbc14.zip:
/opt/oracle/apps/prodcomn/java/servlet.zip:
/opt/oracle/apps/prodcomn/java/ojdigsig.zip:
/opt/oracle/apps/prodcomn/java/loadjava.zip:
/opt/oracle/apps/prodcomn/java/jdbc12.zip:
/opt/oracle/apps/prodcomn/java/graphbuilder.zip:
/opt/oracle/apps/prodcomn/java/appsborg2.zip:
/opt/oracle/apps/prodcomn/java/xmlparserv2-904.zip:
/opt/oracle/apps/prodcomn/java/fwkToolbox.zip:
/opt/oracle/apps/prodcomn/java/nls_charset12.zip:
/opt/oracle/apps/prodcomn/java/owa.zip:
/opt/oracle/apps/prodcomn/java/HTBGateway.zip:
/opt/oracle/apps/prodcomn/java/jdbc111.zip:
/opt/oracle/apps/prodcomn/java/jmscommon.zip:
/opt/oracle/AS1012/BC4J/lib:
/opt/oracle/AS1012/BC4J/lib/collections.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jdomorcl.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jimdomains.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jmt.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jct.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jmtejb.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jctejb.jar:
/opt/oracle/AS1012/BC4J/lib/adfm.jar:
/opt/oracle/AS1012/BC4J/lib/adfmtl.jar:
/opt/oracle/AS1012/BC4J/lib/adfmweb.jar:
/opt/oracle/AS1012/jlib/ojmisc.jar:
/opt/oracle/AS1012/ord/jlib/ordim.jar:
/opt/oracle/AS1012/ord/jlib/ordhttp.jar:
/opt/oracle/AS1012/jlib/jdev-cm.jar:
/opt/oracle/AS1012/lib/dsv2.jar:
/opt/oracle/AS1012/lib/xsu12.jar::
/opt/oracle/AS1012/j2ee/home/applications/SessionTest/sessiontest/WEB-INF/classes:
/opt/oracle/AS1012/j2ee/home/applications/SessionTest/sessiontest/WEB-INF/lib/htbclnt.jar]
... in fact, how do you feel? I feel very bad about so many irrelevant libaries were loaded in AS by default. No wonder AS has huge memory requirement. And next bad thing is, my application (SessionTest) libraries only appear at the end of the CLASSPATH.
This has caused one major problem. For example, if my application needs a particular version of classes12dms.zip JDBC library (because Oracle has released so many version of JDBC drivers, I have problem with RMI Serialization), AS will never be able to load my needed classes12dms.zip because there are so many JDBC libraries existing ahead.
So, I need to force AS to load my application libraries (in classes and lib folder).
In JDeveloper1012, we'll go New->General->Deployment Descriptors->orion-web.xml. Update the file with:
<orion-web-app servlet-webdir="/">
<web-app-class-loader search-local-classes-first="true"/>
</orion-web-app>
Then, deploy the application again. And we'll see what happens to the class loading sequence:
Show CLASSPATH: [:
/opt/oracle/AS1012/j2ee/home/applications/SessionTest/sessiontest/WEB-INF/classes:
/opt/oracle/AS1012/j2ee/home/applications/SessionTest/sessiontest/WEB-INF/lib/htbclnt.jar:
oc4j.jar:/opt/oracle/AS1012/j2ee/home/lib/ejb.jar:
/opt/oracle/AS1012/j2ee/home/lib/servlet.jar:
/opt/oracle/AS1012/j2ee/home/lib/ojsp.jar:
/opt/oracle/AS1012/j2ee/home/lib/jndi.jar:
/opt/oracle/AS1012/j2ee/home/lib/jdbc.jar:
/opt/oracle/AS1012/j2ee/home/iiop.jar:
/opt/oracle/AS1012/j2ee/home/iiop_gen_bin.jar:
/opt/oracle/AS1012/j2ee/home/lib/jms.jar:
/opt/oracle/AS1012/j2ee/home/lib/jta.jar:
/opt/oracle/AS1012/j2ee/home/lib/jmxri.jar:
/opt/oracle/AS1012/j2ee/home/lib/javax77.jar:
/opt/oracle/AS1012/j2ee/home/lib/javax88.jar:
/opt/oracle/AS1012/j2ee/home/../../opmn/lib/ons.jar:
/opt/oracle/AS1012/j2ee/home/../../opmn/lib/optic.jar:
/opt/oracle/AS1012/j2ee/home/../../lib/dms.jar:
/opt/oracle/AS1012/j2ee/home/../../dms/lib/dms.jar:
/opt/oracle/AS1012/j2ee/home/../../diagnostics/lib/ojdl.jar:
/opt/oracle/AS1012/j2ee/home/../../dms/diagnostics/lib/ojdl.jar:
/opt/oracle/AS1012/j2ee/home/lib/connector.jar:
/opt/oracle/AS1012/j2ee/home/lib/bcel.jar:
/opt/oracle/AS1012/j2ee/home/lib/cos.jar:
/opt/oracle/AS1012/j2ee/home/lib/jsse.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/lib/jsse.jar:
/opt/oracle/AS1012/j2ee/home/lib/jnet.jar:
/opt/oracle/AS1012/j2ee/home/lib/jcert.jar:
/opt/oracle/AS1012/j2ee/home/lib/activation.jar:
/opt/oracle/AS1012/j2ee/home/lib/mail.jar:
/opt/oracle/AS1012/j2ee/home/../../javavm/lib/jasper.zip:
/opt/oracle/AS1012/j2ee/home/../../lib/xmlparserv2.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/lib/xmlparserv2.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/orai18n.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/orai18n.jar:
/opt/oracle/AS1012/j2ee/home/lib/jaxp.jar:
/opt/oracle/AS1012/j2ee/home/lib/jaas.jar:
/opt/oracle/AS1012/j2ee/home/jazn.jar:
/opt/oracle/AS1012/j2ee/home/../../jdbc/lib/classes12dms.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jdbc/lib/classes12dms.jar:
/opt/oracle/AS1012/j2ee/home/../../jdbc/lib/nls_charset12.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jdbc/lib/nls_charset12.jar:
/opt/oracle/AS1012/j2ee/home/jaxb-rt-1.0-ea.jar:
/opt/oracle/AS1012/j2ee/home/../../soap/lib/soap.jar:
/opt/oracle/AS1012/j2ee/home/../../webservices/lib/wsserver.jar:
/opt/oracle/AS1012/j2ee/home/../../webservices/lib/wsdl.jar:
/opt/oracle/AS1012/j2ee/home/../../rdbms/jlib/aqapi.jar:
/opt/oracle/AS1012/j2ee/home/lib/jem.jar:
/opt/oracle/AS1012/j2ee/home/../../javacache/lib/cache.jar:
/opt/oracle/AS1012/j2ee/home/lib/http_client.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/jssl-1_1.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/jssl-1_1.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/repository.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/repository.jar:
/opt/oracle/AS1012/j2ee/home/lib/jaasmodules.jar:
/opt/oracle/AS1012/j2ee/home/../../sqlj/lib/runtime12ee.jar:
/opt/oracle/AS1012/j2ee/home/../../sqlj/lib/translator.jar:
/opt/oracle/AS1012/j2ee/home/lib/crimson.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpcs.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpcs.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpcp.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpcp.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpse.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpse.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpsmime.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpsmime.jar:
/opt/oracle/AS1012/j2ee/home/../../jlib/ojpcms.jar:
/opt/oracle/AS1012/j2ee/home/../../oracle/jlib/ojpcms.jar::
/opt/oracle/AS1012/j2ee/home/applib:
/opt/oracle/AS1012/jdbc/lib/classes12dms.jar:
/opt/oracle/AS1012/diagnostics/lib/ojdl.jar:
/opt/oracle/AS1012/jlib/oraclepki.jar:
/opt/oracle/AS1012/jlib/ojpse.jar:
/opt/oracle/AS1012/jlib/ldapjclnt10.jar:
/opt/oracle/AS1012/jlib/netcfg.jar:
/opt/oracle/AS1012/jlib/jssl-1_1.jar:
/opt/oracle/AS1012/jlib/javax-ssl-1_1.jar:
/opt/oracle/AS1012/jlib/orai18n.jar:
/opt/oracle/AS1012/owm/jlib/owm-3_0.jar:
/opt/oracle/apps/prodcomn/java:
/opt/oracle/apps/prodcomn/java/xmlparserv2.zip:
/opt/oracle/apps/prodcomn/java/ieoservers.zip:
/opt/oracle/apps/prodcomn/java/jbojdbcpatch.zip:
/opt/oracle/apps/prodcomn/java/cache.zip:
/opt/oracle/apps/prodcomn/java/bc4jdatum817.zip:
/opt/oracle/apps/prodcomn/java/jdev-rt.zip:
/opt/oracle/apps/prodcomn/java/fndoam.zip:
/opt/oracle/apps/prodcomn/java/nls_charset11.zip:
/opt/oracle/apps/prodcomn/java/jbodatum111.jar:
/opt/oracle/apps/prodcomn/java/aqapi.zip:
/opt/oracle/apps/prodcomn/java/ieoall.zip:
/opt/oracle/apps/prodcomn/java/xdoparser.zip:
/opt/oracle/apps/prodcomn/java/sax2.zip:
/opt/oracle/apps/prodcomn/java/appsborg.zip:
/opt/oracle/apps/prodcomn/java/F1J7Swing.jar:
/opt/oracle/apps/prodcomn/java/bipres.zip:
/opt/oracle/apps/prodcomn/java/jdbc14.zip:
/opt/oracle/apps/prodcomn/java/servlet.zip:
/opt/oracle/apps/prodcomn/java/ojdigsig.zip:
/opt/oracle/apps/prodcomn/java/loadjava.zip:
/opt/oracle/apps/prodcomn/java/jdbc12.zip:
/opt/oracle/apps/prodcomn/java/graphbuilder.zip:
/opt/oracle/apps/prodcomn/java/appsborg2.zip:
/opt/oracle/apps/prodcomn/java/xmlparserv2-904.zip:
/opt/oracle/apps/prodcomn/java/fwkToolbox.zip:
/opt/oracle/apps/prodcomn/java/nls_charset12.zip:
/opt/oracle/apps/prodcomn/java/owa.zip:
/opt/oracle/apps/prodcomn/java/HTBGateway.zip:
/opt/oracle/apps/prodcomn/java/jdbc111.zip:
/opt/oracle/apps/prodcomn/java/jmscommon.zip:
/opt/oracle/AS1012/BC4J/lib:
/opt/oracle/AS1012/BC4J/lib/collections.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jdomorcl.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jimdomains.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jmt.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jct.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jmtejb.jar:
/opt/oracle/AS1012/BC4J/lib/bc4jctejb.jar:
/opt/oracle/AS1012/BC4J/lib/adfm.jar:
/opt/oracle/AS1012/BC4J/lib/adfmtl.jar:
/opt/oracle/AS1012/BC4J/lib/adfmweb.jar:
/opt/oracle/AS1012/jlib/ojmisc.jar:
/opt/oracle/AS1012/ord/jlib/ordim.jar:
/opt/oracle/AS1012/ord/jlib/ordhttp.jar:
/opt/oracle/AS1012/jlib/jdev-cm.jar:
/opt/oracle/AS1012/lib/dsv2.jar:
/opt/oracle/AS1012/lib/xsu12.jar:]
Yes. Mission accomplished. AS is loading my application libraries first.
Friday, November 03, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment