[JBossWS] - Jboss-5.0.0.Beta1 JSR-181 Endpoint ClassCastException
by volna
I am trying to deploy a WebService using JSR-181 with Jboss-5.0.0.Beta1. If I have understood correctly this includes support for JBossWS-2.0
package testService;
@WebService( serviceName="TestService", name="Testing",
targetNamespace="urn:Testing" )
@SOAPBinding( style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
public class TestUI {
@WebMethod()
public String Test(String tString) {
return "Hello " + tString;
}
}
I have the following web.xml file
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>TestService</servlet-name>
<servlet-class>testService.TestUI</servlet-class>
<servlet-mapping>
<servlet-name>TestService</servlet-name>
<url-pattern>/testService</url-pattern>
</servlet-mapping>
</web-app>
I am getting the following error
javax.servlet.ServletException: Class testService.TestUI is not a Servlet
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:86)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
java.lang.Thread.run(Thread.java:595)
root cause
java.lang.ClassCastException: testService.TestUI
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:86)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
java.lang.Thread.run(Thread.java:595)
Any pointers to help me out are appreciated
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013891#4013891
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013891
19 years, 2 months
[JBossWS] - jbossws-samples-1.0.4.GA ws-security sign - Unprocessed 'mus
by redcat63
I have been trying to get webservices security to work for a couple of days but cant solve a bug. I have now run the jbossws-samples-1.0.4.GA and get the same issue. The issue is that the server can't process the signature and gives the following error:
2007-02-09 17:06:50,732 ERROR [org.jboss.ws.common.CommonClient:329] Call invocation failed
| javax.xml.rpc.soap.SOAPFaultException: Unprocessed 'mustUnderstand' header element: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security
| at org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper.getSOAPFaultException(SOAPFaultExceptionHelper.java:100)
| at org.jboss.ws.common.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:574)
| at org.jboss.ws.common.CommonClient.invoke(CommonClient.java:319)
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:560)
| at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:338)
| at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
| at $Proxy0.echoUserType(Unknown Source)
| at org.jboss.test.ws.jaxrpc.samples.wssecurity.SimpleSignTestCase.testEndpoint(SimpleSignTestCase.java:69)
| 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 junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.framework.TestSuite.runTest(TestSuite.java:208)
| at junit.framework.TestSuite.run(TestSuite.java:203)
| at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.extensions.TestSetup.run(TestSetup.java:23)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
I am running jboss-4.0.4.GA, the server side output is:
| 2007-02-09 17:06:50,669 DEBUG [javax.xml.rpc.soap.SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}MustUnderstand,string=Unp... 'mustUnderstand' header element: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security,actor=null,detail=null]
| 2007-02-09 17:06:50,669 ERROR [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception
| javax.xml.rpc.soap.SOAPFaultException: Unprocessed 'mustUnderstand' header element: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security
| at org.jboss.ws.handler.HandlerChainBaseImpl.checkMustUnderstand(HandlerChainBaseImpl.java:510)
| at org.jboss.ws.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:215)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:104)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:234)
| at org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServlet.java:120)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
The only changes I have made to the samples are that I have commented out the deploy and undeploy code in the JBossTestDeployer class as I was geting another error when deploying, so I copy the files across manually. I have made the test class SimpleSignTestCase I have forced it to set up the port without using contexts (as this was giving a classcastexception). I have also commented out all of the other tests in ant.
If someone can tell me what is going wrong it would be good as I can then get my code working that has the same problem. If anyone can tell me why I get the classcastexception when I use jndi with the sign example but not witht the encrypt example that would be greate. Exception:
2007-02-09 17:45:16,867 ERROR [org.jboss.ws.jaxrpc.ServiceObjectFactory:269] Cannot create service
| java.lang.ClassCastException: org.jboss.webservice.metadata.serviceref.ServiceRefMetaData
| at org.jboss.ws.jaxrpc.ServiceObjectFactory.getObjectInstance(ServiceObjectFactory.java:122)
| at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
| at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
| at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
| at org.jboss.naming.client.java.javaURLContextFactory$EncContextProxy.invoke(javaURLContextFactory.java:135)
| at $Proxy0.lookup(Unknown Source)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.test.ws.jaxrpc.samples.wssecurity.SimpleSignTestCase.getPort(SimpleSignTestCase.java:78)
| at org.jboss.test.ws.jaxrpc.samples.wssecurity.SimpleSignTestCase.testEndpoint(SimpleSignTestCase.java:66)
| 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 junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.framework.TestSuite.runTest(TestSuite.java:208)
| at junit.framework.TestSuite.run(TestSuite.java:203)
| at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
| at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.extensions.TestSetup.run(TestSetup.java:23)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013783#4013783
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013783
19 years, 2 months
[JBossWS] - trouble using user defined classes and java.util classes in
by santhoshitha
i am trying to use jax-ws for my web service. i have to invoke a remote method that accepts a java.uitl.List(SecurityAttr is a user defined class) as one of the parameters. i would like guidance in this regard.
1) is it possible to use jax ws for this purpose? if so, how should the complex types and collection classes be serialised?
2) i dint find much guidance or tutorials in this regard. i would be really happy if i could be directed to some documents/samples.
3) as of now i have deployed the server side of the service and i try to connect using a jax rpc client. running wstools from the client, for wsdl to java generation, gives me a class called list along with the SEI and mapping files. i dont know how to use this. i am using the servicefactoryimpl class provided by jbossws to use the jaxrpc-mapping file, but the list class doesnt accept any parameters. hence if i connect from the client and try to pass a List, it doesnt help.
Kindly guide me. Any help is much appreciated. Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013716#4013716
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013716
19 years, 2 months
[JBossWS] - Security domain definition
by rMikky
How I can use my own security domain for EJB endpoint instead of java:/jaas/JBossWS defined in lofin-config.xml?
I would like to use doman java:/jaas/mydomain.
The problem is that all my EJBs are in my own security domain.
The domain is defined in jboss.xml:
<jboss>
| <security-domain>java:/jaas/mydomain</security-domain>
| ........
| </jboss>
Also I have domain definition in login-config.xml :
<application-policy name="mydomain">
| <authentication>
| <login-module code="com.myproject.helper.MyLoginModule"
| flag="required">
| </login-module>
| </authentication>
| </application-policy>
(MyLoginModule extends AbstractServerLoginModule and creates my own Principal (My Principal) )
It worked ok under jBoss.NET and axis.
But now I try to migrate to jBossWS and I do not understand how I have to define my security domain for EJB endpoint.
I have error in my class MyLoginModule.
It looks like that <username> and <password> is null while SOAP request.
Should I define anything else?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4013535#4013535
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4013535
19 years, 2 months