Support for Payara Server instance running on WSL breaks "Web Application" ant projects #8138
Labels
Ant
[ci] enable "build tools" tests
Java EE/Jakarta EE
[ci] enable enterprise job
kind:bug
Bug report or fix
Regression
This used to work!
Discussed in #8121
Apache NetBeans version
Apache NetBeans 24
What happened
A new unwanted directory is appearing in the build directory and so being included in the .war file
/build/web/WEB-INF/classesa/NetbeansProjects/jaffa/build/web/javascript/[various files here]
The folder contains files that are generated and written to the web directory during the build.
If I subsequently edit files in under the web directory of the project they start to appear in the classesa directory with additional directory tree structure
Language / Project Type / NetBeans Component
java ant web application project
How to reproduce
build/web/WEB-INF/
- you will see there is aclasses
directory but noclassesa
directory.-Make an edit to the
index.html
, save, and then review the contents ofbuild/web/WEB-INF/
- you will see there is now aclassesa
directory created with subdirectories that ultimately contain a copy of theindex.html
file.When files under the web directory are subsequently modified the classesa directory gets added to with the jsp files I have edited.
Did this work correctly in an earlier version?
Yes
Analysis
The issue was originally reported as issue #8119 which was converted to a discussion under the assumption, that this was a misunderstanding of the correct project structure. In the discussion the steps to reproduce above were added. And with these the issue is reproducible (a slightly different name prefix was observed, but the problem is identical).
Debugging ultimately leads to
enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/DeployOnSaveManager.java
and itsdistributeOnSave
method. For any change that method is triggered and this code is executed:netbeans/enterprise/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/DeployOnSaveManager.java
Lines 623 to 631 in 56b8332
The value of
filePath
in line 628 is/tmp/WebApplication1/build/web/index.html
, the value ofclasses
from line 627 istarget/classes
. Now in line 629filePath.indexOf
is called and will yield-1
(not found). This case is not handled. The assumptions here are wrong and cause this issue.The text was updated successfully, but these errors were encountered: