4 Replies Latest reply on Jul 10, 2006 2:21 AM by hien_2008

    Using jBPM with EJB, Could you help me?

    hien_2008

      I have created EJB 3 session bean (stateful) and I have this code as below:

      1. InitialContext ctx = new InitialContext();
      2. JbpmConfiguration cfg = (JbpmConfiguration) ctx.lookup("java:/jbpm/JbpmConfiguration");
      3. JbpmContext __ctx = cfg.createJbpmContext();
      4. GraphSession session = __ctx.getGraphSession();

      I ran this (of course I have jbpm.3.1.sar in deploy folder of jboss server. and JBOSS raised an error at the line 4 with a message (org.jboss.security.SecurityAssociation).

      I did not find out the way to fix this. Anyone who has this experience, pls. share me.

      (my email: hiennguyen@truthinet.com)
      Thanks
      Hien Nguyen

        • 1. Re: Using jBPM with EJB, Could you help me?
          kukeltje

          PLEASE post the full error, how on earth do you think we can know what is going on.

          • 2. Re: Using jBPM with EJB, Could you help me?
            hien_2008

            Hi Ronald,

            Here is error message details
            =========
            2006-07-10 01:55:07,203 ERROR [STDERR] java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProvider
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:109)
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:582)
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:108)
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.create(SimpleStatefulCache.java:207)
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.createSession(StatefulContainer.java:209)
            2006-07-10 01:55:07,203 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxyFactory.createProxy(StatefulLocalProxyFactory.java:100)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.JndiProxyFactory.getObjectInstance(JndiProxyFactory.java:52)
            2006-07-10 01:55:07,218 ERROR [STDERR] at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1125)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1142)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:705)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            2006-07-10 01:55:07,218 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
            2006-07-10 01:55:07,218 ERROR [STDERR] at com.inet.ejb.bo.workflow.WorkflowBusinessBean.initContext(WorkflowBusinessBean.java:44)
            2006-07-10 01:55:07,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2006-07-10 01:55:07,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2006-07-10 01:55:07,218 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2006-07-10 01:55:07,218 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:159)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:105)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:582)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:108)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:227)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
            2006-07-10 01:55:07,218 ERROR [STDERR] Caused by: java.lang.RuntimeException: java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProvider
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:170)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.postConstruct(LifecycleInterceptorHandler.java:105)
            2006-07-10 01:55:07,218 ERROR [STDERR] ... 39 more
            2006-07-10 01:55:07,218 ERROR [STDERR] Caused by: java.lang.IllegalAccessError: tried to access method net.sf.ehcache.CacheManager.()V from class org.hibernate.cache.EhCacheProvider
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:180)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:216)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:433)
            2006-07-10 01:55:07,218 ERROR [STDERR] at com.inet.ejb.bo.workflow.WorkflowContextBean.initContext(WorkflowContextBean.java:51)
            2006-07-10 01:55:07,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            2006-07-10 01:55:07,218 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            2006-07-10 01:55:07,218 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            2006-07-10 01:55:07,218 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
            2006-07-10 01:55:07,218 ERROR [STDERR] at org.jboss.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:159)
            2006-07-10 01:55:07,218 ERROR [STDERR] ... 40 more
            ===================

            - I am using ehcache-1.1.jar and Hibernate3.1.

            Thanks
            Hien Nguyen

            • 3. Re: Using jBPM with EJB, Could you help me?
              kukeltje

              I assume you did not search other forums or the internet. I found this http://www.jbossgroup.com/index.html?module=bb&op=viewtopic&t=85570

              Can you look at it and see if it contains any valuable info?

              • 4. Re: Using jBPM with EJB, Could you help me?
                hien_2008

                Thanks Ronald,

                It's very useful to me and fixed my problem. I just replace ehcache-1.1.jar by using ehcache-1.2.jar and it worked

                BTW: Why the servlet environment (I deployed in TOMCAT without EJB context) works well but EJB? what are differences between these environments?

                Hien