Cannot change space while agent is moving - anylogic

I'm totally new to Anylogic (only learned it in 3 days). I have an agent which is moving between 2 nodes of a network. When the Fleet reaches the node, it needs to perform something (flowchart). In the flowchart, there is service where the agent location in the queue follows a path. Then I got the error below.
Exception during discrete event execution:
root.Fleet[0]:
Cannot change the space while agent is moving. Please call stop() method.
java.lang.RuntimeException: root.Fleet[0]:
Cannot change the space while agent is moving. Please call stop() method.
at com.anylogic.engine.Engine.error(Unknown Source)
at com.anylogic.engine.Agent.error(Unknown Source)
at com.anylogic.engine.Utilities.error(Unknown Source)
at com.anylogic.engine.AgentExtensionImpl.error(Unknown Source)
at com.anylogic.engine.gb.setSpace(Unknown Source)
at com.anylogic.engine.ExtAgentWithSpatialMetricsDelegate.setSpace(Unknown Source)
at com.anylogic.engine.Agent.setSpace(Unknown Source)
at com.anylogic.libraries.processmodeling.x.a(Unknown Source)
at com.anylogic.libraries.processmodeling.Wait.e(Unknown Source)
at com.anylogic.libraries.processmodeling.Wait$8.onEnter(Unknown Source)
at com.anylogic.libraries.processmodeling.InputBlock$1.b(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.InPort.receiveImmediately(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.OutPort.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$2.a(Unknown Source)
at com.anylogic.libraries.processmodeling.OutputBlock$2.action(Unknown Source)
at com.anylogic.libraries.processmodeling.AsynchronousExecutor_xjal$a.execute(Unknown Source)
at com.anylogic.engine.LibraryEventHandler$a.execute(Unknown Source)
at com.anylogic.engine.Engine.h(Unknown Source)
at com.anylogic.engine.Engine.nj(Unknown Source)
at com.anylogic.engine.Engine$a.run(Unknown Source)
I tried agent.setEnvironment(node.getEnvironment()) but it's not working. Can someone tell me what I did wrong ?
Thanks.

Your agents are still moving while they arrive at the Service element. You should make sure they arrive first before changing their location in the service queue.

Related

The error in matlab:Exception in thread "AWT-EventQueue-0" java.lang.​IllegalArg​umentExcep​tion: Comparison method violates its general contract

I started receiving an error in matlab, which prevents me to see the command window but does not prevent the code from executing. I attached all the error message below. I do not know why this is happening but I guess it started after I used "save" commands in the editor. I basically load data into the editor and then preprocess the data so that I can use them later, and I save the new data for future computations. Since when I started saving data, this problem has been initiated. Now, I can't stop matlab to produce this error every time I run any code. Can you please help me with this? I really appreciate that, thank you.
Original error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeHi(Unknown Source) at java.util.TimSort.mergeAt(Unknown Source) at java.util.TimSort.mergeCollapse(Unknown Source) at java.util.TimSort.sort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.ArrayList.sort(Unknown Source) at java.util.Collections.sort(Unknown Source) at com.mathworks.widgets.grouptable.GroupingTableUtils.sortNonRecursively(GroupingTableUtils.java:296) at com.mathworks.widgets.grouptable.RowListTransactionTarget.finishTransaction(RowListTransactionTarget.java:115) at com.mathworks.widgets.grouptable.GroupingTableTransaction$1.run(GroupingTableTransaction.java:112) 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$JavaSecurityAccessImpl.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) >>

Couldn't connect to the Box API due to a network error?

I am getting below mentioned error while accessing the box api using box java sdk in java application.Please suggest the cause for this problem.
Exception in thread "main" com.box.sdk.BoxAPIException: Couldn't connect to the Box API due to a network error.
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:386)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:200)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:175)
at com.box.sdk.BoxUser.getCurrentUser(BoxUser.java:112)
at com.box.cdm.demo.Main.main(Main.java:24)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:384)
... 4 more
The main causes of this exception - and the things you need to check - are:-
There is no network between your application (the client) and the server (the Box API). Where is the Box instance running, on same machine as your application (locally)?
What port is Box listening on? You need to show your connection code code (endpoint / port etc).
If client and server on different hardware, and you know you have a network connection between them then is Box behind firewall?

