9 Replies Latest reply on May 31, 2007 11:57 AM by Turkhanova Elena

    is there an example that sends a message back?

    Hannes Schulz Newbie

      Hello,

      i 'm looking for example where theres send a message (out of an EJB) and the client recieves a response from the invoked service.

      i adapted the helloworld quickstart example so that the message is send from an ejb, but sofar i havent found something where a response is sent back to the client.

      thanks for a hint...

      regards,
      hasc



        • 1. Re: is there an example that sends a message back?
          Kurt Stam Master

          Hi Hasc,

          In the current architecture we are all about one way async communication, as you already noticed. The only thing you get back is an acknoledgement. So if you want a reply back you need your code to listen on a Q, or file drop, or wait for an email, like in the TrailBlazer. BTW the trailblazer does use a TwoWayCourier to do "synchronous" communication to the clearing house. You may look into using that, but I would suggest keeping with the One-Way Async model.

          I hope this makes sense. Adding features is all about manpower and priorities, and you can influence both of them :). So let us know.

          Cheers,

          --Kurt

          • 2. Re: is there an example that sends a message back?
            Hannes Schulz Newbie

            thanks for reply.

            I am quite new to this environment, so its hard to contribute anything useful here so far. but as soon as i got an example working i will let u know.

            In another thread with a similar question the webservice_war example was mentioned. now i tried to adapt the example in the way, that the request is sent from an entity bean and the result is simply logged to the JBoss AS console.

            I tried it with the following code, including the required jars, like in the webservice example in the *ear directory and defining them in the application.xml


            @Stateless
            @Name("helloworld")
            public class HelloWorldMessageBean implements HelloWorldMessage, Serializable{
            
             @Logger Log log;
            
             String myMessage = "blabla";
            
             public void sayHello()
             {
             log.info("execute sayHello");
            
             try
             {
             Registry registry = RegistryFactory.getRegistry();
            
             Message requestMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
             requestMessage.getBody().setContents(myMessage.getBytes()); // inject the value from the WS client
            
             Message replyMessage=null;
            
             EPR requestEPR = (EPR)registry.findEPR("MyServiceCategory", "MyService"); // from HelloWorld quickstart
            
             EPR replyEPR = CourierUtil.getTemporaryReplyToEpr(requestEPR);
             TwoWayCourier courier = CourierFactory.getCourier(requestEPR, null);
            
             try
             {
             if (requestMessage.getHeader().getCall()==null)
             {
             Call call = new Call();
             requestMessage.getHeader().setCall(call);
             }
             requestMessage.getHeader().getCall().setReplyTo(replyEPR);
            
             if (courier.deliver(requestMessage))
             {
             courier.setReplyToEpr(replyEPR); // why?
             replyMessage = courier.pickup(5000); // attempt for 5 secs
            
             }
             }
             finally
             {
             CourierUtil.cleanCourier(courier) ;
             }
            
             if (replyMessage != null)
             {
             String results = new String(replyMessage.getBody().getContents());
             log.info("replyMessage is:#0", results);
             }
             else
             {
             log.info("replyMessage is null");
             }
             }
             catch (Exception e)
             {
             log.info("Error!");
             }
             }
            }


            and i get the following exception:

            2007-04-07 13:10:19,562 INFO [gmp.service.HelloWorldMessageBean] execute sayHello
            2007-04-07 13:10:19,593 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@383ed6{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,593 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@a58701{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,625 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1b07961{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,625 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@f1036f{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,625 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1187f5b{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,656 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@2a5e75{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,656 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@cfefe9{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,656 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@18fe8fc{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,718 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@b8a28b{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,718 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@e03500{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1b7c9d1{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@122cbaf{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1497537{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1ae8935{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,734 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1b22cc7{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,750 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1df7713{ url=null ,addedOrder=0}
            2007-04-07 13:10:19,906 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@e86073{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,250 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@11a6bc7{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,250 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@f1770a{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,296 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@7661f4{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,406 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@17e18d5{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,406 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1f3386a{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,406 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@158b812{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,421 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@16f6a81{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,421 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@8eaa46, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@1b9ae95{ url=null ,addedOrder=0}
            2007-04-07 13:10:20,437 ERROR [org.apache.juddi.function.FindServiceFunction] java.sql.SQLException: You cannot commit during a managed transaction!
            2007-04-07 13:10:20,437 ERROR [org.apache.juddi.registry.local.AbstractService] java.sql.SQLException: You cannot commit during a managed transaction!
            2007-04-07 13:10:20,437 ERROR [STDERR] java.lang.reflect.InvocationTargetException
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.ws.scout.transport.LocalTransport.send(LocalTransport.java:67)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.ws.scout.registry.RegistryImpl.execute(RegistryImpl.java:273)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.ws.scout.registry.RegistryImpl.findService(RegistryImpl.java:736)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findServices(BusinessQueryManagerImpl.java:638)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:440)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPR(JAXRRegistryImpl.java:348)
            2007-04-07 13:10:20,437 ERROR [STDERR] at gmp.service.HelloWorldMessageBean.sayHello(HelloWorldMessageBean.java:47)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2007-04-07 13:10:20,437 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:37)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.interceptors.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2007-04-07 13:10:20,437 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
            2007-04-07 13:10:20,437 ERROR [STDERR] at $Proxy190.sayHello(Unknown Source)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2007-04-07 13:10:20,437 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.javassist.tmp.java.lang.Object_$$_javassist_11.sayHello(Object_$$_javassist_11.java)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2007-04-07 13:10:20,437 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2007-04-07 13:10:20,437 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2007-04-07 13:10:20,437 ERROR [STDERR] at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
            2007-04-07 13:10:20,437 ERROR [STDERR] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
            2007-04-07 13:10:20,437 ERROR [STDERR] at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:71)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.core.Pages.callAction(Pages.java:499)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.core.Pages.enterPage(Pages.java:282)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:276)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:214)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:56)
            2007-04-07 13:10:20,437 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:249)
            2007-04-07 13:10:20,437 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
            2007-04-07 13:10:20,437 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            2007-04-07 13:10:20,437 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            2007-04-07 13:10:20,453 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
            2007-04-07 13:10:20,453 ERROR [STDERR] Caused by: java.lang.reflect.InvocationTargetException
            2007-04-07 13:10:20,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2007-04-07 13:10:20,453 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2007-04-07 13:10:20,453 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2007-04-07 13:10:20,453 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.ws.scout.transport.LocalTransport.send(LocalTransport.java:63)
            2007-04-07 13:10:20,453 ERROR [STDERR] ... 119 more
            2007-04-07 13:10:20,453 ERROR [STDERR] Caused by: java.lang.Exception: faultCode=null, faultString=You cannot commit during a managed transaction!, faultActor=null, errno=null, errCode=null, errText=null
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.juddi.registry.local.AbstractService.handleRequest(AbstractService.java:269)
            2007-04-07 13:10:20,453 ERROR [STDERR] at org.apache.juddi.registry.local.InquiryService.inquire(InquiryService.java:77)
            2007-04-07 13:10:20,453 ERROR [STDERR] ... 124 more
            2007-04-07 13:10:20,453 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.interpolator
            2007-04-07 13:10:20,453 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.interpolator
            2007-04-07 13:10:20,453 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.interpolator
            2007-04-07 13:10:20,453 INFO [gmp.service.HelloWorldMessageBean] Error!
            2007-04-07 13:10:20,453 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.inter


            the problem seems to be caused by the method:

            EPR requestEPR = (EPR)registry.findEPR("MyServiceCategory", "MyService");


            and i have no clue why.

            • 3. Re: is there an example that sends a message back?
              Burr Sutter Master

              Can you try the code outside of a MDB? I'm wondering if the built-in transaction of a MDB is causing an issue.

              Burr

              • 4. Re: is there an example that sends a message back?
                Hannes Schulz Newbie

                Do you mean by simply removing the @Stateless annotation and compiling its as POJO?

                • 5. Re: is there an example that sends a message back?
                  Burr Sutter Master

                  Sorry. I saw the name of the class and assumed you were working with an MDB. In fact, you are working with a stateless session bean.

                  Where is the entity bean? And why are you using a stateless session bean?
                  Can you give us a picture of your overall architecture?

                  Thanks,
                  Burr

                  • 6. Re: is there an example that sends a message back?
                    Hannes Schulz Newbie

                    well,

                    so far i do not have a entity bean. i just adapted the webservice_war1 in the way i descriped above. sinse it works with the webservice example i just tried to send and recieve a message from a enterprise bean. i tried it also with a stateful bean with the same result.

                    architecture:

                    jboss-4.0.5.GA
                    jboss-esb-4.0GA
                    jboss-seam-1.2.1.GA

                    i called the sayHello method via a jsf page with the expression #{helloworld.sayHello}

                    • 7. Re: is there an example that sends a message back?
                      Turkhanova Elena Newbie

                      I have the same problem calling ListenerUtil.tryToDeliver(...) :
                      java.sql.SQLException: You cannot commit during a managed transaction!

                      I'm using a stateless session bean and here is a bean method which sends a message:

                      public static void sendEsbMsg() throws Exception
                      {

                      Message esbMessage = MessageFactory.getInstance().getMessage();
                      esbMessage.getBody().setContents("test message".getBytes());

                      Call call = new Call();
                      call.setMessageID(new URI(UUID.randomUUID().toString()));
                      esbMessage.getHeader().setCall(call);


                      ListenerUtil.tryToDeliver(esbMessage,"FirstServiceESB", "SimpleListener");

                      }

                      To see test message I run 'ant' from samples\quickstarts\helloworld directory. When running 'ant sendesb' in another window - all works, but when I try to send message with my bean an error occurs. Bean is deployed in server\default\deploy directory. What I'm doing wrong?

                      • 8. Re: is there an example that sends a message back?
                        Turkhanova Elena Newbie

                        The problem is solved bu putting correct jbossesb.xml, jbossesb-properties.xml and juddi.properties into jboss 'conf' directory.

                        • 9. Re: is there an example that sends a message back?
                          Turkhanova Elena Newbie

                          When I used jboss-esb-4.0GA, I solved the problem with "java.sql.SQLException: You cannot commit during a managed transaction!". But when I use jbossesb-4.2MR2, I have this problem again. What I have do just to send esb-aware message from my ejb?