Stack overflow error encountered in AnyLogic - java

My model executed for the first 800 seconds after which I encounter the following error. Is there a way by which I can increase the stack size in AnyLogic? Is there any other approach I could use to counter the same?
`Exception during discrete event execution:
StackOverflowError
java.lang.StackOverflowError
at com.anylogic.engine.Agent.e(Unknown Source)
at com.anylogic.engine.Agent.h(Unknown Source)
at com.anylogic.engine.Agent.ext(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown
Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutPort.b(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.forwardReadyEntityNotification(Unknown
Source)`

I believe that you are using the free trial /(PLE) version of the AnyLogic software as the stack size is limited . The problem can be resolved by downsizing you model in terms of decreasing the number of agents or purchasing the full version here. https://www.anylogic.com/purchase/

Related

In D2RQ, I run d2r-server.bat kg_movie.ttl,but got an error: "Exception in thread "main" java.lang.ExceptionInInitializerError"

I want to use D2RQ to start a service,so I run d2r-server.bat kg_movie.ttl, but got the following error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.ibm.icu.impl.UPropertyAliases.<clinit>(UPropertyAliases.java:87)
at com.ibm.icu.lang.UCharacter.<clinit>(UCharacter.java:5680)
at com.hp.hpl.jena.rdf.arp.impl.CharacterModel.isComposingChar(CharacterModel.java:147)
at com.hp.hpl.jena.rdf.arp.impl.ParserSupport.checkComposingChar(ParserSupport.java:128)
at com.hp.hpl.jena.rdf.arp.states.AbsWantLiteralValueOrDescription.characters(AbsWantLiteralValueOrDescription.java:59)
at com.hp.hpl.jena.rdf.arp.states.WantTypedLiteral.characters(WantTypedLiteral.java:28)
at com.hp.hpl.jena.rdf.arp.impl.XMLHandler.characters(XMLHandler.java:149)
at org.apache.xerces.parsers.AbstractSAXParser.characters(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.characters(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.characters(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at com.hp.hpl.jena.rdf.arp.impl.RDFXMLParser.parse(RDFXMLParser.java:155)
at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:173)
at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:160)
at com.hp.hpl.jena.rdf.arp.JenaReader.read(JenaReader.java:232)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:268)
at com.hp.hpl.jena.ontology.OntDocumentManager.findMetadata(OntDocumentManager.java:894)
at com.hp.hpl.jena.ontology.OntDocumentManager.initialiseMetadata(OntDocumentManager.java:852)
at com.hp.hpl.jena.ontology.OntDocumentManager.<init>(OntDocumentManager.java:200)
at com.hp.hpl.jena.ontology.OntDocumentManager.<init>(OntDocumentManager.java:182)
at com.hp.hpl.jena.ontology.OntDocumentManager.<init>(OntDocumentManager.java:166)
at com.hp.hpl.jena.ontology.OntDocumentManager.getInstance(OntDocumentManager.java:244)
at com.hp.hpl.jena.ontology.OntModelSpec.getDocumentManager(OntModelSpec.java:339)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.getDocumentManager(OntModelImpl.java:181)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.loadImports(OntModelImpl.java:1973)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:147)
at com.hp.hpl.jena.ontology.impl.OntModelImpl.<init>(OntModelImpl.java:119)
at com.hp.hpl.jena.rdf.model.ModelFactory.createOntologyModel(ModelFactory.java:359)
at de.fuberlin.wiwiss.d2rq.parser.MapParser.<init>(MapParser.java:85)
at de.fuberlin.wiwiss.d2rq.SystemLoader.getMapping(SystemLoader.java:300)
at de.fuberlin.wiwiss.d2rq.SystemLoader.getModelD2RQ(SystemLoader.java:323)
at d2rq.server.run(server.java:65)
at de.fuberlin.wiwiss.d2rq.CommandLineTool.process(CommandLineTool.java:158)
at d2rq.server.main(server.java:17)
Caused by: java.lang.IllegalArgumentException: Invalid version number: Version number may be negative or greater than 255
at com.ibm.icu.util.VersionInfo.getInstance(VersionInfo.java:188)
at com.ibm.icu.impl.ICUDebug.getInstanceLenient(ICUDebug.java:65)
at com.ibm.icu.impl.ICUDebug.<clinit>(ICUDebug.java:69)
... 40 more
The file "kg_movie.ttl" does not have any problems, so I don't know why? any answer will be appreciated
https://github.com/d2rq/d2rq/issues/322 ,a possible reason,java version.and, we are working on similar projects

