- This topic has 20 replies, 2 voices, and was last updated 18 years, 1 month ago by Anthony Estelita.
-
AuthorPosts
-
Anthony EstelitaMemberI have the following workspace:
myEar (ear project)
myWeb (web project)
myEJB (ear project)
myClient (java project)Issue #1:I have a dependent java project that only gets updated when I do a clean on my ear project. If I go to my deployment directory I can see the myClient.jar file; however, it doesn’t get updated if I modify any file in the myClient project (even if I do a clean of the myClient java project). I have the MyEclipse-EAR settings to “Jar dependent Java Project”. Is there any way to have this jar project get built automatically without having to do a clean of the myEar project. The clean of the EAR project takes forever because it has to re-deploy all my projects. 🙁
Issues #2:
I have a jar’d EJB that needs to get deployed with my server. I don’t have any problems deploying and using the external JAR; however, whenever I do a clean of my ear project the application.xml file gets changed which prevents the external JAR from being deployed when my server boots.
My Ear project has the following files:
MyEar
—META-INF
——lib
—externalEJB.jar
and my application.xml setting has the following settings (to deploy the externalEBJ.jar):
<module>
<ejb>externalEJB.jar</ejb>
</module>
whenever I do a clean the application.xml file (on my server, not the one in my project) gets updated to
<module>
<ejb>externalEJB</ejb>
</module>
without the “.jar” extension; weblogic will fail to find/deploy the externalEJB. 🙁 I verified that I do have the settings to “Do not modify ‘application.xml'” checkbox in the MyEclipse-EAR settins of my ear project. Any ideas what would cause this?Greatly appreciated any idea/help you may have,
Anthony
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Configuraiton Summary Information:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** Date: Wed Mar 15 15:50:58 PST 2006*** System properties:
OS=WindowsXP
OS version=5.1
Java version=1.5.0_06*** MyEclipse details:
MyEclipse Enterprise WorkbenchVersion: 4.1.1 GA
Build id: 20060228-4.1.1-GA*** Eclipse details:
Eclipse SDKVersion: 3.1.2
Build id: M20060118-1600Eclipse Platform
Version: 3.1.2
Build id: M20060118-1600Eclipse RCP
Version: 3.1.2
Build id: M20060118-1600Eclipse Java Development Tools
Version: 3.1.2
Build id: M20060118-1600Eclipse Plug-in Development Environment
Version: 3.1.2
Build id: M20060118-1600Eclipse Project SDK
Version: 3.1.2
Build id: M20060118-1600Eclipse startup command=-os
win32
-ws
win32
-arch
x86
-launcher
c:\eclipse\eclipse.exe
-name
Eclipse
-exitdata
b64_7cc
-vm
C:\Program Files\Java\jre1.5.0_06\bin\javaw.exeThe EarProject has
Riyad KallaMemberIssue #1:I have a dependent java project that only gets updated when I do a clean on my ear project. If I go to my deployment directory I can see the myClient.jar file; however, it doesn’t get updated if I modify any file in the myClient project (even if I do a clean of the myClient java project). I have the MyEclipse-EAR settings to “Jar dependent Java Project”. Is there any way to have this jar project get built automatically without having to do a clean of the myEar project. The clean of the EAR project takes forever because it has to re-deploy all my projects. 🙁
Unfortunately no. The redeploy of the JAR is triggered from the EAR->Java project. Which project really needs the Java code? Your Web or EJB project or both?
As for Issue #2, I wasn’t able to reproduce this. Try this on your end and see if it still does it:
1) Create a new Enterprise Application Project, create a new Web and EJB project as part of the Wizard
2) Drop a random JAR into the root of your EAR, edit your application.xml file to add it with module/ejb tags like you have above.
3) Change your MyEclipse-EAR settings to tell it to leave the file alone, hit OK.Now clean/deploy your project. Check the application.xml file, is it changed? If not, can you make it change? I’ll try and dupe it over here if you can.
Anthony EstelitaMemberRegarding:
Issue #1:
The dependent java project is used by both the EJB and the web project. Both projects have the java client project as a “project reference”. I was going to play around with the setting to merge the dependent project output into the EJB and web projects, but I am afraid that this may cause a class mismatch, serialization, or class cast exceptions (for example, if one of the classes in the java client project is passed from the web project to the EJB project). Too bad that the only way to get the client jar recreated is to do a clean of the ear project (painfully slow). 🙁Issue #2:
The strange thing about this issue is that the application.xml in my ear project is correct, it is the one that gets deployed to my server that gets changed. It is a simple fix, all I do is add a character to my project file and delete it, and when I hit save the server gets properly updated. I did a little research and here are the steps that I can do to always recreate this:
1. Do a refresh and clean of the EAR project
2. After it does the “DeploymentBuilder” of the ear project
3. Quickly verify that the server’s application.xml file is correct
4. After the “Building Workpace” finishes deploying all the web projects and the ejb projects
5. The server’s application.xml file gets changedI also created a new ear project and I did the following:
1. Associate just one of the existing web projects
2. Copy the third party EJB to the root of the new ear project
3. Modify the new ear projects application.xml to have
<module>
<ejb>thirdPartyEJB.jar</ejb>
</module>
4. Make sure the ear projects setting to “do not modify the application.xml” file
5. Click the “Deploy Project to server” button and add a deployment.
6. Look at the new ear projects on the server and verify that the application.xml is missing the .jar from the thirPartyEJB.jar setting. UGH. :-((I also tried the following
1. From the new ear project that I created above, remove all dependent web projects (this will result in an error but will not prevent the ear from being deployed to the server).
2. Do a clean on the new ear project
3. And again the server’s deployment application.xml file is missing the “.jar”Not sure if it will help any but here is the contents of my application.xml
PROJECT:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> <display-name>My.ear2</display-name> <module> <ejb>thirdParty_EJB.jar</ejb> </module> </application>
DOMAIN:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> <display-name>My.ear2</display-name> <module> <ejb>thirdParty_EJB</ejb> </module> </application>
Hopefully this helps??? 🙂
Thank you,
Anthony
Riyad KallaMemberIssue #1:
The dependent java project is used by both the EJB and the web project. Both projects have the java client project as a “project reference”. I was going to play around with the setting to merge the dependent project output into the EJB and web projects, but I am afraid that this may cause a class mismatch, serialization, or class cast exceptions (for example, if one of the classes in the java client project is passed from the web project to the EJB project). Too bad that the only way to get the client jar recreated is to do a clean of the ear project (painfully slow). 🙁I believe each module get’s it’s own classloader… you might try it just to see what happens.
Ahh ok so this problem is occuring after you deploy, I wonder if the app server is doing it. Try downloading JBoss and deploy to it as a test and see if it changes the application.xml file or leaves it along. (just download JBoss zip and unzip it, then setup the connector and deploy your ear)
SILLY BRAINSTORM: Each time you deploy, is the TIMESTAMP on the application.xml file in your app server deployment dir changing? I just realized that it might be a old file that isn’t getting updated, so I’m curious if the time stamp is changing on it (signifying it is getting updated).
Anthony EstelitaMemberUnfortunately big brother doesn’t allow us to download and install unapproved software anymore. 🙁
I thought about what you said about maybe it being the application server so I did one more test, this time I stopped my server (I wasn’t 100% sure if my WebLogic server was running before). And I did a clean of the ear project and it still changed the application.xml file. UGH. 🙁
Riyad KallaMemberOk let’s try this, open up the deployment dialog window, select your deployment and hit Browse (should popup an explorer window). Now go back to the deployment tool and hit remove (make sure weblogic is stopped for all of this).
Now switch to the navigator window that popped up and verify that your app isn’t anywhere in sight, exploded or in EAR format. Now go back to MyEclipse, redeploy your EAR, switch back to window and verify it’s there. Now use WinZip or any other ZIP program to open the EAR, find the application.xml file, does it have the JAR in it?
Anthony EstelitaMemberAfter I deleted the app I only had two things in my applications directory (a .wlnotdelete a readme.txt).
First Test:
I told the Deployment window to use a .ear file
1. I opened up the .ear file in winzip, and the application.xml file had the .jar extension for my third party ejb.
2. I then did a clean of my ear project and it didn’t appear to do anything (nor did the timestamp change on the .ear file).Second Test:
I did a remove again, and this time I told it to use an Exploded archive.
1. I opened up the applicaion.xml file from the exploded archive directory and it was missing the gosh darn .jar extension from my third party ejb. :-((So it looks like it works for archived .ear files but not for an exploded archive.
Hope this helps some!
Anthony
Riyad KallaMember2. I then did a clean of my ear project and it didn’t appear to do anything (nor did the timestamp change on the .ear file).
It won’t with packaged deployments, you have to initiate redeployments manually.
So far so good…
I did a remove again, and this time I told it to use an Exploded archive.
1. I opened up the applicaion.xml file from the exploded archive directory and it was missing the gosh darn .jar extension from my third party ejb. :-((Hmm! And you are absolutely certain that the directory that was created due to the deployment (usually something like YourApp.EAR) was not there before you did the redeployment?
If you are certain, can you email a sample project to support@genuitec.com ATTN Riyad, with a link to this thread and I will try it over here and see what is going on. I checked with a developer about this when you first reported it and he was almost certain that the only code that exists that processes the application.xml file is inside of the Add/Remove module wizard and had no idea why this was happening. So I’m not ruling out general weirdness.
Have you tried restarting your computer or restarting Eclipse using the -clean command line argument? ALSO, have you tried an exploded deployment to a Custom location to make sure the directory is new? And lastly, was the app server running when you did the exploded deployment or was it shut down?
Anthony EstelitaMemberI sent you an email; however, I haven’t heard anything back (not sure if you ever got it or not). 🙁 Anyway, I did a few further tests that may help:
I noticed that the application.xml wouldn’t be updated till the end of the clean’s progress, so right after I issued the clean command I changed the permissions on the file to see if an error would be thrown. And voila three errors were thrown:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error #1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java.io.FileNotFoundException: c:\bea\user_projects\domains\enterprise\applications\concorde.ear\META-INF\application.xml (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileWriter.<init>(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.ā(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.updateDeploymentDescriptorIfNeeded(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.resyncAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.earProjectBuildAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.buildAll(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.build(Unknown Source)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error #2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
java.io.IOException: Unable to open file c:\bea\user_projects\domains\enterprise\applications\concorde.ear\META-INF\application.xml for writing.
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:740)
at org.apache.commons.io.FileUtils.copyFileToDirectory(FileUtils.java:700)
at org.apache.commons.io.FileUtils.copyFileToDirectory(FileUtils.java:674)
at com.genuitec.eclipse.ast.deploy.core.Deployment.resourceChanged(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.resourceChanged(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.ProjectDeltaVisitor.visit(Unknown Source)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:56)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.earProjectBuildDelta(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.earProjectBuildDelta(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.buildDelta(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.build(Unknown Source)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error #3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
org.eclipse.core.runtime.CoreException[0]: com.genuitec.eclipse.core.GenuitecCoreException: Unable to open file c:\bea\user_projects\domains\enterprise\applications\concorde.ear\META-INF\application.xml for writing.
at com.genuitec.eclipse.ast.deploy.core.Deployment.resourceChanged(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.EARDeployment.resourceChanged(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.ProjectDeltaVisitor.visit(Unknown Source)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:56)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.earProjectBuildDelta(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.earProjectBuildDelta(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.buildDelta(Unknown Source)
at com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder.build(Unknown Source)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:593)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:168)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:202)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:231)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:234)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:253)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:282)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:139)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Caused by: java.io.IOException: Unable to open file c:\bea\user_projects\domains\enterprise\applications\concorde.ear\META-INF\application.xml for writing.
at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:740)
at org.apache.commons.io.FileUtils.copyFileToDirectory(FileUtils.java:700)
at org.apache.commons.io.FileUtils.copyFileToDirectory(FileUtils.java:674)
… 24 more~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hopefully this will help your developers. 🙂Thank you,
Anthony
Anthony EstelitaMemberOops I did get your email (THANK YOU); stupid outlook flagged the email as spam (SORRY). Anyway I hope this information helps some. 🙂
Riyad KallaMemberThis one is a doosey but that was a really smart trick you did with the read-only flag, I’ve filed this bug for us to look into.
Riyad KallaMemberThis thread has gotten quite long so I need a quick refresher.
Did we try and deploy your project to a custom location and see if the application.xml file still gets changed? I want to remove weblogic from this process completely.
The reason I ask is I still can’t reproduce this.
Anthony EstelitaMemberTo tell you the truth I don’t quite recall neigher myself. Here is what I just tried:
1. Deploy the Enterprise Project with a server type as “Custom Location” and deploy it in the same directory (C:\bea\user_projects\domains\enterprise\applications)
a) The problem still exists2. Deploy the Enterprise Project with a server type as “Custom Location” and deploy it in a temp directory(C:\foo)
a) The problem still exists3. Deploy the Enterprise Project with a server type as “Externally Launched” and deploy it in a temp directory(C:\foo)
a) The problem still exists4. Deploy the Enterprise Project with a server type as “Custom Location – Suffixed” and deploy it in a temp directory(C:\foo\project.ear)
a) The problem does not exist5. Re-try Deploy the Enterprise Project with a server type as “Custom Location” and deploy it in a temp directory(C:\foo\project.ear)
a) The problem still exists (I was hoping that since it finally worked the others would now work) 🙂2. Deploy the Enterprise Project with a server type as “Custom Location” and deploy it in a default directory(c:\Program Files\project.ear)
a) The problem still exists (had to give this puppy a try too) 🙁NOTE: The project is called “project.ear” this is the name of the exploded directory too (even though it has a “.ear” in it’s NAME this is not an archived file)
Riyad KallaMemberIs there any way you can create a little set of projects that exhibit this problem then export all of them into a ZIP and email it to me? I have tried this 3 times now on two different machines with just a random JAR each time and cannot get it to rip off the .JAR extension in the application.xml file.
Riyad KallaMemberAnthony,
Do you have the time to download Eclipse 3.2M6 and MyEclipse 5.0M1 and try to see if this works now? I’ve been testing this test case internally and it seems to be fine, it’s not ripping the .jar extension off anymore. -
AuthorPosts