MyEclipse: Deployment with OC4J [Closed]

capt_houseyii - Jun 01, 2004 - 03:21 PM
Post subject: Deployment with OC4J [Closed]
Could someone please point me in the right direction for implementing myeclipse deployment with OC4J. I have read all the topics in the forum and still cant get it to work.

-capt_houseyii
support-scott - Jun 01, 2004 - 03:31 PM
Post subject:
Two things that trip people up with OC4J: first you need to modify server.xml to turn on auto-deployment like this:

Code:

<application-server application-directory="../applications"
 application-auto-deploy-directory="../application-autodeploy"
 deployment-directory="../application-deployments"
>


Second, I don't believe OC4J supports exploded deployment, only packaged.

If that doesn't get you moving, please let us know. And remember, more specific you can make your question, the faster we'll be able to answer them correctly. :-)

Also, if you'd provide all the configuration information we request in the 'Posting Guidelines' thread at the top of this forum we'll have at least a minimal context with which to work.
capt_houseyii - Jun 01, 2004 - 04:29 PM
Post subject:
OS: 2k SP4
Eclipse was freshly installed for My Eclipse
The only other plugin is for Source Safe
I am using MyEclipse Verson 3.71
JDK version 1.4.2
OC4j oc4j_extended_rel3)is running on 1.4.2 (to the best of my knowledge)

I have an enterprise project called EASE_1 containing a web module called EASE

here is the application.xml
application>
<display-name>EASE_1</display-name>
<module id="myeclipse.1081260834687">
<web>
<web-uri>EASE.war</web-uri>
<context-root>/EASE</context-root>
</web>
</module>
</application>

I have EASE_1 project deployment set to packaged:
C:\oc4j_extended_rel3\j2ee\home\application-autodeploy

I have my server.xml file as follows:


<application-server application-directory="../applications"
application-auto-deploy-directory="../application-autodeploy"
deployment-directory="../application-deployments"
connector-directory="../connectors"
>
<rmi-config path="./rmi.xml" />
<jms-config path="./jms.xml" />
<log>
<file path="../log/server.log" />
</log>
<transaction-config timeout="30000" />
<global-application name="default" path="application.xml" />
<application name="EASE_1" path="C:\oc4j_extended_rel3\j2ee\home\application-autodeploy\EASE_1.ear" auto-start="true" />
<global-web-app-config path="global-web-application.xml" />
<web-site path="./http-web-site.xml" />
<cluster id="-1332567986" />
</application-server>


With tomcat, I was simply able to hit the save button and all changes were automatilcly deployed and compiled. With OC4j I Must stop the server, delete any insance of "EASE" in the application directory , redeploy and then re-start the server.

There are no errors in the log
support-scott - Jun 01, 2004 - 05:00 PM
Post subject:
Quote:

With tomcat, I was simply able to hit the save button and all changes were automatilcly deployed and compiled.

That works with Tomcat and exploded deployment since our hot sync deployer will automatically update the complete installation. However, we don't automatically sync all changes with each save for packaged deployments since we'd have to completely repackage the entire application, the overhead of which could be huge. For packaged deployments, you must use the 'Redeploy' button in the deployment manager dialog to tell MyEclipse when the deployment should be resync'ed. This is the basic difference between exploded and packaged deployments. It also shows why servers that support exploded deployment are so much better for development and testing.

Quote:

With OC4j I Must stop the server, delete any insance of "EASE" in the application directory , redeploy and then re-start the server.

Unfortunately, how well each server supports hot deployment of applications varies widely. However, even though OC4J doesn't support exploded deployments, I haven't seen any issues with its handling of packaged deployments. Here's what works for me, so please let me know if you see something else:
1) Create a web project and an EAR to contain it.
2) Deploy it as 'packaged' to OC4J
3) Start the server, test the application
4) Make code changes in MyEclipse. Java code changes will be hot-synced into the server JVM immediately on save and will be available until the server is restarted. Changes to JSP's or other artifacts will require redeploying the EAR.
5) Open the deployment management dialog, select OC4J deployment and hit 'Redeploy'
6) At that point I see the following messages in the console, letting me know that my application was redeployed:
Quote:

Auto-deploying file:/C:/dev/appservers/oc4j_rel2/j2ee/home/application-autodeploy/TestEAR/TestWeb/ (New server version detected)...
Auto-unpacking C:\dev\appservers\oc4j_rel2\j2ee\home\application-autodeploy\TestEAR.ear... done.
Auto-unpacking C:\dev\appservers\oc4j_rel2\j2ee\home\application-autodeploy\TestEAR\TestWeb.war... done.
Auto-deploying TestEAR (Assembly had been updated)...
Auto-deploying file:/C:/dev/appservers/oc4j_rel2/j2ee/home/application-autodeploy/TestEAR/TestWeb/ (Assembly had been updated)...


Can you try the steps I outlined above and see that they work for you? Please note that I specifically did not need to restart the OC4J server while doing any of this.
capt_houseyii - Jun 02, 2004 - 04:25 PM
Post subject:
Scott,

