[rules-users] BRMS Insurance Sample - Invalid Class Exception -> Solved

Waruzjan Shahbazian wshahbazian at xiam.nl
Tue Nov 27 03:40:20 EST 2007


I found the solution, the mvel in drools-jbrms library is indeed 
mvel14-1.2.10.jar, but probably the compilation of the model wasn't done 
with that version in the classpath?

 Anyway, you need to compile the package  org.acme.insurance.base in a 
.jar file and upload it as the model in the BRMS ( after you 
successfully imported repository_export.xml ) . Than you can deploy the 
package in brms and the test units should work fine.

Waruzjan Shahbazian schreef:
> I am having the same problem. Has anyone got this working?
>
> I have tried using mvel version 1.2.8 and 1.2.10 in the classpath of 
> drools-insurance ( where the jUnit tests are ) and by both the
> serialVersionUID is different. So can anyone tell me which version of 
> mvel is needed to get this working?
>
> Thx,
>
> Waruzjan
>
> John Nader schreef:
>> I am seeing the same issue.  My configuration is slightly different in
>> that I am using Drools 4.0.3 and JBoss 4.2.2GA with Java 5.  I have been
>> searching very hard to find where these two different version of
>> AbstractParser are coming from.   This class comes out of the MVEL.  The
>> jar in the drools-jbrms is mvel14-1.2.10.jar.  I only see this jar
>> within the deployment.
>>
>>  
>>
>> My thought is that a serialized version of the class is stored in a file
>> somewhere in the demo project or the BRMS itself, and that it is from an
>> older version mvel.
>>
>>  
>>
>>  
>>
>> -J
>>
>>  
>>
>> --Original Message-
>>
>> Folks,
>>  
>> Using BRMS 4.0.2 and examples 4.02 as downloaded from the 'official 
>> release' site.
>>  
>> Working my way through the Drools Insurance Sample (on BRMS). I'm 
>> deploying BRMS successfully on JBoss 4.2.1 with Java 1.6.0_02. I can 
>> import the repository_export.xml ok and see the files. I leave this part
>>
>> of the sample running as per the instructions.
>>  
>> When I go to the 2nd part of the example I have a problem running the 
>> unit tests: within /drools-examples/drools-insurance I run: mvn clean 
>> package. I get the error(1) at the bottom of this email. I do *not* 
>> get the output as per the documentaiton. I skip the tests, build and 
>> deploy the drools-insurance.war
>>  
>> When deploying the war I see the following error (2) in the JBoss logs .
>>
>> However main drools insurance page loads ok as per the screenshot in the
>>
>> documentation):
>>  22:43:13,576 INFO  [WebappClassLoader] 
>> validateJarFile(C:\software\jboss-4-2-1\server\default\.\tmp\deploy\tmp2
>> 6632drool
>> s-insurance-exp.war\WEB-INF\lib\servlet-api-2.3.jar) - jar not 
>> loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: 
>> javax/servlet/Servlet.class
>>  
>> I enter some values in the web app (make sure there are no nulls) 
>> press 'continue' then get the same error (3)
>> 22:48:55,294 ERROR [STDERR] java.io.InvalidClassException: 
>> org.mvel.AbstractParser; local class incompatible: stream cla
>> ssdesc serialVersionUID = 256028721591955695, local class 
>> serialVersionUID = -7464517220700761297
>> 22:48:55,310 ERROR [STDERR]     at 
>> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
>>  
>> As an aside , when I look for the latest BRMS , as mentioned in the docs
>>
>> (http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules) - I get a 
>> 'Invalid File or Directory'
>>  
>> Is there anything I should try to resolve this?
>>  
>> Paul
>>  
>>  
>>  
>>  
>>  
>> RuleAgent(insuranceconfig) INFO (Thu Oct 18 22:37:44 BST 2007): 
>> Configuring package provider : URLScanner monitoring URL
>> s:  
>> http://localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/org.acm
>> e.insurance.base/InsuranceDemo
>> RuleAgent(insuranceconfig) EXCEPTION (Thu Oct 18 22:37:45 BST 2007): 
>> org.mvel.AbstractParser; local class incompatible:
>> stream classdesc serialVersionUID = 256028721591955695, local class 
>> serialVersionUID = -7464517220700761297. Stack trace
>>  should follow..io.ObjectStreamClass.initNonProxy(Unknown Source)
>> java.io.InvalidClassException: org.mvel.AbstractParser; local class 
>> incompatible: stream classdesc serialVersionUID = 25
>> 6028721591955695, local class serialVersionUID = -7464517220700761297
>>         at java.io.ObjectStreamClass.initNonProxy(Unknown Source)rce)
>>         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>>         at java.io.ObjectInputStream.readClassDesc(Unknown Source)urce)
>>         at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
>>         at java.io.ObjectInputStream.readClassDesc(Unknown Source)rce)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)Source)
>>         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
>>         at java.io.ObjectInputStream.readSerialData(Unknown Source)ce)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)Source
>>         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
>>         at java.io.ObjectInputStream.readSerialData(Unknown Source)ce)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)Source)
>>         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
>>         at java.io.ObjectInputStream.readSerialData(Unknown Source)ce)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)Source)
>>         at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
>>         at java.io.ObjectInputStream.readSerialData(Unknown Source)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)ource)
>>         at java.io.ObjectInputStream.readObject(Unknown Source)own
>> Source)
>>         at java.util.HashMap.readObject(Unknown Source)ce)
>>         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>>         at java.lang.reflect.Method.invoke(Unknown Source)known Source)
>>         at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
>>         at java.io.ObjectInputStream.readSerialData(Unknown Source)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)urce)
>>         at java.io.ObjectInputStream.readObject(Unknown Source) Source)
>>         at org.drools.rule.Package.readExternal(Package.java:194)
>>         at java.io.ObjectInputStream.readExternalData(Unknown Source)
>>         at java.io.ObjectInputStream.readOrdinaryObject(Unknown 
>> Source)java:54)
>>         at java.io.ObjectInputStream.readObject0(Unknown Source)va:137)
>>         at java.io.ObjectInputStream.readObject(Unknown Source)java:109)
>>         at 
>> org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:54)
>>         at
>> org.drools.agent.URLScanner.readPackage(URLScanner.java:137)0)
>>         at
>> org.drools.agent.URLScanner.getChangeSet(URLScanner.java:109))
>>         at 
>> org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)
>>         at
>> org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330)
>>         at
>> org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298)
>>         at org.drools.agent.RuleAgent.configure(RuleAgent.java:284)48)
>>         at org.drools.agent.RuleAgent.init(RuleAgent.java:208)ava:216)
>>         at 
>> org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:176)romRuleAgent(
>> InsuranceSessionHelper.java:26)
>>         at 
>> org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:148)suranceSessio
>> nHelper.java:17)
>>         at 
>> org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:216)ntalInfoTest.
>> java:23)
>>         at 
>> org.acme.insurance.web.InsuranceSessionHelper.loadRuleBaseFromRuleAgent(
>> InsuranceSessionHelper.java:26)
>>         at 
>> org.acme.insurance.web.InsuranceSessionHelper.getSession(InsuranceSessio
>> nHelper.java:17)
>>         at 
>> org.acme.insurance.test.SupplementalInfoTest.setUp(SupplementalInfoTest.
>> java:23)
>>         at junit.framework.TestCase.runBare(TestCase.java:125)
>>         at junit.framework.TestResult$1.protect(TestResult.java:106)
>>         at junit.framework.TestResult.runProtected(TestResult.java:124)
>>         at junit.framework.TestResult.run(TestResult.java:109)
>>         at junit.framework.TestCase.run(TestCase.java:118)tive Method)
>>         at junit.framework.TestSuite.runTest(TestSuite.java:208)ource)
>>         at junit.framework.TestSuite.run(TestSuite.java:203)nknown
>> Source)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
>> Source)estSet.java:210)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
>> Source)uteTestSet(AbstractDirectoryTestSuite.java:135
>>         at java.lang.reflect.Method.invoke(Unknown Source)
>>         at 
>> org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:2
>> 10)DirectoryTestSuite.java:122)
>>         at 
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSe
>> t(AbstractDirectoryTestSuite.java:135
>> )       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at 
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Abstr
>> actDirectoryTestSuite.java:122)
>>         at
>> org.apache.maven.surefire.Surefire.run(Surefire.java:129)ource)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown 
>> Source)Process(SurefireBooter.java:225)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
>> Source)oter.java:747)
>>         at java.lang.reflect.Method.invoke(Unknown Source)psed: 0.671 
>> sec <<< FAILURE!
>>         at 
>> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Suref
>> ireBooter.java:225)
>>         at 
>> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java
>> :747)
>> Tests run: 5, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 0.655 
>> sec <<< FAILURE!
>> Running org.acme.insurance.test.DriverTestped: 0, Time elapsed: 0 sec 
>> <<< FAILURE!
>> Tests run: 7, Failures: 0, Errors: 7, Skipped: 0, Time elapsed: 0.016 
>> sec <<< FAILURE!
>> Running org.acme.insurance.test.DriverAdditionalInfoTestlapsed: 0.015 
>> sec <<< FAILURE!
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.015 
>> sec <<< FAILURE!
>> Running org.acme.insurance.test.InsuranceCalculateTest
>> Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.016 
>> sec <<< FAILURE!
>>
>>  
>>
>>
>>   
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>   
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list