[rules-users] java.lang.ClassCastException: [Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package

Mark Proctor mproctor at codehaus.org
Mon Jul 22 07:31:51 EDT 2013


That's assuming you have done as geoffrey instructed and use the correct classes. Lots of examples here in this unit test, as to which classes to use:
http://grepcode.com/file/repository.jboss.org/nexus/content/repositories/releases/org.drools/drools-compiler/5.5.0.Final/org/drools/agent/KnowledgeAgentTest.java/

So first make sure you are using the correct classes and apis, as per above. Then do as per below, checking your client and server class paths and rebuilding packages on the server.

Mark
On 22 Jul 2013, at 12:24, Mark Proctor <mproctor at codehaus.org> wrote:

> Your's is a different issue. 
> 
> You either have an incorrect class path, with mixed versions. Or your client and your server are using different versions. Or you didn't tell Guvnor to recompile all it's packages, when you changed jar versions.
> 
> Also your try/catch would result in no actual consequence happening - which would be pointless.
> 
> Mark
> On 22 Jul 2013, at 11:17, Ganesh <ganeshneelekani at gmail.com> wrote:
> 
>> Hi David,
>> 
>> 
>> Thanks for response,
>> Exacts exception is "java.lang.ClassCastException:
>> [Lorg.drools.rule.Package; cannot be cast to org.drools.rule.Package "
>> 
>> 
>> And I am not handing exception in any java code ..
>> I am just handling it in rule part.
>> 
>> ex.
>> 
>> dialect "java"
>> no-loop
>> ruleflow-group "Apply Buy Discount"
>> 
>> when
>> 	/*removed*/
>> then
>> 
>> try{
>> 
>> 
>> System.out.println("==================================");
>> System.out.println("Apply Buy Discount");
>> System.out.println($discountPercent);
>> System.out.println($advAdditional);
>> 		System.out.println("==================================");
>> $lql.setEndUserUnitPrice(applyDiscount($lql.getEndUserUnitPrice(),$discountPercent+$advAdditional));
>> 		$lql.setTotalCost(applyDiscount($lql.getTotalCost(),$discountPercent));
>> 	//	update($lql);
>> 
>> }
>> catch(Exception e)
>> {
>> 
>> System.out.println(e.toString());
>> 
>> }
>> 
>> Let me know if any issue.
>> 
>> 
>> Regards
>> Ganesh Neelekani
>> India
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://drools.46999.n3.nabble.com/java-lang-ClassCastException-Lorg-drools-rule-Package-cannot-be-cast-to-org-drools-rule-Package-tp4017821p4025073.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> _______________________________________________
>> 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