views:

540

answers:

1

How can I have one classpath for building and a different classpath for deploying to the embedded OC4J container (pressing the green run button) in JDeveloper 10.1.3.4 (or any similar version.) Examples in other tools include Maven's provided scope and Eclipse's Java EE Module Dependencies (items checked are deployed at runtime with the application while those not checked are not.)

PS If i get any answers on this list, you will have bragging rights over the OTN discussion forums where I have been ignored for weeks on this very simple question. A simple "It can't be done." would at least give me some resolution.

Thanks, Steve

+1  A: 

Each application that you intend to run in the embedded OC4J installation of JDeveloper 10.1.3.x (I'm using 10.1.3.3) at the moment has an <application>-oc4j-app.xml file (re)created before every deployment.

This is equivalent to the application specific orion-application.xml file in OC4J. If you intend to not deploy certain JARs from appearing in this file, and hence the classpath, you should avoid exporting those JARs in the Libraries section of the Project Properties dialog. There are side-effects though, you will have to re-import these JARs in other projects that require them; libraries are preferred for JARs reused across projects.

Moreover, you can notice that separate classloaders for the application and the individual modules (EJBs,Web modules etc) are not created when the application is deployed to the emebedded OC4J distribution in JDeveloper. All classes specified in the <application>-oc4j-app.xml are loaded by this classloader (unless I'm mistaken). This is why it is always recommended to have an Ant build script that builds and deploys your application onto an OC4J instance.

Vineet Reynolds
My oversight came from relating "Export" in Jdev to "Export" in Eclipse. In Eclipse, "Export" means "to make available for dependent child projects to use". It has the same affect in Jdev, but it also has the affect "to make available for dependent projects in the EAR to use via the global classpath." In other words, at runtime (deploying to the embedded OC4J container), any library not exported is also not in the global classpath via <app>-oc4j-app.xml <libraries>. Exactly what I needed.Thank you very much,StevePS We're using Maven to build and deploy to external OC4J containers.
Steven