[rules-users] java.util.NoSuchElementException in buildAsset

Sergio Stateri Jr sergio.stateri at globo.com
Wed Jul 23 17:53:13 EDT 2008


   Hi,

   I have installed BRMS (Drools 5) and create a repository for BRMS. When
I create a simple rule, like:
when
   $object: Object()
then
   System.out.println("ok");
end

   all works fine, but... When I create a complex rule, using my own complex
classes and click in the validate button, the following error is reported
:

 Error
 An error occurred executing the action.
java.util.NoSuchElementException at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
at org.codehaus.janino.UnitCompiler.findClass(UnitCompiler.java) at org.codehaus.janino.Compiler$CompilerIClassLoader.findIClass(Compiler.java)
at org.codehaus.janino.IClassLoader.loadIClass(IClassLoader.java) at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.reclassifyName(UnitCompiler.java) at
org.codehaus.janino.UnitCompiler.reclassify(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$114(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$15.visitAmbiguousName(UnitCompiler.java)
at org.codehaus.janino.Java$AmbiguousName.accept(Java.java) at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$104(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$15.visitMethodInvocation(UnitCompiler.java)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java) at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.access$51(UnitCompiler.java) at org.codehaus.janino.UnitCompiler$9.visitMethodInvocation(UnitCompiler.java)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java) at org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java) at
org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$25(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$6.visitMethodInvocation(UnitCompiler.java)
at org.codehaus.janino.Java$MethodInvocation.accept(Java.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$8(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$4.visitExpressionStatement(UnitCompiler.java)
at org.codehaus.janino.Java$ExpressionStatement.accept(Java.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.access$7(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$4.visitBlock(UnitCompiler.java) at org.codehaus.janino.Java$Block.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java)
at org.codehaus.janino.UnitCompiler$3.visitPackageMemberClassDeclaration(UnitCompiler.java)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java) at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java)
at org.codehaus.janino.Compiler.compile(Compiler.java) at org.drools.commons.jci.compilers.JaninoJavaCompiler.compile(JaninoJavaCompiler.java:174)
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:394)
at org.drools.compiler.DialectRegistry.compileAll(DialectRegistry.java:60)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:324)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:168)
at org.drools.brms.server.contenthandler.DRLFileContentHandler.compile(DRLFileContentHandler.java:32)
at org.drools.brms.server.builder.ContentPackageAssembler.buildAsset(ContentPackageAssembler.java:139)
at org.drools.brms.server.builder.ContentPackageAssembler.buildPackage(ContentPackageAssembler.java:127)
at org.drools.brms.server.builder.ContentPackageAssembler.(ContentPackageAssembler.java:84)
at org.drools.brms.server.builder.ContentPackageAssembler.(ContentPackageAssembler.java:92)
at org.drools.brms.server.ServiceImplementation.buildPackage(ServiceImplementation.java:897)
at org.drools.brms.server.ServiceImplementation.buildPackage(ServiceImplementation.java:887)
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:585) at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
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:31)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:40)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
at org.drools.brms.server.ServiceImplementation_$$_javassist_3.buildPackage(ServiceImplementation_$$_javassist_3.java)
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:585) at org.jboss.seam.remoting.gwt.GWTToSeamAdapter.callWebRemoteMethod(GWTToSeamAdapter.java:85)
at org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.processCall(GWTRemoteServiceServlet.java:320)
at org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.doPost(GWTRemoteServiceServlet.java:188)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
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:46)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
 

   I have created my models, categories and packages using the BRMS interface.
Then, I have no idea how to solve this problem, and the brms code doesn?t
show the line numbers before StringTokenizer class (I could see the error
cause in the brms source code, but the "UnitCompiler.java" is shown in the
line number position, why ?).

   Thanks for any help.

   Sergio Stateri Jr.
   sergio.stateri at globo.com






More information about the rules-users mailing list