[JBossWS] - Failed to setup client ENC ... Cannot bind webservice to cli
by sverker
We have a project that deploys to the AS as an ear. Suddenly the deployment begun to fail because it says that the webservice clients are already bound.
We have two webservice clients that are deployed as jar files in the ear. They are referenced by application.xml like this:
| <module>
| <java>IdentificationApi-europe-3.0-1.jar</java>
| </module>
| <module>
| <java>SmsApi-europe-5.1-1.jar</java>
| </module>
|
Until now this have worked fine. The webservice clients were deployed and could be looked up from jndi. They are not directly called by the ejb's but through a third package.
Now we've started to get exceptions during the deploy, the webservice clients are first bound but directly after we get an Exception that client ENC could not be bound because of NameAlreadyBoundException. According to the debug output in server.log this happens when it tries to deploy our ejb jar. I've searched that jar and the only reference I can find is that MANIFEST.MF specifies one of the webservice clients in it's classpath (don't know why though, as there is no reference to it in pom.xml)
This is the relevant log output:
13:11:34,154 INFO [ClientDeployer] Client ENC bound under: IdentificationApi30Europe-client
| 13:11:34,444 INFO [ClientDeployer] Client ENC bound under: SmsApi51Europe-client
| 13:11:34,584 WARN [NestedThrowable] Duplicate throwable nesting of same base type: class org.jboss.deployment.DeploymentException is assignable from: class org.jboss.deployment.DeploymentException
| 13:11:34,594 ERROR [MainDeployer] Could not start deployment: file:/C:/java/jboss-4.0.5.GA/server/default/tmp/deploy/tmp34838t2-tvportal-0.1.ear-contents/t2-tvportal-core-0.1.jar
| org.jboss.deployment.DeploymentException: Failed to setup client ENC; - nested throwable: (org.jboss.deployment.DeploymentException: Cannot bind webservice to client environment; - nested throwable: (javax.naming.NameAlreadyBoundException))
|
| at org.jboss.deployment.ClientDeployer.start(ClientDeployer.java:171)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
| er.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
| or.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
| BeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
| java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy8.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
| tScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
| canner.java:610)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
| run(AbstractDeploymentScanner.java:225)
| Caused by: org.jboss.deployment.DeploymentException: Cannot bind webservice to c
| lient environment; - nested throwable: (javax.naming.NameAlreadyBoundException)
| at org.jboss.ws.integration.jboss.WebServiceClientDeployer.setupServiceR
| efEnvironment(WebServiceClientDeployer.java:94)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
| java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
| er.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
| java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy62.setupServiceRefEnvironment(Unknown Source)
| at org.jboss.webservice.WebServiceClientHandler.setupServiceRefEnvironme
| nt(WebServiceClientHandler.java:94)
| at org.jboss.deployment.ClientDeployer.setupEnvironment(ClientDeployer.j
| ava:272)
| at org.jboss.deployment.ClientDeployer.start(ClientDeployer.java:167)
| ... 22 more
| Caused by: javax.naming.NameAlreadyBoundException
| at org.jnp.server.NamingServer.bind(NamingServer.java:144)
| at org.jnp.server.NamingServer.bind(NamingServer.java:109)
| at org.jnp.server.NamingServer.bind(NamingServer.java:109)
| at org.jnp.server.NamingServer.bind(NamingServer.java:109)
| at org.jnp.interfaces.NamingContext.bind(NamingContext.java:566)
| at org.jnp.interfaces.NamingContext.bind(NamingContext.java:531)
| at org.jboss.util.naming.Util.bind(Util.java:102)
| at org.jboss.util.naming.Util.bind(Util.java:89)
| at org.jboss.ws.integration.jboss.WebServiceClientDeployer.setupServiceR
| efEnvironment(WebServiceClientDeployer.java:87)
| ... 36 more
|
If I remove the webservice clients from application.xml then the ejb jar is not deployed. The application is generated with AndroMDA so the problem could have occured because of some update there but on the other hand I've verified all deployment descriptiors and it looks correct. Another strange thing is that if I deploy the application as an unpackaged ear, i.e. as a directory then it works eventhough it's the same content.
The problem first occured when we deployed on a freshly installed 4.2.0. We then went back to our lab server with 4.0.5, the same problem. Even when taking the same ear that deploys successfully on the production server (also 4.0.5) cause the same problem.
What to look for? What could be the cause of this problem?
What is the correct way to deploy the webservice clients in our ear? I couldn't find documentation regarding that so I tried this variant and it has worked until now.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060390#4060390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060390
17 years, 8 months
[JBossWS] - HalloWorld Problem
by florian79
I got exceptions by tring a hallo world example
I use: jboss-4.2.0.GA with jbossws-1.2.1.GA (default WS)
My EJB- endpoint:
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebResult;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| //@WebService
| @WebService(name="HalloWorldWS")
| //@WebService(name="HalloWorldWS",serviceName="HalloWorldWSService")
| @SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
| //@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
| //@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
| @Stateless
| public class HalloWorldWSImpl implements HalloWorldWS
| {
| @WebMethod(operationName="getHalloWorld")
| @WebResult(name="hallo")
| public final String getHalloWorld()
| {
| return "Hallo Welt";
| }
|
| }
|
and my client unit test code:
| private void initByService() throws Exception
| {
| String strURL = "http://localhost:8080/HalloWorldWSImplService/HalloWorldWSImpl";
| String strQName = "HalloWorldWSImpl";
| URL url = new URL(strURL + "?wsdl");
| QName qname = new QName(strURL,strQName);
| Service service = Service.create(url, qname ); //here I get the exception!!!
| HalloWorldWS mySessionBean = service.getPort(HalloWorldWS.class);
| }
|
By using the SOAPBinding:
@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
I get the following exception:
| javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
| at javax.xml.ws.Service.create(Service.java:731)
| at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
| at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
| 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 org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
| at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
| at javax.xml.namespace.QName.<init>(QName.java:164)
| at javax.xml.namespace.QName.<init>(QName.java:113)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseExtensibilityAttributes(WSDLReaderImpl.java:1344)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1268)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
| at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
| 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 javax.xml.ws.Service.create(Service.java:726)
| ... 22 more
|
By using the SOAPBinding:
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
or
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
I get the following exception:
| javax.xml.ws.WebServiceException: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
| at javax.xml.ws.Service.create(Service.java:731)
| at com.dooris.ws.HalloWorldWSImplTest.initByService(HalloWorldWSImplTest.java:41)
| at com.dooris.ws.HalloWorldWSImplTest.setUp(HalloWorldWSImplTest.java:22)
| 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 org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
| at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
| at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
| at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
| Caused by: org.jboss.ws.metadata.wsdl.WSDLException: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:155)
| at org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:321)
| at org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:83)
| at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
| at org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:61)
| at javax.xml.ws.Service.<init>(Service.java:83)
| at org.jboss.ws.core.jaxws.client.ServiceExt.<init>(ServiceExt.java:60)
| 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 javax.xml.ws.Service.create(Service.java:726)
| ... 22 more
| Caused by: javax.wsdl.WSDLException: WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_PREFIX: Unable to determine namespace of 'tns:getHalloWorld'.
| at com.ibm.wsdl.util.xml.DOMUtils.getQName(DOMUtils.java:309)
| at com.ibm.wsdl.util.xml.DOMUtils.getQualifiedAttributeValue(DOMUtils.java:367)
| at com.ibm.wsdl.xml.WSDLReaderImpl.getQualifiedAttributeValue(WSDLReaderImpl.java:2019)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parsePart(WSDLReaderImpl.java:1278)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseMessage(WSDLReaderImpl.java:1257)
| at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(WSDLReaderImpl.java:309)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2265)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2229)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2282)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
| at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
| at org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:130)
| ... 33 more
|
where is my stupide mistake?
Thank you!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060348#4060348
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060348
17 years, 8 months
[JBossWS] - POJO web services and standard security annotations
by Mikha
Hi!
I'm new to JAX-WS and trying to find my way around this technology. One thing of particular importance for me is how JBoss treats standard security annotations when deploying POJO web services.
JSR 181 "Web Services Metadata for the JavaTM Platform" doesn't mention security-related annotations explicitely; however change log there contains comment "Removed security annotations as these will be defined by JSR 250 ? Common Annotations." So I took it as security-related annotations apply to web services, includng POJO-based.
However, when I tried to test it in JBoss-4.2.0.GA, I found that container simply ignores these annotations or, at least, @RolesAllowed.
Here is code snippet:
| @WebService(name = "AccountingIf", endpointInterface = "org.mikha.webservice.test.accountingif3.AccountingIf")
| @RolesAllowed("AccountingIfClient")
| public class AccountingIfImpl implements AccountingIf
| {
|
| /** web service context */
| @Resource
| private WebServiceContext m_ctx;
|
| /**
| * @see org.mikha.webservice.test.accountingif3.AccountingIf#commit(org.mikha.webservice.test.accountingif3.RecordTypeType,
| * long)
| */
| public void commit(RecordTypeType recordType, long trID)
| {
| // TODO Auto-generated method stub
| }
|
| /**
| * @see org.mikha.webservice.test.accountingif3.AccountingIf#fetch(org.mikha.webservice.test.accountingif3.RecordTypeType,
| * int)
| */
| public FetchResultType fetch(RecordTypeType recordType, int dataSize)
| {
| Principal p = m_ctx.getUserPrincipal();
| if (!m_ctx.isUserInRole("AccountingIfClient"))
| {
| throw new SecurityException("User " + p
| + " is not allowed to access accounting interface");
| }
| // ....
|
|
When request is made by user belonging to "AccountingIfClient" role, both methods work fine.
But, when request is made by valid user not belonging to "AccountingIfClient" role, "commit" method still works; and "fetch" method throws "javax.xml.ws.soap.SOAPFaultException: User johndoe is not allowed to access accounting interface", which comes from my code, not from container.
The questions:
1) Should container for POJO-based web services honor standard security annotations?
2) If not, is there any way to specify security restrictions for POJO-based web services in declarative manner (i.e. without checking access rights in the business logic)?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060314#4060314
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060314
17 years, 8 months