This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 124728 - run ent app followed by undeploy and deploy fails
Summary: run ent app followed by undeploy and deploy fails
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Infrastructure (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 116790 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-04 20:17 UTC by Vince Kraemer
Modified: 2008-02-20 18:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
first pass at a patch (3.44 KB, text/plain)
2008-01-04 20:23 UTC, Vince Kraemer
Details
new patch (6.65 KB, text/plain)
2008-01-07 22:20 UTC, Vince Kraemer
Details
patch without need of binary file, some other issues fixed (6.11 KB, text/plain)
2008-01-09 16:56 UTC, Petr Hejl
Details
gf v2 ur1 server log file with the exceptions (42.07 KB, text/plain)
2008-01-22 14:14 UTC, nouar38
Details
message.log with many warnings messages (286.50 KB, text/plain)
2008-01-22 14:52 UTC, nouar38
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2008-01-04 20:17:02 UTC
against GF v2 b58g

steps to reproduce

1. create an ent app with a web app
2. add struts to the web app
3. change the welcome file list to open welcomeStruts.jsp by default for the web app
4. run the app... 
   the app deploys and runs and appears in the browser
5. make a change to the web app (optional)
6. use the 'Undeploy and Deploy' action.

See...
  ...
post-dist:
dist:
pre-run-deploy:
Undeploying ...
While undeploying, trying to stop application in target server  completed successfully
While undeploying, trying to remove reference for application in target server  completed successfully
Undeploying the application 
Trying to undeploy application from domain completed successfully
Undeployment of application EnterpriseApplication2  completed successfully
All operations completed successfully
Initial deploying EnterpriseApplication2 to C:\Users\vbk\Documents\NetBeansProjects\EnterpriseApplication2\dist\gfdeploy
Error during incremental deploy: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot delete file
antlr.jar in C:/Users/vbk/Documents/NetBeansProjects/EnterpriseApplication2/dist/gfdeploy.
Start registering the project's server resources
Finished registering server resources
Deployment error:
null
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor481.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.lang.NullPointerException
        at org.netbeans.modules.j2ee.sun.bridge.DirectoryDeployment.initialDeploy(DirectoryDeployment.java:320)
        at
org.netbeans.modules.j2ee.sun.ide.j2ee.incrdeploy.DirectoryDeploymentFacade.initialDeploy(DirectoryDeploymentFacade.java:210)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:508)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:148)
        ... 16 more
BUILD FAILED (total time: 0 seconds)
Comment 1 Vince Kraemer 2008-01-04 20:22:19 UTC
it looks like the root cause is the use of delete() in InitialServerFileDistributor.java 
Comment 2 Vince Kraemer 2008-01-04 20:23:21 UTC
Created attachment 54704 [details]
first pass at a patch
Comment 3 Petr Hejl 2008-01-07 21:04:14 UTC
Vince, can you elaborate bit more on the steps to reproduce please? I'm probably doing something wrong and I'm not able
to reproduce it.

Thanks.
Comment 4 Vince Kraemer 2008-01-07 21:16:26 UTC
are you using Windows?  That is the most important step.

At step four: use the Run item from the project's right-click menu.  You need to see the output of the welcomeStruts.jsp
page in the browser.

At step six: use the 'Undeploy and Deploy' item from the project's right-click menu.
Comment 5 Vince Kraemer 2008-01-07 22:20:54 UTC
Created attachment 54779 [details]
new patch
Comment 6 Vince Kraemer 2008-01-07 22:26:05 UTC
Notes on the new patch:

1. try to limit the work-around to windows only
2. try to overwrite jar and zip files that may be present... this is to try to prevent bleed through of old into new
deployment. I am not sure that old stuff could slip back into a deployment (say if you changed the name of a jar).

Comment 7 Vince Kraemer 2008-01-08 17:22:43 UTC
*** Issue 116790 has been marked as a duplicate of this issue. ***
Comment 8 Petr Hejl 2008-01-09 10:26:41 UTC
This is a bit suspicious - standalone webapp works fine, while webapp as a part of ear requires this workaround (maybe
it is not stopped before).
Comment 9 Petr Hejl 2008-01-09 11:05:12 UTC
When I follow the steps server has some trouble with deployment of the webapp. When the application is undeployed (after
that) the log shows the message "[WebContainer] Undeployment failed for context /EnterpriseApplication2-war
" and deployment fails with the stacktrace. Probably due to this the libs remains locked.