Null pointer exception in an XML parsing story system with a java based combat system and a nimbus GUI

I currently have two halves of a video game; a storyboard system that reads in a scene from an XML file then displays a description of the scene and a list of choices that the player interacts with, and a combat system that works in a similar way only with the players prompts coming directly from the java system and not the XML. I am having trouble putting these two things together. I have combined the code of both but, in combining two working programs I have ended up with two NullPointerExceptions coming off of a DefaultListModel that in every instance has at least one value added. I can't figure out why it's still being thrown as NULL.
I cant enter my code here because it exceeds 30000 characters so here is a link to a version control repository:
https://github.com/jpinaz92/Itc303-textAdventure/commit/59a24a677b85ec237d9270c75592e09fd43cb9e6
If some one could figure out what is causing all of these problems it would rally help me, and if there is a way to post my code here even though it is longer than 30000 characters let me know and I will do it.
Here is the full output:
java.lang.NullPointerException
at textadventure.TextAdventureGUI2.initComponents(TextAdventureGUI2.java:199)
at textadventure.TextAdventureGUI2.<init>(TextAdventureGUI2.java:150)
at textadventure.TextAdventureGUI2$1.run(TextAdventureGUI2.java:107)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "main" java.lang.NullPointerException
at textadventure.TextAdventureGUI2.initComponents(TextAdventureGUI2.java:199)
at textadventure.TextAdventureGUI2.<init>(TextAdventureGUI2.java:150)
at textadventure.TextAdventureGUI2.main(TextAdventureGUI2.java:146)
I fixed it the issue was in the initialization the list model needed arguments.

Getting StackOverFlow Error in Kettle(PDI)

everyone,when i use kettle to do loop,the error occured,the kettle's memory is 8G ,I used hundreds of cycles,Kettle to cycle 1500 times, when the cycle time to about 700 times the error occourd.how can i solve it
ERROR (version 5.0.1-stable, build 1 from 2013-11-15_16-08-58 by buildguy) : java.lang.StackOverflowError
at java.io.UnixFileSystem.getBooleanAttributes0(Native Method)
at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242)
at java.io.File.exists(File.java:772)
at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1057)
at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:1024)
at sun.misc.URLClassPath.findResource(URLClassPath.java:172)
at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
at java.lang.ClassLoader.getResource(ClassLoader.java:1138)
at java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:227)
at org.apache.xerces.parsers.SecuritySupport$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.xerces.parsers.SecuritySupport.getResourceAsStream(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.findJarServiceProvider(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.ObjectFactory.createObject(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:553)
at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:515)
at org.pentaho.di.core.xml.XMLHandler.loadXMLFile(XMLHandler.java:501)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2797)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2774)
at org.pentaho.di.trans.TransMeta.<init>(TransMeta.java:2759)
at org.pentaho.di.job.entries.trans.JobEntryTrans.getTransMeta(JobEntryTrans.java:1166)
at org.pentaho.di.job.entries.trans.JobEntryTrans.execute(JobEntryTrans.java:634)
at org.pentaho.di.job.Job.execute(Job.java:678)
at org.pentaho.di.job.Job.execute(Job.java:815)
at org.pentaho.di.job.Job.execute(Job.java:815)
at org.pentaho.di.job.Job.execute(Job.java:815)
I'm no expert in Kettle. However, a StackOverflowError is NOT caused by running out of memory, so the fact that you have an 8Gb heap is not directly relevant. What is relevant is the size of the thread stack. That is controlled by the java command's -Xss command-line option.
I also don't know what you mean by "cycles" in the context of Kettle ... and Google isn't helping me. However, I guess it is something to do with Jobs that cause other Jobs to run. And since you hit the limit at ~700 and need to get to ~1500, you probably need to triple the current thread stack size ... whatever that may be.

