Announcement Announcement Module
Collapse
No announcement yet.
AndroMDA/Swing - problem with remote connecting... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AndroMDA/Swing - problem with remote connecting...

    Hi there,

    I am using spring framework from within application generated with AndroMDA. Recently they've applied patch to use the JtaTransactionManager from spring as the default instead of the HibernateTransactionManager and probably this is causing strange effects:

    I have 2 types of clients - web-app (deployed within the same EAR as ejb) and standalone Swing-based application. And here comes "bad voodoo":

    If my session bean (being session facade for some hibernate/spring persistance layer) is being called for the first time by web appliacation based on the same JBoss - everything works ok. Web app (made with bpm4struts) is connecting to the service and so is standalone appliaction.

    BUT if first connection is being made by standalone remote appliacation (and therfore EJB is initialized) - I get exceptions while initializing and ALL following attempts to connect (whenever from web-app or standalone remote application) are failing.

    The problem is posted also here http://galaxy.andromda.org/forum/viewtopic.php?t=398

    Exceptions I get:
    while attempting to make first (after redeployment) connection to ejb service with remote client:
    Code:
    Exception in thread "main" org.springframework.remoting.RemoteAccessException: Cannot access remote service [massolit/ejb/com.massolit.service.MassolitCatalogService]; nested exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
       java.rmi.ServerException: EJBException:; nested exception is: 
       javax.ejb.EJBException: null; CausedByException is: 
       Unable to initialize group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [beanRefFactory]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactory' defined in URL [jar:file:/D:/Programs/jboss-4.0.1sp1/server/default/tmp/deploy/tmp34727massolit-app-0.1.ear-contents/massolit-core-0.1.jar!/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlApplicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceTransactionInterceptor' defined in class path resource [applicationContext.xml]: Can't resolve reference to bean 'transactionManager' while setting property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext-dataSource.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.TransactionSystemException: JTA UserTransaction is not available at JNDI location [java:comp/UserTransaction]; nested exception is javax.naming.NameNotFoundException: UserTransaction not bound 
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
       java.rmi.ServerException: EJBException:; nested exception is: 
       javax.ejb.EJBException: null; CausedByException is: 
       Unable to initialize group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [beanRefFactory]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactory' defined in URL [jar:file:/D:/Programs/jboss-4.0.1sp1/server/default/tmp/deploy/tmp34727massolit-app-0.1.ear-contents/massolit-core-0.1.jar!/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlApplicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceTransactionInterceptor' defined in class path resource [applicationContext.xml]: Can't resolve reference to bean 'transactionManager' while setting property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext-dataSource.xml]: Initialization of bean failed; nested exception is org.springframework.transaction.TransactionSystemException: JTA UserTransaction is not available at JNDI location [java:comp/UserTransaction]; nested exception is javax.naming.NameNotFoundException: UserTransaction not bound 
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325) 
       at sun.rmi.transport.Transport$1.run(Transport.java:153) 
       at java.security.AccessController.doPrivileged(Native Method) 
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149) 
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460) 
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701) 
       at java.lang.Thread.run(Thread.java:595) 
       at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247) 
       at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223) 
       at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126) 
       at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source) 
       at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118) 
       at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227) 
       at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167) 
       at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) 
       at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55) 
       at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97) 
       at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86) 
       at $Proxy2.getSomeText(Unknown Source) 
       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.springframework.remoting.rmi.RmiClientInterceptorUtils.doInvoke(RmiClientInterceptorUtils.java:103) 
       at org.springframework.ejb.access.SimpleRemoteSlsbInvokerInterceptor.doInvoke(SimpleRemoteSlsbInvokerInterceptor.java:75) 
       at org.springframework.ejb.access.AbstractRemoteSlsbInvokerInterceptor.invoke(AbstractRemoteSlsbInvokerInterceptor.java:114) 
       at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) 
       at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) 
       at $Proxy1.getSomeText(Unknown Source) 
       at com.massolit.tests.SimpleTests.<init>&#40;SimpleTests.java&#58;23&#41; 
       at com.massolit.tests.SimpleTests.main&#40;SimpleTests.java&#58;28&#41; 
    Caused by&#58; java.rmi.ServerException&#58; EJBException&#58;; nested exception is&#58; 
       javax.ejb.EJBException&#58; null; CausedByException is&#58; 
       Unable to initialize group definition. Group resource name &#91;classpath*&#58;beanRefFactory.xml&#93;, factory key &#91;beanRefFactory&#93;; nested exception is org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'beanRefFactory' defined in URL &#91;jar&#58;file&#58;/D&#58;/Programs/jboss-4.0.1sp1/server/default/tmp/deploy/tmp34727massolit-app-0.1.ear-contents/massolit-core-0.1.jar!/beanRefFactory.xml&#93;&#58; Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException&#58; Could not instantiate class &#91;org.springframework.context.support.ClassPathXmlApplicationContext&#93;; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'serviceTransactionInterceptor' defined in class path resource &#91;applicationContext.xml&#93;&#58; Can't resolve reference to bean 'transactionManager' while setting property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'transactionManager' defined in class path resource &#91;applicationContext-dataSource.xml&#93;&#58; Initialization of bean failed; nested exception is org.springframework.transaction.TransactionSystemException&#58; JTA UserTransaction is not available at JNDI location &#91;java&#58;comp/UserTransaction&#93;; nested exception is javax.naming.NameNotFoundException&#58; UserTransaction not bound 
       at org.jboss.ejb.plugins.LogInterceptor.handleException&#40;LogInterceptor.java&#58;352&#41; 
       at org.jboss.ejb.plugins.LogInterceptor.invoke&#40;LogInterceptor.java&#58;196&#41; 
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke&#40;ProxyFactoryFinderInterceptor.java&#58;122&#41; 
       at org.jboss.ejb.SessionContainer.internalInvoke&#40;SessionContainer.java&#58;624&#41; 
       at org.jboss.ejb.Container.invoke&#40;Container.java&#58;870&#41; 
       at sun.reflect.NativeMethodAccessorImpl.invoke0&#40;Native Method&#41; 
       at sun.reflect.NativeMethodAccessorImpl.invoke&#40;NativeMethodAccessorImpl.java&#58;39&#41; 
       at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;DelegatingMethodAccessorImpl.java&#58;25&#41; 
       at java.lang.reflect.Method.invoke&#40;Method.java&#58;585&#41; 
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke&#40;ReflectedDispatcher.java&#58;144&#41; 
       at org.jboss.mx.server.Invocation.dispatch&#40;Invocation.java&#58;80&#41; 
       at org.jboss.mx.server.Invocation.invoke&#40;Invocation.java&#58;72&#41; 
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke&#40;AbstractMBeanInvoker.java&#58;249&#41; 
       at org.jboss.mx.server.MBeanServerImpl.invoke&#40;MBeanServerImpl.java&#58;642&#41; 
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke&#40;JRMPInvoker.java&#58;805&#41; 
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke&#40;JRMPInvoker.java&#58;406&#41; 
       at sun.reflect.NativeMethodAccessorImpl.invoke0&#40;Native Method&#41; 
       at sun.reflect.NativeMethodAccessorImpl.invoke&#40;NativeMethodAccessorImpl.java&#58;39&#41; 
       at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;DelegatingMethodAccessorImpl.java&#58;25&#41; 
       at java.lang.reflect.Method.invoke&#40;Method.java&#58;585&#41; 
       at sun.rmi.server.UnicastServerRef.dispatch&#40;UnicastServerRef.java&#58;294&#41; 
       at sun.rmi.transport.Transport$1.run&#40;Transport.java&#58;153&#41; 
       at java.security.AccessController.doPrivileged&#40;Native Method&#41; 
       at sun.rmi.transport.Transport.serviceCall&#40;Transport.java&#58;149&#41; 
       at sun.rmi.transport.tcp.TCPTransport.handleMessages&#40;TCPTransport.java&#58;460&#41; 
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run&#40;TCPTransport.java&#58;701&#41; 
       at java.lang.Thread.run&#40;Thread.java&#58;595&#41; 
    Caused by&#58; javax.ejb.EJBException&#58; null; CausedByException is&#58; 
       Unable to initialize group definition. Group resource name &#91;classpath*&#58;beanRefFactory.xml&#93;, factory key &#91;beanRefFactory&#93;; nested exception is org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'beanRefFactory' defined in URL &#91;jar&#58;file&#58;/D&#58;/Programs/jboss-4.0.1sp1/server/default/tmp/deploy/tmp34727massolit-app-0.1.ear-contents/massolit-core-0.1.jar!/beanRefFactory.xml&#93;&#58; Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException&#58; Could not instantiate class &#91;org.springframework.context.support.ClassPathXmlApplicationContext&#93;; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'serviceTransactionInterceptor' defined in class path resource &#91;applicationContext.xml&#93;&#58; Can't resolve reference to bean 'transactionManager' while setting property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException&#58; Error creating bean with name 'transactionManager' defined in class path resource &#91;applicationContext-dataSource.xml&#93;&#58; Initialization of bean failed; nested exception is org.springframework.transaction.TransactionSystemException&#58; JTA UserTransaction is not available at JNDI location &#91;java&#58;comp/UserTransaction&#93;; nested exception is javax.naming.NameNotFoundException&#58; UserTransaction not bound 
       at org.jboss.ejb.StatelessSessionEnterpriseContext.<init>&#40;StatelessSessionEnterpriseContext.java&#58;70&#41; 
       at org.jboss.ejb.plugins.StatelessSessionInstancePool.create&#40;StatelessSessionInstancePool.java&#58;35&#41; 
       at org.jboss.ejb.plugins.AbstractInstancePool.get&#40;AbstractInstancePool.java&#58;146&#41; 
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke&#40;StatelessSessionInstanceInterceptor.java&#58;80&#41; 
       at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke&#40;ServiceEndpointInterceptor.java&#58;51&#41; 
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke&#40;CallValidationInterceptor.java&#58;48&#41; 
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext&#40;AbstractTxInterceptor.java&#58;105&#41; 
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions&#40;TxInterceptorCMT.java&#58;313&#41; 
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke&#40;TxInterceptorCMT.java&#58;146&#41; 
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke&#40;SecurityInterceptor.java&#58;122&#41; 
       at org.jboss.ejb.plugins.LogInterceptor.invoke&#40;LogInterceptor.java&#58;192&#41; 
       ... 25 more
    If I try to connect with web app I get such en exceptions:
    Code:
    javax.servlet.ServletException&#58; UserTransaction not bound 
    org.apache.struts.action.RequestProcessor.processException&#40;RequestProcessor.java&#58;516&#41; 
    org.apache.struts.action.RequestProcessor.processActionPerform&#40;RequestProcessor.java&#58;423&#41; 
    org.apache.struts.action.RequestProcessor.process&#40;RequestProcessor.java&#58;226&#41; 
    org.apache.struts.action.ActionServlet.process&#40;ActionServlet.java&#58;1164&#41; 
    org.apache.struts.action.ActionServlet.doGet&#40;ActionServlet.java&#58;397&#41; 
    javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;697&#41; 
    javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;810&#41; 
    org.apache.struts.action.RequestProcessor.doForward&#40;RequestProcessor.java&#58;1056&#41; 
    org.apache.struts.tiles.TilesRequestProcessor.doForward&#40;TilesRequestProcessor.java&#58;261&#41; 
    org.apache.struts.action.RequestProcessor.processForwardConfig&#40;RequestProcessor.java&#58;388&#41; 
    org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig&#40;TilesRequestProcessor.java&#58;316&#41; 
    org.apache.struts.action.RequestProcessor.process&#40;RequestProcessor.java&#58;231&#41; 
    org.apache.struts.action.ActionServlet.process&#40;ActionServlet.java&#58;1164&#41; 
    org.apache.struts.action.ActionServlet.doGet&#40;ActionServlet.java&#58;397&#41; 
    javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;697&#41; 
    javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;810&#41; 
    org.displaytag.filter.ResponseOverrideFilter.doFilter&#40;ResponseOverrideFilter.java&#58;125&#41; 
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter&#40;ReplyHeaderFilter.java&#58;75&#41; 
    
    root cause 
    
    javax.naming.NameNotFoundException&#58; UserTransaction not bound 
    org.jnp.server.NamingServer.getBinding&#40;NamingServer.java&#58;491&#41; 
    org.jnp.server.NamingServer.getBinding&#40;NamingServer.java&#58;499&#41; 
    org.jnp.server.NamingServer.getObject&#40;NamingServer.java&#58;505&#41; 
    org.jnp.server.NamingServer.lookup&#40;NamingServer.java&#58;278&#41; 
    org.jnp.interfaces.NamingContext.lookup&#40;NamingContext.java&#58;544&#41; 
    org.jnp.interfaces.NamingContext.lookup&#40;NamingContext.java&#58;658&#41; 
    org.jnp.interfaces.NamingContext.lookup&#40;NamingContext.java&#58;520&#41; 
    javax.naming.InitialContext.lookup&#40;InitialContext.java&#58;351&#41; 
    org.springframework.jndi.JndiTemplate$1.doInContext&#40;JndiTemplate.java&#58;123&#41; 
    org.springframework.jndi.JndiTemplate.execute&#40;JndiTemplate.java&#58;85&#41; 
    org.springframework.jndi.JndiTemplate.lookup&#40;JndiTemplate.java&#58;121&#41; 
    org.springframework.jndi.JndiTemplate.lookup&#40;JndiTemplate.java&#58;146&#41; 
    org.springframework.transaction.jta.JtaTransactionManager.lookupUserTransaction&#40;JtaTransactionManager.java&#58;459&#41; 
    org.springframework.transaction.jta.JtaTransactionManager.afterPropertiesSet&#40;JtaTransactionManager.java&#58;372&#41; 
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods&#40;AbstractAutowireCapableBeanFactory.java&#58;962&#41; 
    org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean&#40;AbstractAutowireCapableBeanFactory.java&#58;354&#41; 
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean&#40;AbstractBeanFactory.java&#58;223&#41;
    If the first connection is made with web-app - service initializes properly and both remote and web apps are able to connect...
Working...
X