Troubleshooting ColdFusion 9 .NET Integration Issues

November 10, 2010
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)


1 person found this page useful, what do you think?

Comments

Pete, did you happen to see my recent 3 posts on doing this in CF 8 64x? It's really kinda crazy :)
Hello Pete,
I am looking for some help to complete coding of a few modules in CF 9.0
If you know anyone you can recommend, I would appreciate making contact.
Thanks for help!
Hey Blogger,Merry Christmas!

When you write some blogs and share with us,That is a hard work for you but share makes you happly right?
Yes I am a blogger too,and I wanna share with you my method to make some extra cash.

If you're interested in Internet marketing then you've probably heard about all
the different marketing "Gurus" out there.

They're those marketers that have multi-million dollar launches nearly every
time they launch, the ones that everyone's heard of and everyone wishes they could be.

If you're interested in becoming one of those mega masters of
Internet marketing, you're in luck!

I've created a FREE training course that can teach you exactly what
you need to know to be come one of these renowned gurus!

In my FREE course you'll discover what it takes to get connected with
other marketing gurus and create a promotion circle.

The guide is extremely easy to understand and anyone can use it.
Whether this is your first time even thinking about Internet
marking or you're a seasoned pro who wants to expand, this
course is for you!

If you want to become well respected marketer or just increase
your profits, this FREE course will help you out!

More info you can checkout http://bit.ly/makemoneyonlinefreereport
good luck and cheers!
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!
I had this issue with the result being the fact that the assembly was a 32bit assembly on a 64bit platform. Nothing in the CF or proxy error logs that stated that was the issue however.
Hi pete,

I am still getting this error coldfusion.runtime.dotnet.ProxyGenerationException

Coldfusion 9.0.1 (64 bit)
IIS 7 (Enabled IIS 6 compatibility)

This code trying to run
http://www.forta.com/blog/index.cfm/2007/5/30/GetDriveInfo-UDF-Powered-By-NET

Ramesh

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?