4 Replies Latest reply on Feb 8, 2011 12:51 AM by Syed Mahdi

    Exception @Createprocess:  No ClassLoaders found for: javax.jcr.Node

    Syed Mahdi Apprentice

      I have been working with the dvdstore example and created my own project using seam-gen. I added a jbpm process definition and after some effort i was able to create the jBPM tables and start up the application. I (like the dvd store example) have placed my @Createprocess annotation on a method in my EntityHome of an entity which i call when I click on a button. upon clicking that button the method runs fine. and persists the things it needs to persist. but then it throws this exception:

      "Caused by: java.lang.NoClassDefFoundError
           at org.jbpm.context.exe.matcher.JcrNodeMatcher.class$(JcrNodeMatcher.java:33)
           at org.jbpm.context.exe.matcher.JcrNodeMatcher.matches(JcrNodeMatcher.java:33)
           at org.jbpm.context.exe.JbpmType.matches(JbpmType.java:53)
           at org.jbpm.context.exe.VariableInstance.createVariableInstance(VariableInstance.java:86)
           at org.jbpm.context.exe.VariableInstance.create(VariableInstance.java:65)
           at org.jbpm.context.exe.VariableContainer.setVariableLocally(VariableContainer.java:173)
           at org.jbpm.context.exe.VariableContainer.setVariable(VariableContainer.java:45)
           at org.jbpm.context.exe.ContextInstance.setVariable(ContextInstance.java:212)
           at org.jbpm.context.exe.ContextInstance.setVariable(ContextInstance.java:202)
           at org.jboss.seam.contexts.BusinessProcessContext.flushToProcessInstance(BusinessProcessContext.java:206)
           at org.jboss.seam.contexts.BusinessProcessContext.flush(BusinessProcessContext.java:168)
           at org.jboss.seam.bpm.BusinessProcess.afterCreateProcess(BusinessProcess.java:159)
           at org.jboss.seam.bpm.BusinessProcess.createProcess(BusinessProcess.java:152)
           at org.jboss.seam.bpm.BusinessProcessInterceptor.afterInvocation(BusinessProcessInterceptor.java:112)
           at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at gso.conf.action.NDBApplicationHome_$$_javassist_seam_4.submitApplication(NDBApplicationHome_$$_javassist_seam_4.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
           at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348)
           at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
           at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
           at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
           at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
           at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
           ... 53 more
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: javax.jcr.Node
           at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:534)
           at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:428)
           at java.lang.ClassLoader.loadClass(Unknown Source)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Unknown Source)
           ... 92 more"

      now i have the jbpm.jpdl.jar whose metaInf has this manifest file:

      "Manifest-Version: 1.0
      Ant-Version: Apache Ant 1.6.5
      Created-By: 1.5.0_11-b03 (Sun Microsystems Inc.)
      Implementation-Title: jBPM Core Library
      Implementation-Version: 3.2.2 (date:12-Sep-2007 13:59)
      Implementation-URL: http://www.jboss.org/
      Implementation-Vendor: JBoss Inc.
      Implementation-Vendor-Id: http://www.jboss.org/"

      i saw the jar file and the JCR is actually bundled up in org.jbpm.jcr, but still there is no Node class in there either. this is the same jar that is in the dvdstore example libraries as well. What is so wrong here ??? Can anybody please help.

        • 1. Re: Exception @Createprocess:  No ClassLoaders found for: javax.jcr.Node
          Syed Mahdi Apprentice

          I tried putting quotes but it was giving me some errors which didnt mean anything as it was highlighting a word for some underscores needed. so sorry about the format of the post..

          I did get into the server.log and saw that I was doing :

          @Out(scope=ScopeType.BUSINESS_PROCESS, required=false)
               private MyObject appMyObject;

          and setting it in one of the method. On this point it was giving this error. Can i not make any objects as process variables?? then how come the String does not give me the same error I also have

          @Out(value="appcountry",scope=ScopeType.BUSINESS_PROCESS, required=false)
               private String appCountry;

          because it creates:

          2011-02-06 10:17:10,174 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] 1 collections were found in result set for role: org.jbpm.graph.def.Node.exceptionHandlers
          2011-02-06 10:17:10,174 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] Caching collection: [org.jbpm.graph.def.Node.exceptionHandlers#2]
          2011-02-06 10:17:10,174 DEBUG [org.hibernate.cache.NonstrictReadWriteCache] Caching: org.jbpm.graph.def.Node.exceptionHandlers#2
          2011-02-06 10:17:10,174 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] collection fully initialized: [org.jbpm.graph.def.Node.exceptionHandlers#2]
          2011-02-06 10:17:10,174 DEBUG [org.hibernate.engine.loading.CollectionLoadContext] 1 collections initialized for role: org.jbpm.graph.def.Node.exceptionHandlers
          2011-02-06 10:17:10,174 DEBUG [org.hibernate.loader.Loader] done loading collection
          2011-02-06 10:17:10,174 DEBUG [org.hibernate.loader.Loader] done entity load
          2011-02-06 10:17:10,176 DEBUG [org.jboss.seam.contexts.BusinessProcessContext] flushing to process instance: 22
          2011-02-06 10:17:10,176 DEBUG [org.jbpm.context.exe.VariableContainer] create variable 'appcountry' in 'TokenVariableMapde1f90' with value 'United Arab Emirates'
          2011-02-06 10:17:10,184 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'D', 'org.jbpm.context.exe.converter.DoubleToStringConverter'
          2011-02-06 10:17:10,185 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'C', 'org.jbpm.context.exe.converter.CharacterToStringConverter'
          2011-02-06 10:17:10,186 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'B', 'org.jbpm.context.exe.converter.BooleanToStringConverter'
          2011-02-06 10:17:10,187 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'Y', 'org.jbpm.context.exe.converter.BytesToByteArrayConverter'
          2011-02-06 10:17:10,187 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'A', 'org.jbpm.context.exe.converter.DateToLongConverter'
          2011-02-06 10:17:10,188 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'R', 'org.jbpm.context.exe.converter.SerializableToByteArrayConverter'
          2011-02-06 10:17:10,189 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'I', 'org.jbpm.context.exe.converter.IntegerToLongConverter'
          2011-02-06 10:17:10,190 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'H', 'org.jbpm.context.exe.converter.ShortToLongConverter'
          2011-02-06 10:17:10,190 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'G', 'org.jbpm.context.exe.converter.FloatToDoubleConverter'
          2011-02-06 10:17:10,191 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'F', 'org.jbpm.context.exe.converter.FloatToStringConverter'
          2011-02-06 10:17:10,192 DEBUG [org.jbpm.db.hibernate.Converters] adding converter 'E', 'org.jbpm.context.exe.converter.ByteToLongConverter'
          2011-02-06 10:17:10,201 DEBUG [org.jbpm.context.exe.VariableContainer] create variable 'appMyObject' in 'TokenVariableMapde1f90' with value 'package.MyObject@19966f0'
          2011-02-06 10:17:10,202 ERROR [javax.enterprise.resource.webcontainer.jsf.application] java.lang.NoClassDefFoundError
          javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError 

          any explanation will be very very appreciated..


          • 2. Re: Exception @Createprocess:  No ClassLoaders found for: javax.jcr.Node
            Syed Mahdi Apprentice

            Ok I commented out the @OUT MyObject and things styarted working a bit: my question:

            Why is that so. in Seam in Action it states that

            (on page 5 of http://manning.com/dallen/ SeamIACH14 _ bonus. pdf )

            As part of the execution state, it’s possible to store arbitrary variables, represented
            as key-value pairs in the process instance. jBPM allows you to store just about any Java
            data type in the business process context. That list includes
            ■ java.lang.String
            ■ Primitives (int, long, etc.)
            ■ Primitive wrappers (java.lang.Integer, java.lang.Long, etc.)
            ■ byte[]
            ■ java.io.Serializable
            ■ Classes persistable with Hibernate
            Most of the types in this list you’d expect to see. The entry you might find the most
            intriguing is the last one, classes persistable with Hibernate

            Shouldnt be any @Entity be now become a process variable??

            explanations will be appreciated. Iw ould love to have MyObject as a process varibale it will solve a lot of hassle...


            • 3. Re: Exception @Createprocess:  No ClassLoaders found for: javax.jcr.Node
              omid pourhadi Apprentice

              if you want to outject your component into jbpm you have to tell jbpm how to inject it

              Contexts.getBusinessProcessContext().set("reviewGadget", getActiveGadget());

              for more info take a look at practical jboss seam book by jim farley

              • 4. Re: Exception @Createprocess:  No ClassLoaders found for: javax.jcr.Node
                Syed Mahdi Apprentice

                Thanks really appreciate your reply. not many ppl reply on this forum anymore.

                I have one question. i will try to read the book for that error but just asking in case you know whats going on...

                i tried the dvdstore example for jbpm and seam and its working fine and perfectly..

                I even tried and modified it to make their process def to suit my requirements (just to test it out)

                then i made my own project trhough seam gen and the issue coming now is that after the first transition where i create the process variables, they are persisted and used in the task node but after this task node transitions to another task node the columns token processInstance and tokenvariabelMap in JBPM-variableinstance all three are nullified. they are present but not bound to any process instance anymore. i am trying to dig through dvdstore and i still am but not able to find anything that would suggest this behaviour. in dvdstore i checked that they are not nullified and they are still attached to processinstance but in my own created project they are setting to null.

                even my screens are pretty much the same so its not like i am setting these variables to something else.

                I would really appreciate if that can be explained. I saw like three or four posts where ppl were having the same problem.