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 118603 - Unable to deploy EAR to SJSAS 9.1 because of .svn folder?
Summary: Unable to deploy EAR to SJSAS 9.1 because of .svn folder?
Status: RESOLVED WORKSFORME
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-10-11 20:11 UTC by rdelaplante
Modified: 2008-03-05 03:46 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2007-10-11 20:11:29 UTC
Building jar: D:\dev\MyProject\MyProjectEAR\dist\MyProject.ear
post-dist:
dist:
pre-run-deploy:
Checking for missing JDBC drivers ...
Start registering the project's server resources
Finished registering server resources
Initial deploying MyProjectEAR to D:\dev\MyProject\MyProjectEAR\dist\gfdeploy
Error during incremental deploy: java.io.FileNotFoundException:
D:\dev\MyProject\MyProjectEAR\dist\gfdeploy\MyProjectWeb_war\.svn\entries (The system cannot find the path specified)
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.GeneratedMethodAccessor228.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:326)
        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: 14 seconds)
Comment 1 rdelaplante 2007-10-11 20:58:30 UTC
I manually undeployed the app from SJSAS, then tried the "Undeploy and Deploy" command.  It still gave me the error, but
did deploy.

I tried a few more times and the most recent time the error was gone, but SJSAS shows an error:

java.io.FileNotFoundException: D:/dev/MyProject/MyProjectEAR/dist/gfdeploy
        at com.sun.enterprise.deployment.deploy.shared.FileArchive.open(FileArchive.java:79)
        at com.sun.enterprise.instance.AppsManager.getAppDescriptor(AppsManager.java:355)
        at com.sun.enterprise.server.ApplicationLoader.<init>(ApplicationLoader.java:112)
        at com.sun.enterprise.server.TomcatApplicationLoader.<init>(TomcatApplicationLoader.java:88)
        at
com.sun.enterprise.server.pluggable.TomcatApplicationLoaderFactory.createApplicationLoader(TomcatApplicationLoaderFactory.java:63)
        at com.sun.enterprise.server.ApplicationManager.getLoader(ApplicationManager.java:166)
        at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:201)
        at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:217)
        at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:442)
        at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:120)
        at com.sun.enterprise.server.PEMain.run(PEMain.java:411)
        at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)

My app is deployed, and seems to be running fine?
Comment 2 rdelaplante 2007-10-11 21:01:12 UTC
These issues might be because I am bringing a NB 5.5.1 project over to NB 6.0, and replacing the NB 5.5.1 deployed
projects with the newly built NB 6.0 projects
Comment 3 rdelaplante 2007-10-11 21:23:32 UTC
I've learned some more.  In order to deploy without errors I first have to manually undeploy the project from the app
server, restart the app server, then use the "Undeploy and Deploy" menu item.  If I don't restart the app server, I
still get the errors.
Comment 4 Nitya Doraisamy 2007-10-12 00:31:46 UTC
Could you please attach the project that is causing the deploy failure. 
Comment 5 rdelaplante 2007-10-12 03:28:38 UTC
I'm sorry I cannot provide the project. It is a large closed source system with many dependencies.  Maybe I could create
a new EAR and if it has the same problems, I could attach it.  Inside the EAR is an EJB module project, two VWP
projects, and the dependencies.
Comment 6 Vince Kraemer 2007-10-12 15:27:25 UTC
regarding the comment from rdelaplante Thu Oct 11 20:23:32 +0000 2007....

Do you need to go through this 'undeploy, stop server, start server, "undeploy and deploy"' process when you want to
redeploy the app... after you have gotten it to deploy with this process initially?

Comment 7 rdelaplante 2007-10-12 15:34:15 UTC
I only did it two or three times yesterday, but yes I had to do that every time. 
Comment 8 rdelaplante 2007-10-12 15:37:49 UTC
I know I ran into this a couple of times:

"undeploy and deploy", error message, go to glassfish to try to undeploy but the app has already been undeployed,
"undeploy and deploy", error message, restart glassfish, "undeploy and deploy", either success or error message (I
forget) but the app works.

And later:

manually undeploy from glassfish, "undeploy and deploy", error message, restart glassfish, "undeploy and deploy", either
success or error message (I forget) but the app works.


I didn't really understand what was happening and was experimenting with different steps in different orders.
Comment 9 Nitya Doraisamy 2007-10-17 19:37:03 UTC
I have not been able to reproduce this issue. 
Are you still seeing this error? Could you try to deploy this project on a clean appserver and list the steps and
behavior you are seeing. 
Comment 10 rdelaplante 2007-10-17 19:53:31 UTC
Funny you ask.. I forgot about this issue because I haven't noticed it lately.  However I haven't been deploying that
app much, and have been restarting the app server semi-frequently because of file locking issues.  When I try to do
builds, or clean-builds it fails because it can't delete files.  I just tried an "Undeploy and Deploy" on the EAR now
and got this exception:

