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 125132 - Directory deployment of enterprise app fails
Summary: Directory deployment of enterprise app fails
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-11 18:34 UTC by Vince Kraemer
Modified: 2008-01-16 20:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
the stack traces... (4.98 KB, text/plain)
2008-01-11 18:34 UTC, Vince Kraemer
Details
initial cut at a patch (2.35 KB, text/plain)
2008-01-13 07:13 UTC, Vince Kraemer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2008-01-11 18:34:12 UTC
steps to reproduce

1. register GF
2. create an ent app with a web app sub project that targets the GF domain registered in step 1.
3. use clean on the ent app project.
4. start the GF domain
5. Use the Ent App project's Run item.

  See the attached stack traces.
Comment 1 Vince Kraemer 2008-01-11 18:34:52 UTC
Created attachment 54962 [details]
the stack traces...
Comment 2 Vince Kraemer 2008-01-11 18:37:52 UTC
looks like it is related to the code changes being discussed here:
http://www.netbeans.org/servlets/BrowseList?list=nbdev&by=thread&from=827178
Comment 3 Vince Kraemer 2008-01-13 07:13:35 UTC
Created attachment 54999 [details]
initial cut at a patch
Comment 4 Vince Kraemer 2008-01-13 07:18:35 UTC
I added the following patch to my build... and I cannot reproduce the failed deployment.

There is a new warning trace, but the deployment is successful.

WARNING: externally created folder: /Users/vbk/NetBeansProjects/EnterpriseApplication52/EnterpriseApplication52-war/dist
        at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FolderObj.getFileObject(FolderObj.java:120)
        at org.openide.filesystems.FileObject.getFileObject(FileObject.java:667)
        at org.openide.filesystems.FileUtil.createFolder(FileUtil.java:423)
        at org.openide.filesystems.FileUtil.createData(FileUtil.java:488)
        at org.openide.filesystems.FileUtil.createData(FileUtil.java:220)
        at org.netbeans.spi.project.support.ant.PropertyUtils.resolveFileObject(PropertyUtils.java:572)
        at org.netbeans.spi.project.support.ant.AntProjectHelper.resolveFileObject(AntProjectHelper.java:1112)
        at org.netbeans.modules.web.project.ProjectWebModule.getFileObject(ProjectWebModule.java:276)
        at org.netbeans.modules.web.project.ProjectWebModule.getArchive(ProjectWebModule.java:270)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule.getArchive(J2eeModule.java:169)
        at org.netbeans.modules.j2ee.earproject.ProjectEar$IT.<init>(ProjectEar.java:378)
        at org.netbeans.modules.j2ee.earproject.ProjectEar$IT.<init>(ProjectEar.java:367)
        at org.netbeans.modules.j2ee.earproject.ProjectEar.getArchiveContents(ProjectEar.java:195)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule.getArchiveContents(J2eeModule.java:180)
        at
org.netbeans.modules.j2ee.deployment.impl.InitialServerFileDistributor.distribute(InitialServerFileDistributor.java:118)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.initialDistribute(TargetServer.java:186)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:518)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:148)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
Comment 5 Milan Kubec 2008-01-14 09:14:44 UTC
Does it really fail or just print warning and info exception?
Comment 6 Jesse Glick 2008-01-14 13:27:19 UTC
Patch looks wrong.

Bug is probably in j2ee.ant.Deploy which should use FileObject/System.refresh before working with Filesystems API on
possibly externally modified files.
Comment 7 Vince Kraemer 2008-01-14 16:03:19 UTC
without my patch: deployment fails, warning and info stack traces.

with my patch: deployment is successful, warning stack trace.

Patch wrong: I agree. I was showing a what worked for me... not a final solution.

Moving patch out to j2ee.ant.Deploy: That code isn't directly calling toFileObject()... it seems like you are asking all
the clients of spi/project/support/ant/AntProjectHelper.java to compensate for an unguarded use of toFileObject() in
spi/project/support/ant/PropertyUtils.java....  
Comment 8 Vince Kraemer 2008-01-14 20:42:13 UTC
Changing code in j2ee.ant.Deploy:  Do you mean I should add another/different refresh call to the execute method?

There is already one in that method... before the call to toFileObject() in PropertyUtils.java...

See: line 96 of
http://www.netbeans.org/source/browse/j2eeserver/ant/antsrc/org/netbeans/modules/j2ee/ant/Deploy.java?annotate=1.21
Comment 9 Jesse Glick 2008-01-14 20:44:28 UTC
Maybe you need to refresh the whole filesystem.
Comment 10 Milan Kubec 2008-01-15 12:34:17 UTC
Please see issue #125090, it describes similar problem and Radek Matous fixed behavior of FileUtil.toFileObject() to
work the same way as before the change. Please, get a new build and try the testcase again to see if it's still
reproducible. Thanks.
Comment 11 Vince Kraemer 2008-01-15 17:58:44 UTC
I just did a full update and tried it... it appears that Radek's change did not resolve the issue in
AntProjectHelper.resolveFileObject().
Comment 12 Milan Kubec 2008-01-16 09:09:36 UTC
resolveFileObject() method used shortcut way to resolve FileObject in some cases, now it uses only backward compatible
way. For details see also issue #125090.

Checking in PropertyUtils.java;
/cvs/ant/project/src/org/netbeans/spi/project/support/ant/PropertyUtils.java,v  <--  PropertyUtils.java
new revision: 1.41; previous revision: 1.40
done
Comment 13 Vince Kraemer 2008-01-16 20:31:48 UTC
yup