Pete Freitag Pete Freitag

Troubleshooting ColdFusion 9 .NET Integration Issues

Published on November 10, 2010
By Pete Freitag
coldfusion

I recently helped a client get .NET integration working on their 64 bit ColdFusion 9 multiserver installation. There seams to be some quirks with multi-instance installs when using .NET integration in ColdFusion (when you create a new instance, you may not get all the files you need for .NET to work for example).

The first thing you should do if you are running into issues is checkout the error.log file located in the ColdFusion9DotNetService folder. If you are lucky it will have a clear error message that you can use to fix the problem, however in many cases it may not be very clear.

Here are the steps I took to get things working for my client.

Step 1 - Install CF 9.0.1

Make sure you are running the latest version of ColdFusion, the 9.0.1 update added support for .NET Framework version 4.0

Step 2 - Uninstall .NET integration

This may not be necessary, but it did seam to help in our case, go through the other steps first and if you are still having trouble come back to this.

The uninstaller will be located in the ColdFusion9DotNetService\uninstall folder.

Step 3 - Download and install the .NET integration installer for ColdFusion 9.0.1

  • Download the .NET integration installer here: http://www.adobe.com/support/coldfusion/downloads.html
  • Pick 64 bit or 32 bit installer to match your ColdFusion installation type.
  • The installer will ask you if you want to install .NET service remotely or in ColdFusion. For multiserver you want to choose the remote install so it can be used for all instances. This places the .NET service outside of your CF instance in its own directory.
  • Make sure you install it to the same location as it was previously located, for example c:\ColdFusion9DotNetService\ if you choose a different directory ColdFusion will throw an error that it can't find one of the exe's located in this folder when you try to invoke a .NET object.

Step 4 - Copy Missing dotnet_coreproxy.config File

Make sure that each instance has the file {cf-instance}/WEB-INF/cfusion/lib/dotnet_coreproxy.config you might need to copy it from the default cfusion instance into any new instances.

Here is the error message that you will see in the error.log file if you have this problem:

.NET exception = System.IO.FileNotFoundException
.NET exception message = Could not find file 'D:\JRun4\servers\instanceName\cfusion.ear\cfusion.war\WEB-INF\cfusion\lib\dotnet_coreproxy.config'.
.NET-side stack trace =    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at com.jnbridge.jnbproxy.JNBProxy.Main(String[] args)

Step 5 - Clear generated .NET proxy jar files

First make a backup of {cf-instance}/WEB-INF/cfclasses/dotNetProxy/, and then delete all jar files in that directory except the dotNetCoreProxy.jar file.

Note we had to stop all CF instances in order to delete these jar files because it said that the jar files were in use by jrun.exe

Here's an exception we were seeing in the error.log file:

Java-side exception: com.jnbridge.jnbcore.ClassNotFoundException
Java-side exception message: java.lang.Class+EnclosingMethodInfo
Java-side stack trace: com.jnbridge.jnbcore.ClassNotFoundException: java.lang.Class+EnclosingMethodInfo
    at com.jnbridge.jnbproxy.ClassInfo.(Unknown Source)
    at sun.reflect.GeneratedConstructorAccessor461.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.jnbridge.jnbcore.JNBDispatcher.construct(Unknown Source)
    at com.jnbridge.jnbcore.JNBDispatcher.call(Unknown Source)
    at com.jnbridge.jnbcore.server.b.d.a(Unknown Source)
    at com.jnbridge.jnbcore.server.b.c.p(Unknown Source)
    at com.jnbridge.jnbcore.server.b.c.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:619)

