Here is a better more complete stack trace:

 

Exception in thread "pool-9-thread-8" java.lang.NoClassDefFoundError: javax/pers

istence/EntityManager

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

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

        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

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

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

        at org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectClassLoader.java:99)

        at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:82)

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

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

        at java.lang.Class.forName(Class.java:270)

        at org.kie.scanner.KieModuleMetaDataImpl.getClass(KieModuleMetaDataImpl.java:91)

        at org.guvnor.common.services.builder.Builder.build(Builder.java:162)

        at org.guvnor.common.services.builder.BuildServiceImpl.doBuild(BuildServiceImpl.java:122)

        at org.guvnor.common.services.builder.BuildServiceImpl.build(BuildServiceImpl.java:77)

        at org.guvnor.common.services.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.build(BuildServiceImpl$Proxy$_$$_WeldClientProxy.java)

        at org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$3.run(ResourceChangeIncrementalBuilder.java:214)

 

From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Joe White
Sent: Thursday, March 13, 2014 1:24 PM
To: Rules Users List
Subject: [rules-users] Pojo with spring dependency in DWB

 

What is the best way to import a jar that has a spring dependency into the Drools Workbench? When I upload my pojos that I intend use in my rules I get the exception below. Do I also need to load the spring jars for this to work or is it not possible?

 

Specifically I need my rules objects to have the @Component annotation so that they can be autowired.

 

Exception in thread "pool-9-thread-1" java.lang.NoClassDefFoundError: javax/peristence/EntityManager

        at java.lang.ClassLoader.defineClass1(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

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

        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

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

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

        at org.drools.core.common.ProjectClassLoader.internalLoadClass(ProjectCassLoader.java:99)

        at org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoadr.java:82)

 

 

Joe