[rules-users] DroolsServiceImplementation - from examples

2013-02-11 Thread MaverickDrools
Hi,

Trying to run the startServers() test at:

https://github.com/droolsjbpm/guvnor/blob/5.5.x/guvnor-webapp-drools/src/test/java/org/drools/guvnor/server/jaxrs/BasicPackageResourceIntegrationTest.java

which gives me an exception:

java.lang.NoClassDefFoundError:
Lorg/drools/guvnor/server/DroolsServiceImplementation;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
at java.lang.Class.getDeclaredFields(Class.java:1743)
at org.junit.runners.model.TestClass.(TestClass.java:40)
at org.junit.runners.ParentRunner.(ParentRunner.java:65)
at
org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:59)
at org.jboss.arquillian.junit.Arquillian.(Arquillian.java:50)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at
org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at
org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at 
org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(JUnit4TestReference.java:33)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(JUnit4TestClassReference.java:25)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException:
org.drools.guvnor.server.DroolsServiceImplementation
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 25 more

I'm guessing I need to add a dependency in the pom file to get the
implementation of this class.

org.drools / guvnor-webapp-drools / 5.5.0.Beta1 is a WAR artifact and so

org.drools.guvnor.server.DroolsServiceImplementation resides within a WAR
file. How can I make it accessible to the JUnit that I'm trying to execute?

Thanks,
Aseem 



--
View this message in context: 
http://drools.46999.n3.nabble.com/DroolsServiceImplementation-from-examples-tp4022218.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] MavenImporter from GuvnorIntegrationTest

2013-02-12 Thread MaverickDrools
Hi,

Any idea about this exception? Tried to google it up, but didn't get
anything satisfactory.

java.lang.RuntimeException: Could not invoke deployment method: public
static org.jboss.shrinkwrap.api.spec.WebArchive
org.drools.guvnor.server.test.GuvnorIntegrationTest.createDeployment()
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:160)
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:94)
at
org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:57)
at
org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)
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:597)
at 
org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
at
org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
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:597)
at 
org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at
org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
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:597)
at 
org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at
org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
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:597)
at 
org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at
org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at
org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
at 
org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(Remo

[rules-users] Effective Dating of Rules

2013-02-18 Thread MaverickDrools
Is there a way to effective date a rule through a program?

Requirement:
without using the Guvnor UI to write the rules, trying to upload a .drl file
using REST APIs which already has rules specified "without" the
date-effective/date-expire attributes. Is there a way to maintain versions
that could be used by effective dating the entire package itself?

Or in general, how do we effective date the rules in Guvnor without using
date-effective attributes for rules and create a knowledgebase from the
package based on the current date?

Thanks



--
View this message in context: 
http://drools.46999.n3.nabble.com/Effective-Dating-of-Rules-tp4022422.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] Getting POJO through rest from Guvnor

2013-02-26 Thread MaverickDrools
Hi,

Uploaded a POJO to Guvnor and I was able to build the package successfully.
I can download the MODEL jar from 

http://localhost:8080/guvnor-5.5.0.Final-tomcat-6.0/org.drools.guvnor.Guvnor/package/packName/LATEST/MODEL

through the web browser. Wished to know how can I download the jar in my
JAVA program in order to create the KnowledgeBase.

Thanks,
Aseem



--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-POJO-through-rest-from-Guvnor-tp4022596.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] Upgrade from drools 5.4 to 6.0.0-Beta3 - Legacy API Adapter JAR

2013-07-02 Thread MaverickDrools
Hi,

There is not enough documentation on drools v6.0.0-Beta3, but this is what
I'm trying to do.

Our system was designed with 5.3 but then we encountered the issue with
synchronization (https://issues.jboss.org/browse/JBRULES-3283), so we
upgraded to v 5.4.

Things worked fine until we multithreaded the client code due to which we
faced another issue (https://issues.jboss.org/browse/JBRULES-3675)

So finally now, I'm trying to upgrade to 6.0.0-Beta3 since both those issues
should've been fixed with 6.0.0-Alpha1. The problem I'm facing is, I do not
have enough documentation to look at to see how to convert those things. I
went through the slides etc that were posted on the mailing list for the
conferences, but I'm still unable to figure it out correctly..

So, can someone point me to a JUnit or something that I can look at to
figure this thing out?

static {
KieServices ks = KieServices.Factory.get();

KieRepository kr = ks.getRepository();

Resource res = ks.getResources().newFileSystemResource(
"src/main/resources/rules/abc.drl");

KieModule kModule = kr.addKieModule(res);
kc = ks.newKieContainer(kModule.getReleaseId());
}

throws an exception on kr.addKieModule(res) which says Error in opening zip
file.. I assume we are now expecting a jar instead of a plain drl file. Is
there a way to convert this drl into a jar that the 6.0 code can understand
(for compatibility purposes with the existing system)?

Another thought was to make use of the Legacy API Adapter JAR, but I
couldn't find any examples of the same. Can you point me to a code
sample/JUnit that could explain how this works?

Thanks



--
View this message in context: 
http://drools.46999.n3.nabble.com/Upgrade-from-drools-5-4-to-6-0-0-Beta3-Legacy-API-Adapter-JAR-tp4024713.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] Upgrade from drools 5.4 to 6.0.0-Beta3 - Legacy API Adapter JAR

2013-07-02 Thread MaverickDrools
Please ignore, I got it working

thanks



--
View this message in context: 
http://drools.46999.n3.nabble.com/Upgrade-from-drools-5-4-to-6-0-0-Beta3-Legacy-API-Adapter-JAR-tp4024713p4024724.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] Upgrading to Drools 6.0 questions (General)

2013-07-08 Thread MaverickDrools
Hi,

We are trying to evaluate what it takes to move from drools 5.4 to drools
6.0

There are some questions that I'd appreciate if someone clarifies after I've
updated the code to use KieContainer instead of KnowledgeBase and
successfully upgraded to drools 6.0.0-Beta3


1. Resolution of the imports:

In previous versions (5.3/5.4) we were able to give import abc.def.* which
would import all the model classes required by a .drl file, this doesn't
seem to be valid anymore. Now we have to give a specific class name in every
import statement so the 6.0 compiler is still able to use it. (eg) import
abc.def.SomeCalss.
Is that a change that was done to the compiler to resolve the imports, or is
it just me?

2. Setting null values:

Some rule in one of my drl files was of the form - 

delare SomeDate
date : java.util.Date
end

rule "do something"
when
.
.
then
insertLogical (new SomeDate(null));
end

I'm assuming the compiler is calling the java.util.Date constructor which
shouldn't allow you to create a date with null being passed to the
constructor. This was ok with the previous versions (upto 5.4) and now
throws a NPE in 5.5 and 6.0. I'd think this should actually be throwing an
IllegalArgumentException with Date but throws a NPE instead. Is that true?
Is the drools compiler now catching that llegalArgumentException and
throwing a org.kie.api.runtime.rule.ConsequenceException due to null Date?

3. KieContainerImpl not serialized:

>From KnowledgeBase javadoc - Creating the KnowledgeBase can be heavy, where
as session creation is very light, so it is recommended that KnowledgeBases
be cached where possible to allow for repeated session creation.
We could achieve this using the EhCache and caching Knowledgebase objects.
We cannot do the same with KieContainer since it throws a
SerializationException with KieContainerImpl is not Serializable. So seems
like we cannot cache these KieCaontainer objects? Or is there some other way
to do that?

4. Release date for 6.0-Final:

What does the roadmap look like for the 6.0-Final?

Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Upgrading-to-Drools-6-0-questions-General-tp4024812.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