Will investigate further.
Comment 10 Vince Kraemer 2008-01-09 14:52:53 UTC
stand-alone fine; ear with struts has problem: Part of the reason for this is the stand-alone case doesn't have to go
through this copy everything to a new directory process.
Comment 11 Petr Hejl 2008-01-09 16:56:14 UTC
Created attachment 54880 [details]
patch without need of binary file, some other issues fixed
Comment 12 Petr Hejl 2008-01-09 16:57:09 UTC
If no objections, I will integrate the patch tomorrow morning.
Comment 13 Vince Kraemer 2008-01-09 17:18:40 UTC
I will put it through its paces today.  Your version is much cleaner... thanks.
Comment 14 Vince Kraemer 2008-01-09 20:52:31 UTC
my windows box has gotten corrupted... so i won't be able to test this today. I was seeing issues with my version of
this last night... but they were in an environment where I also saw  issue 124973... I don't trust the environment at
this point....
Comment 15 Petr Hejl 2008-01-10 09:34:24 UTC
Fixed. Maybe better solution could be to deploy to another dir when the jars are locked - just an idea, I'm not sure if
it can be done in a clean way.

Checking in InitialServerFileDistributor.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/InitialServerFileDistributor.java,v  <-- 
InitialServerFileDistributor.java
new revision: 1.24; previous revision: 1.23
done
Comment 16 Vince Kraemer 2008-01-16 21:22:50 UTC
finally got a rebuilt environment.  all good.
Comment 17 nouar38 2008-01-22 14:11:08 UTC
Tried over daily 200801220000 & GF v2 ur1 & jdk 1.6 u3 on windows/xp
But I cannot do the Run of the ear at step 4.
With Run (project) or Undeploy&Deploy, I'm getting a "Parsing error processing resource path /WEB-INF/struts-config.xml"

When I added struts Framework to the web App I've check the box Add Truts TLDs.


The deployment (Run, UndeployDeploy & Run many times) of the web application with struts 1.2.9 has no issue.
Joining the server log file in the attachement.


Comment 18 nouar38 2008-01-22 14:14:54 UTC
Created attachment 55368 [details]
gf v2 ur1 server log file with the exceptions
Comment 19 nouar38 2008-01-22 14:40:26 UTC
Tried again with another ear and web + struts in which I did not check the tld box, got the same error
for the ear deployment (web module) in 4.
Comment 20 nouar38 2008-01-22 14:41:37 UTC
adding myself in cc to receive the notification.
Comment 21 nouar38 2008-01-22 14:52:49 UTC
Created attachment 55370 [details]
message.log with many warnings messages
Comment 22 Petr Hejl 2008-01-22 15:28:09 UTC
nouar, behaviour you describe is the issue 116370
Comment 23 nouar38 2008-01-22 15:51:12 UTC
that's right I've looked to 116370, so how can this one be verified ? the two ones are related ?
Comment 24 Vince Kraemer 2008-01-22 16:39:12 UTC
use 'undeploy and deploy' on an ear that doesn't have a 'space in path'.  For example:

c:\Users\vbk\Documents\NetBeansProjects\Test124728

instead of

c:\Documents and Settings\vbk\Documents\NetBeansProjects\Test124728...
Comment 25 nouar38 2008-01-23 12:25:04 UTC
ok tried over an ear project created in c:\temp\EntAppTest124728 and all the steps described
in the Description are done with success, did 4/6, 5 times and all are ok.
thanks.
Comment 26 cambazz 2008-01-31 22:32:11 UTC
I have dont have spaces in my netbeansprojects folder path, but I still get the error.
Issue was marked verified fixed, what is the fix for it? do we have to download 6.1m1? download a patch?
Comment 27 Vince Kraemer 2008-01-31 22:49:34 UTC
you would need to get a build of NetBeans 6.1 created after Jan 10, 2008.

I have flagged this fix as a candidate for the next round of updates to NetBeans 6.0.1.

Comment 28 pgebauer 2008-02-07 16:59:18 UTC
The fix has been ported into the release601_fixes branch.

Checking in InitialServerFileDistributor.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/Attic/InitialServerFileDistributor.java,v  <-- 
InitialServerFileDistributor.java
new revision: 1.22.10.1; previous revision: 1.22
done