[rules-users] 5.6.0 Unable to authenticate for rest api: null

2014-02-05 Thread anjana.ackroyd
I had perm gen issues on 5.5 so I upgraded to 5.6 now I get authentication
denied
=== session-guest-9
INFO 05-02 09:42:36,249 (DemoAuthenticator.java:authenticate:54) Demo login
for user (null) failed: unsupported username/credential.
WARN 05-02 09:42:36,265 (AuthorizationHeaderChecker.java:loginByHeader:65)
Unable to authenticate for rest api: null
WARN 05-02 09:42:42,166 (RulesRepositoryManager.java:getRulesRepository:70)
Creating RulesRepository with default username.


In my ChangeSet.xml 

If I access my
'http://vlslcitcat01:8082/guvnor/org.drools.guvnor.Guvnor/package/org.numbercompare/LATEST
with no userid /password and admin/admin it works 
I am not sure why null is being picked up?

I am not sure why its picking up null?


similar changeset worked great on 5.5.0


Also tried commenting out the following lines in beans.xml with no luck.




also commented out 
xmlns:security="urn:java:org.jboss.seam.security"
xmlns:guvnorSecurity="urn:java:org.drools.guvnor.server.security"




Downloaded the guvnor war from 
http://downloads.jboss.org/drools/release/5.6.0.Final/





--
View this message in context: 
http://drools.46999.n3.nabble.com/5-6-0-Unable-to-authenticate-for-rest-api-null-tp4028001.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] permgen error for simple rule stress test

2014-01-29 Thread anjana.ackroyd
Mark,

I did some more analysis  and I tracked it down to Guvnor my app connects to 
running out of memory before the test starts failing.Once I restart guvnor
and redo my tests I get good response time and it eventually starts to slow
down then throw 500 errors.

I see a whole bunch of logs for Creating RulesRepository with default
username.  like before it throws out of memory






WARN  29-01 14:08:18,920 (RulesRepositoryManager.java:getRulesRepository:70)
Creating RulesRepository with default username.
=== session-guest-779944
=== session-guest-779944
java.lang.OutOfMemoryError: GC overhead limit exceeded
at
org.jboss.weld.util.reflection.Reflections$TypeHolder.wrap(Reflections.java:542)
at
org.jboss.weld.util.reflection.Reflections$TypeHolder.access$000(Reflections.java:470)
at
org.jboss.weld.util.reflection.Reflections.isAssignableFrom(Reflections.java:320)
at
org.jboss.weld.util.reflection.Reflections.isAssignableFrom(Reflections.java:290)
at
org.jboss.weld.resolution.ResolvableBuilder.create(ResolvableBuilder.java:123)
at
org.jboss.weld.manager.BeanManagerImpl.getBeans(BeanManagerImpl.java:486)
at
org.jboss.weld.injection.ParameterInjectionPoint.getValueToInject(ParameterInjectionPoint.java:118)
at
org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:217)
at
org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:137)
at
org.jboss.weld.bean.ProducerMethod$ProducerMethodProducer.produce(ProducerMethod.java:136)
at
org.jboss.weld.bean.AbstractProducerBean$AbstractProducer.produce(AbstractProducerBean.java:319)
at
org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:307)
at
org.jboss.weld.context.AbstractContext.get(AbstractContext.java:107)
at
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90)
at
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
at
org.drools.repository.RulesRepository$Proxy$_$$_WeldClientProxy.loadModule(RulesRepository$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.files.FileManagerService.getLastModified(FileManagerService.java:378)
at
org.drools.guvnor.server.files.FileManagerService$Proxy$_$$_WeldClientProxy.getLastModified(FileManagerService$Proxy$_$$_WeldClientProxy.java)
at
org.drools.guvnor.server.files.PackageDeploymentServlet.getLastModified(PackageDeploymentServlet.java:74)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:636)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)






We are running guvnor 5.5.0-Final on Springsource TOmcat 7.0.23




JAVA_HOME="/usr/pservices/jdk1.7.0_45"
AGENT_PATHS=""
JAVA_AGENTS=""
JAVA_LIBRARY_PATH=""
JVM_OPTS="-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m
-XX:MaxPermSize=512m -Xss1024K "
JAVA_OPTS="$JVM_OPTS $AGENT_PATHS $JAVA_AGENTS $JAVA_LIBRARY_PATH"






