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.
Created attachment 132344 [details] Sample maven project exposing the problem NetBeans 7.3 modifies web.xml and sun-jaxws.xml when invoking the Run action on an existing Maven war project. This happens when a Tomcat 6 or 7 is selected as the deployment server. In the web.xml of the provided sample project, the web service servlet is already defined and configured as: <servlet> <servlet-name>VerifierWebService</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>VerifierWebService</servlet-name> <url-pattern>/verifier/*</url-pattern> </servlet-mapping> In sun-jaxws.xml it is suitably configured as: <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0"> <endpoint name="Verifier" implementation="org.example.webservice.Verifier" url-pattern="/verifier/*"/> </endpoints> See attached sample-web_before.zip (unzips into sample-web folder). NetBeans 7.3 modifies the web.xml and adds additional servlet and servlet-mapping definitions (after the existing ones): <servlet> <servlet-name>VerifierService</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>VerifierService</servlet-name> <url-pattern>/VerifierService</url-pattern> </servlet-mapping> sun-jaxws.xml is also modified: <endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"> <endpoint implementation="org.example.webservice.Verifier" name="VerifierService" url-pattern="/VerifierService"/> </endpoints> Thus the service is no longer available on the "/verifier/*" URL. See attached sample-web_after.zip (unzips into sample-web folder). Steps to reproduce: - Unzip attached sample-web_before.zip. - Open the project in sample-web directory using NetBeans 7.3 (official release). - Choose to run the project, select Tomcat 6 or 7. - After the server was started, the above-mentioned files are modified, the web service is not accessible on the URL specified in original web.xml/sun-jaxws.xml. There is not even a warning that either of these files were modified. It might be related to https://netbeans.org/bugzilla/show_bug.cgi?id=218819 or http://netbeans.org/bugzilla/show_bug.cgi?id=217892. This did not happen in NetBeans 7.2.
Created attachment 132345 [details] The state after NetBeans Run action (target directory was removed to reduce size)
Bumped into this one today. Wonder if there's a workaround ? The bug is pretty serious if you ask me. Netbeans shouldn't on its own change existing source code (yes, I would say those files are source code, they may have been manually edited by the developer).
I've resorted to setting the read-only attribute on the files: ..../src/main/webapp/WEB-INF/sun-jaxws.xml ..../src/main/webapp/WEB-INF/web.xml I did from the OS. This way NB can't change those files. This seems to circumvent the bug for now.
This makes impossible to work with webservices. I can't test using my url-pattern defined in file sun-jaxws.xml
To be honest (based on the feedback we have here), I think this has to be fixed in the 7.3.1.
I am able to reproduce in the latest 7.3.1 build. I agree bug 218819 looks related; OTOH bug 217892 does not. Looking at the history, there were some changes in this area during the 7.3 release cycle which may have caused regressions, e.g.: http://hg.netbeans.org/web-main/rev/923cac7f0e06 David, can you please try to investigate? Thanks.
Created attachment 135039 [details] patch
Yes, the commit http://hg.netbeans.org/web-main/rev/923cac7f0e06, which Petr mentioned, did cause this issue (issue 218819 on the other hand is not relevant). The commit introduced a new method WSUtils.needNonJsr109Artifacts and used it in two places. Unfortunately the second usage (from WSUtils.java) was incorrect and changed the behaviour to call addJaxWsEntries() even when it is not appropriate. I rolled back that change in attached patch and it resolved this issue for me. MartinJ, could you please review the change and if you are OK with it commit it and push it. I cannot do it myself as I discovered some nasty classloader issue as a result of fixing issue 229898 and I need to resolve that first. Thanks! As for the integration into NB 7.3.1 the fix should be save as it reverts the code to a previous state and it should not cause regressions.
The patch is fine and safe. Pushed in web-main #12e862692652
Not sure what is the decision about 7.3.1 integration and if it's even desirable to do another final build --> reassigning to Petr
Jirka Skrivanek is going to verify the fix. Please backport as soon as possible after verification, so we can start another (and hopefully the last) build. Thanks in advance.
Ok, transplanted to release73 as http://hg.netbeans.org/releases/rev/b8f49f19dde0. Module spec version increase is not necessary, in release73 it is already higher (1.19.1) thank 7.3 patch 1 (1.18.1). For anyone who would like to try out the fix in trunk and does not want to wait for the next daily build, it will be available in this build when it completes in about 30 minutes: http://bertram2.netbeans.org:8080/job/web-main/10649/
Verified in NetBeans IDE Dev (Build web-main-10649-on-20130529).
Integrated into 'releases', will be available in build *201305291404* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/b8f49f19dde0 User: Martin Janicek <mjanicek@netbeans.org> Log: #227177 - NetBeans 7.3 modifies web.xml and sun-jaxws.xml (in a Maven war project)
Integrated into 'main-golden', will be available in build *201305292301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/12e862692652 User: Martin Janicek <mjanicek@netbeans.org> Log: #227177 - NetBeans 7.3 modifies web.xml and sun-jaxws.xml (in a Maven war project)
This has started happening again on Build 20130615-4b6222f102af
Not able to reproduce yet. Need to evaluate the code how could this happen.
Managed to reproduce now, and got the problem.The fix is based on not adding entries to web.xml, sun-jaxws.xml:1. sun-jaxws.xml is not changed when the entries are already there for given implementation class.2. web.xml is not changed, when a/ the servlet name is found for given Endpoint or b/ url pattern from sun-jaxws.xml Endpoint
Managed to reproduce now, and got the problem. The fix is based on not adding entries to web.xml, sun-jaxws.xml: 1. sun-jaxws.xml is not changed when the entries are already there for given implementation class. 2. web.xml is not changed, when a/ the servlet name is found for given Endpoint or b/ url pattern from sun-jaxws.xml Endpoint matches one of the the web.xml servlet mappings. See: http://hg.netbeans.org/web-main/rev/b27b2138e670 http://hg.netbeans.org/web-main/rev/569aaa4e6840
Integrated into 'main-silver', will be available in build *201307011244* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/b27b2138e670 User: Milan Kuchtiak <mkuchtiak@netbeans.org> Log: #227177 Don't add entries to web.xml, sun-jaxws.xml when there are already some for given implementation class
I believe the problem still exist. My tests are from NB8.0RC1. Because of this long time bug I've set my web.xml file to read-only at the level of the OS. This way I get assurance that NB doesn't try to change that file without me knowing it. In NB8.0RC1 I get a "Cannot lock read-only file foo/bar/web.xml" warning when I start up my IDE. This is because I have the project in question as one of those files that open when I start the IDE. The project is Maven based. This is my sun-jaxws.xml: <endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"> <endpoint implementation="com.myorg.armada.CalculationSvc" name="CalculationSvc" url-pattern="/WebService"/> </endpoints> and this is my web.xml: <web-app ...> <servlet> <description>Armada Calc Service</description> <servlet-name>CalculationWS</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>CalculationWS</servlet-name> <url-pattern>/calculation</url-pattern> </servlet-mapping> </web-app> What NB does silently is to add an additional <servlet> and <servlet-mapping> as follows: <servlet> <servlet-name>CalculationSvc</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>CalculationSvc</servlet-name> <url-pattern>/CalculationSvc</url-pattern> </servlet-mapping> (luckily the change cannot be saved to disk because I've set the file read-only, hence I get that read-only warning from the IDE) What the source code change means is that the webservice which was previously exposed on '/WebService' is now suddenly exposed on '/CalculationSvc' instead. ==> the webservice no longer works. Now, my sun-jaxws.xml and web.xml may not be completely by-the-book (dunno actually, aren't they?). But they work and they've been like that for this project since ... well probably since project's inception 4-5 years ago. My points are: 1. NB should *NOT* change my source code without telling me and it most definitely shouldn't do it SILENTLY on 'project open' action. Period ! Even if the project has the most crappy of source I don't think there's any excuse for the IDE to ever change source code silently. 2. Why does the IDE feel a need to change web.xml file in the first place? What would happen if it didn't? Whatever it is that the Maven jaxws module is trying to accomplish by doing this there must be other ways to accomplish it. I'll be glad to contribute with ideas, etc, if I could just figure out what it is the module is trying to accomplish.
> 2. Why does the IDE feel a need to change web.xml file in the first place? What would happen if it didn't? The motivation was to make services work automatically - in JSR-109 environment (e.g GlassFish) and in non JSR-109 environment (e.g. Tomcat). Thus, Netbeans is trying to include servlet and servlet-mapping to web.xml elements "silently". It's true, user should be informed, or asked, when web.xml is modified.
Now, Netbeans doesn't modify web.xml and sun-jaxws.xml when user doesn't wish to. Specifically, when user says NO in "Non JSR-109 server detected" dialog, and checks "Don't ask this question next time" checkbox neither web.xml nor sun-jaxws.xml will be modificated. See the dialog in attachment. See: http://hg.netbeans.org/web-main/rev/d32a96f81f4d
Created attachment 148082 [details] Non JSR-109 Server Detected dialog
One more commit: http://hg.netbeans.org/web-main/rev/7ff50d13fba9
Integrated into 'main-silver', will be available in build *201407170001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/d32a96f81f4d User: Milan Kuchtiak <mkuchtiak@netbeans.org> Log: #227177 Don't modify web.xml and sun-jaxws.xml if user doesn't want
I have this problem in my team work. We use linux kubuntu 14.04 LTS and Kubuntu 16.04 LTS. NetBeans IDE 8.1 (Build 201510222201). I want to know what I must do in order to solve this problem. My sun-jaxws.xml is: <pre> <?xml version="1.0" encoding="UTF-8"?> <endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime"> <endpoint implementation="com.cablevision.provisioning.services.wsprovisioning.WSProvisioning" name="WSProvisioning" url-pattern="/WSProvisioning"/> <endpoint implementation="com.cablevision.provisioning.services.cliente.ServicesCliente" name="ServicesCliente" url-pattern="/ServicesCliente"/> <endpoint implementation="com.cablevision.provisioning.services.cablemodem.ServicesCablemodem" name="ServicesCablemodem" url-pattern="/ServicesCablemodem"/> <endpoint implementation="com.cablevision.provisioning.services.wsprovisioning.WSProvisioning" name="WSProvisioningService" url-pattern="/WSProvisioningService"/> <endpoint implementation="com.cablevision.provisioning.services.cliente.ServicesCliente" name="ServicesClienteService" url-pattern="/ServicesClienteService"/> <endpoint implementation="com.cablevision.provisioning.services.cablemodem.ServicesCablemodem" name="ServicesCablemodemService" url-pattern="/ServicesCablemodemService"/> </endpoints> </pre> I saw the message you talk about "JSR-109 compliant" https://bugzilla-attachments-227177.netbeans.org/bugzilla/attachment.cgi?id=148082 Can someone show me how we can to solve this. Thanks in advance.
(In reply to marianoCali from comment #27) > I have this problem in my team work. > We use linux kubuntu 14.04 LTS and Kubuntu 16.04 LTS. > NetBeans IDE 8.1 (Build 201510222201). > > I want to know what I must do in order to solve this problem. > ... @marianoCali: Please file a new issue instead of reopening this 3 years old issue! You can link to this issue from the new issue! Reverting the changed fields.