0

Installed DD4T on Tridion 2013 SP1 with ASP.NET 4.0 on 62 bit machine. I installed DD4T using NuGet command Install-Package DD4T-Tridion-2013sp1.

When i published it is smooth, but when i run website. It gives following exception: I understand it is related to xmogrt.dll, but i have same in upload and other classic instance of deployer as well as other websites. It runs smooth there. Any more light on this issue would be really appreciated.

Exception information: 
    Exception type: BadImageFormatException 
    Exception message: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
       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.JavaClass.init()
       at Codemesh.JuggerNET.JavaClass.get_JObject()
       at Codemesh.JuggerNET.JavaMethod.init()
       at Codemesh.JuggerNET.JavaMethod.get_MethodPtr()
       at Codemesh.JuggerNET.JavaMethod.get_Handle()
       at Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo)
       at Com.Tridion.Broker.Querying.Query..ctor()
       at Tridion.ContentDelivery.DynamicContent.Query.Query..ctor()
       at DD4T.Providers.SDLTridion2013.TridionPageProvider.GetContentByUrl(String Url)
       at DD4T.Factories.PageFactory.TryFindPage(String url, IPage& page)
       at DD4T.Mvc.Controllers.TridionControllerBase.GetModelForPage(String PageId)
       at DD4T.Mvc.Controllers.TridionControllerBase.Page(String pageId)
       at dd4tdemo.Controllers.PageController.Page(String pageId) in e:\www\dd4tdemo\dd4tdemo\Controllers\PageController.cs:line 16
       at lambda_method(Closure , ControllerBase , Object[] )
       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<>c__DisplayClass2a.<BeginInvokeAction>b__20()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag)
       at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
2
  • The exception is telling you that one of the dlls is wrong (either 32bit dll on 64bit OS, or other way around). Try to see which one is it Commented Feb 11, 2015 at 12:35
  • I installed package using command line other five Tridion dlls are same as i used elswhere on the same machine! I am wondering if any of the DD4T ddls could be wrong here as well?
    – user1423
    Commented Feb 11, 2015 at 12:37

2 Answers 2

2

BadImageFormatException is always about attempting to use a 64-bit assembly in a 32-bit runtime, or vice versa.

First, I would make sure that the website is configured to use the 64-bit runtime within IIS (assuming that's what you want to run). You can check this by looking at the Advanced Settings for the application pool and checking if the "Enable 32-bit Applications" setting is set to False.

If that's all fine, you should make sure that all of the assemblies are compiled for either Any CPU, Any Platform or 64-bit, by using a tool like corflags.exe or .NET Reflector.

1

Looks like a mismatch between the bitness of your application pool and the bitness of your JRE. If you are using a 64 bit application pool you must install a 64 bit JRE (i'd say the same for the 32 bit versions but you really just shouldn't use those anymore to begin with).

So: check if your JRE is 32 or 64 bit

java -version -d64
java -version -d32

Only of these will give you the installed JRE version; the other will give an error message:

Error: This Java instance does not support a 64-bit JVM.
2
  • Hi, as i have mentioned, i have 64bit setup and java xmogrt dlls are fine..infact i am using same set of dlls which is working on classic deployer instance and content delivery of websites running on it! not sure if any of the dd4t dll used causing problem here
    – user1423
    Commented Feb 15, 2015 at 4:43
  • The stacktrace clearly indicates that the problem is not with the DD4T DLLs but with the JVM; xmogrt.dll is the juggernet unmanaged runtime library not the JVM itself! See codemesh.com/products/vfour/tutorial/dotnet/v3/… Commented Feb 16, 2015 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.