Java Game - ClassCastException

I am developing a simple java game and my scrollbar is raising an exception.
The scrollbar is supposed to be a "gameslider".
Exception in thread "Thread-3" java.lang.ClassCastException: sun.java2d.NullSurfaceData cannot be cast to sun.java2d.d3d.D3DSurfaceData
at sun.java2d.d3d.D3DRenderer.copyArea(Unknown Source)
at sun.java2d.d3d.D3DSurfaceData.copyArea(Unknown Source)
at sun.java2d.SunGraphics2D.doCopyArea(Unknown Source)
at sun.java2d.SunGraphics2D.copyArea(Unknown Source)
at javax.swing.BufferStrategyPaintManager.copyArea(Unknown Source)
at javax.swing.RepaintManager.copyArea(Unknown Source)
at javax.swing.JViewport.blitDoubleBuffered(Unknown Source)
at javax.swing.JViewport.windowBlitPaint(Unknown Source)
at javax.swing.JViewport.setViewPosition(Unknown Source)
at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.hsbStateChanged(Unknown Source)
at javax.swing.plaf.basic.BasicScrollPaneUI$Handler.stateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.fireStateChanged(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setRangeProperties(Unknown Source)
at javax.swing.DefaultBoundedRangeModel.setValue(Unknown Source)
at javax.swing.JScrollBar.setValue(Unknown Source)
at GameEnvironment.GamePanel.gameUpdate(GamePanel.java:171)
at GameEnvironment.GamePanel.run(GamePanel.java:73)
at java.lang.Thread.run(Unknown Source)
Code Line is following:
if (reachedMiddle)
scrollPane.getHorizontalScrollBar().setValue(player.getX() - (widthHorizontalScrollBar / 2));
The exception will be raised more or less randomly. I didnt figured it out so far.
I would make sure this code is run on the GUI Event Thread. If you call the Swing components on other threads you can get strange, randonm errors.
Have a look at using SwingUtilities.invokeLater(Runnable) to perform the tasks where the Swing components are updated.

InvocationTargetException occured : null in Play framework

I'm using play framework for my application
In my application.conf i have given
jvm.memory=-Xmx512M -Xms512M -XX:-UseGCOverheadLimit
I have a function which will be executed for every Customer and for customers each microapp
This function will return records for that customer and for that microapp from DB.
if i run for all customer I'm getting InvocationTargetException for 16th customer.(For 15 customers it ran successfully).
The error is
12:38:30,153 ERROR ~
Execution exception
InvocationTargetException occured : null
play.exceptions.JavaExecutionException
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:230)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.reflect.InvocationTargetException
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:543)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:499)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:475)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:470)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:158)
... 1 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.StringValue.from(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at com.mysql.jdbc.SingleByteCharsetConverter.toString(SingleByteCharsetConverter.java:327)
at com.mysql.jdbc.ResultSetRow.getString(ResultSetRow.java:787)
at com.mysql.jdbc.BufferRow.getString(BufferRow.java:539)
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5571)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5448)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5488)
at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:61)
at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:64)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:253)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249)
at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:229)
at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:330)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2283)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
at org.hibernate.loader.Loader.getRow(Loader.java:1355)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
at org.hibernate.loader.Loader.doQuery(Loader.java:829)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
I found there is something error with that customer . so i run for that customer alone. I'm getting
Exception in thread "Timer-0" java.lang.OutOfMemoryError: Java heap space
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:633)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Exception in thread "pool-2-thread-1" java.lang.OutOfMemoryError: Java heap space
For this microapp( Error occuring ) alone i have 421,251 records
What could be the source of error. Please help me.
Your problem is an OutOfMemory error. It happens later when you increase the ram for that reason.
You did not provide any code sample, but I assume you are trying to load into memory too much data from your clients with only one query. That comment about having 421k records kind of confirms this (unless I misunderstood).
Instead of doing a find() (or select, or the cal you are doing) to retrieve all the records, try to retrieve records in batches (100, 200) and process them that way.

Categories

Resources