--
View this message in context: 
http://drools.46999.n3.nabble.com/permgen-error-for-simple-rule-stress-test-tp4027895p4027925.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] permgen error for simple rule stress test

2014-01-28 Thread anjana.ackroyd
We are running a simple stress test (whose code I will paste below) for a
numbercompare rule file)
We get the following error before the test finishes. Which seems odd for one
rule
javax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space

This test is run against 3 loablanced tomcat servers 


Here is my JVM_OPTS for each of those tomcat 
JVM_OPTS="-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m
-XX:MaxPermSize=512m -Xss1024K -XX:+UseCodeCacheFlushing
-XX:-UseSplitVerifier"

Here is 

I have a simple rule file deployed on guvnor on my abc with JVM_OPTS on the
guvnor being
JVM_OPTS="-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m
-XX:MaxPermSize=512m -Xss1024K 




Here is my stress test that we are running

package DroolsTest;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
 
import confident.guppy.tools.Caller;
 
public class DroolsSpeedTest {

public static void main(String[] args) {
HttpURLConnection httpURLConnection = null;
InputStream inputStream = null;
BufferedReader bufferedReader = null;
 
long t1 = System.currentTimeMillis();
for (int i = 0; i < 1; i++) {
try {
long start =
System.currentTimeMillis();
// Three
boxes
String url =
"https://abc-uat2.xyz.com/ces/v2.0/rules/10/compare/10";;


  

   
httpURLConnection = (HttpURLConnection) ( new URL(url).openConnection());
 
if
(httpURLConnection != null) {
   
inputStream = httpURLConnection.getInputStream();
   
bufferedReader = new BufferedReader(new InputStreamReader(

   
inputStream));
   
String results = "";
   
String info = "";
   
while ((info = bufferedReader.readLine()) != null) {

   
results += info;
   
}
   
//caller.log(results);
} else {
   
System.out.println("Unable to create the HTTP connection with the required
server...");
}
 
if (i % 20
== 0 && i != 0 ) {
   
System.out.println(" passing " + i + " ms " + (
System.currentTimeMillis() - start ));
}
 
} catch (Exception boom) {
   
boom.printStackTrace();
   
System.out.println("It died on the " + i + " attempt because " +
boom.getMessage());
}
}
long t2 = System.currentTimeMillis() - t1 ;
System.out.println("I took ms : "+  t2 );
}
}




Here is my rules defined on guvnor 



package org.numbercompare;
declare NumberCompare
message : String
numberone: Integer
numbertwo: Integer
end

rule "numberone is equals to numbertwo"

when
n: NumberCompare(numberone == numbertwo);

then
n.setMessage("numberone is equals to numbertwo");

end

rule "numberone is greater than numbertwo"
when
n: NumberCompare(numberone > numbertwo);

then
n.setMessage("numberone is greater than numbertwo");
end

rule "numberone is 

Re: [rules-users] Drools 5.5 java.lang.ClassCastException: org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration

2013-12-14 Thread anjana.ackroyd
If I take that dependency out I get
java.lang.IllegalArgumentException: Unable to instantiate service for Class
'org.drools.builder.KnowledgeBuilderFactoryService'
at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:166)
at
org.drools.builder.KnowledgeBuilderFactory.loadServiceFactory(KnowledgeBuilderFactory.java:130)
at
org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderServiceFactory(KnowledgeBuilderFactory.java:124)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:85)
at
com.cambiahealth.enterprise.service.rules.EnterpriseDroolsService.readKnowledgeBase(EnterpriseDroolsService.java:66)
at
com.cambiahealth.enterprise.service.rules.EnterpriseDroolsService.getDroolsDTO(EnterpriseDroolsService.java:38)
at
com.cambiahealth.enterprise.service.delegate.EnterpriseDroolsDelegate.compareNumbers(EnterpriseDroolsDelegate.java:22)
at
com.cambiahealth.enterprise.service.endpoint.DroolsEndPoint.compareNumbers(DroolsEndPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
at
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:910)
at
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:858)
at
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:812)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.cambiahealth.enterprise.service.common.filter.LoggerFilter.doFilter(LoggerFilter.java:32)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Unable to instantiate
'org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl'
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:217)
at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:209)
at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.

