[rules-users] Problems using Packages from BRMS (urls, serialization, enums..)

Felipe Piccolini felipe.piccolini at bluesoft.cl
Tue Aug 21 12:18:32 EDT 2007


Hi,

Im trying to test the RuleAgent to get a pkg from BRMS (url) but it  
cant load the pkg (which was succesfuly
created) from the snapshot url given by BRMS. If I try to connect to  
that URL I inmediatly get the pkg to download...

Tryed to debug but I stoped at
DroolsObjectInputStream oin = new DroolsObjectInputStream(in);
                 return (Package) oin.readObject();

at HttpClientImpl.java... the readObject() fails from ObjectInputStream.

Here is the stacktrace....

RuleAgent(testSolcredProfesion) INFO (Tue Aug 21 10:12:02 CLT 2007):  
Configuring with newInstance=true, secondsToRefresh=30
RuleAgent(testSolcredProfesion) INFO (Tue Aug 21 10:12:06 CLT 2007):  
Configuring package provider : URLScanner monitoring URLs:  http:// 
localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/ 
cl.bluesoft.test/test_1.0 with local cache dir of /tmp/drools
RuleAgent(testSolcredProfesion) WARNING (Tue Aug 21 10:12:08 CLT  
2007): Falling back to local cache.
java.lang.NullPointerException
	at org.drools.agent.FileScanner.readPackage(FileScanner.java:101)
	at org.drools.agent.FileScanner.getChangeSet(FileScanner.java:79)
	at org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:57)
	at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:93)
	at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:297)
	at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:265)
	at org.drools.agent.RuleAgent.configure(RuleAgent.java:251)
	at org.drools.agent.RuleAgent.init(RuleAgent.java:183)
	at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:140)
	at cl.bluesoft.drools.api.RulesFactory.addRules(RulesFactory.java:149)
	at cl.bluesoft.test.TestBRMS.main(TestBRMS.java:36)

-------
Also downloaded the pakage from the BRMS and used simple  
BinaryRuleBaseLoader:

BinaryRuleBaseLoader loader = new BinaryRuleBaseLoader(ruleBase);
	    loader.addPackage( CONTEXT_CLASS_LOADER.getResourceAsStream 
( binaryPackageFilePath ) );

but I have a problem with serialization... my first thought was about  
different mvel jars, replaced mvel jar in my classpath with the one  
in BRMS war, but
the problem is still there... Im using Enum clases (enum types from  
1.5), maybe this is the problem?... because I cant set the  
serialVersionID in enums.

org.drools.RuntimeDroolsException: java.io.InvalidClassException:  
org.mvel.CompiledExpression; local class incompatible: stream  
classdesc serialVersionUID = -8459552198577984707, local class  
serialVersionUID = -1994048675652702021
	at org.drools.util.BinaryRuleBaseLoader.addPackage 
(BinaryRuleBaseLoader.java:100)
	at org.drools.util.BinaryRuleBaseLoader.addPackage 
(BinaryRuleBaseLoader.java:67)
	at cl.bluesoft.drools.api.RulesFactory.addRulesBinPkg 
(RulesFactory.java:105)
	at cl.bluesoft.solcred.TestSolcredProfesionBinPkg.main 
(TestSolcredProfesionBinPkg.java:35)
Caused by: java.io.InvalidClassException:  
org.mvel.CompiledExpression; local class incompatible: stream  
classdesc serialVersionUID = -8459552198577984707, local class  
serialVersionUID = -1994048675652702021
	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:546)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java: 
1552)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
	at java.io.ObjectInputStream.readOrdinaryObject 
(ObjectInputStream.java:1699)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
	at java.io.ObjectInputStream.defaultReadFields 
(ObjectInputStream.java:1908)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 
1832)
	at java.io.ObjectInputStream.readOrdinaryObject 
(ObjectInputStream.java:1719)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
	at java.io.ObjectInputStream.defaultReadFields 
(ObjectInputStream.java:1908)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 
1832)
	at java.io.ObjectInputStream.readOrdinaryObject 
(ObjectInputStream.java:1719)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
	at java.util.HashMap.readObject(HashMap.java:1013)
	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:585)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java: 
946)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java: 
1809)
	at java.io.ObjectInputStream.readOrdinaryObject 
(ObjectInputStream.java:1719)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
	at org.drools.rule.Package.readExternal(Package.java:184)
	at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java: 
1755)
	at java.io.ObjectInputStream.readOrdinaryObject 
(ObjectInputStream.java:1717)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
	at org.drools.util.BinaryRuleBaseLoader.addPackage 
(BinaryRuleBaseLoader.java:82)
	... 3 more

Thanks for help... I really need to use enums in my model...  :)



Felipe Piccolini M.
felipe.piccolini at bluesoft.cl




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070821/a8079d6a/attachment.html 


More information about the rules-users mailing list