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 210144 - STS wizard generates incorrect web.xml
Summary: STS wizard generates incorrect web.xml
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: WSIT (show other bugs)
Version: 7.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-26 18:01 UTC by nitkal
Modified: 2012-05-18 09:49 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 nitkal 2012-03-26 18:01:39 UTC
We were trying to work on developing an STS service using Netbeans
 (7.1) and I observed a few issues. The server used was GF 3.1.2.


1. the web.xml of the generated STS service contains the name of the Provider as a servlet class in addition to the  MexEndPoint:

<servlet>
<servlet-name>MySTSService</servlet-name>
<servlet-class>MySTSService</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>MySTSService</servlet-name>
<url-pattern>/MySTSService</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>com.sun.xml.ws.mex.server.MEXEndpoint</servlet-name>
<servlet-class>com.sun.xml.ws.mex.server.MEXEndpoint</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>com.sun.xml.ws.mex.server.MEXEndpoint</servlet-name>
<url-pattern>/SampleSTSService/mex</url-pattern>
</servlet-mapping>

As a result, on deployment, the following error is thrown:

[#|2012-03-02T17:05:04.536+0530|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=17;_ThreadName=Thread-2;|Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.ClassCastException: NewSTSWizard cannot be cast to javax.servlet.Servlet|#]


2. On trying to remove the servlet element related to  the Provider, still the error is thrown for the MexEndpoint class. Only the following servlet mappings (obtained from a metro ws-trust sample test case) seems to work (deploy fine):

<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>sts</servlet-name>
<display-name>sts</display-name>
<description>JAX-WS endpoint - sts</description>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>sts</servlet-name>
<url-pattern>/sts</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>sts</servlet-name>
<url-pattern>/sts/mex</url-pattern>
</servlet-mapping>


3. On proceeding with the web.xml mentioned in [2] and deploying the app, the wsdl that is present in src/conf/xml-resources/.../servicename.wsdl does not seem to be copied in the final war to the right location mentioned (WEB-INF/wsdl/servicename.wsdl) on a clean/build. As a result the wsdl is not accessible from the deployed service.

4. I also tried to copy the wsdl to the right location mentioned in [3] to the war file and redeploy. However on trying to access the service from the browser, a new error is thrown:

[#|2012-03-01T17:45:56.367+0530|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=17;_ThreadName=Thread-2;|Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: javax.servlet.ServletException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: javax.xml.ws.WebServiceException: WSDL jndi:/server/MySTSServiceService/WEB-INF/wsdl/MySTSServiceService.wsdl has the following services [{http://tempuri.org/}MySTSServiceService] but not . Maybe you forgot to specify a serviceName and/or targetNamespace in @WebService/@WebServiceProvider?|#]


This is not clear since the serviceName and the targetNamespace are specified in the Provider:

@WebServiceProvider(serviceName = "SampleSTSService", portName = "ISampleSTSService_Port", targetNamespace = "http://tempuri.org/", wsdlLocation = "WEB-INF/wsdl/SampleSTS/SampleSTSService.wsdl")
Comment 1 Martin Matula 2012-03-27 09:17:52 UTC
This is quite important issue as it makes the metro feature useless. Bumping priority to P2.
Comment 2 Denis Anisimov 2012-03-27 10:32:05 UTC
Reproduced with both 7.1.2 dev and 7.2 dev.
I have no idea did it ever work at all.
Comment 3 Denis Anisimov 2012-03-27 14:34:23 UTC
See also issue #180759.
Comment 4 nitkal 2012-03-28 08:48:14 UTC
It seemed to have worked before:

http://java.net/jira/browse/GLASSFISH-10339

This issue was resolved in v3. This is just a part of the problem that is re-appearing in the current scenario.
Comment 5 Denis Anisimov 2012-03-29 07:27:34 UTC
web-main#412ec71790ab
I've fixed the web.xml and sun-jaxws.xml files.
The resulting application could be successfully deployed with these changes.
Unfortunately I'm not an expert in WSIT area and I cannot affirm that resulting 
application works as expected. Please verify.

WSDL file is available in a standard way : application_url?wsdl. You don't need to search it in some other place.
Comment 6 gchoi 2012-04-09 17:57:54 UTC
Currently this bug completely blocks my project which use Metro with NetBeans. Is there anyway that I can get fixed version as soon as possible?
Comment 7 gchoi 2012-04-09 17:59:31 UTC
Currently this bug completely blocks my project which use Metro with NetBeans. Do we have workaround for this issue?
Comment 8 Denis Anisimov 2012-05-10 14:39:37 UTC
Correction for generated WSDL file name:
web-main#a8f7455be657
Comment 9 Quality Engineering 2012-05-11 10:12:44 UTC
Integrated into 'main-golden', will be available in build *201205110400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a8f7455be657
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#210144 - STS wizard generates incorrect web.xml. Correct generated WSDL file name.
Comment 10 Jiri Skrivanek 2012-05-15 07:25:21 UTC
Verified in NetBeans IDE Dev (Build 201205140400). Please, integrate to release71_fixes branch. My test case

- create web project with GlassFish server
- create new file "Web Services|Secure Token Service (STS)"
- deploy project
- check http://localhost:8080/WebApplication6/NewSTSWizardService is accessible
Comment 11 Denis Anisimov 2012-05-15 08:00:54 UTC
Integrated into release71_fixes:
http://hg.netbeans.org/releases/rev/b20ed9fa324d
Comment 12 Quality Engineering 2012-05-15 14:58:53 UTC
Integrated into 'releases', will be available in build *201205151102* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/b20ed9fa324d
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#210144 - STS wizard generates incorrect web.xml ( 71patch3 ).