Thanks 10^6 !


Looks like I have it as good as it is going to get. It just amazes me how politics and CBS can really mess things up. Oracle must have some really good salespersons because JDeveloper and OC4J are a sad joke compared to open source application servers and the Eclipse/MyEclipse IDE. A small fortune was paid for our “turnkey” solution, which does nothing but hinder developers. At least the powers that be are allowing us to use the Eclipse solutions over Jdeveloper. I am quite pleased in my investment with your product…

As far as I am concerned, Oracle should stick to the database business…

-Mike
support-scott - Jun 02, 2004 - 04:43 PM
Post subject:
Mike,

Glad to hear that we've gotten you moving. :-)

Now that you probably have about a year before management has to decide whether or not to pay Oracle again (upgrades, support, etc) here's what you need to do.

First, if your company doesn't already have one, lobby to create an "Employee Suggested Cost Savings" program. In the program, employees make suggestions on how to save money (corporate wonks love this stuff) and for each suggestion that's accepted, the employee gets some percentage of the savings as a bonus. Propose something significant, like 30% because they'll try to knock it down or cap it anyway.

<digression> Legend has it that an IBM employee retired on the revenue he garnered back in the late 70's for suggesting that IBM buy all their coax from a single vendor, thus saving tens of millions due to volume discounts. </digression>

Second, evangalize MyEclipse internally and once the program is up and running suggest that you stop paying Oracle ridiculous sums of money for dev tools and use MyEclipse instead.

Three, take your substantial bonus and have a nice vacation. :-)
myu - Dec 23, 2004 - 07:01 PM
Post subject: deployment to oc4j
I still have the same problem. I could not launch the jsp page after I successfully deployed my web project from my eclipse to oc4j.

The error message from browser is: http 404 error. I have spent hours doing the research and modify the server.xml by adding auto deployment entry. It won't help.

Please give me help.

Mark
support-scott - Dec 23, 2004 - 08:05 PM
Post subject:
Mark,

Does the server report that it loaded your application in the log? If not, that's the cause of your error. If so, it's possible that you're referencing it under the wrong web context name or your application simply is misconfigured. Also please note that OC4J does not support exploded deployment, so you'll need to use packaged deployment for your application to be recognized by the server.

Lots of additional information can be found in our Application Server Quickstart and our Web Development Quickstart, which are located in the Documenation section here: http://www.myeclipseide.com/ContentExpress-display-ceid-67.html
Necron99 - May 12, 2005 - 10:12 PM
Post subject:
support-scott wrote:

1) Create a web project and an EAR to contain it.


Scott, could you (or someone) please expand on how this is done, or point me to where it is explained? I have never created an EAR to contain anything. I've been through the tutorials and it is not readily apparent to me how to create an EAR after the fact.

I already have a Web Project and I need to deploy to OC4J. I can do this by editing applications.xml and http-web-site.xml and manually copying a .war into <oc4j_home>/applications. I'd rather do it from within MyEclipse.

Thank you very much,
Dave
support-rkalla - May 12, 2005 - 11:45 PM
Post subject:
Quote:

I've been through the tutorials and it is not readily apparent to me how to create an EAR after the fact.

Necron anything we step you through will just be straight from the tutorial, when you use the deployment tool on an Enterprise Application Project, the EAR is created for your and deployed out to the app server. That is where it comes from. Just add your projects as "modules" to the EAR and MyEclipse will take care of the rest.
Necron99 - May 13, 2005 - 03:43 PM
Post subject:
Thank you, Riyad. I did the following:
Now my new question: Do I have to change a configuration file somewhere for OC4J (Orion) to recognize the newly deployed project? Accessing http://localhost:8888/<NewEARProject> returns a 404. Normally, OC4J is looking at <OC4J_HOME>/applications for it's root. The newly deployed project is in <OC4J_HOME>/application-autodeploy.

Thanks again,
Dave
support-scott - May 13, 2005 - 03:56 PM
Post subject:
Dave,

Sometimes Oracle isn't defaulted to auto-deploy. Please check the server.xml file in the installation and add this if it's not present.
Code:

<application-server application-directory="../applications"
 application-auto-deploy-directory="../application-autodeploy"
 deployment-directory="../application-deployments"
>

support-rkalla - May 13, 2005 - 03:57 PM
Post subject:
Dave,
Some J2EE app servers (like WebSphere) require that you fire up the adaministrative console and "deploy" the application into the app server before it is loaded... OC4J might be the same way.
Necron99 - May 13, 2005 - 05:27 PM
Post subject:
support-rkalla wrote:
Some J2EE app servers (like WebLogic) require that you fire up the adaministrative console and "deploy" the application into the app server before it is loaded... OC4J might be the same way.

OC4J has no administrative console. However, Scott's change to server.xml above was the key.

Initially, this didn't work and I spent hours doing research until I realized that I had to have Packaged Archive instead of Exploded Archive selected. Now all is as well in OC4JLand as it can be.

Thanks to both Riyad and Scott for your help.

