apache / apache/netbeans

Netbeans removes key elements from sun-jaxws.xml and web.xml after doing clean and build breaking application.

Open
#8,454 5 comments 0 reactions 0 assignees View on GitHub
Ant Java EE/Jakarta EE kind:bug
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 25

### What happened

We have an existing web application that was compiled with Netbeans 8.2 under Java 8.
We have ported it to Java 11 using Netbeans 21 and got it working but have an issue with the build process.
I have reproduced the build error with a TestSeller11 project built with Netbeans 25.

This TestSeller11 project will not run but it does build and demonstrates how the build gets broken by
a clean and build.

Created a Java Web project.
File->New Project
Java with Ant
Java Web
Project Name: TestSeller11
Server: Apache Tomcat or TomEE (apache-tomcat-10.1.40)
Java EE Version: Jakarta EE 10 Web (jdk-17.0.15+6) 64bit
Project properties:
Sources: Source/Binary Format: JDK11
Libraries: add jaxws libraries found in lib-jaxws-4.0.0 directory

key files:
TestSeller11\src\conf\xml-resources\web-services\PartOrderMgr\wsdl\PartOrderMgr.wsdl
TestSeller11\src\java\com\example\PartOrderMgr.java
TestSeller11\catalog.xml
TestSeller11\web\META-INF\context.xml
TestSeller11\web\WEB-INF\sun-jaxws.xml
TestSeller11\web\WEB-INF\web.xml
TestSeller11\web\WEB-INF\wsdl\PartOrderMgr.wsdl
TestSeller11\nbproject\jax-ws.xml
TestSeller11\nbproject\jaxws-build.xml (built from jax-ws.xml by netbeans)
TestSeller11\lib-jaxws-4.0.0\jakarta.activation-api.jar
TestSeller11\lib-jaxws-4.0.0\jakarta.xml.bind-api.jar
TestSeller11\lib-jaxws-4.0.0\jakarta.xml.ws-api.jar
TestSeller11\lib-jaxws-4.0.0\jaxws.rt.jar

- Start with clean project.
- Start netbeans 25.
- build project
after build is done, sun-jaxws.xml and web.xml will get modified (breaking the application).
- sun-jaxws.xml
for com.example.PartOrderMgr will get removed.
- web.xml
for WSServletContextListener will get removed.
and for PartOrderMgr will get removed.
- Restore sun-jaxws.xml and web.xml from the files in tmp directory.
- build project again and files do not get modified.

### Language / Project Type / NetBeans Component

Java Web application with Ant build

### How to reproduce

zip file included with TestSeller11 project.
- Start with clean project.
- Start netbeans 25.
- build project
after build is done, sun-jaxws.xml and web.xml will get modified (breaking the application).
- sun-jaxws.xml
for com.example.PartOrderMgr will get removed.
- web.xml
for WSServletContextListener will get removed.
and for PartOrderMgr will get removed.
- Restore sun-jaxws.xml and web.xml from the files in tmp directory.
- build project again and files do not get modified.

### Did this work correctly in an earlier version?

Apache NetBeans 21 or earlier

### Operating System

Windows 11 64 bit

### JDK

jdk-17.0.15+6

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

My original project built fine under Netbeans 8.2.
ported project to Java 11 using Netbeans 21 but build has issues.
Build small TestSeller11 project using Netbeans 25 to reproduce build issue.
You can find my project in the attached TestSeller11.zip file.

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Reproduce the clean-and-build flow with the attached TestSeller11 project, then inspect nbproject/jax-ws.xml and nbproject/jaxws-build.xml alongside web/WEB-INF/sun-jaxws.xml and web.xml. Compare the files after the first build with their restored copies in tmp. Done means the build preserves the PartOrderMgr endpoint, WSServletContextListener, servlet, and servlet-mapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.