Initial deploying MyProjectEAR to D:\dev\MyProject\MyProjectEAR\dist\gfdeploy
Error during incremental deploy: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot delete file
velocity-dep-1.5.jar in D:/dev/MyProject/MyProjectEAR/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.GeneratedMethodAccessor339.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:326)
        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: 5 seconds)

I stopped the app server and was able to do a build.  I started the app server back up, and "Undeploy and Deploy". It
worked, and I was able to run my app.  Without restarting the app server, I tried to "Undeploy and Deploy" again.  It
gave the same exception.

Maybe it was just a fluke that it chose the .svn folder when I originally created the ticket.  Now it's complaining
about velocity-dep-1.5.jar.  I still wonder why I did not have this problem on NB 5.5.1 but do on 6.0.

Regarding trying with a clean app server, I'll have to make some time to do that this week. I'll have to install
Glassfish on an other computer and set it all up etc.
Comment 11 rdelaplante 2007-10-17 19:56:47 UTC
I forgot to show the second exception, the one while deploying to the app server. I said it was the same exception, but
it turns out the stack dump is slightly different.  It is still complaining about deleting the velocity-deps file.

Undeployment of application MyProjectEAR  completed successfully
All operations completed successfully
Initial deploying MyProjectEAR to D:\dev\MyProject\MyProjectEAR\dist\gfdeploy
Error during incremental deploy: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot delete file
velocity-dep-1.5.jar in D:/dev/MyProject/MyProjectEAR/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.GeneratedMethodAccessor339.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:326)
        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: 2 seconds)
Comment 12 Nitya Doraisamy 2007-10-18 10:28:16 UTC
This does seem related to Windows file locking issues. Will investigate some more.
Comment 13 Nitya Doraisamy 2007-10-24 18:45:45 UTC
Unable to consistently reproduce this issue. Happens randomly on redeploy or clean of a deployed project. 
Did not see this any issues at all, if deployed after disabling Directory Deployment.

rdelaplante, could you deploy this project after disbling Directory Deployment? Services->GlassFish
V2->Properties->Options->Directory Deployment Enabled checkbox.

Comment 14 rdelaplante 2007-10-24 19:29:09 UTC
Yes this helped, I don't have to restart Glassfish every time I want to try a change now! Thanks.
Comment 15 Nitya Doraisamy 2007-10-26 00:14:52 UTC
WA - disabling directory deployment works. Will file an IZ against GlassFish regarding this behavior.
Downgrading to P3.
Comment 16 tjquinn 2007-10-26 14:31:46 UTC
There is a long history of file locking problems on Windows.  I have blogged about it in connection with GlassFish and
posted a tool that helps diagnose the cause of such lock-ups here
http://blogs.sun.com/quinn/entry/tool_for_diagnosing_failed_glassfish.

In the more recent file-locking variation of this problem does the GlassFish server.log contain anything helpful?

Clearly, some code somewhere is opening a stream to the JAR and not closing it.  The tool I mentioned helps to pinpoint
the code that opens the JAR.  

The reason this behavior is intermittent is that garbage collection can trigger finalizers that close the files. If GC
has run, then a subsequent delete or rename might work; if it has not run then the JAR might remain open thereby causing
the next delete or rename attempt to fail.  Because the memory usage in GlassFish can vary greatly depending on what is
asked of it and in what order, the problem can seem to come and go with no apparent pattern.  Truly maddening.

If GlassFish itself or code that GlassFish invokes (such as the application or a third-party library) is opening the
JAR, then the tool will show where and that's the first step in understanding this problem.  If you use the tool please
follow the instructions carefully to get the most focused output and post it here.

- Tim
Comment 17 rdelaplante 2007-11-22 18:21:13 UTC
This is still an issue on RC2. Even if file locking issues are GlassFish issues, shouldn't NetBeans not be doing a stack
dump of a NullPointerException?
Comment 18 Petr Jiricka 2007-11-23 07:54:27 UTC
In an earlier comment by Nitya, it soulds like the root cause needs to be fixed on the GlassFish side. Has a bug against
GF been filed? Thanks.
Comment 19 Vince Kraemer 2007-12-07 16:21:15 UTC
please close this issue if you forgot to earlier.  If this issue is still open,
please change the target milestone to reflect the current commitment.
Comment 20 Nitya Doraisamy 2008-02-29 07:14:31 UTC
Will try to reproduce this again with the latest server versions and close/update accordingly.
Comment 21 Nitya Doraisamy 2008-03-05 03:46:25 UTC
Tested several times with various applications. Cannot reproduce.
Closing.