The following is a solution that works for products only certified with OC4J/Application Server 10.1.2.x and an application build on OC4J/Application Server 10.1.3.x...
Background
The product called Oracle Healthcare Transaction Base (HTB) is currently certified for OC4J/Application Server 10.1.2.x only. It has a client library that hides all the nitty-gritty details of connecting to several SessionFacades but still needs the usual JNDI configuration details like Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL. The Context.SECURITY_PRINCIPAL and Context.SECURITY_CREDENTIALS are handled through a special UserManager (hence not yet certified for OC4J 10.1.3.x).Server Setup
To be able to connect to the HTB server running on OC4J/Application
Server 10.1.2 you need to apply patch 4676768 or related, first.
Library Requirements
Every caller of the HTB client library (htbclnt.jar) must use the HTB client library as well as a specific Oracle JDBC driver (classes12dms.jar). The default Oracle JDBC driver available in OC4J will not work for reasons that easily fill another post. You also need a library containing the class com.evermind.server.rmi.OrionRemoteException. See my post on this topic.Scenario 1: Web application
If you only use a web application, the issue with the specific JDBC library can be solved by putting the above mentioned libraries into the WEB-INF/libs dircetory and include a WEB-INF/orion-web.xml with this line<web-app-class-loader
search-local-classes-first="true"
include-war-manifest-class-path="false"/>
Scenario 2: Web application, EJBs
A typical Java EE application with EJB and WAR modules. One of the EJB modules is calling the HTB Session Facades. The WAR is displaying the results.WAR module
The WAR module can be any normal or high sophisticated web application. The only difference to scenario 1 is that we do not include the HTB libraries!EJB module
The EJB module is also quite normal in terms of EJBs. Surely there is one Session Bean that acts as a facade to HTB and uses the HTB API to call it. In our IDE we configure the above mentioned HTB libs for compilation, but not for inclusion in the EJB JAR package!EAR packaging
Since OC4J 10.1.3 we can use the Java EE 5 "shared library approach" to specify our libraries used by all modules. We also need to tell OC4J not to include pre-packaged shared libraries from the OC4J environment. For this we need to configure the EAR deployment descriptors: application.xml and orion-application.xml.application.xml
The standard Java EE deployment descriptor application.xml contains the standard tags for EJB and WAR modules, plus the Java EE 5 <library-directory> tag and the version="5" attribute setting for the <application> tag. Here is a sample:<?xml version = '1.0' encoding = 'windows-1252'?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5" xmlns="http://java.sun.com/xml/ns/javaee">
<display-name>ear-application</display-name>
<module>
<ejb>quoteBeans.jar</ejb>
</module>
<module>
<web>
<web-uri>quoteUI.war</web-uri>
<context-root>quote</context-root>
</web>
</module>
<library-directory>libs</library-directory>
</application>
orion-application.xml
The OC4J-specific deployment descriptor orion-application.xml tells OC4J not to include the JDBC driver from the default OC4J library environment. Here is a sample:<?xml version = '1.0' encoding = 'windows-1252'?>
<orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd">
<imported-shared-libraries>
<remove-inherited name="oracle.jdbc" />
</imported-shared-libraries>
</orion-application>
Comments (6)
Great stuff, Olaf! Let's hope 10.1.3 will be certified soon. I'll have one Tiger, please.
Posted by Robbie Vanbrabant | July 25, 2007 4:18 AM
Posted on July 25, 2007 04:18
Hello! Good Site! Thanks you! uvykwcigaqr
Posted by gcmyibtlsi | November 23, 2007 3:51 AM
Posted on November 23, 2007 03:51
How to avoid use shared libraries on oc4j version 10.1.2.
I tried changed orion-web.xml, setting the web-app-class-loader, and restarting the instance, but it doesn't work, the server doesn't restart.
I also tried changed orion-application.xml, and add remove-inheritance-libraries, but it doesn't work.
I working on an application with web services, axis, etc, and i want to remove the shared library oracle.xml, but i don't know why.
Thans for your answers.
Posted by Carlos | May 9, 2008 5:13 AM
Posted on May 9, 2008 05:13
AFAIK, shared libraries are a 10.1.3 only feature.
Posted by Olaf Heimburger | May 9, 2008 5:34 AM
Posted on May 9, 2008 05:34
How can i avoid use library oracle.xml in a web application in the 10.1.2 application server?
The workaround to the 10.1.3 version works like you explain in the post, but have you got any idea on how to avoid the use of this library?
I have access to the file system where the oc4j is configured, perhaps deleting the library on "j2ee\home\applib"?
Posted by Carlos | May 9, 2008 6:16 AM
Posted on May 9, 2008 06:16
applib is the 10.1.2 mechanism to provide additional libraries. To use the XML parser of your choice you have to use the JAXP properties to specify the right XML parser. I've done this but the sample is at the moment out of reach on an external disk.
Posted by Olaf Heimburger | May 9, 2008 6:29 AM
Posted on May 9, 2008 06:29