0 Replies Latest reply on Jun 27, 2009 7:16 PM by Mike Amann

    Issue with processing of incoming mails

    Mike Amann Newbie

      Hi there,


      right now I'm experimenting with JBoss Seam 2.1 and JBoss 5.1. I'm trying to raise an event whenever a new message arrives.


      I'm using the following code:


      @MessageDriven(activationConfig = {
                @ActivationConfigProperty(propertyName = "mailServer", propertyValue = "<server>"),
                @ActivationConfigProperty(propertyName = "mailFolder", propertyValue = "INBOX"),
                @ActivationConfigProperty(propertyName = "storeProtocol", propertyValue = "pop3"),
                @ActivationConfigProperty(propertyName = "userName", propertyValue = "<user>"),
                @ActivationConfigProperty(propertyName = "password", propertyValue = "<password>"),
                @ActivationConfigProperty(propertyName = "port", propertyValue = "110"),
                @ActivationConfigProperty(propertyName = "pollingInterval", propertyValue = "30000"),
                @ActivationConfigProperty(propertyName = "flush", propertyValue = "false"),
                @ActivationConfigProperty(propertyName = "debug", propertyValue = "false") })
      @ResourceAdapter("mail-ra.rar")
      @Name("incomingMailService")
      public class IncomingMailService implements MailListener {
      
           @In
           private Events events;
           
           public void onMessage(Message message) {
                try {
                     events.raiseEvent("incomingMailReceivedEvent", message);
                     
                } catch (Exception e) {
                     e.printStackTrace();
                }
                
           }
      }
      



      But unfortunately I get the following exception:


      ERROR [STDERR] org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.transaction.synchronizations
      ERROR [STDERR]      at org.jboss.seam.Component.newInstance(Component.java:2144)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:2021)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:2000)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:1994)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:1989)
      ERROR [STDERR]      at org.jboss.seam.transaction.AbstractUserTransaction.getSynchronizations(AbstractUserTransaction.java:79)
      ERROR [STDERR]      at org.jboss.seam.transaction.UTTransaction.registerSynchronization(UTTransaction.java:92)
      ERROR [STDERR]      at org.jboss.seam.bpm.ManagedJbpmContext.joinTransaction(ManagedJbpmContext.java:91)
      ERROR [STDERR]      at org.jboss.seam.bpm.ManagedJbpmContext.getJbpmContext(ManagedJbpmContext.java:73)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      ERROR [STDERR]      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      ERROR [STDERR]      at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
      ERROR [STDERR]      at org.jboss.seam.Component.unwrap(Component.java:2275)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:2041)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:1983)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstance(Component.java:1977)
      ERROR [STDERR]      at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
      ERROR [STDERR]      at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2362)
      ERROR [STDERR]      at org.jboss.seam.Component.getValueToInject(Component.java:2301)
      ERROR [STDERR]      at org.jboss.seam.Component.injectAttributes(Component.java:1736)
      ERROR [STDERR]      at org.jboss.seam.Component.inject(Component.java:1554)
      ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
      ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
      ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
      ERROR [STDERR]      at mypackage.IncomingMailListener_$$_javassist_seam_2.processIncomingMail(IncomingMailListener_$$_javassist_seam_2.java)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
      ERROR [STDERR]      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
      ERROR [STDERR]      at org.jboss.seam.Component.callComponentMethod(Component.java:2253)
      ERROR [STDERR]      at org.jboss.seam.core.Events.raiseEvent(Events.java:85)
      ERROR [STDERR]      at mypackage.incoming.IncomingMailService.onMessage(IncomingMailService.java:32)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
      ERROR [STDERR]      at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)
      ERROR [STDERR]      at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      ERROR [STDERR]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
      ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:118)
      ERROR [STDERR]      at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:83)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:70)
      ERROR [STDERR]      at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:59)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      ERROR [STDERR]      at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
      ERROR [STDERR]      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_24955103.invoke(InvocationContextInterceptor_z_fillMethod_24955103.java)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
      ERROR [STDERR]      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_24955103.invoke(InvocationContextInterceptor_z_setup_24955103.java)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
      ERROR [STDERR]      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:194)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:80)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      ERROR [STDERR]      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      ERROR [STDERR]      at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:282)
      ERROR [STDERR]      at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:270)
      ERROR [STDERR]      at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:140)
      ERROR [STDERR]      at $Proxy2162.onMessage(Unknown Source)
      ERROR [STDERR]      at org.jboss.resource.adapter.mail.inflow.MailActivation.deliverMsg(MailActivation.java:149)
      ERROR [STDERR]      at org.jboss.resource.adapter.mail.inflow.MailActivation.run(MailActivation.java:125)
      ERROR [STDERR]      at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
      ERROR [STDERR]      at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
      ERROR [STDERR]      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      ERROR [STDERR]      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      ERROR [STDERR]      at java.lang.Thread.run(Thread.java:619)
      ERROR [STDERR] Caused by: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@452f63{vfszip:/P:/Server/jboss-server-5.1/server/default/deploy/mail-ra.rar/}]
      ERROR [STDERR]      at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
      ERROR [STDERR]      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
      ERROR [STDERR]      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
      ERROR [STDERR]      at javax.naming.InitialContext.lookup(InitialContext.java:392)
      ERROR [STDERR]      at org.jboss.seam.Component.instantiateSessionBean(Component.java:1400)
      ERROR [STDERR]      at org.jboss.seam.Component.instantiate(Component.java:1364)
      ERROR [STDERR]      at org.jboss.seam.Component.newInstance(Component.java:2122)
      ERROR [STDERR]      ... 116 more
      ERROR [STDERR] Caused by: java.lang.RuntimeException: Can not find interface declared by Proxy in our CL + BaseClassLoader@452f63{vfszip:/P:/Server/jboss-server-5.1/server/default/deploy/mail-ra.rar/}
      ERROR [STDERR]      at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:343)
      ERROR [STDERR]      at org.jboss.ejb3.proxy.impl.objectfactory.session.SessionProxyObjectFactory.createProxy(SessionProxyObjectFactory.java:134)
      ERROR [STDERR]      at org.jboss.ejb3.proxy.impl.objectfactory.session.stateful.StatefulSessionProxyObjectFactory.getProxy(StatefulSessionProxyObjectFactory.java:64)
      ERROR [STDERR]      at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:158)
      ERROR [STDERR]      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
      ERROR [STDERR]      at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
      ERROR [STDERR]      at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
      ERROR [STDERR]      ... 122 more
      ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: org.jboss.seam.transaction.LocalEjbSynchronizations from BaseClassLoader@452f63{VFSClassLoaderPolicy@2a286a{name=vfszip:/P:/Server/jboss-server-5.1/server/default/deploy/mail-ra.rar/ domain=ClassLoaderDomain@1c98360{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@99353f} roots=[MemoryContextHandler@29590728[path= context=vfsmemory://5c4o05-5ub7x2-fwgjxe7e-1-fwgjxp46-22 real=vfsmemory://5c4o05-5ub7x2-fwgjxe7e-1-fwgjxp46-22], DelegatingHandler@21131944[path=mail-ra.rar context=file:/P:/Server/jboss-server-5.1/server/default/deploy/ real=file:/P:/Server/jboss-server-5.1/server/default/deploy/mail-ra.rar], DelegatingHandler@24479412[path=mail-ra.rar/mail-ra.jar context=file:/P:/Server/jboss-server-5.1/server/default/deploy/ real=file:/P:/Server/jboss-server-5.1/server/default/deploy/mail-ra.rar/mail-ra.jar]]  delegates=null exported=[org.jboss.resource.adapter.mail, org.jboss.resource.adapter.mail.inflow, META-INF] <IMPORT-ALL>NON_EMPTY}}
      ERROR [STDERR]      at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
      ERROR [STDERR]      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
      ERROR [STDERR]      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ERROR [STDERR]      at java.lang.Class.forName0(Native Method)
      ERROR [STDERR]      at java.lang.Class.forName(Class.java:247)
      ERROR [STDERR]      at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.redefineProxyInTcl(ProxyObjectFactory.java:339)
      ERROR [STDERR]      ... 128 more
      



      Do you have an idea, what's wrong here?


      Thanks
      Mike