Archive for the ‘MyEclipse’ Category

One of the days at work, we had some requirements to deploy a java web application in an OC4J container (Oracle Container for Java). We are using MyEclipse as our development tool. We had easily integrated it with Tomcat for all the previous deployments. So, we thought it is going to be a cake walk. Not a big deal. Unfortunately it took us a day to figure out how to do it. Here are the steps to integrate MyEclipse with the OC4J container:

  • Install OC4J
    • Download the oc4j container
    • Unzip it to some directory e.g. c:\oc4j
    • Set the JAVA_HOME environment variable to your java directory
    • Set the ORACLE_HOME environment variable to where you unzipped the oc4j i.e c:\oc4j
    • Start the oc4j container by running the oc4j batch file located in c:\oc4j\bin from the command prompt
      c:\oc4j\bin\oc4j -start
    • It will prompt for the admin password. Set the password. You would need to remember it for later
    • Stop the oc4j either by pressing CRTL+C or just close the window
  • Integrate OC4J with MyEclipse
    • In the menu bar of MyEclipse go to Windows → Preferences → MyEclipse → Application Servers
    • Click on Oracle AS
    • Set Oracle AS to Enable
    • Set Oracle AS Home Directory to c:\oc4j\j2ee\home
    • Provide the Administration Password that you have just configured
    • Click ok
    • Start the Oracle AS to ensure that it has been configured properly
  • Deploy your web application in OC4J

    Assuming that you already have a web project that you need to deploy, you would need to create an Enterprise Application Project. This is because you can only deploy ear files in OC4J container and not war files

    • Create new Project File → New → Project
    • MyEclipse → J2EE Projects → Enterprise Application Project
    • Add your web project as a module to the Enterprise Application Project before deployment you would need to change the server.xml that is located at c:\oc4j\j2ee\home\config.
    • <application-server application-directory="../applications"
    • In MyEclipse, click on the Deploy button to bring up deployment dialog.
    • Choose the Enterprise Application’s project from the selection box, Click Add button, choose Oracle AS as the server, choose Packaged Archive and click Deploy.
    • If you want to change the deployment mode to Exploded Mode, shutdown the OC4J.
    • Go to deployment dialog, choose the same project in the list of deployments below the project selection box. Click on Remove. Now repeat deployment with only one exception.
    • Instead of choosing Packaged Deployment, choose Exploded Deployment option.
    • Start OC4J as usual, now it’ll have a fully hot deployable application.

Just to note that the version we are using are MyEclipse 5.1.0 and OC4J

For more information, you can check http://www.myeclipseide.org/


Read Full Post »