In the earlier post If you intend to deploy JHeadstart 10.1.3 to OracleAS 10.1.2 I explained which preparation steps to take if you are going to deploy your JHeadstart 10.1.3 application to an
application server that uses JDK 1.4 (like Oracle Application Server
10.1.2). I promised that in a later post I would blog about how to do the actual deployment.
Well, here it is! Below are the steps I took to successfully deploy a JHeadstart 10.1.3 application to Oracle AS 10.1.2 (after trying out several other methods). The steps are so generic that I think they can be used for any JDeveloper 10.1.3 web application using ADF Business Components and JSF or ADF Faces.
- Create a new OC4J Instance in OracleAS 10.1.2 (for example from the Application Server Home Page).
- Disable ADF Runtime for this OC4J instance by modifying its [OC4JInstanceHome]/config/application.xml (on the file system of the application server machine). Comment out the following lines:
- If necessary, set up Data Sources and other configuration settings for OC4J.
- In the ViewController project properties, go to Libraries.
- Add the following libraries that are needed for the Model project:
BC4J Oracle Domains
Oracle JDBC
SQLJ Runtime - Also add or create any other libraries where needed to get the right jar files in the EAR file.
- In the ViewController project, create a new WAR Deployment Profile (File | New | General | Deployment Profiles | WAR File).
- In the deployment profile properties, go to WEB-INF/lib Contributors, and select all the libraries (except JSP Runtime).
- In the deployment profile properties, go to WAR Options, and select Compress Archive.
- If you use Subversion, go to all Filters categories, then to Patterns, and exclude **/.svn/
- In web.xml, replace
- On your development PC, install JDK 1.4 (for example, copy the jdk folder from a JDeveloper 10.1.2 home).
- In the ViewController Project Properties, go to Libraries.
- Click the Change button for the J2SE Version.
- Click the New button to create a new J2SE Definition.
- Browse to your [JDK1.4Home]/bin/java.exe for the J2SE Executable.
- When asked to install OJVM, click OK.
- Accept the default settings for name, class path, source path, and doc path.
- Choose if you want to define the new J2SE definition at Project level (every deployer needs to have JDK 1.4 in same path), or User level (every deployer needs to create own J2SE definition).
- Save the settings.
Warning: after this step (usage of J2SE 1.4), do not try to run Embedded OC4J (see below how to enable Embedded OC4J again). - In the Model Project Properties, do the same (define a similar J2SE 1.4 Version).
- Empty your classes folder (the output directory for the compiler). You can do that in JDeveloper via the menu option Run - Clean ViewController.jpr.
- Right-click the deployment profile and choose Deploy to EAR. The log tells you where it creates the EAR file.
- Deploy the EAR file to the new OC4J instance (see this documentation).
<library path="../../../BC4J/lib"/>and
<library path="../../../jlib/ojmisc.jar"/>
<library path="../../../ord/jlib/ordim.jar"/>
<library path="../../../ord/jlib/ordhttp.jar"/>
<library path="../../../jlib/jdev-cm.jar"/>
<library path="../../../uix/taglib"/>
<web-appby
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee">
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
This is a long list of steps, isn't it! Fortunately, you only need to do them the first time you are going to deploy. For subsequent deployments you only need to perform the following steps:
- In both the Model and the ViewController Project Properties, go to the Libraries page, and change the J2SE Version to 1.4 (which is now already defined).
- Empty your classes folder (the output directory for the compiler). You can do that in JDeveloper via the menu option Run - Clean ViewController.jpr.
- Right-click the deployment profile and choose Deploy to EAR.
- Deploy the EAR file in the new OC4J instance.
- Change the J2SE Version back to 1.5 (in both Model and ViewController).
Comments (5)
Excellent Documentation It Helped. I could Deploy the Application in 10.1.2 But Got The Error While Running
java.lang.NoClassDefFoundError: javax/servlet/jsp/el/VariableResolver at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1655) at java.lang.Class.getDeclaredMethod(Class.java:1262) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterHelperImpl._setupJboDomainStuff(AdfFacesFilterHelperImpl.java:187) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterHelperImpl.init(AdfFacesFilterHelperImpl.java:64) at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.init(AdfFacesFilterImpl.java:96) at oracle.adf.view.faces.webapp.AdfFacesFilter.init(AdfFacesFilter.java:56) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.getFilterConfig(HttpApplication.java:7708) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:487) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
Any idea?
Posted by Rajagopalan Raghuraman | March 28, 2007 10:27 AM
Raghu,
Thank you for your compliment!
Please see the JHeadstart discussion forum thread at http:\//forums.oracle.com/forums/thread.jspa?threadID=490244&tstart=0 for a discussion of this problem.
kind regards,
Posted by Sandra Muller | April 2, 2007 2:51 AM
My application is developed for OracleAS 10.1.2 on jdeveloper 10.1.2.2.0 with java 1.4
is there a way i can continue developing my application on the new jdeveloper 10.1.3 and keep it able to be deployed on OracleAS 10.1.2
Posted by Amgad Hanafy | March 31, 2009 4:38 AM
Amgad,
please post this type of question on the JDeveloper or OC4J forum on OTN. It will help if you include in the forum post some more information about which frameworks you are using, and other information which may help others decide if it could be a problem on OracleAS 10.1.2.
Posted by Sandra Muller | March 31, 2009 7:07 AM
I successful deployed a JHS 10.13 application, on Oracle application server 10.12 after following your instructions.
But after I installed Oracle ADF runtime libraries 10.13 to Oracle application server 10.12 I found that the old application which built with Jdeveloper 10.12 is not working and give me this error
-------------------------------------
java.lang.NoClassDefFoundError: javax/servlet/jsp/el/VariableResolver at oracle.adf.model.BindingRequestHandler.loadApplication(BindingRequestHandler.java:420)
---------------------------------------
and note that these old applications is deployed on another OC4J instance
Any solutions ???
Thanks
Posted by Samy Omar | October 13, 2009 6:51 AM