File location

[0] The CPN Tools simulator is running in a separate environment (under Cygwin) which may have problems reading .cpn model files stored in a “strange location”. Try saving your model in a directory/filename without special characters (no spaces, only basic ASCII characters, e.g., AZ, 09,_).

Stale preference files

[1] First, try deleting stale preferences.xml files. It is located in the user settings directory, often C:\Documents and Settings\USER\Application Data\CPN Tools or C:\Users\USER\AppData\Roaming\CPN Tools, depending on the version of Windows.

[2] From CPN Tools 4.0 onwards, the simulator also makes use of Java (see “When Using CPN Tools 4” later on), which stores preferences in the Windows registry key HKEY_CURRENT_USER\Software\JavaSoft\Prefs\org\cpntools. Try clearing stale preferences in the registry by deleting the entire key ...\cpntools. Caution: using the registry editor incorrectly can cause serious, system-wide problems that may require you to re-install Windows to correct them.

Correctly running simulator

[3] In Options -> Simulator Process, make sure Remote is unchecked (or you know what you are doing)

[4] Make sure that the cpnmld process is allowed to listen on port 2098 (make sure no firewall or anything else is blocking it)

[5] Try loading a model and check if you have these processes: cpnmld* and run.x86*. The * indicated that the suffix may depend on which version of CPN Tools and operating system you are running. You should see (at least) two copies of cpnmld and one of run.x86.

[6] Try shutting down CPN Tools and killing any cpnmld* and run.x86* processes. Alternatively restart your computer. Then try again.

[7] Try logging in and running CPN Tools as an administrator.

More advanced steps.

[8] Try starting the simulator manually; go to the cpnsim subdirectory of the CPN Tools installation directory (C:\Program Files\CPN Tools\cpnsim is standard on 32 bit systems, C:\Program Files (x86)\CPN Tools\cpnsim on 64 bit systems). In a terminal (cmd) run C:\Program Files\CPN Tools\cpnsim>.\cpnmld.x86-cygwin -d 2098 .\run.x86-cygwin (don’t type anything before the >); then load your net and see if that helps. If not, try entering absolute paths for both programs, i.e., the default on 32 bit systems would be C:\Program Files\CPN Tools\cpnsim>"c:\Program Files\CPN Tools\cpnsim\cpn.ML.x86-cygwin" -d 2098 "c:\Program Files\CPN Tools\cpnsim\run.x86-cygwin.exe" and try again.

[9] If step 8 does not help, try executing steps 6 and 8 again.

[10] If step 8 complains about a DLL with cygwin in its name, you may be running programs using a conflicting version of the Cygwin DLL (such as Cygwin or another Cygwin-compiled program like nx). The easiest is to restart your computer

[11] Try executing step 8 without debug info (remove the -d flag). This means I cannot look into your problem, but may provide you with a means to run CPN Tools.

Version-specific fixes

Make sure, the version of the simulator used is compatible with the version of the GUI used. CPN Tools always ships with appropriate and matching versions of the two, but if you have multiple versions of CPN Tools installed, they may get mixed up. This can also happen if you run using a remote simulator and forgot to update or is using Access/CPN. Access/CPN is always released along with CPN Tools to ensure compatibility. It is always a good idea to use the latest version of CPN Tools and the latest version of Access/CPN for production work.

When using CPN Tools 4

CPN Tools 4 requires a recent installation of Java. Sometimes the Java installation does not set up your computer correctly (or Java is installed by another user without administrative privileges). If you encounter problems creating a net (tool crashing/net cannot be created), try the following:

  1. Make sure to download and install a recent JRE/JDK from (anything from 7 and up should work).
  2. If you get an error after installing Java, make sure to set your environment variables (varies with the version of Windows, so look that up; on Windows, select advanced system settings in Control panel and then Environment variables) so that JAVA_HOME points to the installation location (e.g., c:\Program Files\Java\jre8) and your PATH includes the bin directory under JAVA_HOME (in the example, it would have to include c:\Program Files\Java\jre8\bin).

Sometimes the installer sets this up correctly, sometimes not. It seems to be a problem especially with the 64 bit installer, but everything works with all combinations of architectures as long as the variables are set correctly.

When using CPN Tools prior to 3.5.0

Make sure your model is actually valid. Places must have types, arcs must have inscriptions, and transitions must be connected to at least one place. Starting with 3.5.0 these requirements have been removed.

If you are positive, your model is valid (or have loaded one of the shipping samples), make sure your simulator is running correctly. Typically the Standard declarations should be checked if it is.

Final Hints

You may also want to check out the tips for CPN Tools crashing.

Can I run CPN Tools on my Mac/Linux?
CPN Tools crashes

You must be logged in to post a comment.