Re: [rules-users] Drools 5.5 java.lang.ClassCastException: org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration

2013-12-13 Thread anjana.ackroyd
Here is the complete error message
SEVERE: The RuntimeException could not be mapped to a response, re-throwing
to the HTTP container
org.drools.RuntimeDroolsException: Unable to load dialect
'org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration'
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:283)
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:268)
at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:181)
at
org.drools.compiler.PackageBuilderConfiguration.(PackageBuilderConfiguration.java:154)
at
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactoryServiceImpl.java:26)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:85)
at
com.cambiahealth.enterprise.service.rules.EnterpriseDroolsService.readKnowledgeBase(EnterpriseDroolsService.java:66)
at
com.cambiahealth.enterprise.service.rules.EnterpriseDroolsService.getDroolsDTO(EnterpriseDroolsService.java:38)
at
com.cambiahealth.enterprise.service.delegate.EnterpriseDroolsDelegate.compareNumbers(EnterpriseDroolsDelegate.java:22)
at
com.cambiahealth.enterprise.service.endpoint.DroolsEndPoint.compareNumbers(DroolsEndPoint.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
at
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
at
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
at
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
at
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:910)
at
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:858)
at
com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:812)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.cambiahealth.enterprise.service.common.filter.LoggerFilter.doFilter(LoggerFilter.java:32)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang

[rules-users] Drools 5.5 java.lang.ClassCastException: org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration

2013-12-13 Thread anjana.ackroyd
I am stuck with this error 
java.lang.ClassCastException:
org.drools.compiler.rule.builder.dialect.mvel.MVELDialectConfiguration
cannot be cast to org.drools.compiler.DialectConfiguration

I am using Intellij IDE. I have googled the error and tried all options but
nothing seems to work

Here is my pom dependencies
   
org.drools
drools-compiler
5.5.0.Final


org.drools
drools-core
5.5.0.Final


org.drools
knowledge-api
5.5.0.Final


org.mvel
mvel2
2.0.10



org.codehaus.janino
janino
2.5.16


org.apache.servicemix.bundles
org.apache.servicemix.bundles.drools
5.1.1_1







Here is my Code 

//I added the Properties after reading that someone solved the problem using
those lines
   private KnowledgeBase readKnowledgeBase() throws Exception {
Properties props = new Properties();
props.setProperty("drools.dialect.java.compiler", "JANINO");
KnowledgeBuilderConfiguration config =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(props, null);
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(config);

   
kbuilder.add(ResourceFactory.newUrlResource("http://vlslcitcat07.abc.com:38083/guvnor/org.drools.guvnor.Guvnor/package/org.numbercompare/LATEST/ChangeSet.xml";),
ResourceType.CHANGE_SET);

KnowledgeBuilderErrors errors = kbuilder.getErrors();

if (errors.size() > 0) {

for (KnowledgeBuilderError error: errors) {

System.err.println(error);

}

throw new IllegalArgumentException("Could not parse
knowledge.");

}

KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();

kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());

return kbase;





here is my DRL file in Guvnor
rule "numberone is equals to numbertwo"
  when
n: NumberCompare(numberone == numbertwo);

then
n.setMessage("numberone is equals to numbertwo");

end

rule "numberone is greater than numbertwo"
  
when
n: NumberCompare(numberone > numbertwo);

then
n.setMessage("numberone is greater than numbertwo");
end

rule "numberone is less than numbertwo"

when
n: NumberCompare(numberone < numbertwo);

then
n.setMessage("numberone is less than numbertwo");







--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-5-java-lang-ClassCastException-org-drools-compiler-rule-builder-dialect-mvel-MVELDialectConn-tp4027293.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] Drools 5.5.0 - Runtime Exception java.lang.RuntimeException: Provider org.drools.agent.impl.KnowledgeAgentProviderImpl could not be set

2013-12-13 Thread anjana.ackroyd
Here is my snippet of my code in 5.5.0.Final


import org.drools.KnowledgeBase;
import org.drools.agent.KnowledgeAgent;
import org.drools.agent.KnowledgeAgentFactory;
import org.drools.definition.type.FactType;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatelessKnowledgeSession;


