users@glassfish.java.net

GF2 b52 / NB 6.0 : Secure Web services

From: Sebastien Stormacq <Sebastien.Stormacq_at_Sun.COM>
Date: Mon, 02 Jul 2007 11:56:33 +0200

Dear All,

Using GF2 b53 and NB 6.0 20070627
I am trying to create a simple helloworld web service, secured with AM
and the UserNameToken profile.
I also create a simple web app calling this service.

when calling the web service from the web app, I received the following :

com.sun.xml.ws.server.UnsupportedMediaException: Unsupported
Content-Type: text/html Supported ones are: [text/xml]
(full stack trace below)

I received the same error message with other profiles.
everything is working fine when *not* using any AM security for my web
service.

Any help ?

Thanks

Seb


getEntry for: SOAP -- AMServerProvider-UserNameToken
    module class: com.sun.identity.agents.jsr196.as9soap.AMServerAuthModule
    options: {providername=UserNameToken}
    request policy: javax.security.auth.message.MessagePolicy_at_190b5e
    response policy: javax.security.auth.message.MessagePolicy_at_3953a7
AMServerAuthModule.Init
StandardWrapperValve[StockQuoteWS]: PWC1406: Servlet.service() for
servlet StockQuoteWS threw exception
javax.servlet.ServletException
        at
com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:164)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
        at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:631)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:562)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:803)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
        at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361)
        at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.NoClassDefFoundError
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at
com.sun.identity.agents.jsr196.as9soap.AMServerAuthModule.initialize(AMServerAuthModule.java:132)
        at
com.sun.enterprise.security.jmac.config.GFServerConfigProvider.createModuleInfo(GFServerConfigProvider.java:258)
        at
com.sun.enterprise.security.jmac.config.GFServerConfigProvider$GFAuthConfig.getModuleInfo(GFServerConfigProvider.java:1012)
        at
com.sun.enterprise.security.jmac.config.GFServerConfigProvider$GFServerAuthConfig.getAuthContext(GFServerConfigProvider.java:1053)
        at
com.sun.enterprise.security.jmac.config.PipeHelper.getServerAuthContext(PipeHelper.java:137)
        at
com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:153)
        at
com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
        at
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
        at
com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
        at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
        at
com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
        at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
        at
com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:159)
        ... 29 more
com.sun.xml.ws.server.UnsupportedMediaException: Unsupported
Content-Type: text/html Supported ones are: [text/xml]
        at
com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:130)
        at
com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:294)
        at
com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:172)
        at
com.sun.enterprise.webservice.ClientSecurityPipe.processSecureRequest(ClientSecurityPipe.java:172)
        at
com.sun.enterprise.webservice.ClientSecurityPipe.process(ClientSecurityPipe.java:160)
        at
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
        at com.sun.xml.ws.client.Stub.process(Stub.java:248)
        at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:134)
        at
com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:244)
        at
com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
        at $Proxy97.hello(Unknown Source)
        at stockquoteclientwebapp.Page1.button1_action(Page1.java:246)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.el.parser.AstValue.invoke(AstValue.java:187)
        at
com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
        at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
        at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
        at
com.sun.rave.web.ui.appbase.faces.ActionListenerImpl.processAction(ActionListenerImpl.java:69)
        at javax.faces.component.UICommand.broadcast(UICommand.java:383)
        at
com.sun.webui.jsf.component.WebuiCommand.broadcast(WebuiCommand.java:160)
        at
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:447)
        at
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
        at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
        at
com.sun.faces.extensions.avatar.lifecycle.PartialTraversalLifecycle.execute(PartialTraversalLifecycle.java:80)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
        at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at
com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:266)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:624)
        at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:268)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:631)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:562)
        at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:803)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
        at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
        at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
-- 
<http://www.java.com> 	* Sebastien Stormacq*
Software Architect
GSS, Software Practice
Belgium & Luxembourg
	*Sun Microsystems, sarl*
Parc d'Activités 77-79
Capellen L8308
Phone x48356/+352 49 11 33 56
Mobile +352 621 503 626
Fax +352 49 11 33 33
Email sebastien.stormacq_at_sun.com