DocuSign : Getting connection timedout while using the Java program in the Demo site.

I am new to DocuSign.
Started trying with the basic Login authentication in Java. Used the code snippet in the below link.
http://iodocs.docusign.com/APIWalkthrough/getEnvelopeRecipientStatus#java
Getting the below exception.
Exception in thread "main" java.net.ConnectException: Connection timed out: conn
ect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewH
ttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unk
nown Source)
at GetEnvelopeInfo.main(GetEnvelopeInfo.java:56)
Tried to Ping the server address. got the same Request timed out error.
ping demo.docusign.net
Pinging demo.docusign.net.akadns.net [209.46.117.172] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Please help me out on this.
You might need to set the proxy information for your environment. The jvm parameters are http.proxyHost and http.proxyPort. It can be set by using
System.setProperty("http.proxyHost", "yourProxyHostname");

Java 1.7 is not allowing to access the system root preference in client machine through applet

We need to get the list of hard printers from client machine through applet call.
It works well in java 1.6. But in 1.7 it throws the exception as below even though we gave all permission.
New Method got Error:access denied ("java.lang.RuntimePermission" "preferences")
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "preferences")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.util.prefs.Preferences.systemRoot(Unknown Source)
at printer.Printers.getAvailableNewPrinters(Printers.java:134)
at printer.Printers.getAvailablePrinters(Printers.java:66)
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 sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
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 sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MethodInfo.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass$MemberBundle.invoke(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke0(Unknown Source)
at sun.plugin2.liveconnect.JavaClass.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$DefaultInvocationDelegate.invoke(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo.doObjectOp(Unknown Source)
at sun.plugin2.main.client.LiveConnectSupport$PerAppletInfo$LiveConnectWorker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
1) Aplication blocked by security settings
There is a problem with the new version of java 1.7 update 51 onwards as restriction is done in three levels
• Very High: Most secure setting - Only Java applications identified by a non-expired certificate from a trusted authority will be allowed to run.
• High (minimum recommended): Java applications identified by a certificate from a trusted authority will be allowed to run.
• Medium - All Java applications will be allowed to run after presenting a security prompt.
http://docs.oracle.com/javase/7/docs/technotes/guides/security/spec/security-spec.doc3.html
might help

Applet not working in Chrome,Firefox but working in IE

I know the subject is similar to some other questions available but none have given satisfactory solution.So here goes the question.I have an applet that works perfectly in IE but doesnt work in Chrome or Firefox.
The trace found in Java console is this:
Java Plug-in 10.25.2.17
Using JRE version 1.7.0_25-b17 Java HotSpot(TM) Client VM
java.security.AccessControlException: access denied ("java.net.SocketPermission" "www.w3.org:80" "connect,resolve")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.a(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc(Unknown Source)
at com.bea.dsp.oam.console.metadatabrowser.datalineage.LineageGraphApplet.start(LineageGraphApplet.java:53)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.nwoods.jgo.svg.DefaultElement.getAttribute(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.buildJGoDoc(Unknown Source)
at com.nwoods.jgo.svg.DefaultDocument.SVGReadDoc(Unknown Source)
at com.bea.dsp.oam.console.metadatabrowser.datalineage.LineageGraphApplet.start(LineageGraphApplet.java:53)
at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.start(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The applet tag in the page is like this:
<applet width="100%" code="/LineageGraphApplet.class"archive="/DataLineageApplet.jar" style="border:0px" id="lineageapplet" MAYSCRIPT>
<param name="viewDocumentUrl" value="/generateDocument.do?mode=0"/>
</applet>
What could be the issue and how to resolve it?Similar questions have seen answers like open the port or seeing the applet work using applet viewer in conjugation with a security policy file granting all permissions or signing the jar.But I still was not able to make it work on Firefox?
I had a similar issue once - my applet was also running in IE but not in other browsers. However from the amount of information you have given it is difficult to tell. Do you use authentification (like FormLogin, BasicLogin etc) before one can access the applet? If so you can try the following:
Set (thus disable) the cookie-http-only to false.