KnowledgeAgent ka = KnowledgeAgentFactory.newKnowledgeAgent("MyAgent");
ka.applyChangeSet(
ResourceFactory.newClassPathResource("src/main/resources/ChangeSet.xml") );
KnowledgeBase kb = ka.getKnowledgeBase();

FactType factType =
kb.getFactType("org.numbercompare","NumberCompare");
Object nc = factType.newInstance();
factType.set( nc, "numberone",numberone );
factType.set( nc, "numbertwo", numbertwo );

StatelessKnowledgeSession ks = kb.newStatelessKnowledgeSession();
ks.execute(nc);


I get the following error
java.lang.RuntimeException: Provider
org.drools.agent.impl.KnowledgeAgentProviderImpl could not be set




Here are my dependencies in pom.xml


  

org.drools
drools-compiler
5.5.0.Final


org.drools
drools-core
5.5.0.Final

   
org.drools
knowledge-api
5.5.0.Final






--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-5-0-Runtime-Exception-java-lang-RuntimeException-Provider-org-drools-agent-impl-KnowledgeAgt-tp4027288.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 push changes to cloned repo on Kie-Workbench

2013-12-12 Thread anjana.ackroyd
 I was under the impression that under Authoring->Administration->
Repositories->Clone Repository is actually making a local copy for me to put
my jar files into?
I cloned my repository

GIT URL I used
ssh://gitolite@vlslcdapp01:22/
com.enterprise.service/service-rules-dsl
After I wrote my DRL etc I went Tools->Project Explorer -> Build and Deploy
Then Project Settings -> Add From repository and added the jar I just
created

When I look at Administration I see my repo listed with my package and drl
files in it.

Now if I dont get to push these changes to the service-rules-dsl repo then
how will my Java code access the drl file from it?



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-push-changes-to-cloned-repo-on-Kie-Workbench-tp4027264p4027270.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] How to push changes to cloned repo on Kie-Workbench

2013-12-12 Thread anjana.ackroyd
I was able to do all my steps successfully on the work bench , Cloned my
repository, added a new project, package,drl file, build and deployed it. 

I see wb created the repositories on my local machine which is good but I
dont see a way to push those changes to my cloned reposity 

Git Push?
I am not even sure what branch of the cloned repository the work bench is
using 


I noticed on this URL below there is recommendation to use the
./kie-config-cli.sh script to push changes
http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html/wb.Workbench.html

I downloaded the zip file from 
https://github.com/droolsjbpm/kie-wb-distributions/tree/6.0.x

Ran the script from  \kie-config-cli\src\main\dist but I get a error message 


Exception in thread "main" java.lang.NoClassDefFoundError:
org/kie/config/cli/CmdMain
Caused by: java.lang.ClassNotFoundException: org.kie.config.cli.CmdMain
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:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.kie.config.cli.CmdMain.  Program will
exit.



I was hoping there would be a way to push my changes from the Workbench UI
itself. 







--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-push-changes-to-cloned-repo-on-Kie-Workbench-tp4027264.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] Kie Work Bench missing repositories menu option

2013-12-12 Thread anjana.ackroyd
Thanks adding port 22 helped!

GIT URL I used 
ssh://gitolite@vlslcdapp01:22/com.enterprise.service/service-rules-dsl 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027257.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] Kie Work Bench missing repositories menu option

2013-12-12 Thread anjana.ackroyd
Sorry for not giving the exact error . 

Here is what I see on the console as a pop-up . Although no logs get written
to server.log
Can't clone repository. java.lang.RuntimeException:Exception caught during
execution of fetch command



Here is how I know my GIT URL 
$* git config --get remote.origin.url*
gitolite@vlslcdapp01:com.enterprise.service/service-rules-dsl

In the console -> Clone Repository -> When I put in 
* Git URL
git://gitolite@vlslcdapp01:com.enterprise.service/service-rules-dsl

I get 
Can't clone repository. java.lang.RuntimeException:Exception caught during
execution of fetch command


I tried it with http:// and also ssh:// get the same error . 

Here are the formats for GIT URL 
The following syntaxes may be used with them:

ssh://[user@]host.xz[:port]/path/to/repo.git/

git://host.xz[:port]/path/to/repo.git/

http[s]://host.xz[:port]/path/to/repo.git/

