[rules-users] Guvnor - Decision Tables

David Sinclair dsinclair at chariotsolutions.com
Mon Jan 11 10:59:13 EST 2010


Guvnor uses reflection to find out about classes in your object model, so
any referenced class also needs to be uploaded.

I would suggest, if possible, that you make a smaller JAR only consisting of
your fact objects and try to only reference the service objects from their
interface as opposed to implentation via a Drools global variable or normal
object that you match on. For example, as opposed to coding to
FooServiceImpl that references JMS/JEE classes directly, have a global that
is type FooService that is just the interface.

dave

On Mon, Jan 11, 2010 at 10:33 AM, HonorGod <
jagadeesh.motamarri at barclayscapital.com> wrote:

>
> Thanks for the quick response. I have been playing doing this all over the
> weekend.
> I have noticed couple of issues. Drools Guvnor enforces us that we have all
> the dependency packages to be included in the snapshot. Lets say my
> decision
> table uses Log4j to spit some output to the logs....Guvnor forces me to
> upload log4j jars into my package. My decision tables access some singleton
> classes that have other dependencies on JMS and j2ee packages.....and
> guvnor
> enforces me to upload them as well....
>
> I created a package and uploaded my models [ and dependencies] which is
> around 40 MB. Guvnor freezes while unpacking those jars.
>
> And finally after doing all this...i get weird errors while saving and
> validating configurations...something like the below..
>
> ERROR 11-01 10:07:23,616
> (RepositoryServiceServlet.java:doUnexpectedFailure:66)
> java.lang.reflect.InvocationTargetException
> com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
> abstract org.drools.guvnor.client.rpc.ValidatedResponse org.d
>
> s.guvnor.client.rpc.RepositoryService.savePackage(org.drools.guvnor.client.rpc.PackageConfigData)
> throws com.google.gwt.user.client.rpc.
> alizableException' threw an unexpected exception:
> java.lang.reflect.InvocationTargetException
>        at
> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
>        at
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
>        at
>
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
>        at
>
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>        at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>        at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
>        at
>
> org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
>        at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
>        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:128)
>        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:293)
>        at
>
> org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
>        at
>
> org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)
>        at
> org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)
>        at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.reflect.InvocationTargetException
>        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 org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
>        at
>
> org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
>        at
>
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
>        at
>
> org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
>        at
>
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>        at
>
> org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
>        at
>
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>        at
>
> org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
>        at
>
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>        at
>
> org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:157)
>        at
>
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
>        at
> org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
>        at
>
> org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
>        at
>
> org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
>        at
>
> org.drools.guvnor.server.ServiceImplementation_$$_javassist_8.savePackage(ServiceImplementation_$$_javassist_8.java)
>        at
>
> org.drools.guvnor.server.RepositoryServiceServlet.savePackage(RepositoryServiceServlet.java:148)
>        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
> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
>        ... 21 more
> Caused by: java.lang.NoClassDefFoundError:
> com/enterprisedt/net/ftp/FileTransferClientInterface
>        at java.lang.ClassLoader.defineClass1(Native Method)
>        at java.lang.ClassLoader.defineClass(Unknown Source)
>        at
>
> org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:70)
>        at
>
> org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:89)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
>        at
> org.drools.base.ClassTypeResolver.resolveType(ClassTypeResolver.java:144)
>        at
>
> org.drools.guvnor.server.rules.SuggestionCompletionLoader.loadClass(SuggestionCompletionLoader.java:387)
>        at
>
> org.drools.guvnor.server.rules.SuggestionCompletionLoader.populateModelInfo(SuggestionCompletionLoader.java:289)
>        at
>
> org.drools.guvnor.server.rules.SuggestionCompletionLoader.processPackageHeader(SuggestionCompletionLoader.java:180)
>        at
>
> org.drools.guvnor.server.rules.SuggestionCompletionLoader.getSuggestionEngine(SuggestionCompletionLoader.java:130)
>        at
>
> org.drools.guvnor.server.util.BRMSSuggestionCompletionLoader.getSuggestionEngine(BRMSSuggestionCompletionLoader.java:52)
>        at
>
> org.drools.guvnor.server.ServiceImplementation.savePackage(ServiceImplementation.java:860)
>        ... 46 more
>
> Looks like there is a workaround for this in 5.0.1 [i am currently using
> 5.0] -
> https://jira.jboss.org/jira/browse/BRMS-197
>
>
> Any finally when I try to build the package guvnor seems to invoke one of
> my
> classes and is checking to see if it has some files in the classpath [not
> sure how to include these] and throws a java.io.FileNotFoundException
>
> Please help
>
>
>
>
> David Sinclair-2 wrote:
> >
> > Any artifact in Guvnor needs to be put into a package. Yes, you need to
> > build your package and create a snapshot with said snapshot available via
> > the URL
> >
> > http://<your
> >
> server>/drools-guvnor/org.drools.guvnor.Guvnor/packages/<packageName>/<snapshotName>
> >
> > On Mon, Jan 11, 2010 at 9:56 AM, HonorGod <
> > jagadeesh.motamarri at barclayscapital.com> wrote:
> >
> >>
> >> Sure...I read this part already and my question is after I uploaded the
> >> decision tables, Do i need to create packages and create a snapshot so
> >> that
> >> I get URL?
> >>
> >> Please let me know.
> >>
> >> Thanks.
> >>
> >> David Sinclair-2 wrote:
> >> >
> >> > I would recommend you reading the Guvnor documentation, specifically
> >> this
> >> > section on integration of rules from Guvnor with your application
> >> >
> >> >
> >>
> http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-guvnor/html_single/index.html#d0e1053
> >> >
> >> > On Mon, Jan 11, 2010 at 9:45 AM, HonorGod <
> >> > jagadeesh.motamarri at barclayscapital.com> wrote:
> >> >
> >> >>
> >> >> I guess the forum is too slow...may be becoz the number of people
> >> using
> >> >> drools is few...I was just wondering if someone can point me in right
> >> >> direction..
> >> >>
> >> >> i upload the decision tables inot guvnor....now i need to access them
> >> >> thru
> >> >> java....how do i do that? Do i need to create packages with
> >> drools....or
> >> >> ?
> >> >>
> >> >>
> >> >> HonorGod wrote:
> >> >> >
> >> >> > Hi,
> >> >> >
> >> >> > Is there a specific tutorial that guides step by step on how to use
> >> >> drools
> >> >> > guvnor to upload decision tables and use them in java code.
> >> >> >
> >> >> > - packages [why they are required]
> >> >> > - what is deployment snapshot...is it something that is necessary?
> >> >> > - any tutorials etc.
> >> >> >
> >> >> > Please let know.
> >> >> >
> >> >> > Thank You!
> >> >> >
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://n3.nabble.com/Guvnor-Decision-Tables-tp116258p116836.html
> >> >> Sent from the Drools - User mailing list archive at Nabble.com.
> >> >> _______________________________________________
> >> >> rules-users mailing list
> >> >> rules-users at lists.jboss.org
> >> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >> >>
> >> >
> >> > _______________________________________________
> >> > rules-users mailing list
> >> > rules-users at lists.jboss.org
> >> > https://lists.jboss.org/mailman/listinfo/rules-users
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >> http://n3.nabble.com/Guvnor-Decision-Tables-tp116258p116850.html
> >> Sent from the Drools - User mailing list archive at Nabble.com.
> >> _______________________________________________
> >> rules-users mailing list
> >> rules-users at lists.jboss.org
> >> https://lists.jboss.org/mailman/listinfo/rules-users
> >>
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://n3.nabble.com/Guvnor-Decision-Tables-tp116258p116896.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100111/3b3c24c0/attachment.html 


More information about the rules-users mailing list