.NET-side stack trace = .NET-side stack trace:

   at com.jnbridge.jnbproxy.ExceptionFactory.throwException(JNBException e, Hashtable objMap)
   at com.jnbridge.jnbproxy.ClassInfo..ctor(String name)
   at com.jnbridge.jnbcore.ObjectHelper.getSubstituteProxy(String returnedType, Type expectedType)
   at com.jnbridge.jnbproxy.ProxyClass.getSubstituteProxy(String className)
   at com.jnbridge.jnbproxy.ProxyClass.getType(String className, Boolean noSubstituteProxy)
   at com.jnbridge.jnbproxy.ProxyClass.isThreadTrue(String className, Hashtable threadTrue, ClassInfo ci)
   at com.jnbridge.jnbproxy.ProxyClass.generateProxyClassMembers(ModuleBuilder module, ClassInfo ci, Boolean verbose, Boolean noSupporting, Boolean isJSharpCompatible, ReferenceValueData refValData, Hashtable threadTrue, Boolean mapEnums)
   at com.jnbridge.jnbproxy.ProxyAssembly.addClass(ClassInfo ci)
   at com.jnbridge.jnbcore.ObjectHelper.getSubstituteProxy(String returnedType, Type expectedType)
   at com.jnbridge.jnbproxy.ProxyClass.getSubstituteProxy(String className)
   at com.jnbridge.jnbproxy.ProxyClass.getType(String className, Boolean noSubstituteProxy)
   at com.jnbridge.jnbproxy.ProxyField.genClassLiteral(TypeBuilder theClass, ReferenceValueOptions rvo)
   at com.jnbridge.jnbproxy.ProxyClass.generateProxyClassMembers(ModuleBuilder module, ClassInfo ci, Boolean verbose, Boolean noSupporting, Boolean isJSharpCompatible, ReferenceValueData refValData, Hashtable threadTrue, Boolean mapEnums)
   at com.jnbridge.jnbproxy.ProxyAssembly.addClass(ClassInfo ci)
   at com.jnbridge.jnbcore.ObjectHelper.getSubstituteProxy(String returnedType, Type expectedType)
   at com.jnbridge.jnbproxy.ProxyClass.getSubstituteProxy(String className)
   at com.jnbridge.jnbproxy.ProxyClass.getType(String className, Boolean noSubstituteProxy)
   at com.jnbridge.jnbproxy.ProxyClass.isThreadTrue(String className, Hashtable threadTrue, ClassInfo ci)
   at com.jnbridge.jnbproxy.ProxyClass.generateProxyClassMembers(ModuleBuilder module, ClassInfo ci, Boolean verbose, Boolean noSupporting, Boolean isJSharpCompatible, ReferenceValueData refValData, Hashtable threadTrue, Boolean mapEnums)
   at com.jnbridge.jnbproxy.ProxyAssembly.addClass(ClassInfo ci)
   at com.jnbridge.jnbcore.ObjectHelper.getSubstituteProxy(String returnedType, Type expectedType)
   at com.jnbridge.jnbproxy.ExceptionFactory.throwException(JNBException e, Hashtable objMap)
   at com.jnbridge.jnbcore.ProxyJarFile.close()
   at com.jnbridge.jnbproxy.JNBProxy.generateJavaProxies(String[] classes, Options options, AppDomain dotNetAssembliesAppDomain, Hashtable refValueMap, Hashtable threadTrue)
   at com.jnbridge.jnbproxy.JNBProxy.Main(String[] args)

Java-side stack trace:

com.jnbridge.jnbcore.ClassNotFoundException: java.lang.Class+EnclosingMethodInfo
    at com.jnbridge.jnbproxy.ClassInfo.(Unknown Source)
    at sun.reflect.GeneratedConstructorAccessor461.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.jnbridge.jnbcore.JNBDispatcher.construct(Unknown Source)
    at com.jnbridge.jnbcore.JNBDispatcher.call(Unknown Source)
    at com.jnbridge.jnbcore.server.b.d.a(Unknown Source)
    at com.jnbridge.jnbcore.server.b.c.p(Unknown Source)
    at com.jnbridge.jnbcore.server.b.c.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:619)


coldfusion dotnet net multiserver

Troubleshooting ColdFusion 9 .NET Integration Issues was first published on November 10, 2010.


Fixinator

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.


Try Fixinator

CFBreak
The weekly newsletter for the CFML Community


Comments

Pete, did you happen to see my recent 3 posts on doing this in CF 8 64x? It's really kinda crazy :)
by Mark Kruger on 11/12/2010 at 2:15:05 PM UTC
Hi Pete,

First, thank you very much for posting this, as it did help. Rupesh's post here also helped: http://www.rupeshk.org/blog/index.php/2010/11/issues-with-net-integration-in-coldfusion-9-0-1/

I say this b/c I just experienced this issue on two x64 Win7 boxes. Both running CF9.0.1 Standalone. Machine A experienced exactly what you discuss here. And machine B experienced what Rupesh describes.

I couldn't find the official bug, so I've described my findings in full in #86720: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=86720

Thanks again!,
-Aaron Neff

P.S. @Mark, I just read your 3 posts. Amazing!
by Aaron Neff on 03/20/2011 at 8:00:11 AM UTC