Re: [rules-users] how to run pkg from java
ok, I think I'm missing the second zip file, my computer contains only one zip file - brms-standalone-5.1.0.zip So I probbly need to send email to RHT and ask for the second zip, as for now my runtime is (brms-standalone-5.1.0) . Thanks for your Help On Fri, Apr 22, 2011 at 6:33 PM, Tihomir Surdilovic tsurd...@redhat.comwrote: Sorry I don't understand I deleted the current run time and link it from the beginning to the runtime. Earlier you said you are using JBoss BRMS so seems like the supported bits you downloaded from the RHT customer support portal. In this case your download should contain two zips, jboss-brms-manager (guvnor) and jboss-brms-engine (core engine). When you create your Drools runtime in Eclipse, you should first unzip jboss-brms-engine into a directory, then point your runtime to that directory. Hope this helps On 4/22/11 3:48 AM, MichaelBini wrote: ok , You are right, I created the pkg file using Eclipse and everything works fine. Then I reconfigured my Eclipse to the BRMS(Window-preferences-Drools-Installed Drools runtime) I deleted the current run time and link it from the beginning to the runtime. But I'm still having the same problem. am I missing something ? -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2850667.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Michael Biniashvili, ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
Look at the BRMS download section in the Customer Support Portal. It contains JBoss BRMS 5.1.0 Standalone which apparently you got. This contains both guvnor and the engine together deployed in the Guvnor web application. On the same download page you should also see JBoss BRMS 5.1.0 which contains the two zips I was talking about. Hope this helps. Thanks. On 4/24/11 8:33 AM, ? ?? wrote: ok, I think I'm missing the second zip file, my computer contains only one zip file - brms-standalone-5.1.0.zip So I probbly need to send email to RHT and ask for the second zip, as for now my runtime is (brms-standalone-5.1.0) . Thanks for your Help On Fri, Apr 22, 2011 at 6:33 PM, Tihomir Surdilovic tsurd...@redhat.com mailto:tsurd...@redhat.com wrote: Sorry I don't understand I deleted the current run time and link it from the beginning to the runtime. Earlier you said you are using JBoss BRMS so seems like the supported bits you downloaded from the RHT customer support portal. In this case your download should contain two zips, jboss-brms-manager (guvnor) and jboss-brms-engine (core engine). When you create your Drools runtime in Eclipse, you should first unzip jboss-brms-engine into a directory, then point your runtime to that directory. Hope this helps On 4/22/11 3:48 AM, MichaelBini wrote: ok , You are right, I created the pkg file using Eclipse and everything works fine. Then I reconfigured my Eclipse to the BRMS(Window-preferences-Drools-Installed Drools runtime) I deleted the current run time and link it from the beginning to the runtime. But I'm still having the same problem. am I missing something ? -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2850667.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Michael Biniashvili, ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
ok , You are right, I created the pkg file using Eclipse and everything works fine. Then I reconfigured my Eclipse to the BRMS(Window-preferences-Drools-Installed Drools runtime) I deleted the current run time and link it from the beginning to the runtime. But I'm still having the same problem. am I missing something ? -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2850667.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
Sorry I don't understand I deleted the current run time and link it from the beginning to the runtime. Earlier you said you are using JBoss BRMS so seems like the supported bits you downloaded from the RHT customer support portal. In this case your download should contain two zips, jboss-brms-manager (guvnor) and jboss-brms-engine (core engine). When you create your Drools runtime in Eclipse, you should first unzip jboss-brms-engine into a directory, then point your runtime to that directory. Hope this helps On 4/22/11 3:48 AM, MichaelBini wrote: ok , You are right, I created the pkg file using Eclipse and everything works fine. Then I reconfigured my Eclipse to the BRMS(Window-preferences-Drools-Installed Drools runtime) I deleted the current run time and link it from the beginning to the runtime. But I'm still having the same problem. am I missing something ? -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2850667.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] how to run pkg from java
Hi , I Build few classes using Eclipse and then import it into JBoss BRMS then I created few rule and and using knowledge base I created binary package. I try to open the pkg using Eclipse with this code : CollectionKnowledgePackage kpkgs = new ArrayListKnowledgePackage(); ObjectInputStream in = new ObjectInputStream(new FileInputStream( c:/com.jspeed.brms.fire.pkg)); Object o = in.readObject(); System.out.println(Read: pkg ok ); in.close(); KnowledgePackage kp = (KnowledgePackage) o; kpkgs.add(kp); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kpkgs); and I am getting error - java.io.ObjectInputStream cannot be cast to org.drools.common.DroolsObjectInput What am I doing wrong ? My imports : import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.definition.KnowledgePackage; import org.drools.runtime.StatefulKnowledgeSession; import org.drools.runtime.rule.FactHandle; -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2848164.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
You are getting this error in one of the lines shown in your email? -W On 21 April 2011 20:52, MichaelBini mich...@jspeed.co.il wrote: Hi , I Build few classes using Eclipse and then import it into JBoss BRMS then I created few rule and and using knowledge base I created binary package. I try to open the pkg using Eclipse with this code : CollectionKnowledgePackage kpkgs = new ArrayListKnowledgePackage(); ObjectInputStream in = new ObjectInputStream(new FileInputStream( c:/com.jspeed.brms.fire.pkg)); Object o = in.readObject(); System.out.println(Read: pkg ok ); in.close(); KnowledgePackage kp = (KnowledgePackage) o; kpkgs.add(kp); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kpkgs); and I am getting error - java.io.ObjectInputStream cannot be cast to org.drools.common.DroolsObjectInput What am I doing wrong ? My imports : import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.definition.KnowledgePackage; import org.drools.runtime.StatefulKnowledgeSession; import org.drools.runtime.rule.FactHandle; -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2848164.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
The full Error - java.lang.ClassCastException: java.io.ObjectInputStream cannot be cast to org.drools.common.DroolsObjectInput at org.drools.rule.JavaDialectRuntimeData.readExternal(JavaDialectRuntimeData.java:111) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.util.HashMap.readObject(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown 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) at java.io.ObjectInputStream.readObject(Unknown Source) at org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:59) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.drools.rule.Package.readExternal(Package.java:194) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at com.jspeed.brms.fire.Alarm2.readKnowledgeBase(Alarm2.java:66) at com.jspeed.brms.fire.Alarm2.main(Alarm2.java:24) Exception in thread main java.lang.NullPointerException at com.jspeed.brms.fire.Alarm2.main(Alarm2.java:28) I get this Error in this line : KnowledgePackage kp = (KnowledgePackage) o; -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2848269.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
I'm not sure how this .pkg file was created, but if I guess correctly, you should be able to add it to a KnowledgeBuilder: kbuilder.add( ResourceFactory.newFileResource( ...pkg ), ResourceType.PKG ); -W On 21 April 2011 20:52, MichaelBini mich...@jspeed.co.il wrote: Hi , I Build few classes using Eclipse and then import it into JBoss BRMS then I created few rule and and using knowledge base I created binary package. I try to open the pkg using Eclipse with this code : CollectionKnowledgePackage kpkgs = new ArrayListKnowledgePackage(); ObjectInputStream in = new ObjectInputStream(new FileInputStream( c:/com.jspeed.brms.fire.pkg)); Object o = in.readObject(); System.out.println(Read: pkg ok ); in.close(); KnowledgePackage kp = (KnowledgePackage) o; kpkgs.add(kp); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kpkgs); and I am getting error - java.io.ObjectInputStream cannot be cast to org.drools.common.DroolsObjectInput What am I doing wrong ? My imports : import java.io.FileInputStream; import java.io.ObjectInputStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.drools.KnowledgeBase; import org.drools.KnowledgeBaseFactory; import org.drools.definition.KnowledgePackage; import org.drools.runtime.StatefulKnowledgeSession; import org.drools.runtime.rule.FactHandle; -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2848164.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
still don't working the code - private static KnowledgeBase readKnowledgeBase() throws Exception { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add( ResourceFactory.newFileResource( c:/com.jspeed.brms.fire.pkg ), ResourceType.PKG ); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); return kbase; } Error - java.lang.RuntimeException: java.io.EOFException at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:544) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28) at com.jspeed.brms.fire.Alarm2.readKnowledgeBase(Alarm2.java:75) at com.jspeed.brms.fire.Alarm2.main(Alarm2.java:27) Caused by: java.io.EOFException at java.io.DataInputStream.readInt(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source) at java.io.ObjectInputStream.readInt(Unknown Source) at org.drools.rule.JavaDialectRuntimeData.readExternal(JavaDialectRuntimeData.java:112) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2849214.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how to run pkg from java
Probably the Drools Runtime configured in Eclipse is not same version as what is used in your Guvnor. Make sure that you are using the same bits on both sides and try again. On 4/21/11 7:19 PM, MichaelBini wrote: still don't working the code - private static KnowledgeBase readKnowledgeBase() throws Exception { KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); kbuilder.add( ResourceFactory.newFileResource( c:/com.jspeed.brms.fire.pkg ), ResourceType.PKG ); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(); kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); return kbase; } Error - java.lang.RuntimeException: java.io.EOFException at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:544) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28) at com.jspeed.brms.fire.Alarm2.readKnowledgeBase(Alarm2.java:75) at com.jspeed.brms.fire.Alarm2.main(Alarm2.java:27) Caused by: java.io.EOFException at java.io.DataInputStream.readInt(Unknown Source) at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source) at java.io.ObjectInputStream.readInt(Unknown Source) at org.drools.rule.JavaDialectRuntimeData.readExternal(JavaDialectRuntimeData.java:112) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) -- View this message in context: http://drools.46999.n3.nabble.com/how-to-run-pkg-from-java-tp2848164p2849214.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users