14 Replies Latest reply on Oct 7, 2009 2:14 PM by groovie

    Cannot find service endpoint target

    hansotto

      I have deployed several Webservices as EJB endpoints successfully on the JBoss 4.2.1 with JBossWS 1.2.1. There are many SLSBs inside the Webservices, injected by the @EJB annotation and build as local deployment.
      Now, after upgrading from JBossWS 1.2.1 to JBossWS 2.0.0, I get the following error during the EAR deployment:

      14:01:25,984 INFO [org.jboss.web.tomcat.service.TomcatDeployer] deploy, ctxPath=/v1, warUrl=.../tmp/deploy/deploy.last-webservices.ear-webservices_ejb3.jar5109.war/
      14:01:26,578 INFO [org.jboss.wsf.stack.jbws.WSDLFilePublisher] WSDL published to: file:/C:/jboss_4.2.1_WS/server/default/data/wsdl/deploy.last/webservices.ear/webservices_ejb3.jar/TestService5107.wsdl
      14:01:26,875 INFO [org.jboss.wsf.spi.management.BasicEndpointRegistry] register: jboss.ws:context=v1,endpoint=TestService
      14:03:09,734 ERROR [org.jboss.deployment.MainDeployer] Could not start deployment: file:/C:/jboss_4.2.1_WS/server/default/tmp/deploy/tmp5106webservices.ear-contents/webservices_ejb3.jar
      javax.xml.ws.WebServiceException: Cannot find service endpoint target: jboss.j2ee:name=TestService,service=EJB3,jar=webservices_ejb3.jar,ear=webservices.ear
       at org.jboss.wsf.container.jboss42.InvocationHandlerEJB3.start(InvocationHandlerEJB3.java:78)
       at org.jboss.wsf.spi.deployment.BasicLifecycleHandler.start(BasicLifecycleHandler.java:57)
       at org.jboss.wsf.stack.jbws.LifecycleHandlerImpl.start(LifecycleHandlerImpl.java:40)
       at org.jboss.wsf.spi.deployment.EndpointLifecycleDeployer.start(EndpointLifecycleDeployer.java:49)
       at org.jboss.wsf.spi.deployment.BasicDeployerManager.deploy(BasicDeployerManager.java:81)
       at org.jboss.wsf.container.jboss42.MainDeployerHook.deploy(MainDeployerHook.java:46)
       at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
       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 $Proxy32.start(Unknown Source)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
       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.GeneratedMethodAccessor27.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.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 $Proxy9.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.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)


      I tried to debug the deployment process and noticed that the error occurred in line 77 of the InvocationHandlerEJB3:
      if (dispatcher.getRegistered(objectName.getCanonicalName()) ==null)
       throw new WebServiceException("Cannot find service endpoint target: " + objectName);
      

      The problem is, that the dispatcher wants to invoke the webservice project before it is registered. At this point, the dispatcher has all deployed projects registered except the webservice project.

      If I remove all SLSB with the @EJB injections from the Webservices, the deployment runs successfully.

      Has anybody an idea?

      Harry


        • 1. Re: Cannot find service endpoint target
          thomas.diesler

          Could you modify one of our EJB3 samples test cases to reproduce this issue.

          Ideally, you would create a jira issue and attach patch file against the testsuite.

          Does this occur with jbossws-2.0.1 as well?

          http://jbws.dyndns.org/mediawiki/index.php?title=Building_From_Source

          • 2. Re: Cannot find service endpoint target
            garethevans

            Hi,

            I've been having the same issue (with jboss-4.2.1GA and jbossws-2.0.1.GA). I managed to get around it replacing all @EJB annotations with @Resource annotations within my web services.

            Gareth

            • 3. Re: Cannot find service endpoint target
              hansotto

              Sorry for my late response, but I was on vacation.

              Thank you for the ideas.

              Yes, the Error occur also with JbossWS 2.0.1.

              I´ve taken the TestSample called 'webservice' of the JbossWS-native-2.0.1GA package and modified it by adding a simple TestBean with the @EJB annotation inside of the 'EJB3Bean01.java'. See the listing below:

              [EJB3Bean01.java]

              .....
              public class EJB3Bean01 implements EJB3RemoteInterface
              {
               @EJB
               private TestBeanIntf testBean;
              
               @WebMethod
               public String echo(String input)
               {
               return testBean.printString();
               }
              }

              [TestBean.java]
              @Stateless
              @LocalBinding(jndiBinding = "TestBeanIntf")
              public class TestBean implements TestBeanIntf {
              
               public String printString(){
               return "Hello Peter!!";
               }
              }

              This works very well, only if all classes are in the same package,
              if you move the TestBean in another package, the Error I described in the startposting occur.
              So, I think this is the problem.
              Unfortunately, I have more than ten packages with several beans.

              Should I create a new Jira Issue and add the whole zipped eclipse project as an attachment?

              • 4. Re: Cannot find service endpoint target
                richard_opalka

                 

                "hansOtto" wrote:

                Should I create a new Jira Issue and add the whole zipped eclipse project as an attachment?


                Yes, please ;-)

                • 5. Re: Cannot find service endpoint target
                  hansotto

                   

                  "richard_opalka" wrote:
                  "hansOtto" wrote:

                  Should I create a new Jira Issue and add the whole zipped eclipse project as an attachment?


                  Yes, please ;-)

                  done!
                  http://jira.jboss.com/jira/browse/JBWS-1822

                  Thanks a lot!
                  Harry.

                  • 6. Re: Cannot find service endpoint target
                    whichever

                    I'm seeing this same problem. Whats the proper workaround? I'm using 4.2.2.

                    • 7. Re: Cannot find service endpoint target
                      whichever

                      Anyone home?

                      • 8. Re: Cannot find service endpoint target
                        memema

                         

                        "whichever" wrote:
                        Anyone home?

                        Guys,

                        I have been stuffing up one of my clients with jboss ejb3/jax-ws support. I asked them to upgrade to 4.2.2 because of @PreDestroy in sslb & then they say jax-ws is broken.

                        Any news on when this will be fixed?

                        Thanks

                        • 9. Re: Cannot find service endpoint target
                          asoldano

                           

                          "memema" wrote:
                          "whichever" wrote:
                          Anyone home?

                          Guys,

                          I have been stuffing up one of my clients with jboss ejb3/jax-ws support. I asked them to upgrade to 4.2.2 because of @PreDestroy in sslb & then they say jax-ws is broken.

                          Any news on when this will be fixed?

                          Thanks


                          JBWS-1822 is currently scheduled for the 2.0.3 release that should be available on the 1st of February 2008.
                          http://jira.jboss.com/jira/browse/JBWS?report=com.atlassian.jira.plugin.system.project:roadmap-panel

                          • 10. Re: Cannot find service endpoint target
                            ropalka
                            • 11. Re: Cannot find service endpoint target
                              jope

                              I had the same problem as hansOtto. The cause in my case was that the <jta-data-source> written in my META-INF/persistence.xml file didn't match the datasource name in the ...-ds.xml in my deployment directory. (And this needs to match the ...-ds.xml file name afaik.)

                              • 12. Re: Cannot find service endpoint target
                                patrickmadden

                                I know this is asking a lot but it would be amazing if the the error that stated that it couldn't find the service endpoint target also put a warning in the log that said "make sure your persistence.xml jta-data-source element matches your ${foo}-ds.xml's jndi-name element".

                                Otherwise it is very difficult to track down.

                                Thanks,

                                PVM

                                • 13. Re: Cannot find service endpoint target
                                  huberth

                                  I get this error as well with AS4.2.1 and WS2.0.3, as well as with AS4.2.3. I get it on 3 out of 8 web services. All 8 are simple JSR-181 web services and SLSBs - the 3 that fail have @Depends annotations, that being the only commonality I can find. One of the 3 failing ones doesn't even have injected resources.

                                  JBWS-1822 has been closed-won't-fix but I'm not sure how the cross-module ordering workaround in there applies to this case... especially as the service it can't find is the SLSB itself.

                                  It seems to be timing related (race condition?) as, if I remove the @Depends annotations on those 3, 2 of them start up.

                                  • 14. Re: Cannot find service endpoint target
                                    groovie

                                    Salut mecs,

                                    the problem hints to an inavailable ressource on the
                                    session bean, like a delayed of unavailable
                                    datasource.You shold check the server.log for any
                                    kind of ressource problems.

                                    In our case, our web-services suddently ran
                                    into the same problem,. throwing the same exception.
                                    We are using an Oracle-DB for to persist our data.
                                    Sombody changed the OracleDialect to OracleDialect
                                    or another one finally we hat the problems with our
                                    webservice.
                                    Some week later i noticed error messages (only one
                                    line) like this one:

                                    server.log.2009-10-02:2009-10-02 11:28:36,575 INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.Oracle10gDialect
                                    server.log.2009-10-02:2009-10-02 11:39:37,602 INFO [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.OracleDialect
                                    server.log.2009-10-02:2009-10-02 11:39:37,602 WARN [org.hibernate.dialect.Oracle9Dialect] The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect instead

                                    Despite the fact, that this are only warnings, i guess,
                                    i found that smoking gun.

                                    Assumption:
                                    The error/warning condition slowed down the
                                    session bean, causing the WS unsuccessfully
                                    searching for a session bean, that has not been
                                    started.
                                    I switched to the Oracle10gDialect and the problem
                                    disappeared!

                                    Voila