facebook

[Workaround] Deploying to oc4j 10g (10.1.2.0.)

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 15 posts - 1 through 15 (of 41 total)
  • Author
    Posts
  • #233789 Reply

    bradm
    Member

    I pointed my eclipse to the j2ee/home directory in the oc4j directory; hooked up a jdk, and successfully started the server from within My Eclipse (this is the pure Java J2EE Containers version). I also deployed an application to the server, and My Eclipse reports that it was successful. The app doesn’t really get deployed though, it seems: I see no evidence of it on the server, and a “Not Found” error results if I try to browse to it.

    Is it too early for 10g (i.e. is 9i the only one supported)?

    I’m on Eclipse 3.1RC4, and MyEclipse 4M2.

    #233799 Reply

    bradm
    Member

    I forgot to mention that I also tried the suggestions in the oc4j “Sticky” re: the server.xml and http-app.xml file adjustments, and that I tried deploying both an exploded app and a WAR.

    #233811 Reply

    Scott Anderson
    Participant

    OC4J is a strange beast. Exploded applications don’t work at all. I *think* a war works and I’m sure an EAR works. Can you try creating an EAR project, adding your WAR to it (in the wizard) and deploying that as a packaged archive? That should work fine, provided you’ve set up the autodeploy directory in server.xml correctly.

    #233832 Reply

    Dave Trussell
    Participant
    #233869 Reply

    bradm
    Member

    Thank you Dave. I had looked at that thread and tried what was suggested there with no luck.

    I work for a university that has just committed to oc4j (or rather a department that has… but I digress….).

    If anybody is looking at this who can share some battle scars please speak up! Thanks in advance.

    #233903 Reply

    Scott Anderson
    Participant

    Brad,

    Did deploying a packaged EAR work?

    #234042 Reply

    bradm
    Member

    Scott,

    Sorry to admit it, but I can’t see how to take this project (which I initiated with Web Project abilities) and export it as an EAR file. I tried to export what I have, but I get a message saying that suggests I need to START a project with EAR capabilities first (” No EAR projects Found for Export. This wizard displays only those EAR projects that are currently OPEN.”

    What am I missing?

    #234046 Reply

    Scott Anderson
    Participant

    Brad,

    You need to create an addition project using File > New > Project… > MyEclipse > J2EE Projects > Enterprise Application Project.
    In the first page of the wizard under Creation Tasks > Available Tasks, uncheck the create ejb project settings. Click next and then select your web project in the bottom section of the next page under “Select Applicable Web Module Projects”. Let the wizard finush running and then deploy this new EAR project (as packaged) to Oracle and you’ll have a .ear file that properly includes you’re web project’s .war file.

    #234066 Reply

    bradm
    Member

    Hi Scott. All went just as you describe above, and again I’m told that deployment was successful. But again when I try to load a page from it in a browser oc4j tells me it “can’t be found” (404).

    For what it’s worth this same app is loaded up just fine on Tomcat. How could Oracle have managed to make something so basic to the notion of a web server so impossibly complex and cryptic?

    #234078 Reply

    Riyad Kalla
    Member

    Brad,
    I know that typically J2EE application servers require that you additionally “install” or “deploy” the EAR from within the server’s administrative console, and MyEclipse’s step of “deploying” it isn’t the end of the road. So I looked up deploying an app into OC4J and found this link for 9, check the last section here: http://www.oracle.com/technology/sample_code/tech/xml/customermanagement/Install.html

    It looks like you need to edit some config files to let the app server become aware of the installed app. I can’t imagine that OC4J dosen’t include an administrative console much like WebSphere has that you can “Install” the EAR from, does it?

    #234128 Reply

    kinjalsonpal
    Member

    After good amount of research on OC4J deployment, I’ve managed to achieve true hot deployment (for both, the web content and java content). Following is a step by step procedure. I’ve tested this on MEI 3.8.4 with OC4J 9.0.4 and 10.1.3. The standalone OC4J installation in both the cases was a fresh install on a Windows XP (SP1) m/c. Go through and follow contents of the ReadMe in the downloaded OC4J archive. Configure OC4J in MEI as described in the tutorial.

    1) modify server.xml to achive following effect.

    <application-server application-directory=”../applications”
    deployment-directory=”../application-deployments”
    connector-directory=”../connectors”
    application-auto-deploy-directory=”../application-autodeploy”
    check-for-updates=”true”
    >

    2) Create a directory called application-autodeploy under $OC4J_HOME\j2ee\home.

    3) Start OC4J using the server launcher. Create a J2EE Enterprise Application Project and a subproject (typically a webproject), if you already do not have one. OC4J recognises only .ear files for auto-deploy.

    4) 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 9i/AS as target server, choose Packaged Archive and click Deploy.

    5) Once the deployment is successful, on the OC4J console, there would be good number of informational messages regarding the deployment process. Test your newly deployed application. Now, shutdown OC4J.

    6) While the server is down, again 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.

    7) Start OC4J as usual, now it’ll have a fully hot deployable application.

    I’ve observed that sometimes, changes are not HotSynched. This typically happens if MEI is restarted. If this happens, just do Exploded Deployment again. Btw, if you guys have a choice, use version 10.1.x. It comes with a pretty comprehensive admin console running on port 1810.

    I’m sure the MEI team will be able to refine this further and correct it if required.

    HTH.

    Regards,
    Kinjal

    #234133 Reply

    bradm
    Member

    Thank you very much for your detailed instructions Kinjal. I’m sorry to report that following them to the letter still leads to the same problem: “Page Not Found”.

    I’m going to just lobby this department against using oc4j! This one takes the cake.

    #234135 Reply

    kinjalsonpal
    Member

    @bradm wrote:

    Thank you very much for your detailed instructions Kinjal. I’m sorry to report that following them to the letter still leads to the same problem: “Page Not Found”.

    There’re good number of reasons why you would receive “Page Not Found” error. It ranges from a typo in the address bar of your browser to misconfiguration of the application server. Is the same application working on some other application server, like, say Tomcat which only deals with a .war file? Also, were you able to follow all the above steps successfully?

    I’m going to just lobby this department against using oc4j! This one takes the cake.

    Lobbying against a product just because it’s a tough cookie does not look to be a good thing to do IMHO. Sometimes people do not have such a luxury of liking or disliking a product, they’re just asked to make it work.

    My 2 cents.

    Regards,
    Kinjal

    #234169 Reply

    bradm
    Member

    Yes, all the steps you outlined appeared to be successful; and yes: the same app has been deployed as a WAR file and in exploded form on two different servers using Tomcat.

    I’m curious: is there anything about oc4j that other options don’t provide that would explain it’s comparative complexity and fussiness?

    #234170 Reply

    Scott Anderson
    Participant

    One thing we haven’t covered is what port you’re trying to access to see the server. See (http://www.johntopley.com/kb/oracle/0025.html) which shows the default port is 8888. So, try http://localhost:8888/&#8230;

Viewing 15 posts - 1 through 15 (of 41 total)
Reply To: [Workaround] Deploying to oc4j 10g (10.1.2.0.)

You must be logged in to post in the forum log in