ftp[s]://host.xz[:port]/path/to/repo.git/

rsync://host.xz/path/to/repo.git/

But When I remove gitolite@vlslcdapp01 and add my URL like 
* Git URL
git://com.enterprise.service/service-rules-dsl

or ssh://com.enterprise.service/service-rules-dsl
 it starts cloning, but is in loading mode for ever I assuming thats because
its not the right URL 

The servers are on the same network so no proxy involved. I said it doesnt
like it because the error returns right when I hit Clone button no logs are
being written which is not helpful





--
View this message in context: 
http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027253.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] Kie Work Bench missing repositories menu option

2013-12-11 Thread anjana.ackroyd
Sorry one last question hopefully 

To clone a repository on my machine I run 

git clone gitolite@vlslcdapp01:com.enterprise.service/service-rules-dsl


In the Kie-wb I am trying to clone a repository , if I put the URL as 

git://gitolite@vlslcdapp01:com.enterprise.service/service-rules-dsl it
doesnt like it

I cant just put git://com.enterprise.service/service-rules-dsl because my
repo is hosted on a remote machine  




--
View this message in context: 
http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027224.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] Kie Work Bench missing repositories menu option

2013-12-11 Thread anjana.ackroyd
Yay! I found the conflicting process using that port and now its all golden .
I see all the menu options. 
Although it would be nice to have it working on tomcat as well because thats
the JVM we use enterprise wide. But for now I am going to go ahead and play
with the work bench in jboss!


Thanks a lot !



--
View this message in context: 
http://drools.46999.n3.nabble.com/Re-rules-users-Kie-Work-Bench-missing-repositories-menu-option-tp4027198p4027222.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] Kie Work Bench missing repositories menu option

2013-12-10 Thread anjana.ackroyd
I deployed
kie-drools-wb-distribution-wars-6.0.0-20131207.033517-672-tomcat7.0.war to
my tomcat. I am trying to point it to the repository I have by using the
steps listed
http://docs.jboss.org/jbpm/v6.0/userguide/wb.Workbench.html#wb.QuickStartAddRepository

But under Administration all I see is File Explorer


 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Kie-Work-Bench-missing-repositories-menu-option-tp4027197.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 insert values into drl

2013-12-09 Thread anjana.ackroyd

Thanks. Now when I do a get on Message I get a null value. I was under the
assumption that the drl n.setMessage is setting the value for message 

  FactType factType =
runner.buildFactType("org.drools.test","NumberCompare") ; 
Object nc = factType.newInstance(); 
factType.set( nc, "numberone",Integer.valueOf( 42 )); 
factType.set( nc, "numbertwo", Integer.valueOf( 42 ) ); 
kieSession.insert(nc); 
runner.fireAllRules(); 
System.out.println(factType.get(nc,"message"));--> is
null 




In the DRL 


declare NumberCompare
message : String
numberone: Integer
numbertwo: Integer
end

rule "numberone is equals to numbertwo"
when
n: NumberCompare(numberone == numbertwo);

then
n.setMessage("numberone is equals to numbertwo");

end



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-insert-values-into-drl-tp4027151p4027177.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 insert values into drl

2013-12-09 Thread anjana.ackroyd
Thanks. Now when I do a get on Message I get a null value. I was under the
assumption that the drl n.setMessage is setting the value for message

  FactType factType =
runner.buildFactType("org.drools.test","NumberCompare") ;
Object nc = factType.newInstance();
factType.set( nc, "numberone",Integer.valueOf( 42 ));
factType.set( nc, "numbertwo", Integer.valueOf( 42 ) );
kieSession.insert(nc);
runner.fireAllRules();
System.out.println(factType.get(nc,"message"));--> is
null 




In the DRL 
rule "numberone is equals to numbertwo"
when
n: NumberCompare(numberone == numbertwo);

then
n.setMessage("numberone is equals to numbertwo");

end



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-insert-values-into-drl-tp4027151p4027176.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] 'org.jboss.dashboard-builder:dashboard-builder-bom' not found in repository:

2013-12-09 Thread anjana.ackroyd
When I try to build my drools project I get

