1
votes

I'm really struggeling here. Anylogic gives me the Database Connection Problem for some days now and the support was not able to help me until now

Screenshot1

What I got here is a windows mashine running the latest Win10 with Anylogic 7.3 Professional

My Anylogic Model is completely local and runs perfect until I try to add an Database Table. As mentioned above Anylogic asks me reconnect the database each time I try to insert a table. Pressing the Connect button does nothing, but showing the same window again. Pressing cancel shows me the following error message:

Screenshot2

Together with the Anylogic Support I already tried to disable the Antivirus, send them logs,etc. Nothing helped so far. I already tried to reinstall the whole program including a thourough clean (all .Anylogic Folders, files,...).

I don't know anymore what else to do at this point. I hope any of you guys can help out a little.

!ENTRY org.eclipse.ui 4 0 2016-12-21 13:48:02.168
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.RuntimeException: java.sql.SQLException: Connection timed out
    at com.anylogic.objectmodel.commands.database.AbstractDatabaseCommand.execute(Unknown Source)
    at com.anylogic.objectmodel.commands.CompoundCommand.execute(Unknown Source)
    at com.anylogic.objectmodel.commands.BasicCommandStack.execute(Unknown Source)
    at com.anylogic.objectmodel.commands.CommandStack.execute(Unknown Source)
    at com.anylogic.properties.widget.WidgetBuilder$86.n(Unknown Source)
    at com.anylogic.properties.widget.WidgetBuilder$86.onAdd(Unknown Source)
    at com.anylogic.properties.widget.base.list.ListWidget.j(Unknown Source)
    at com.anylogic.components.button.ButtonDecorator.a(Unknown Source)
    at com.anylogic.components.button.ButtonDecorator.a(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at com.anylogic.application.AnyLogicApplication.start(Unknown Source)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
    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:497)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
Caused by: java.sql.SQLException: Connection timed out
    at com.anylogic.database.DatabaseManager.getConnection(Unknown Source)
    at com.anylogic.database.DatabaseManager.getConnection(Unknown Source)
    at com.anylogic.database.DatabaseManager.a(Unknown Source)
    at com.anylogic.database.DatabaseManager.createColumn(Unknown Source)
    at com.anylogic.database.DatabaseManager.createColumn(Unknown Source)
    at com.anylogic.objectmodel.commands.database.CreateColumnCommand.doExecute(Unknown Source)
    ... 35 more
4
Would be useful to see code, I guess. Or, what exactly makes this a Java question is unclear other than the exception message, which is only a software problem that the support team can help you with. Otherwise this belongs on Super User - OneCricketeer
I adde the java tag as Anylogic is based on java and the second screenshot throws some java exeption - Patrick
"some Java exception" isn't really answerable here. You have a networking issue, that's all we can tell - OneCricketeer
I added a part of the log file, maybe that helps, the only thing I can read from it is that it lost the connection. But the thing is that I don't understand how I can loose the connection when everyting is local and the same folder as the rest of the model, which works - Patrick
The server isn't running? You connect to the wrong port number? Your firewall or anti virus is otherwise blocking the connection? There's lots of things to check for that error - OneCricketeer

4 Answers

1
votes

I faced the same problem. I don't know exactly why it occurred, but something with storing the Model went wrong. But I managed to reconnect with the following procedure:

  1. Copy the whole folder of the Project and store it somewhere
  2. In the new folder delete the .original.alp-File
  3. Rename the .alp-File
  4. then open the Renamed .alp-File in an text-editor

In that file you'll find something like that:

*************************************************
	         AnyLogic Project File 
*************************************************	         
-->
<AnyLogicWorkspace WorkspaceVersion="1.9" AnyLogicVersion="8.5.1.201910011746" AlpVersion="8.4.9">
<Model>
	<Id>1570541727194</Id>
	<Name><![CDATA[20191030-02-SBB-DAT]]></Name>
	<EngineVersion>6</EngineVersion>
	<JavaPackageName><![CDATA[_20191008_02_sbb_dat]]></JavaPackageName>
	<ModelTimeUnit><![CDATA[Minute]]></ModelTimeUnit>
	<ActiveObjectClasses>
		<!--   =========   Active Object Class   ========  -->

Now find all Strings in that file equals to the packageName, in my case:

_20191008_02_sbb_dat

and replace it with the name of your .alp file, in mycase:

sbb_dat.

It should look like this:

<AnyLogicWorkspace WorkspaceVersion="1.9" AnyLogicVersion="8.5.1.201910011746" AlpVersion="8.4.9">
<Model>
	<Id>1570541727194</Id>
	<Name><![CDATA[SBB-DAT]]></Name>
	<EngineVersion>6</EngineVersion>
	<JavaPackageName><![CDATA[sbb_dat]]></JavaPackageName>
	<ModelTimeUnit><![CDATA[Minute]]></ModelTimeUnit>
	<ActiveObjectClasses>
		<!--   =========   Active Object Class   ========  -->

After that store and close the file and open it with AnyLogic. In my case this helped.

1
votes

I have also run into this problem. If you go into the database folder of the model and delete the lock file and the previous database folder it will open without throwing that error.

-1
votes

Try deleting all Anylogic relevant rules. This should solve the problem.

-1
votes

According to the result of listening localhost 9001, something blocked the connection between AnyLogic and Server DB. Deleting all rules defined for Anylogic (though all of them were „permit“) helped.