How to deploy a JDev 10.1.3 application to OracleAS 10.1.2

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.

  1. Create a new OC4J Instance in OracleAS 10.1.2 (for example from the Application Server Home Page).
  2. 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:
  3. <library path="../../../BC4J/lib"/>
    <library path="../../../jlib/ojmisc.jar"/>
    <library path="../../../ord/jlib/ordim.jar"/>
    <library path="../../../ord/jlib/ordhttp.jar"/>
    <library path="../../../jlib/jdev-cm.jar"/>
    and
    <library path="../../../uix/taglib"/>
  4. If necessary, set up Data Sources and other configuration settings for OC4J.
  5. In the ViewController project properties, go to Libraries.
  6. Add the following libraries that are needed for the Model project:
       BC4J Oracle Domains
       Oracle JDBC
       SQLJ Runtime
  7. Also add or create any other libraries where needed to get the right jar files in the EAR file.
  8. In the ViewController project, create a new WAR Deployment Profile (File | New | General | Deployment Profiles | WAR File).
  9. In the deployment profile properties, go to WEB-INF/lib Contributors, and select all the libraries (except JSP Runtime).
  10. In the deployment profile properties, go to WAR Options, and select Compress Archive.
  11. If you use Subversion, go to all Filters categories, then to Patterns, and exclude **/.svn/
  12. In web.xml, replace
  13. <web-app
    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">
    by
    <!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>
  14. On your development PC, install JDK 1.4 (for example, copy the jdk folder from a JDeveloper 10.1.2 home).
  15. In the ViewController Project Properties, go to Libraries.
  16. Click the Change button for the J2SE Version.
  17. Click the New button to create a new J2SE Definition.
  18. Browse to your [JDK1.4Home]/bin/java.exe for the J2SE Executable.
  19. When asked to install OJVM, click OK.
  20. Accept the default settings for name, class path, source path, and doc path.
  21. 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).
  22. 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).
  23. In the Model Project Properties, do the same (define a similar J2SE 1.4 Version).
  24. Empty your classes folder (the output directory for the compiler). You can do that in JDeveloper via the menu option Run - Clean ViewController.jpr.
  25. Right-click the deployment profile and choose Deploy to EAR. The log tells you where it creates the EAR file.
  26. Deploy the EAR file to the new OC4J instance (see this documentation).
To use Embedded OC4J, change the J2SE Version of ViewController back to 1.5 and rebuild the project.

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).
As an alternative solution, you can also try to install OC4J 10.1.3 under your Oracle Application Server 10.1.2.

Comments:

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 on March 28, 2007 at 03:27 AM PDT #

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 on April 01, 2007 at 07:51 PM PDT #

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 on March 30, 2009 at 09:38 PM PDT #

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 on March 31, 2009 at 12:07 AM PDT #

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 on October 12, 2009 at 11:51 PM PDT #

thanks! great! it worked! crazy that some projects still require this kind of tweaks. thanks again

Posted by andrei loghin on October 28, 2010 at 01:10 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Java EE Consultants - JHeadstart, ADF, JSF

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today