Coldfusion Missing Error Information When Creating .Net Link

So, I am playing with the Microsoft Office Open XML SDK and trying to create an instance of the class in my CF 10 instance.

I start by creating a DocumentType , so I used the code:

writeDump(createObject("dotnet","DocumentFormat.OpenXml.Wordprocessing.DocumentType","C:\Program Files (x86)\Open XML SDK\V2.5\lib\DocumentFormat.OpenXml.dll").DocumentType());abort;

This gives me an error, however, without useful information.

ColdFusion Error with no information about type of error

So then I read that you also need to include the namespace in the class information. However, this also leads to an error, but with some decent information:

Class DocumentFormat.OpenXml.Wordprocessing.DocumentFormat.OpenXml.Wordprocessing.DocumentType was not found in the specified assembly list.

The aggregate containing the class must be provided to the assembly attribute.

Now I'm a bit stumped. I am doing some obviously wrong.

, , DLL, ?

@Leigh, , :

writeDump(createObject("dotnet","DocumentFormat.OpenXml.Wordprocessing.DocumentType","C:\Program Files (x86)\Open XML SDK\V2.5\lib\DocumentFormat.OpenXml.dll"));abort;

: C:\ColdFusion10\cfusion\jnbridge\error.log

======================
13/05/2014 23:23:53
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.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
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:722)

.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.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
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:722)`
+4
1

. , , .Net , - SomeClass.CustomException, jnbridge/CF.Net -. "ClassNotFound".

, , , ( - ).

<!--- Instantiate our exception classes to ensure the proxies exists --->
<cfset nullObj=CreateObject(".net","System.Net.WebExceptionStatus","C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll")>
<cfset nullObj=CreateObject(".net","System.Net.WebResponse","C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll")>
<cfset nullObj=CreateObject(".net","System.Net.HttpStatusCode","C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll")>

<!--- Create our Web Request class --->
<cfset webReq=CreateObject(".net","OURCUSTOMWRAPPER.HTTP.HTTPXMLWebRequest","C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\resources\utilities\OURCUSTOMWRAPPERLibray.dll")>
0

Source: https://habr.com/ru/post/1540445/


All Articles