Dave
support-scott - May 17, 2005 - 06:13 PM
Post subject:
Dave,

Quote:

I realized that I had to have Packaged Archive instead of Exploded Archive selected.

Darn! I should've mentioned that. I just slipped my mind. OC4J just doesn't support exploded archive formats. Sorry about that.
mheir - May 18, 2005 - 05:25 PM
Post subject:
All,

OC4J *does* support expanded deployment directories. Please see this article by Oracle's Debu Panda:

http://radio.weblogs.com/0135826/2004/05/17.html#a30
mheir - May 18, 2005 - 05:51 PM
Post subject:
Also, for more information, please see:

http://www.oracle.com/technology/docs/tech/java/oc4j/htdocs/getstart.htm#1023376

http://forums.oracle.com/forums/thread.jsp?forum=46&thread=290372&message=903299
dshitzu1 - Nov 16, 2006 - 07:04 PM
Post subject:
Is there an example ANYWHERE that shows how to create WebApplication in MyEclipse 5 and deploy it to OC4J 10.1.2??
support-rkalla - Nov 16, 2006 - 07:34 PM
Post subject:
dshitzu1,
There is no document that covers specific deployment to OC4J, the steps of:

1) Creating web application
2) Creating deployment
3) Running application

are all exactly the same for all the app servers. The only different is that you need to setup the Oracle connector to launch OC4J. Other than that, all the other documentation is identical across all the app servers (you use the same deployment tool, same run/stop/restart tool, and so on).

Is there a specific problem you have been having setting up OC4J?
dshitzu1 - Nov 16, 2006 - 07:44 PM
Post subject:
Thanks for all of your help. I believe the problem is with OC4J v.10.1.2 . I think creating a build.xml file may be the way to go since there are no examples of deploying to this particular version of the app server from MyEclipse 5.0 and nothing I've tried over the last 2 days works.
support-rkalla - Nov 16, 2006 - 08:01 PM
Post subject:
Well I haven't really helped much yet... can you tell me exactly the problems you are having with deployment? There are only two ways to deploy, packaged (WAR) or exploded (just a direct copy of your WebRoot over). We had some JSP-debugging questions earlier on in the year so I played with 10.1.3 to make sure I could get it working and didn't have any problems with the out of the box copy, but I didn't happen to spend time with 10.1.2, so I wonder what the problem might be.

Is it a startup problem maybe? (errors during app server startup)
dshitzu1 - Nov 16, 2006 - 11:41 PM
Post subject:
Riyad,
I've created a build.xml file that deploys to OC4J v.10.1.2 without complaint. The ear file is exploded and the directory structure appears to be correct. HOWEVER (and I don't know if anyone here can help with this), the browser URL continually comes up with a 404 message.
Here are my entries in the revelant OC4J config. files:
server.xml = <application name="CMS" path="../applications/CMS.ear" auto-start="true" />
http-web-site.xml = <application name="CMS" path="../applications/CMS.ear" auto-start="true" />

The directory structure for the application is:
C:\oc4j\j2ee\home\applications (root)
\CMS
..\CMS-web
CMS-web\index.html
CMS-web\doc
CMS-web\META-INF
CMS-web\WEB-INF
CMS\META-INF

The URLs I've tried are:
localhost:8888\CMS\
localhost:8888\CMS-web\
etc. etc.
All return 404 not found....


There are welcome files defined in the web.xml file. I'm at a loss but maybe it will be better tomorrow.

Thanks!
support-rkalla - Nov 17, 2006 - 01:59 AM
Post subject:
Normally most Java app servers run on 8080, did you setup OC4J to run on 8888? (Or does it by default? I'm not terribly familiar with it)
dshitzu1 - Nov 17, 2006 - 04:59 PM
Post subject:
Riyad,
I got it - the port was not used. On another note, I've imported 2 projects into MyEclipse 5.0 . There are only source files - no compiled classes. I cannot get the 'build' or 'build all' or 'build automatically' to work on these apps. What do I need to set to get these items to work like they work with projects I create?
support-rkalla - Nov 17, 2006 - 05:05 PM
Post subject:
I need more information as to what "cannot get it to work" means... are there compilation errors?If you have build path errors in the problem view, what do they say? If you imported these projects from an older install, you might have an older JRE referenced on your build path, that no longer exists in this new install or something like that which will stop the entire project from building.
badgerduke - Jan 20, 2009 - 08:16 PM
Post subject: Maven?
Hello:

I am following all the helpful exceptions but I'm using a Maven (with MyEclipse 7.0) project. if I set my pom.xml to produce an EAR file, will MyEclipse deploy an EAR to OC4J?

Thanks
Eric
support-rkalla - Jan 23, 2009 - 07:26 PM
Post subject: RE: Maven?
Eric,

If you use the MyEclipse deployment tool on an enterprise application project, yes it will create an EAR. If you are creating an EAR with Maven, you will have to manually deploy that -- MyEclipse's deployment tool doesn't pay attention to Maven artifacts, it generates it's own based on the J2EE spec.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits