J2EE patterns: Deployment Presentation Services Project to remote OC4J inctance

  1. Deployment Presentation Services Project (from OTNs JDeveloper Tutorial Pages ) to remote OC4J instance on CentOS4.1 box

    Modify file:
    to replace "localhost:1521:ORCL" with real connecting string to remote database .
    For example : "ServerCentOS41:1523:rawdbase"
    Then start Jdeveloper 10.1.2 and open project ToplinkObjects.jws
     Just to be able to acquire database Server Session add view :-

    create view TeamDriverID asselect a.id,a.constructorname,b.homeCountry,b.yrsExperience,b.name,b.salaryfrom team_order a,drivers bwhere a.driver1_id=b.idorder by a.constructorname

    to RACING schema.

    Import View TeamDriverID as Toplink Java object to PersistenceServices.jpr
    Regenerate Toplink-Deployment-Descriptor.
    Create new session.xml and define data control for TeamDriverID.java though session.xml file.

    Performing following step from [1] :-
    Add a Method to Get a Server Session
    1.In the EJB Diagram, double-click racingFacade EJB to launch the EJB Module editor.
    2.Expand racingFacade in the left hand navigator and select Methods. On the right hand side panel,choose Business Methods in the Method category and click Add.
    3.In the Business Method Details dialog set the following: Name getServerSession Return Type oracle.toplink.threetier.Server

    // Deselect the check boxes for Expose through Remote Interface and Expose through Local Interface.

    Do select the check boxes for Expose through Remote Interface and Expose through.Local Interface.

    Click OK, then click OK in the EJB Module Editor.
    4.Right-click racingFacade EJB in the Applications Navigator and choose Go To Bean Class from the context menu.

    The section shown bellow (inside RacingFacadeBean.java file) should be modified as follows:-

    public void setServerSession(Server serverSession)
     //this.serverSession = serverSession;
    ServerSession aSession = (ServerSession)SessionManager.getManager().getSession("ServerSession");

    Then run RacingFacadeClient1.Java.It will successfully request the UnitOfWork and add the row to "team_order" table on remote database server.

    Proceed with working on project as advised in [1],[2]

    Create ejb1.deploy as EJB deployment profile for BusinessServices.jpr for standalone OC4J.
    Create webapp1.deploy as WAR deployment profile for PresentationServices.jpr for standalone OC4J.
    Create application1.deploy as EAR deployment profile for PresentationServices.jpr for standalone OC4J.
    Application Assembly should include both ejb1.deploy,webapp1.deploy.
    At this point project may be deployed to remote OC4J instance or OAS10gR2 (J2EE&WebCashe) on Linux Box and work with remote box hosting Oracle 9i or 10g database on Linux,exactly as it works with local database on Windows.

     1.Create Business Services using Enterprise JavaBeans
     2.Create Presentation Services Using JSP pages, Struts and ADF Databinding
  2. http://bderzhavets.blogspot.com/2006/02/deployment-presentation-services.html