1

The below line code is giving exception when when we are trying to make Component Link object:

Tridion Application Code:

string strUrl = String.Empty;
ComponentLink comp = new ComponentLink(strUrl);

Exception:

System.BadImageFormatException was caught
  Message="An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
  Source="netrtsn"
  StackTrace:
       at Codemesh.JuggerNET.NativeInterface.GetJvmLoader(Int32 ctorVersion, String configFile, String vers, String conf, String reserved, Boolean bEnvOverrides, Boolean bDefaultJvm, Int32 traceFacility, Int32 traceLevel, Int32& error)
       at Codemesh.JuggerNET.JvmLoader.GetJvmLoader(Boolean bEnvOverrides, Boolean bDefaultJvm, TraceFacility fac, TraceLevel level)
       at Codemesh.JuggerNET.JvmLoader.GetJvmLoader()
       at Codemesh.JuggerNET.NativeInterface.ToJavaStringPinning(String str, Int32 length, IntPtr& result)
       at Codemesh.JuggerNET.NativeInterface.ToJavaString(String str)
       at Codemesh.JuggerNET.JavaMethodArguments.Add_string(String str)
       at Codemesh.JuggerNET.JavaMethodArguments.Add(Object obj, Type type)
       at Codemesh.JuggerNET.JavaMethodArguments.Add(Object obj)
       at Com.Tridion.Linking.ComponentLink..ctor(String publicationURI)
       at Tridion.ContentDelivery.Web.Linking.ComponentLink..ctor(String publicationUri)
       at ResxBind.ResolveLink(String strTcmUri) in F:\Share\Rajeev\Tridion2011\IntegrationLayer\Com.Emirates.Pss.Ibe.UILib\CommonAPI.cs:line 2077

As per the exception it would be something related to old DLLs, however I have removed all the references with lastest Tridion 2011 Dlls.

Please suggest, its very embrassing!!

Thanks.

Best Regards,

MS

Jeremy Grand-Scrutton
  • 2,802
  • 14
  • 20
Manoj Singh
  • 7,569
  • 34
  • 119
  • 198
  • 1
    It may be license issue. Verify your content delivery license. Also are you getting this on all pages or on a particular page? – vikas kumar Sep 11 '12 at 06:51

5 Answers5

6

I think netrtsn is compiled using AnyCpu, but it does have a dependency on xmogrt.dll for which there are specific DLL's for 32 or 64 bits

These are available on your Tridion Installation Media, under /Content Delivery/roles/dotNet

Please also check that all the following are either 32 or 64 bits:

  • Your Application pool (in case of 32 bits is that enabled)
  • Your Installed Java version
  • Any Dll's you provide yourself
Gertjan Assies
  • 1,890
  • 13
  • 23
4

Most of the time this is caused by a 32 - 64 bits version conflict. If you are running inside Visual Studio, use the 32 bits version of all dll's. Else make sure you are using matching versions of all dll's, jars, java version, etc.

Albert Romkes
  • 1,125
  • 1
  • 8
  • 19
3

it could be due to version of your java. Is this also 64 bits? Check JAVA_HOME environment -variable where it points. if you have both 32 and 64 bit versions installed,by using %JAVA_HOME% in your machine's RUN prompt you can check the version being called by tridion .

rene
  • 41,474
  • 78
  • 114
  • 152
Ram Saurabh
  • 1,586
  • 8
  • 27
0

Your are mixing 64 bit Juggernet DLLs with 32 bit Java virtual machine or vice-versa. One solution could be to reinstall the 64-bit JVM (this sets the registry) and then use the 64-bit Juggernet DLLs

Gaizka Allende
  • 9,228
  • 4
  • 21
  • 16
0

I installed the JRE Installation for Microsoft Windows on my machine to overcome this. Windows x64: jre-7-windows-x64.exe

Chazza
  • 226
  • 3
  • 10