Classloading error with AspectJ and Drools 5.2.0.Final
by Steven Williams
Hi,
I have just upgraded to Drools 5.2.0.Final and am getting a weird error when
running unit tests.
java.lang.NullPointerException
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
ClassLoaderWeavingAdaptor.java:251)
at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
DefaultWeavingContext.java:130)
at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
ClassLoaderWeavingAdaptor.java:161)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
Aj.java:271)
at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
Aj.java:276)
at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)
at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)
at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
ClassPreProcessorAgentAdapter.java:54)
at sun.instrument.TransformerManager.transform(TransformerManager.java:169)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365
)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
JavaDialectRuntimeData.java:570)
at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:258)
at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:241)
at org.drools.util.CompositeClassLoader.loadClass(
CompositeClassLoader.java:88)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:405)
at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:396)
at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
JavaDialectRuntimeData.java:237)
at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
DialectRuntimeRegistry.java:132)
at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:360)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(
PackageBuilder.java:538)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(
KnowledgeBuilderImpl.java:28)
at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
KnowledgeBaseBuilder.java:108)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:69)
at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:54)
I have traced the problem to org.drools.rule.
JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
whereas AspectJ expects it to at least return an empty enumeration - hence
the NPE. Interestingly the problem does not occur when running our server,
however we can't upgrade unless our unit tests pass and we can't easily turn
off aspectj for these.
regards
Steve
14 years, 6 months
Re: [rules-users] [rules-dev] Building a (semantic) application
by Wolfgang Laun
This list is dedicated to the communication between Drools developers.
For general questions about Drools and rules, please use the "Rules Users
List" <rules-users(a)lists.jboss.org>, which has a much wider audience.
-W
On 7 September 2011 03:56, Sebastian Samaruga <cognescent(a)gmail.com> wrote:
> Question,
>
>
14 years, 6 months
Druplicate rule name: 0
by bitter
I have 100 rules in xls decision table.
I modify any rule and save change. Then I try to build create new knwoledge
base using this file and I have exception:
java.lang.RuntimeException: [784,0]: Duplicate rule name: 0
[801,0]: Duplicate rule name: 0
[818,0]: Duplicate rule name: 0
[837,0]: Duplicate rule name: 0
[856,0]: Duplicate rule name: 0
[873,0]: Duplicate rule name: 0
[890,0]: Duplicate rule name: 0
[907,0]: Duplicate rule name: 0
[924,0]: Duplicate rule name: 0
[941,0]: Duplicate rule name: 0
[958,0]: Duplicate rule name: 0
[975,0]: Duplicate rule name: 0
[992,0]: Duplicate rule name: 0
[1009,0]: Duplicate rule name: 0
I tried to compile this file using SpreadSheetCompiler. This is a scrap of
drl file wth rules:
*
# rule values at A52, header at A5
rule "0"
salience 60
ruleflow-group "0"
when
*
--
View this message in context: http://drools.46999.n3.nabble.com/Druplicate-rule-name-0-tp3246425p324642...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 6 months
encounter NullPointerException when adding ruleflow
by James Yu
Hi all,
I tried to run Drools in a webapp, it runs smoothly when I only load simple
rules.
The spec I have:
AP server --> WASCE2.1 (or geronimo 2.1)
Spring --> 3.0.5
Drools --> 5.2 Fianl
JVM --> IBM SDK 1.6
When I tried to use ruleflow --> execute drl in rf, I got
NullPointerException with the following trace:
exception
org.springframework.web.util.NestedServletException: Request processing
failed; nested exception is java.lang.NullPointerException
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
root cause
java.lang.NullPointerException
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:516)
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:556)
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
net.viralpatel.drools.core.DroolsCore.createKnowledgeBase(DroolsCore.java:17)
net.viralpatel.contact.controller.ContactController.listContacts(ContactController.java:41)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:59)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:39)
java.lang.reflect.Method.invoke(Method.java:612)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
net.viralpatel.drools.core.DroolsCore.createKnowledgeBase(DroolsCore.java:17)
is the following line:
builder.add(ResourceFactory.newClassPathResource("basicFlow.rf"),
ResourceType.DRF);
Any advise is appreciated.
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
14 years, 6 months
Re: [rules-users] rules-users Digest, Vol 58, Issue 17
by James Yu
>
> Are you sure that basicFlow.rf is in your classpath correctly?
>
I am sure that I have both "basicRule.drl" and "basicFlow.rf" files in
classpath as they are located in "WEB-INF\classes"
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
14 years, 6 months
is null or is not Null failing for a String field check in Guvnor drl
by puja nandamuri
Hi ,
when using a business rule guided editor ,
for a fact, when I select a string type field from the drl guided editor in Guvnor and select
is null from the dropdown list of operators,
I get the following validation error when I do a validate on the rule.
no viable alternative at input 'null' in rule "Asset_Description_NullCheckRule"
when I do a View Source, it shows the source as
when
Asset( description == null null )
Is this a bug ?
if I select the free form drl option and create the when condition as
Asset( description == null ) , it validates fine.
Thanks,
Ram
14 years, 6 months
Rules Fest Last Minute Medical Meetup Speakers Wanted
by Mark Proctor
Rules Fest is very close (24-28th of October, San Francisco) and this
year RHT are sponsoring the bootcamps to a high level to ensure that
they are made freely available to all.
http://rulesfest.org/html/home.html
Thu the 27th will follow the normal intro format as previous years,
along with time to ask questions of core developers.
At the last minute budget was found for an additional day on Friday the
28th. Due to the success of the healthcare meet up in San Diego 2010
<http;//community.jboss.org/wiki/DroolsBootCampSanDiegoApril2010>, we
would like to try and dedicate this day to healthcare.
We would like this day to be 100% community presented, by real
practitioners. If you are doing anything interested in the area of
healthcare related to rules, workflow, events, ontologies, distributed
intelligent agents and would like to talk, please contact me asap:
mproctor at codehaus d0t org.
The talks do not need to be Drools specific, but it should be relevant
to any one looking to do Open Source based technology implementations of
the previously mentioned areas. Applied, theoritcal and technical talks
are all welcome.
Again sorry for the last minute notice, but hopefully we can still make
this into a great community oriented day.
Mark
Drools Project Lead and Co-creator
14 years, 6 months
where is drools-api jar file located for 5.2 final ?
by James Yu
Hi all,
I just downloaded and decompress "drools-distribution-5.2.0.Final", I only
find
drools-core-5.2.0.Final.jar
drools-compiler-5.2.0.Final.jar
I am unable to find "drools-api-5.2.0.Final.jar"
Does anyone know where is it located ?
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
14 years, 6 months
Guvnor repository database use to store assets
by puja nandamuri
Hi All,
we are currently using SQLServer as the database repository for Guvnor 5.2.0.CR1
Can somone throw some light on how the database is used by Guvnor in the following scenario?
the first time we deploy Guvnor,we create an empty database and let Guvnor create the necessary Table and other structures necessary for it to save and load assets .
assuming that Guvnor creates the required structures such as Tables etc during the first deploy and may not need to create any further tables , we lock down the database from creating any further tables. Guvnor works fine for all subsequent rules creation and save.
we had to redeploy Guvnor a second time without changing anything with respect to the database.we however, had to delete the existing workspace and repository directories created on local file system to let Guvnor create them afresh.
the expectation is that Guvnor will read the assets from the existing database and create new repository and workspace directories on file system .
Guvnor threw errors saying
Caused By: java.sql.SQLException: [OWLS][SQLServer JDBC
Driver][SQLServer]CREATE TABLE permission denied in database 'GuvnorRules'.
does Guvnor create new Tables everytime we deploy a fresh instance of Guvnor to weblogic ?
or is it the way that I have generated my repository.xml that is causing Guvnor to create new tables to save non asset related data such as indexing etc?
I have attached a sample of my repository.xml for reference.
I appreciate your thoughts and feedback.
Thanks,
Ram
14 years, 6 months