Authorization is not working in guvnor
by Smurfs
Hi
I have installed guvnor-5.5.0.Final-jboss-as-7.0 in JBOSS As 7.1 and it is
working fine.
I am authenticating using JAAS Authenticator and is working fine. But
authorization is not working.
In guvnor, there is a user permission tab where we can create new users and
set roles to them.
Can we use that user to login? At present, i am giving the user list in
users.properties file and it picks from that. But, authorization is not
working. can you please let me know, how to make it work.
Thanks
Smurf
--
View this message in context: http://drools.46999.n3.nabble.com/Authorization-is-not-working-in-guvnor-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Drools Concurrent Execution causes Blocked Threads
by lalit2583
Hi All,
We are using Drools-core 5.2.0.M2 version and we are facing issue while
inserting facts within
StatefulKnowledge session we insert around 50 facts in single request. We
have 10 threads concurrently requesting for fireAllRules. We are using mvel
dialect and our threads are getting blocked over class.forName
Below is the thread dump
java.lang.Thread.State: BLOCKED (on object monitor) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
org.mvel2.ParserConfiguration.checkForDynamicImport(ParserConfiguration.java:110)
at
org.mvel2.ParserConfiguration.hasImport(ParserConfiguration.java:140)
at org.mvel2.ParserContext.hasImport(ParserContext.java:343) at
org.mvel2.compiler.AbstractParser.createPropertyToken(AbstractParser.java:1308)
at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:830)
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:132)
at org.mvel2.util.ParseTools.subCompileExpression(ParseTools.java:2097)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:900)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:338)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:140)
at org.mvel2.ast.ASTNode.optimize(ASTNode.java:158) at
org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115) at
org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:31) at
org.mvel2.ast.Or.getReducedValueAccelerated(Or.java:31) at
org.mvel2.MVELRuntime.execute(MVELRuntime.java:87) at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:125)
at org.mvel2.MVEL.executeExpression(MVEL.java:954) at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:97)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134) at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:360)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:138) at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
at
Please advise if this is a known issues in MVEL 2?
Regards,
Lalit.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Concurrent-Execution-causes-Bloc...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 3 months
Guvnor-5.5.0.Final : Continuously Throws "Connection reset" exception
by Zahid Ahmed
Hi,
We have an application running on Drools-5.5.0.Final. We are unexpectedly getting the following exception continuously. After the occurrence of this exception there is no impact on the application but sometimes application complains for "Unexpected Process Definition Exception" but that is rear. We need to resolve this issue before going live, still if the below exception has no harm.
Can anyone help in this regard as what might be the issue.
07:06:46,745 INFO [org.drools.guvnor.server.security.SecurityServiceImpl] (http--0.0.0.0-8080-8) Logging in user [admin]
07:06:46,748 INFO [org.drools.guvnor.server.security.DemoAuthenticator] (http--0.0.0.0-8080-8) Demo login for user (admin) succeeded.
07:06:46,751 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session opened
07:06:46,754 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15249
07:06:46,756 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15249
07:06:46,758 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15249
07:06:46,777 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session closed
07:06:48,688 INFO [org.drools.guvnor.server.security.SecurityServiceImpl] (http--0.0.0.0-8080-8) Logging in user [admin]
07:06:48,691 INFO [org.drools.guvnor.server.security.DemoAuthenticator] (http--0.0.0.0-8080-8) Demo login for user (admin) succeeded.
07:06:48,694 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session opened
07:06:48,697 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15250
07:06:48,703 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session closed
07:06:48,709 INFO [org.drools.guvnor.server.security.SecurityServiceImpl] (http--0.0.0.0-8080-8) Logging in user [admin]
07:06:48,712 INFO [org.drools.guvnor.server.security.DemoAuthenticator] (http--0.0.0.0-8080-8) Demo login for user (admin) succeeded.
07:06:48,715 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session opened
07:06:48,717 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15251
07:06:48,719 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15251
07:06:48,721 INFO [stdout] (http--0.0.0.0-8080-8) =============== session-admin-15251
07:06:48,743 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session closed
07:06:48,780 ERROR [org.drools.guvnor.server.files.PackageDeploymentServlet] (http--0.0.0.0-8080-5) null: ClientAbortException: java.net.SocketException: Connection reset
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:403) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:354) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:426) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:415) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:83) [jbossweb-7.0.10.Final.jar:]
at org.drools.guvnor.server.files.PackageDeploymentServlet$1.execute(PackageDeploymentServlet.java:272) [classes:5.5.0.Final]
at org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:59) [guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.guvnor.server.files.PackageDeploymentServlet.doGet(PackageDeploymentServlet.java:139) [classes:5.5.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.1.Final.jar:3.1.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.1.Final.jar:3.1.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
Caused by: java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) [rt.jar:1.6.0_30]
at java.net.SocketOutputStream.write(SocketOutputStream.java:136) [rt.jar:1.6.0_30]
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:724) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:449) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:748) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:559) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.Response.doWrite(Response.java:594) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:398) [jbossweb-7.0.10.Final.jar:]
... 33 more
07:06:48,849 WARN [org.drools.guvnor.server.repository.RulesRepositoryManager] (http--0.0.0.0-8080-8) Creating RulesRepository with default username.
07:06:48,786 ERROR [org.drools.guvnor.server.files.PackageDeploymentServlet] (http--0.0.0.0-8080-7) null: ClientAbortException: java.net.SocketException: Connection reset
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:403) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:354) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:426) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:415) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:83) [jbossweb-7.0.10.Final.jar:]
at org.drools.guvnor.server.files.PackageDeploymentServlet$1.execute(PackageDeploymentServlet.java:272) [classes:5.5.0.Final]
at org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:59) [guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.guvnor.server.files.PackageDeploymentServlet.doGet(PackageDeploymentServlet.java:139) [classes:5.5.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.1.Final.jar:3.1.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.1.Final.jar:3.1.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
Caused by: java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) [rt.jar:1.6.0_30]
at java.net.SocketOutputStream.write(SocketOutputStream.java:136) [rt.jar:1.6.0_30]
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:724) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:449) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:748) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:559) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.Response.doWrite(Response.java:594) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:398) [jbossweb-7.0.10.Final.jar:]
... 33 more
07:06:48,874 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/drools-guvnor].[PackageDeploymentServlet]] (http--0.0.0.0-8080-5) Servlet.service() for servlet PackageDeploymentServlet threw exception: java.lang.RuntimeException: ClientAbortException: java.net.SocketException: Connection reset
at org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:67) [guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
at org.drools.guvnor.server.files.PackageDeploymentServlet.doGet(PackageDeploymentServlet.java:139) [classes:5.5.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.1.Final.jar:3.1.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.1.Final.jar:3.1.1.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
Caused by: ClientAbortException: java.net.SocketException: Connection reset
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:403) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:354) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:426) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:415) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:83) [jbossweb-7.0.10.Final.jar:]
at org.drools.guvnor.server.files.PackageDeploymentServlet$1.execute(PackageDeploymentServlet.java:272) [classes:5.5.0.Final]
at org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:59) [guvnor-webapp-core-5.5.0.Final.jar:5.5.0.Final]
... 26 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96) [rt.jar:1.6.0_30]
at java.net.SocketOutputStream.write(SocketOutputStream.java:136) [rt.jar:1.6.0_30]
at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:724) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:449) [jbossweb-7.0.10.Final.jar:]
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:748) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:559) [jbossweb-7.0.10.Final.jar:]
at org.apache.coyote.Response.doWrite(Response.java:594) [jbossweb-7.0.10.Final.jar:]
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:398) [jbossweb-7.0.10.Final.jar:]
... 33 more
07:06:48,873 INFO [org.apache.jackrabbit.core.TransientRepository] (http--0.0.0.0-8080-8) Session opened
Thanks and Best Regards,
Zahid Ahmed
11 years, 3 months
Getting data from a relational database
by rtanikella
Hi,
I am using Drools Server 5.4.0.Final as a web application deployed on JBoss
AS 7.1.1.Final, and Guvnor 5.4.0.Final for authoring/managing the business
rules.
I need to get data from a relational database (and eventually any other
external system) into the WHEN clause of any rule in the Guvnor, and, if
needed, be able to insert that data into the working memory via the THEN
clause. What is the best approach in achieving this? If there are any
examples or samples, please point them out.
Thanks,
Ramgopal Tanikella
--
View this message in context: http://drools.46999.n3.nabble.com/Getting-data-from-a-relational-database...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 4 months
Could not execute Rules getting NPE
by Smurfs
Hi
I am new to Drools. I am using a maven project to connect to guvnor and
execute the rules.
pom.xml
-----------
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>5.5.0.Final</version>
</dependency>
Code
-----
public static void main(String[] args) throws InstantiationException,
IllegalAccessException {
KnowledgeAgent ruleAgent =
KnowledgeAgentFactory.newKnowledgeAgent("/Guvnor.properties");
System.out.println(ruleAgent.getKnowledgeBase().getFactType("org.sample","NumberTest"));
KnowledgeBase ruleBase = ruleAgent.getKnowledgeBase();
System.out.println(ruleBase.getFactType("org.sample","NumberTest"));
FactType factType = ruleBase.getFactType("org.sample",
"NumberTest");
Object obj = factType.newInstance();
factType.set(obj, "numberone", 2);
factType.set(obj, "numbertwo", 1);
StatefulKnowledgeSession workingMemory =
ruleBase.newStatefulKnowledgeSession();
workingMemory.insert(obj);
workingMemory.fireAllRules();
System.out.println(factType.get(obj, "message"));
}
I am getting the null pointer exception as below:
null
Exception in thread "main" java.lang.NullPointerException
at com.test.drools.guvnor.App.main(App.java:44)
I know, that many people has raised this issue, can anyone know why it is
causing the issue?
Thanks
Smurfs
--
View this message in context: http://drools.46999.n3.nabble.com/Could-not-execute-Rules-getting-NPE-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 4 months
Please help me on hibernate-meet-drools
by Hong Ju
Hi,
I would like Drools to save my POJO objects as Hibernate Entities so that I can see my POJO objects as db tables in my database.
These are my relevant files:
1. ApplicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:c="http://www.springframework.org/schema/c"
xmlns:util="http://www.springframework.org/schema/util" xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://drools.org/schema/drools-spring
drools-spring.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="dataSourceH2"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.h2.Driver" />
<property name="url" value="jdbc:h2:tcp://localhost/~/hibernateExample" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSourceH2" />
<property name="persistenceUnitName" value="stewardcareH2" />
<!-- The persistenceXmlLocation needs to be set so that the application will
not incorrectly use the test version. See:
http://stackoverflow.com/a/2949496 -->
<property name="persistenceXmlLocation" value="META-INF/persistence.xml" />
</bean>
<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<drools:grid-node id="CAREEngineNode" />
<drools:kstore id="CAREKnowledgeStore" />
<drools:kbase id="CAREEngineKBase" node="CAREEngineNode">
<drools:configuration>
<drools:assert-behavior mode="EQUALITY" />
</drools:configuration>
<drools:resources>
<drools:resource type="DRL" source="classpath:lily.drl" />
</drools:resources>
</drools:kbase>
</beans>
2. persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
<persistence-unit name="stewardcareH2" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>com.mkyong.stock.Stock</class>
<class>com.mkyong.stock.StockDailyRecord</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.autocommit" value="true" />
<!-- <property name="hibernate.transaction.manager_lookup_class" value= "org.hibernate.transaction.BTMTransactionManagerLookup"/> -->
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform"/>
</properties>
</persistence-unit>
</persistence>
3. Rule file:
package com.mlyong.stock
//list any import classes here.
import com.mkyong.stock.Stock;
//declare any global variables here
rule "My First Rule"
when
$stock: Stock(stockCode == "123")//conditions
then
System.out.println("lily"); //actions
end
4. Java code:
public static void main(String[] args) throws Exception {
System.out.println("Hibernate one to many (Annotation)");
// Session session = HibernateUtil.getSessionFactory().openSession();
// session.beginTransaction();
context = new ClassPathXmlApplicationContext(APPLICATION_CONTEXT_XML);
KnowledgeStoreService kstore = (KnowledgeStoreService) context.getBean("CAREKnowledgeStore");
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, context.getBean("entityManagerFactory"));
BitronixTransactionManager transactionManager= TransactionManagerServices.getTransactionManager();
try {
UserTransaction ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
ut.begin();
// transactionManager.begin();
env.set( EnvironmentName.TRANSACTION_MANAGER, transactionManager);
env.set(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES, new ObjectMarshallingStrategy[]{
new JPAPlaceholderResolverStrategy(env),
new SerializablePlaceholderResolverStrategy
(ClassObjectMarshallingStrategyAcceptor.DEFAULT)});
session = kstore.newStatefulKnowledgeSession((KnowledgeBase)context.getBean("CAREEngineKBase"), null, env);
Stock stock = new Stock();
stock.setStockCode("7052");
stock.setStockName("Lily");
session.insert(stock);
StockDailyRecord stockDailyRecords = new StockDailyRecord();
stockDailyRecords.setPriceOpen(new Float("1.2"));
stockDailyRecords.setPriceClose(new Float("1.1"));
stockDailyRecords.setPriceChange(new Float("10.0"));
stockDailyRecords.setVolume(3000000L);
stockDailyRecords.setDate(new Date());
stockDailyRecords.setStock(stock);
stock.getStockDailyRecords().add(stockDailyRecords);
session.insert(stockDailyRecords);
ut.commit();
System.out.println("Done");
} catch (SecurityException | IllegalStateException | RollbackException
| HeuristicMixedException | HeuristicRollbackException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
I can create tables in db, but there is data saved in the tables. Does anyone know what I am missing here?
Thank you so much in advance,
Hong Lily Ju
Software Engineer
hong.ju(a)steward.org<mailto:derrick.smith@steward.org>
Steward Heath Care
[Description: cid:image001.png@01CD0DC1.C0D81BD0]
Office: 781-375-3034
Cell: 781-801-9313
11 years, 4 months
Complex DSL constraints to fact
by Sean Su
I do not know if anyone has run into the following scenario. If yes, what
is the solution.
We are following the Drools DSL instruction for "adding constraints to the
fact":
[when]There is a Cheese with=Cheese()
[when]- age is less than {age}=age<{age}
[when]- type is '{type}'=type=='{type}'
[when]- country equal to '{country}'=country=='{country}'
However, Our fact is more complicated than just any Cheese(). We want to
look for all cheeses that follow certain constraints and then count them.
So our first line which defines the fact would be something like this:
[when]There are at least {number} cheese=java.util.Collection(
size>{number} ) from collect ( Cheese())
[when]- age is less than {age}=age<{age}
[when]- type is '{type}'=type=='{type}'
[when]- country equal to '{country}'=country=='{country}'
I am hoping that the "additional" constraints defined after "-" will be
added to Cheese(). However, under Guvnor version 5.5, they are added into
the first (), in this case, it is the Collection (size>{number}).
To be more specific, when adding "age is less than {age}" after "There are
at least {number} cheese", the DRL generated becomes:
java.util.Collection( size>{number}, age<{age} ) from collect ( Cheese())
while what I want is:
java.util.Collection( size>{number} ) from collect ( Cheese(age<{age}))
Is this something Drools DSL and Guvnor can't support at all at this time?
or there is something I am not using correctly?
Thanks in advance.
Sean
11 years, 4 months
Drools Server fails starting when reading brl rules from Guvnor
by gfalco77
Hello Community,
I'm having trouble with the integration of Drools Camel Server and Guvnor..
Version 5.5.0
I've created a JAR which contains POJO and used it in Guvnor to create a BRL
rule (in the future will be created by not technical people)..
The problem is that when I start the drools server , it complains that it
cannot find the class Message defined in the Import of the Rules..
Below the configuration of the Knowledge-servics.xml
<drools:grid-node id="node1" />
<drools:resource-change-scanner id="res-scanner1" interval="15"
enabled="true" />
<drools:kbase id="kbase1" node="node1" />
<drools:kagent id="kagent1" kbase="kbase1" new-instance="false">
<drools:resources>
<drools:resource type="PKG"
source="http://localhost:8082/guvnor/org.drools.guvnor.Guvnor/package/<mypackage>/LATEST"
basic-authentication="enabled" username="admin"
password="admin" />
</drools:resources>
</drools:kagent>
<drools:ksession id="ksession1" type="stateless" kbase="kbase1"
node="node1" />
This is my rule in Guvnor
package mypackage
import mypackage.model.Message
rule "first"
dialect "mvel"
when
Message( text == "a" )
then
Message fact0 = new Message();
fact0.setText( "b" );
insert( fact0 );
end
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Server-fails-starting-when-readi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 4 months