0 Replies Latest reply on Jul 4, 2007 7:42 AM by sverker

    Failed to setup client ENC ... Cannot bind webservice to cli

    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.