12 Replies Latest reply on Feb 8, 2011 3:33 AM by bwallis42

    jBPM5 demo issues with Eclipse

    vikedvik

      I've been playing with the jBPM5 CR1 demo and I seem to having some issues with the Eclipse tooling. When I import the sample project, the jBPM library does not load with it resulting in several compilation errors. This leads me to my first question. Does the jBPM5 runtime get installed into eclipse when you run install.demo?

       

      After I add the jBPM5 runtime manually to Eclipse and apply it to the project I get the following error when I run the ProcessTest program:

       

      java.lang.NoSuchMethodError: org.drools.common.InternalRuleBase.getRootClassLoader()Lorg/drools/util/CompositeClassLoader;
      at org.jbpm.process.instance.ProcessRuntimeImpl.getRootClassLoader(ProcessRuntimeImpl.java:101)
      at org.jbpm.process.instance.ProcessRuntimeImpl.<init>(ProcessRuntimeImpl.java:58)
      at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:10)
      at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:6)
      at org.drools.runtime.process.ProcessRuntimeFactory.newProcessRuntime(ProcessRuntimeFactory.java:12)
      at org.drools.common.AbstractWorkingMemory.createProcessRuntime(AbstractWorkingMemory.java:389)
      at org.drools.common.AbstractWorkingMemory.setKnowledgeRuntime(AbstractWorkingMemory.java:1774)
      at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:115)
      at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:108)
      at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:391)
      at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:371)
      at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:169)
      at com.sample.ProcessTest.createSession(ProcessTest.java:65)
      at com.sample.ProcessTest.main(ProcessTest.java:37)
      

       

      Looking at my jBPM5 library all the required jars are there so it's strange that I would be getting this error.

        • 1. Re: jBPM5 demo issues with Eclipse
          vikedvik

          Ignore my second question. The jBPM5 runtime I created did off of the extracted folder had some jar mismatches so I re-extracted it and everything is working now. My first question still stands.

          • 2. Re: jBPM5 demo issues with Eclipse
            mattu16

            I just imported the sample project and all worked well. I used the install.demo target

             

            jBPM5 is not being installed into eclipse. Rather it is being downloaded into the ./runtime folder. The jbpm5 plugin is configured to point to this folder for the library by default

            • 3. Re: jBPM5 demo issues with Eclipse
              vikedvik

              Yup I saw that the jBPM5 runtime is installed into the runtime folder and also that the eclipse.preferences.ini has a reference to that as well but when I import the sample project the runtime is missing. Maybe I missed a step I will try it again.

              • 4. Re: jBPM5 demo issues with Eclipse
                mattu16

                Does you .project file containe the following

                 

                <buildCommand>
                <name>org.drools.eclipse.jbpmbuilder</name>
                <arguments>
                </arguments>
                </buildCommand>

                <buildCommand>

                <name>org.drools.eclipse.jbpmbuilder</name>

                <arguments>

                </arguments>

                </buildCommand>

                • 5. Re: jBPM5 demo issues with Eclipse
                  krisverlaenen

                  Vikram,

                   

                  The installer should indeed create a new runtime directory in your jbpm-installer folder and copy the necessary jars there.  When eclipse is started (using the ant script, not manually), it should automatically use the eclipse configuration file to set up the jbpm runtime (so you shouldn't do that manually).  Could you simply retry setting up eclipse etc. to verify?  Simply run "ant clean.demo" and then install.demo and start.demo again.  If it doesn't work, would you mind sharing your OS, ant and java version with me so I can see if this is reproducable?


                  Kris

                  • 6. Re: jBPM5 demo issues with Eclipse
                    vikedvik

                    It does contain the buildcommand with the name org.drools.eclipse.jbpmbuilder. I'm going to retry the installer and see if that solves the problem.

                    • 7. Re: jBPM5 demo issues with Eclipse
                      bwallis42

                      Are you by chance running on MacOSX?

                       

                      I'm having the same problem and have determined that eclipse is starting up with a current working directory of ${install.dir}/eclipse/Eclipse.app/Contents/MacOS which is where the actual executable is. I noticed that the workspace directory was not created where I expected it to be so I searched for it and that is where it was.

                       

                      I modified the ant script to put the full path in for install.path but this seems to have caused other issues with null pointer exceptions when importing the sample project. I also had to modify the build.xml to use this path for the eclipse prefs when starting eclipse, ie:

                       

                       

                          <exec executable="${eclipse.home}/Eclipse.app/Contents/MacOS/eclipse" spawn="yes" os="Mac OS X">

                            <arg value="-data" />

                            <arg value="${eclipse.workspace.dir}" />

                            <arg value="-plugincustomization" />

                            <arg value="${install.home}/eclipse.preferences.ini" />

                          </exec>

                       

                      I'm investigating why the null pointer errors occur but at least it now does setup the jBPM runtime correctly.

                      • 8. jBPM5 demo issues with Eclipse
                        krisverlaenen

                        Thanks, apparently eclipse configuration didn't work for Mac OS, but I couldn't figure out yet why.

                        I'll apply this change.

                         

                        If you could show what kind of null pointer exceptions you are getting, I might be able to help.

                         

                        Thx,

                        Kris

                        • 9. Re: jBPM5 demo issues with Eclipse
                          bwallis42

                          I get a dialog about "Initializing Java Tooling" encountering a problem and the details are:

                           

                          An internal error occurred during: "Initializing Java Tooling".

                          java.lang.NullPointerException

                           

                          Looking in the workspace/.metadata/.log file finds the matching stack traces below.

                           

                          The problem first occurs when the sample project is imported. I've attached the log file from a clean start of eclipse followed by an attempt to import the project.

                           

                          Making the change to the build.xml of ${install.home}/eclipse.preferences.ini won't work unless install.home is an absolute path since a relative path is relative to the CWD of eclipse which is wrong on the mac. I also tried setting the "dir" attribute on the exec but that didn't help either.

                           

                          eclipse.buildId=M20100909-0800

                          java.version=1.6.0_22

                          java.vendor=Apple Inc.

                          BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_AU

                          Framework arguments:  -plugincustomization /Users/bwallis/InfoMedix/JBoss/jbpm/jbpm-installer//eclipse.preferences.ini

                          Command-line arguments:  -os macosx -ws carbon -arch x86 -data /Users/bwallis/InfoMedix/JBoss/jbpm/jbpm-installer//workspace -plugincustomization /Users/bwallis/InfoMedix/JBoss/jbpm/jbpm-installer//eclipse.preferences.ini

                           

                           

                          !ENTRY org.eclipse.jdt.core 4 4 2011-01-13 23:29:33.359

                          !MESSAGE Unable to read variable and containers file

                          !STACK 0

                          java.io.EOFException

                                  at java.io.DataInputStream.readBoolean(DataInputStream.java:227)

                                  at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadBoolean(JavaModelManager.java:3258)

                                  at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadPath(JavaModelManager.java:3348)

                                  at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadContainers(JavaModelManager.java:3320)

                                  at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadProjects(JavaModelManager.java:3378)

                                  at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.load(JavaModelManager.java:3212)

                                  at org.eclipse.jdt.internal.core.JavaModelManager.loadVariablesAndContainers(JavaModelManager.java:3049)

                                  at org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:4705)

                                  at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:5048)

                                  at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)

                                  at java.security.AccessController.doPrivileged(Native Method)

                                  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)

                                  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)

                                  at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)

                                  at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)

                                  at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)

                                  at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)

                                  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)

                                  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)

                                  at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)

                                  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

                                  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                                  at java.lang.Class.getDeclaredConstructors0(Native Method)

                                  at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)

                                  at java.lang.Class.getConstructor0(Class.java:2699)

                                  at java.lang.Class.newInstance0(Class.java:326)

                                  at java.lang.Class.newInstance(Class.java:308)

                                  at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:151)

                                  at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:751)

                                  at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)

                                  at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)

                                  at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)

                                  at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)

                                  at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)

                                  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)

                                  at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)

                                  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                                  at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338)

                                  at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232)

                                  at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197)

                                  at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)

                                  at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)

                                  at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)

                                  at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)

                                  at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:267)

                                  at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)

                                  at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:263)

                                  at org.eclipse.ui.internal.registry.ViewDescriptor.createView(ViewDescriptor.java:63)

                                  at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:327)

                                  at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)

                                  at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)

                                  at org.eclipse.ui.internal.WorkbenchPage$ActivationList.setActive(WorkbenchPage.java:4218)

                                  at org.eclipse.ui.internal.WorkbenchPage$18.runWithException(WorkbenchPage.java:3277)

                                  at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)

                                  at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

                                  at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)

                                  at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3511)

                                  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3239)

                                  at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)

                                  at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1567)

                                  at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)

                                  at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)

                                  at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)

                                  at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3511)

                                  at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3239)

                                  at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)

                                  at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)

                                  at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)

                                  at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

                                  at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)

                                  at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

                                  at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)

                                  at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

                                  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

                                  at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

                                  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)

                                  at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

                                  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:597)

                                  at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)

                                  at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)

                                  at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

                           

                           

                          !ENTRY org.eclipse.core.net 1 0 2011-01-13 23:29:34.900

                          !MESSAGE System property http.nonProxyHosts has been set to local|*.local|169.254/16|*.169.254/16 by an external source. This value will be overwritten using the values from the preferences

                           

                           

                          !ENTRY org.eclipse.core.jobs 4 2 2011-01-13 23:29:35.209

                          !MESSAGE An internal error occurred during: "Initializing Java Tooling".

                          !STACK 0

                          java.lang.NullPointerException

                                  at org.jboss.tools.jbpm.util.DefaultJBPMRuntimeRecognizer.addJarNames(DefaultJBPMRuntimeRecognizer.java:38)

                                  at org.jboss.tools.jbpm.util.DefaultJBPMRuntimeRecognizer.recognizeJars(DefaultJBPMRuntimeRecognizer.java:31)

                                  at org.jboss.tools.jbpm.util.JBPMRuntimeManager.recognizeJars(JBPMRuntimeManager.java:253)

                                  at org.jboss.tools.jbpm.util.JBPMRuntimeManager.getJBPMRuntimeJars(JBPMRuntimeManager.java:228)

                                  at org.jboss.tools.jbpm.util.JBPMClasspathContainer.getJarNames(JBPMClasspathContainer.java:77)

                                  at org.jboss.tools.jbpm.util.JBPMClasspathContainer.createJBPMLibraryEntries(JBPMClasspathContainer.java:65)

                                  at org.jboss.tools.jbpm.util.JBPMClasspathContainer.getClasspathEntries(JBPMClasspathContainer.java:47)

                                  at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2651)

                                  at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2783)

                                  at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1915)

                                  at org.eclipse.jdt.core.JavaCore.initializeAfterLoad(JavaCore.java:3496)

                                  at org.eclipse.jdt.internal.ui.InitializeAfterLoadJob$RealJob.run(InitializeAfterLoadJob.java:35)

                                  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

                          • 10. jBPM5 demo issues with Eclipse
                            vikedvik

                            Sorry I have not had a chance to retry this but yes I am running on a Mac OSX when I got the original problem

                            • 11. Re: jBPM5 demo issues with Eclipse
                              bwallis42

                              I've done a little more investigation and this is certainly a macosx issue.

                               

                              I can get it to work by...

                               

                              editing eclipse/Eclipse.app/Contents/MacOS/eclipse.ini and putting the -data and -plugincustomization arguments into that file so it is now:

                               

                              -startup

                              ../../../plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar

                              --launcher.library

                              ../../../plugins/org.eclipse.equinox.launcher.carbon.macosx_1.1.1.R36x_v20100810

                              -showsplash

                              org.eclipse.platform

                              --launcher.XXMaxPermSize

                              256m

                              --launcher.defaultAction

                              openFile

                              -data

                              ../../../../workspace

                              -plugincustomization

                              ../../../../eclipse.preferences.ini

                              -vmargs

                              -Xms40m

                              -Xmx384m

                              -Xdock:icon=../Resources/Eclipse.icns

                              -XstartOnFirstThread

                              -Dorg.eclipse.swt.internal.carbon.smallFonts

                              and then I also changed the eclipse.preferences.ini file to change the path since it needs to be relative to the CWD for eclipse which is eclipse/Eclipse.app/Contents/MacOS

                               

                              org.jboss.tools.jbpm/jBPM.Runtimes=jBPM runtime#../../../../runtime#true#

                               

                              Now it works as it should.

                              • 12. jBPM5 demo issues with Eclipse
                                bwallis42

                                I've just run the released version of the demo installer (5.0.0)  and it all works as it should in mac osx now. Thanks for the fix!