1 Reply Latest reply on Oct 8, 2007 8:38 AM by Stuart Douglas

    NotSuchMethod exception

    Miloslav Vlach Novice

      Hi, I have problem with my application. All was working very well, but now the application throws an exception. The exception is thrown by DroolsRule and i don't know where is the problem.

      Drools

      rule ZobrazeniPozadavku
      when
       c: PermissionCheck(name == "request", action=="read")
       p:Principal()
       r:Request()
       Role(name == "IMS_ADMIN") || Role(name == "IMS_OPERATOR") || ( eval (r.getAuthor() != null && p.toString().equals(r.getAuthor().getLoginName()))) || ( eval (r.getSolver() != null && p.toString().equals(r.getSolver().getLoginName())))
      then
       c.grant();
      end;
      


      Cause:
      java.lang.NoSuchMethodError: javax.persistence.EntityNotFoundException: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
      


      Caused by: java.lang.NoSuchMethodError: javax.persistence.EntityNotFoundException: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
       at org.hibernate.ejb.Ejb3Configuration$1.handleEntityNotFound(Ejb3Configuration.java:99)
       at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:79)
       at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:72)
       at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:160)
       at cz.bpsolutions.ims.model.Account$$EnhancerByCGLIB$$1a7a2f2f.getLoginName(<generated>)
       at cz.bpsolutions.drools.Rule_ZobrazeniPozadavku_0.eval1(Rule_ZobrazeniPozadavku_0.java:15)
       at cz.bpsolutions.drools.Rule_ZobrazeniPozadavku_0Eval1Invoker.evaluate(Rule_ZobrazeniPozadavku_0Eval1Invoker.java:20)
       at org.drools.rule.EvalCondition.isAllowed(Unknown Source)
       at org.drools.reteoo.EvalConditionNode.assertTuple(Unknown Source)
       at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
       at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
       at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
       at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
       at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown Source)
       at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
       at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
       at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
       at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
       at org.drools.reteoo.Rete.assertObject(Unknown Source)
       at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
       at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
       at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
       at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
       at org.jboss.seam.security.RuleBasedIdentity.hasPermission(RuleBasedIdentity.java:115)
       at cz.bpsolutions.mis.request.RequestAction.init(RequestAction.java:333)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
       ... 139 more
      11:49:42,037 ERROR [DebugPageHandler] redirecting to debug page
      java.lang.RuntimeException: java.lang.NoSuchMethodError: javax.persistence.EntityNotFoundException: method <init>(Ljava/lang/String;Ljava/lang/Throwa ble;)V not found
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:174)
       at cz.bpsolutions.seam.validation.method.ValidatorInterceptor.validateMethodCall(ValidatorInterceptor.java:78)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
       at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:47)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
       at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:37)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
       at org.jboss.seam.interceptors.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:63)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
       at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:189)
       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
       at $Proxy89.init(Unknown Source)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
       at org.jboss.seam.interceptors.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:37)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
       at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
       at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:50)
       at org.javassist.tmp.java.lang.Object_$$_javassist_4.init(Object_$$_javassist_4.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:597)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:20)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:123)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1834)
       at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1696)
       at org.jboss.seam.Component.getInstance(Component.java:1633)
       at org.jboss.seam.Component.getInstance(Component.java:1610)
       at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:53)
       at org.apache.myfaces.config.LastVariableResolverInChain.resolveVariable(LastVariableResolverInChain.java:42)
       at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
       at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:73)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:195)
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
       at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
       at javax.faces.component.UIData.getValue(UIData.java:1019)
       at org.jboss.seam.ui.HtmlLink.getSelection(HtmlLink.java:37)
       at org.jboss.seam.ui.HtmlLink.encodeBegin(HtmlLink.java:188)
       at org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:433)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.renderColumnHeaderCell(HtmlTableRendererBase.java:811)
       at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.renderColumnHeaderCell(HtmlTableRenderer.java:682)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.renderColumnChildHeaderOrFooterRow(HtmlTableRendererBase.java:755)
       at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.renderColumnChildHeaderOrFooterRow(HtmlTableRenderer.java:624)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.renderColumnHeaderOrFooterRow(HtmlTableRendererBase.java:719)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.renderColumnHeaderRow(HtmlTableRendererBase.java:649)
       at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.renderColumnHeaderRow(HtmlTableRenderer.java:805)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.renderFacet(HtmlTableRendererBase.java:552)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.beforeBody(HtmlTableRendererBase.java:391)
       at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.beforeBody(HtmlTableRenderer.java:205)
       at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:117)
       at org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:171)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
       at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NoSuchMethodError: javax.persistence.EntityNotFoundException: method <init>(Ljava/lang/String;Ljava/lang/Throwable;)V not found
       at org.hibernate.ejb.Ejb3Configuration$1.handleEntityNotFound(Ejb3Configuration.java:99)
       at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:79)
       at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:72)
       at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:160)
       at cz.bpsolutions.ims.model.Account$$EnhancerByCGLIB$$1a7a2f2f.getLoginName(<generated>)
       at cz.bpsolutions.drools.Rule_ZobrazeniPozadavku_0.eval1(Rule_ZobrazeniPozadavku_0.java:15)
       at cz.bpsolutions.drools.Rule_ZobrazeniPozadavku_0Eval1Invoker.evaluate(Rule_ZobrazeniPozadavku_0Eval1Invoker.java:20)
       at org.drools.rule.EvalCondition.isAllowed(Unknown Source)
       at org.drools.reteoo.EvalConditionNode.assertTuple(Unknown Source)
       at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
       at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
       at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
       at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
       at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown Source)
       at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
       at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
       at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
       at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
       at org.drools.reteoo.Rete.assertObject(Unknown Source)
       at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
       at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
       at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
       at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
       at org.jboss.seam.security.RuleBasedIdentity.hasPermission(RuleBasedIdentity.java:115)
       at cz.bpsolutions.mis.request.RequestAction.init(RequestAction.java:333)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.ejb3.i
      


        • 1. Re: NotSuchMethod exception
          Stuart Douglas Master

          The problem is not caused by Drools as far as I can tell. What I think is happening is you are getting an EntityNotFoundException in cz.bpsolutions.ims.model.Account.getLoginName()

          You then get a NoSuchMethodException when it is attempting to create the EntityNotFoundException, as it cannot find the contructor (String,Throwable). Do you have two Hibernate jars of different versions on the classpath or anything like that?