Problems with Java-to-.NET using shared memory

I’m having problems getting shared-memory to work in a Java-to-.NET project. What should I be doing to solve the problem?

It’s likely that the problem is in the configuration of the interop, so you should examine the contents of your jnbcore.properties file. Open the file and look for the following issues:

  1. Make sure that the assemblies containing all classes for which proxies have been generated are listed in the dotNetSide.assemblyList.* properties. For example, if you are calling proxies for .NET forms, you will need to include System.Windows.Forms in the assembly list since your forms proxies likely derive from System.Windows.Forms.Form, even though you will not call it directly.
  2. Make sure that all file paths in the properties file use forward slashes ( / ) or double backslashes ( \), and not single backslashes ( ). For example, C:abc is not a valid file path, but C:/a/b/c and C:\a\b\c are both valid.
  3. If an assembly named in the assembly list is not specified with a file path (for example, if it is in the GAC), you must use a fully-qualified name. For example,

    dotNetSide.assemblyList.1 = System.Windows.Forms

    is not valid, but

    dotNetSide.assemblyList.1 = System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    is valid.

In addition, make sure that the assemblies jnbshare.dll, jnbsharedmem.dll, and jnbjavaentry2.dll are all installed in the Global Assembly Cache (GAC), ), or set the dotNetSide.appBase property to point to a folder that contains jnbshare.dll, jnbsharedmem.dll, and jnbjavaentry2.dll.