Hide Forgot
project_key: SOA For one to be able to use WS extensions, jbossws-cxf.xml must be configured properly. With servlet based WS this is no problem since the file can be placed within WEB-INF directory inside the war. With EJB3 based web services, it is not possible to have WEB-INF directory inside the jar file (the jar file will be completely ignored by AS). The configuration file can be placed inside META-INF but every try to access the service throws an exception. Attached are two files. The first one (*_1.jar) is working but does not support WS-S. After deployment, you can access http://localhost:8080/Quickstart_helloworld_ejb3/HelloWorldEjbWSBean?wsdl. The second one (*_2.jar) contains META-INF/jbossws-cxf.xml file. It is even not possible to access WSDL. Instead, the following exception is thrown: javax.servlet.ServletException: Servlet.init() for servlet HelloWorldEjbWSBean threw exception org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451) java.lang.Thread.run(Thread.java:619) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HelloWorldEjbWS': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: java.lang.RuntimeException: Soap 1.1 endpoint already registered on address http://localhost:8080/Quickstart_helloworld_ejb3_jar org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) java.security.AccessController.doPrivileged(Native Method) org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) org.jboss.wsf.stack.cxf.CXFServletExt.loadAdditionalConfigExt(CXFServletExt.java:151) org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:109) org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:78) org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:79) org.jboss.internal.soa.esb.soap.cxf.ESBCXFServletExt.init(ESBCXFServletExt.java:38) org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183) org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451) java.lang.Thread.run(Thread.java:619) With native WS, it was possible to use WS extensions with pure EJB3 endpoints.
Attachment: Added: Quickstart_helloworld_ejb3_1.jar
Attachment: Added: Quickstart_helloworld_ejb3_2.jar
Attached sources.
Attachment: Added: helloworld_ejb3_src.tar.bz2
What error do you get for _1.jar ? Locally I have a project I know worked in the past to enable WS-Security Username Token validation for an EJB3 endpoint with CXF on EAP 5.1.0
There is no error for _1.jar except it does not support WS-S. I know about a workaround, because you can have EJBs in a war in JEE6, but this is not what I originally wanted. Can you provide me with your project for me to give it a try? Thanks!
What do you mean when you say it does not support WS-Security? Are you saying the inbound message with a WS-Security header is not processed?
Attached is a simple Eclipse / Ant project to deploy an EJB3 based endpoint with WS-Security / Username Token being used for the authentication.
Attachment: Added: PhoneBook_EJB_UsernameToken.tgz
Many thanks Darran. I was able to make it work using your sample application. I needed to specify even the bean name in jbossws-cxf.xml in the address attribute.