Reason: POM 'org.jboss.dashboard-builder:dashboard-builder-bom' not found in
repository: Unable to download the artifact from any repository

  org.jboss.dashboard-builder:dashboard-builder-bom:pom:6.0.0.Final


My pom has 



org.drools
drools-compiler
6.0.0.Final


org.drools
drools-core
6.0.0.Final




junit
junit
4.11




org.slf4j
slf4j-api
1.7.5




org.slf4j
slf4j-log4j12
1.7.5




--
View this message in context: 
http://drools.46999.n3.nabble.com/org-jboss-dashboard-builder-dashboard-builder-bom-not-found-in-repository-tp4027170.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] How to insert values into drl

2013-12-08 Thread anjana.ackroyd
Hi,
I am new to drools and trying to figure out how to get this simple example
working.
I have intellij IDE . 
I am trying to compare two numbers using drools 6.x and dont know how to
insert numberone and numbertwo after I get my drl file into my file system

Here is my code

RuleRunner.java
package com.cambiahealth.enterprise.service.droolsrule;

import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
import org.kie.api.builder.KieRepository;
import org.kie.api.builder.Message.Level;
import org.kie.api.io.KieResources;
import org.kie.api.io.Resource;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;

public class RuleRunner
{
private KieServices kieServices;
private KieContainer kieContainer;
private KieSession kieSession;
private KieResources kieResources;
private KieFileSystem kieFileSystem;
private KieRepository kieRepository;

public RuleRunner()
{
this.kieServices = KieServices.Factory.get();
this.kieResources = kieServices.getResources();
this.kieFileSystem = kieServices.newKieFileSystem();
this.kieRepository = kieServices.getRepository();
}


public void addRuleFile(String packagename, String rulefile)
{
Resource resource = kieResources.newClassPathResource(rulefile);

packagename = packagename.replace(".","/");

String resourcepath =
"src/main/resources/"+packagename+"/"+rulefile;

kieFileSystem.write(resourcepath, resource);
}

public KieSession buildKnowledgeSession()
{
KieBuilder kb = kieServices.newKieBuilder(kieFileSystem);

kb.buildAll();

if (kb.getResults().hasMessages(Level.ERROR))
{
throw new RuntimeException("Build Errors:\n" +
kb.getResults().toString());
}

kieContainer =
kieServices.newKieContainer(kieRepository.getDefaultReleaseId());

kieSession = this.kieContainer.newKieSession();

return kieSession;
}

public KieSession fireAllRules()
{
kieSession.fireAllRules();

return kieSession;
}

public void dispose()
{
this.kieSession.dispose();
}
}






My numbercompare.drl 


declare NumberCompare
message: String
numberone: Integer
numbertwo: Integer
end

rule "numberone is equals to numbertwo"
when
n: NumberCompare(numberone == numbertwo);

then
n.setMessage("numberone is equals to numbertwo");
end

rule "numberone is greater than numbertwo"
when
n: NumberCompare(numberone > numbertwo);

then
n.setMessage("numberone is greater than numbertwo");
end

rule "numberone is less than numbertwo"
when
n: NumberCompare(numberone < numbertwo);

then
n.setMessage("numberone is less than numbertwo");
end









My DroolsService.java where I want to pass in values 1 and 2 to the drl file


runner.addRuleFile("drools", "compareNumberRule.drl");

   KieSession kieSession = runner.buildKnowledgeSession();
  //How do I pass 1 as numberone and 2 as numbertwo values ? before
firerules
runner.fireAllRules();
runner.dispose();
return number.getMessage();  //To change body of implemented methods
use File | Settings | File Templates.
}
}



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-insert-values-into-drl-tp4027151.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] Guvnor 6.0 download and Example Code

2013-12-06 Thread anjana.ackroyd
I am having a hard time finding a link to download Guvnor 6.0 . Can any
please help me find it?

Also I am looking for an example code where I can read drl file created in
Guvnor 6.0 using KIE 

I can find examples for 5.5.0 


 KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "myAgent1"
); 
kagent.applyChangeSet(
ResourceFactory.newUrlResource("http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/pop.blah.test/CAR/LATEST";));
 
KnowledgeBase kbase = kagent.getKnowledgeBase(); 
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession(); 
ResourceFactory.getResourceChangeScannerService().start(); 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-6-0-download-and-Example-Code-tp4027140.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