We have set up a basic Drools framework with Guvnor UI. Rules are written by semi-technical guys and have scope of errors (scope is always there irrespective of who writes it :))
Yesterday, someone wrote a rule which started throwing NullPoiterException but Drool appears to wrap this exception into CYCLIC_DEPENDENCY_ERROR and showing the same.
Also, we ended up with OOM java.lang.OutOfMemoryError: Java heap space immediately(3-4 minutes) after this issue.
Stacktrace for details:
Feb 2013 08:06:55,447 [ERROR] (SWF Activity DroolsActivityTaskList-2.2 229) com.amazon.mobius.csi.workers.droolsengine.DroolsEngineActivitiesImpl:runRules:220 [CYCLIC_DEPENDENCY_ERROR]: Error
while executing Rules, Please validate all rules against any cyclic dependency
Exception executing consequence for rule "final NON EC" in com.amazon.mobius.csi.workers.droolsengine: java.lang.NullPointerException
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:295)
at com.amazon.mobius.csi.workers.droolsengine.DroolsEngineActivitiesImpl.runRules(DroolsEngineActivitiesImpl.java:216)
at com.amazon.mobius.csi.workers.droolsengine.DroolsEngineActivitiesImpl.executeRules(DroolsEngineActivitiesImpl.java:145)
at sun.reflect.GeneratedMethodAccessor173.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.amazonaws.services.simpleworkflow.flow.pojo.POJOActivityImplementation.execute(POJOActivityImplementation.java:63)
at com.amazonaws.services.simpleworkflow.flow.generic.ActivityImplementationBase.execute(ActivityImplementationBase.java:46)
at com.amazonaws.services.simpleworkflow.flow.worker.SynchronousActivityTaskPoller.execute(SynchronousActivityTaskPoller.java:214)
at com.amazonaws.services.simpleworkflow.flow.worker.ActivityTaskPoller$2.run(ActivityTaskPoller.java:95)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at com.amazon.mobius.csi.workers.droolsengine.Rule_final_NON_EC.defaultConsequence(Unknown Source)
at com.amazon.mobius.csi.workers.droolsengine.Rule_final_NON_ECDefaultConsequenceInvoker.evaluate(Unknown Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
... 18 more
Why does Drools treat it as CYCLIC_DEPENDENCY and result into OOM? Could we have some other issue? Any help would be appreciated.
Thanks,
I believe this to be a cyclic dependency between rules. The RHS of one rule is causing another to activate, which in turn has a RHS which causes the first rule to activate. Therefore there is an infinite loop of rule activations.
Without seeing the rules themselves, I would recommend setting up an agenda event listener to log which rules are firing. That way you should be able to see which 2 rules are activating in this manner. An example such logging listener is here:
https://github.com/gratiartis/scattercode-drools-scenarios/blob/master/src/main/java/uk/co/scattercode/drools/util/TrackingAgendaEventListener.java
Related
All,
How to enable debugging to figure out why I am getting this initialization Error
Pact version: 4.0.10
Is there a way to enable debug (this is spring boot app)
org.junit.runners.model.InitializationError
at au.com.dius.pact.provider.junit.PactRunner.initialize(PactRunner.kt:112)
at au.com.dius.pact.provider.junit.PactRunner.getChildren(PactRunner.kt:140)
at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)
at com.intellij.junit4.JUnit4IdeaTestRunner.getDescription(JUnit4IdeaTestRunner.java:78)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:50)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:66)
All,
I found my problem. User error. but I wish there was an error or warning log.
I used #PactFilter and the state value I used in that was wrong. but my actual test had the right state value in some. So the filter was not finding any test and would throw this initialization error. I did not realize the PactFilter was optional. I commented it out, and then I got a proper error message indicating state not found in the pact broker.
I downloaded and installed the latest version of Typesafe Activator, and created a new project with the Reactive Maps template, then tried to run it, but I get all kinds of java.lang.OutOfMemoryError exceptions in the log, and the UI is unresponsive.
No, I have not really started troubleshooting yet, but I would have expected these templates to be more robust and 'just work' -- is that a bad expectation?
I do not have a support contract, and could not find any way to ask for support; so is stackoverflow the best place to ask for help on these issues?
11:43:58.490 play-akka.actor.default-dispatcher-7 E Weaving class problem. Original class has been returned. The error was caused because of: java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError#6e29ae44
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.aspectj.weaver.bcel.ExtensibleURLClassLoader.defineClass(ExtensibleURLClassLoader.java:63)
at org.aspectj.weaver.loadtime.WeavingURLClassLoader.defineClass(WeavingURLClassLoader.java:148)
at org.aspectj.weaver.bcel.ExtensibleURLClassLoader.defineClass(ExtensibleURLClassLoader.java:97)
at org.aspectj.weaver.bcel.ExtensibleURLClassLoader.findClass(ExtensibleURLClassLoader.java:52)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at com.typesafe.sbt.echo.EchoPlayRun$$anonfun$createWeavingClassLoader$1$$anon$1.loadClass(EchoPlayRun.scala:50)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.joda.time.DateTimeUtils.getChronology(DateTimeUtils.java:283)
at org.joda.time.format.DateTimeFormatter.selectChronology(DateTimeFormatter.java:940)
at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:620)
at org.joda.time.format.DateTimeFormatter.printTo(DateTimeFormatter.java:497)
at org.joda.time.format.DateTimeFormatter.print(DateTimeFormatter.java:599)
at controllers.AssetsBuilder$$anonfun$at$1$$anonfun$apply$2$$anonfun$apply$10$$anonfun$apply$11.apply(Assets.scala:142)
at controllers.AssetsBuilder$$anonfun$at$1$$anonfun$apply$2$$anonfun$apply$10$$anonfun$apply$11.apply(Assets.scala:136)
at scala.Option.getOrElse(Option.scala:120)
at controllers.AssetsBuilder$$anonfun$at$1$$anonfun$apply$2$$anonfun$apply$10.apply(Assets.scala:136)
at controllers.AssetsBuilder$$anonfun$at$1$$anonfun$apply$2$$anonfun$apply$10.apply(Assets.scala:118)
at scala.Option.map(Option.scala:145)
at controllers.AssetsBuilder$$anonfun$at$1$$anonfun$apply$2.apply(Assets.scala:118)
at controllers.AssetsBuilder$$anonfun$at$1$$anonfun$apply$2.apply(Assets.scala:74)
at scala.Option.map(Option.scala:145)
at controllers.AssetsBuilder$$anonfun$at$1.apply(Assets.scala:74)
at controllers.AssetsBuilder$$anonfun$at$1.apply(Assets.scala:65)
at play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:221)
at play.api.mvc.ActionBuilder$$anonfun$apply$10.apply(Action.scala:220)
at play.api.mvc.Action$.invokeBlock(Action.scala:357)
at play.api.mvc.ActionBuilder$$anon$1.apply(Action.scala:309)
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:109)
at play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.apply(Action.scala:109)
11:44:00.224 application-akka.actor.default-dispatcher-3 E Weaving class problem. Original class has been returned. The error was caused because of:java.lang.OutOfMemoryError: PermGen space java.lang.OutOfMemoryError#3bdef2d
java.lang.OutOfMemoryError: PermGen space
Well, after rebooting my Windows system and running the the app again, this time it seems to work correctly. Must be another one of those environment/configuration mysteries as I did not change anything.
I was trying to redeploy a servlet I had recently undeployed but kept getting a org.apache.catalina.LifecycleException. Tomcat wasn't able to load the context properly.
This is what triggered the search:
FAIL - Unable to delete [/var/lib/tomcat7/conf/Catalina/localhost/app.xml].
The continued presence of this file may cause problems.
Here are the errors from the log catalina.out, rearranged to fit the column:
WARNING: Calling stop() on failed component [{0}] to trigger clean-up
did not complete.
org.apache.catalina.LifecycleException:
An invalid Lifecycle transition was attempted ([after_stop]) for
component [org.apache.catalina.startup.FailedContext#13150fc] in state
[FAILED]
WARNING: Error while removing context [/app]
java.lang.ClassCastException:
org.apache.catalina.startup.FailedContext cannot be cast to
org.apache.catalina.core.StandardContext
Scrolling back up, I noticed a whole list of SEVERE errors, beginning with:
SEVERE: Parse error in context.xml for /app
org.xml.sax.SAXParseException;
systemId: file:/etc/tomcat7/Catalina/localhost/app.xml/;
lineNumber: 1;
columnNumber: 1;
Content is not allowed in prolog.
This is not related to Cannot Undeploy a web-app completely in Tomcat 7 or Installing JSTL results in org.xml.sax.SAXParseException: Content is not allowed in prolog, though I wasted quite some time looking through these. Everything seemed to be as it should be, so I was stumped. Eventually, I solved it myself. My answer is below.
It turns out that I had deployed
/path/to/servlet/web/
as the XML Configuration file instead of
/path/to/servlet/website.xml
as Tomcat had been expecting.
A quick check in the saved form content of my other browser revealed this kickself error, so I am posting a Q and A here in the hope that this could save someone some time.
Please be careful when deploying manually, people.
I am making a text editor app in JavaFX2 on NetBeans. My problem is this: whenever I try to insert the line scene.getStylesheets().add(<classname>.class.getResource("<css file>.css").toExternalForm()); to link the css, and run it, it shows an error: "Exception while running Application"What exactly is this exception? I've tried removing this line, and then the app runs smoothly. Just five-six hours back, I had inserted this same line of code (with correct classes and css file), it was easily able to use the css. But now, I've created another 3 projects to check it, but the app shows the same error and gets removed on removing this code. I create the Css by right-clicking the Source-packages icon > new > Cascading Style Sheets. I fill in all the correct classes and location for css file, yet this happens. Also tried Shift + F11 (clean and rebuild). When I launch the older app(with css), it runs without an error. (BTW I use Win8 Pro x64, if u need it)The output panel stops at Executing com.javafx.main.Main from <location>\Qwerty.jar using platform C:\Program Files\Java\jdk1.7.0_17/bin/java and then shows error:
Exception in Application start method
java.lang.reflect.InvocationTargetException
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.javafx.main.Main.launchApp(Main.java:642)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
at qwerty.Qwerty.start(Qwerty.java:36) (LINE 36 is where the reference to css is)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:215)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
... 1 more
Java Result: 1
The issue is explained in the nested excpetion:
Caused by: java.lang.NullPointerException
at qwerty.Qwerty.start(Qwerty.java:36) (LINE 36 is where the reference to css is)
Check if <classname>.class.getResource("<css file>.css") is null. Maybe you're specifing the wrong path or the css is not in the jar?
I'm trying to refactor a package name (pretty near the root of the project hierarchy), and I'm getting the following error (flash builder 4):
A fatal error occurred while performing the refactoring
An unexpected exception occurred while creating a change object. See the error log for more details.
The log file looks like this....
!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2010-09-30 10:57:25.134
!MESSAGE Internal Error
!STACK 0
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:330)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:583)
at org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:422)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:74)
at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:114)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.nextOrPreviewPressed(RefactoringWizardDialog2.java:495)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.access$2(RefactoringWizardDialog2.java:492)
at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2$1.widgetSelected(RefactoringWizardDialog2.java:691)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:143)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:155)
at com.adobe.flexbuilder.as.editor.ui.navigator.FlexPackageExplorerRenameAction.renamePackage(FlexPackageExplorerRenameAction.java:171)
at com.adobe.flexbuilder.as.editor.ui.navigator.FlexPackageExplorerRenameAction.run(FlexPackageExplorerRenameAction.java:143)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.adobe.flexbuilder.standalone.FlexBuilderApplication.start(FlexBuilderApplication.java:109)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Caused by: java.lang.StackOverflowError
at com.adobe.flexbuilder.codemodel.mxml.MXMLData$2.getMXMLVersion(MXMLData.java:501)
<-- snipped 1022 additional identical lines..-->
at com.adobe.flexbuilder.codemodel.mxml.MXMLData$2.getMXMLVersion(MXMLData.java:501)
Root exception:
java.lang.StackOverflowError
at com.adobe.flexbuilder.codemodel.mxml.MXMLData$2.getMXMLVersion(MXMLData.java:501)
<-- snipped 1022 additional identical lines..-->
at com.adobe.flexbuilder.codemodel.mxml.MXMLData$2.getMXMLVersion(MXMLData.java:501)
Any ideas what is wrong...and what I can do to fix it ? I queried google for it, and didn't turn up anything useful with the parameters I tried.
You can try to Restart Eclipse. Oddly that fixes a number of issues in Eclipse that happen all of a sudden with no normal explanation.
Increase the thread size of the JVM you run your IDE in?
I believe in Eclipse you could do it by adding -Xss with some value to eclipse.ini within your Eclipse installation. The setting is a JVM setting so should be added in the -vmargs section, it might be next to -Xmx which is there by default.
This may not be the best answer, but..I recommend you to try a different IDE like IntelliJ.
I've used Flash Builder before. It had always gave me problem. Usually it's because plug-in incompatible. Running tomcat in it sometimes gives me this "undead" java process that just won't die.
I'm using IntelliJ 9 now. It's autocomplete is less complete than Flash Builder, but it has a much better refactoring feature and..much MUCH better integration with other tools (like Maven).