I am developing a web application using SiteCore 8 and uCommerce. To configure uCommerce I go through Sitecore and load the uCommerce interface. This morning I tried to load the uCommerce interface in the normal way, i.e logged into Sitecore and loaded uCommerce, but got nothing more than a white screen in Sitecore. Looking at the browser console I can see 2 different 500 errors:
Failed to load resource: the server responded with a status of 500
(Internal Server Error)
http://local.myapp.co.uk/ucommerceapi/Content/undefined/RootNode
Failed to load resource: the server responded with a status of 500
(Internal Server Error)
http://local.myapp.co.uk/ucommerceapi/Localization/TranslatedStrings
Failed to load resource: the server responded with a status of 500
(Internal Server Error)
http://local.myapp.co.uk/ucommerceapi/Content/tree/RootNode Failed to
load resource: the server responded with a status of 500 (Internal
Server Error)
If I click on the url in the error I get a page that displays:
Server Error in '/' Application.
Value cannot be null. Parameter name: EndpointHost.Config
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: EndpointHost.Config
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null. Parameter name:
EndpointHost.Config]
[ConfigurationErrorsException: ServiceStack: AppHost does not exist or
has not been initialized. Make sure you have created an AppHost and
started it with 'new AppHost().Init();' in your Global.asax
Application_Start()]
ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory..cctor()
+836
[TypeInitializationException: The type initializer for
'ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory' threw
an exception.]
ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory..ctor()
+0
[TargetInvocationException: Exception has been thrown by the target of
an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType
type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
+256 System.Activator.CreateInstance(Type type, Boolean nonPublic) +127 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttributes, StackCrawlMark& stackMark) +14297981
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +198 System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[]
args) +83 System.Web.Configuration.HandlerFactoryCache..ctor(String
type) +57 System.Web.HttpApplication.GetFactory(String type) +94
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+375 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
I have tried recreating the Global.asax, I have tried replacing all the sitecore folders:
sitecore
sitecore modules
sitecore_files
and the App_Config folder using files from a colleagues machine that is working fine but not luck. I can copy my colleagues solution to my PC and it works fine (except he has none of the work I have done)
Can anyone throw any light on what the problem might be?
In case anyone else stumbles on this problem. I deleted the website from IIS then recreated it and the problem has gone away. I have no idea why this has fixed the issue, as I have changed nothing in IIS for days.
Related
I got a sitecore micro site built with glass mapper and working fine with english version.
www.website.com/?sc_lang=en
But, if i go to French version of the website.
www.website.com/?sc_lang=fr
I end up with an error
Constructor on type
'xxxxx.INest_Landing_Page' not
found.
Description: An unhandled exception occurred.
Exception Details: System.MissingMethodException: Constructor on type
'xxxx.INest_Landing_Page' not
found.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[MissingMethodException: Constructor on type 'xxx.INest_Landing_Page'
not found.] System.RuntimeType.CreateInstanceImpl(BindingFlags
bindingAttr, Binder binder, Object[] args, CultureInfo culture,
Object[] activationAttributes, StackCrawlMark& stackMark) +14259449
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +200 System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture) +28
Sitecore.Mvc.Presentation.ModelLocator.GetModelFromTypeName(String
typeName, String model, Boolean throwOnTypeCreationError) +99
Sitecore.Mvc.Pipelines.Response.GetModel.GetFromLayout.GetFromField(Rendering
rendering, GetModelArgs args) +336
Sitecore.Mvc.Pipelines.Response.GetModel.GetFromLayout.Process(GetModelArgs
args) +102 (Object , Object[] ) +83
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +365
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String
pipelineName, TArgs args) +186
Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String
pipelineName, TArgs args, Func`2 resultGetter) +197
Sitecore.Mvc.Presentation.Rendering.GetModel() +337
Sitecore.Mvc.Presentation.Rendering.get_Model() +27
Sitecore.Mvc.Presentation.ViewRenderer.get_Model() +167
Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +158
[InvalidOperationException: Error while rendering view:
'/views/shared/xxxst/xxx.cshtml'. ]
Any suggestions will be appreciated.
Be sure that you have all the items in the language you selecting and as well that the language is installed (fr-FR) not just (fr)
I guess that should help
I am getting the following error when trying to implement code from my peers:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
I see there is a posting for how to "How to retrieve the LoaderException property?" here (How to retrieve the LoaderException property?)
But, I do not understand where this try catch should go since the code to implement my peers code is in the Global.asax.cs file. (see below)
Any help would be appreciated and if you DOWN VOTE me, please explain why.
namespace IMS_STS_Example_SIT
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : StsMvcHttpApplication
{
protected override void OnApplicationStarted()
{
base.OnApplicationStarted();
AreaRegistration.RegisterAllAreas();
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
Here is the full error message from the UI:
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
MyCompNameIT.Common.Utils.Installer.ConfigInstaller.Install(IWindsorContainer container, IConfigurationStore store) in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Utils\Installer\ConfigInstaller.cs:80
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers, DefaultComponentInstaller scope) +200
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers) +144
MyCompNameIT.Common.Utils.InstallerExtension.WithMyCompNameDefaults(IWindsorContainer container) in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Utils\InstallerExtension.cs:52
MyCompNameIT.Common.Web.InstallerExtension.WithMyCompNameWebMvc(IWindsorContainer container) in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Web\InstallerExtension.cs:20
MyCompNameIT.Common.Web.MvcHttpApplication..cctor() in C:\MyCompNameProjects\PrideLands\Common\Main\Source\MyCompNameIT.Common\MyCompNameIT.Common.Web\IocHttpApplication.cs:30
[TypeInitializationException: The type initializer for 'MyCompNameIT.Common.Web.MvcHttpApplication' threw an exception.]
MyCompNameIT.Common.Web.MvcHttpApplication..ctor() +0
IMS_STS_Example_SIT.MvcApplication..ctor() +40
ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\ims_sts_example_sit\2c6588da\447046b5\App_global.asax.lkasnsc6.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14429965
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +312
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881108
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722297
replace StsMvcHttpApplication by MvcHttpApplication or make sure you are refering to StsMvcHttpApplication assemblies and all their dependencies
I have .net 3.5 app that I built in VS 2008. App works fine on my pc and other pc's i have tried. I have also published on several other production servers.
But my app on a particular server does not work. I have checked permissions, gave them to iisusrs, network service. Tried running process mon. but no luck. Would appreciate if somebody can help me.
[NullReferenceException: Object reference not set to an instance of an
object.] Project.Global..cctor() +500
[TypeInitializationException: The type initializer for
'Product.Global' threw an exception.] Project.Global..ctor() +0
ASP.global_asax..ctor() in
c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET
Files\Project\5b298990\c958346b\App_global.asax.aqngqd-g.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of
an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType
type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +146 System.RuntimeType.CreateInstanceImpl(Boolean
publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +298
System.Activator.CreateInstance(Type type, Boolean nonPublic) +79
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +10371979
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +258
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +382
[HttpException (0x80004005): Exception has been thrown by the target
of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11411878
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +4401140
The static constructor for Product.Global is raising a NullReferenceException. This is likely due to some hard coded value that is different or unavailable on that system.
Potential candidates would be localization issues (trying to parse strings in the wrong culture) causing a value to not be initialized, a missing configuration value, or anything else that is occurring within the static initialization of that type.
I have an app using COM library. When i run it to test in console app it works good. But when i install it as Windows Service using installutil. In logs i have error
Message: (SaveInvoice) - Zapisywanie faktury - FS/12584/2012/01
Nie znaleziono błedu o kodzie: Creating an instance of the COM component with CLSID {F8605331-7454-4A45-98DB-A69EBB3D2947} from the IClassFactory failed due to the following error: 8000ffff Katastrofalny błąd. (0x8000FFFF (E_UNEXPECTED)).
Stacktrace: SaveDocuments.SaveInputDocuments => SaveMethods.SaveInvoice => LogProvider.ErrorException
Exception:
System.Runtime.InteropServices.COMException (0x8000FFFF): Creating an instance of the COM component with CLSID {F8605331-7454-4A45-98DB-A69EBB3D2947} from the IClassFactory failed due to the following error: 8000ffff Katastrofalny błąd. (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)).
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at Rewizor.Application.Start.get_Gt()
at Rewizor.Application.Start.get_Rewizor()
at Rewizor.Parsers.Invoice.InvoiceParser.InvoiceParserVatDocument(CustEDIInvoice invoice)
at Rewizor.ModelRepository.Invoice.InvoiceRepository.CreateInvoice(CustEDIInvoice invoice)
at DALRewizor.RewizorRepository.CreateInvoice(CustEDIInvoice invoice)
at EDIService.BLL.RepositoryBLL.CreateInvoice(CustEDIInvoice invoice)
at BLL.InboxRepository.SaveMethods.SaveInvoice(EDI_OutputStorage item)
Anyone have idea, how to solve it?
One of the common problems in this scenario are user permissions, because the service runs as a different user than that who runs in console. But judging by the comments on the question, you already checked it.
Another source of errors is the fact that the working directory of the console application is the directory where the EXE is located. With Windows Services, it's not; the working directory is C:\Windows\System32 (or wherever %SYSTEMDIR% is). So, if you have code that relies on the current working directory (such as reading a file in the same directory), it will not work as a service. I'm not sure, but maybe the same problem could happen if you are trying to load a COM library in the same path as the EXE.
So, what I suggest you:
Double check your permissions.
Check any code that relies on relative paths and change it to absolute paths instead.
I am following the service stack "Hello World" tutorial from http://www.servicestack.net/ServiceStack.Hello/ . But when I am trying to start the asp.net application it says "Value can't be null. Parameter Name: EndpointHost.Config".
The full exception text is:
[ArgumentNullException: Der Wert darf nicht NULL sein.
Parametername: EndpointHost.Config]
[ConfigurationErrorsException: ServiceStack: AppHost does not exist or has not been initialized. Make sure you have created an AppHost and started it with 'new AppHost().Init();' in your Global.asax Application_Start()]
ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory..cctor() in C:\src\ServiceStack\src\ServiceStack\WebHost.EndPoints\ServiceStackHttpHandlerFactory.cs:45
[TypeInitializationException: Der Typeninitialisierer für "ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory" hat eine Ausnahme verursacht.]
[TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Web.Configuration.HttpHandlerAction.Create() +57
System.Web.Configuration.HandlerFactoryCache..ctor(HttpHandlerAction mapping) +19
System.Web.HttpApplication.GetFactory(HttpHandlerAction mapping) +96
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +125
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
My global class is:
public class Global : System.Web.HttpApplication
{
/// Web Service Singleton AppHost
public class InfoAppHost : AppHostBase
{
//Tell Service Stack the name of your application and where to find your web services
public InfoAppHost()
: base("Services", typeof(InfoService).Assembly) { }
public override void Configure(Funq.Container container) { }
}
protected void Application_Start(object sender, EventArgs e)
{
//Initialize your application
var appHost = new InfoAppHost();
appHost.Init();
}
}
But it seems to never get called.
Compiling the example project from the homepage works fine - but I would like to follow the example from the homepage.
Any ideas how to solve this problem ?
I've deleted my test project and tried the tutorial once again.
When creating the Global.asax file I've deleted the whole class and made another class Global in this file. It seems Application_Start never got called in this class.
The problem as you might have guessed is that appHost.Init() hasn't run. Try wrapping it in a try/catch and logging any errors that might have been thrown.
We had the same problem and solved it by setting "Activate 32-bit-applications" to true in the extended ApplicationPool Settings. (sorry, only have a german Windows so the Settings names are rough guesses)
Took me a while to figure out what I was doing wrong to cause this issue...
this happened to me because I accidentally dragged the Global.asax file into a subfolder in my project.
I found that this error is caused by the WebApiConfig. The example is using ServiceStack and does not not need ASP.NET Web API. That line needs to be commented out inthe Gloabal.asax.cs file.
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
// ** comment out ** WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
new ProteinTrackerAppHost().Init();
}