I worked through the Setup documentation found here. I have a sample dashboard application and a sample client application which throws Elmah errors into a SQL database.
The client application has elmah working correctly and I can view the error logs at elmah.axd. When I attempt to access the Dashboard application the page loads and kicks off the "Sending Commands" message. I then get a 500 Internal Server error from the first "send?transport=..." command.
The Dashboard app is an ASP.Net MVC 5 app running on my localhost.
This is the URL that generates the error:
http://localhost/ElmahR/elmahr/commands/send?transport=serverSentEvents&connectionToken=k6HUNtFtmSXrJZgH_2oexTg_cx-el2G7PhJ6NZD4aBLT_svpboE31meZG4wazu7VDS8_WWRjnnV-yGSVhBzBbYWlXFTo08onRvNCzYgYhH5kwMw9KvKOSQIakT6Wzv_Y0
When I inspect that error, this is what I get:
RazorEngine.Templating.TemplateCompilationException
Unable to compile template. Source file 'C:\Windows\TEMP\lahvjqh3.0.cs' could not be found Other compilation errors may have occurred. Check the Errors property for more information.
System.AggregateException: One or more errors occurred. ---> RazorEngine.Templating.TemplateCompilationException: Unable to compile template. Source file 'C:\Windows\TEMP\lahvjqh3.0.cs' could not be found
Other compilation errors may have occurred. Check the Errors property for more information.
at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Compilation\DirectCompilerServiceBase.cs:line 100
at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 256
at RazorEngine.Templating.TemplateService.CreateTemplate(String razorTemplate, Type templateType, Object model) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 127
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 435
at ElmahR.Core.Plugins.<BuildPlugins>b__a(<>f__AnonymousType2`2 <>h__TransparentIdentifier6)
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at ElmahR.Core.StartupConnection.<.ctor>b__1(IConnection c, IRequest r, String cid, String d)
at ElmahR.Core.StartupConnection.OnReceived(IRequest request, String connectionId, String data)
at Microsoft.AspNet.SignalR.PersistentConnection.<>c__DisplayClassa.<>c__DisplayClassc.<ProcessRequest>b__7()
at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod(Func`1 func)
--- End of inner exception stack trace ---
at Microsoft.Owin.Host.SystemWeb.CallContextAsyncResult.End(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
---> (Inner Exception #0) RazorEngine.Templating.TemplateCompilationException: Unable to compile template. Source file 'C:\Windows\TEMP\lahvjqh3.0.cs' could not be found
Other compilation errors may have occurred. Check the Errors property for more information.
at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Compilation\DirectCompilerServiceBase.cs:line 100
at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 256
at RazorEngine.Templating.TemplateService.CreateTemplate(String razorTemplate, Type templateType, Object model) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 127
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName) in c:\_git\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 435
at ElmahR.Core.Plugins.<BuildPlugins>b__a(<>f__AnonymousType2`2 <>h__TransparentIdentifier6)
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at ElmahR.Core.StartupConnection.<.ctor>b__1(IConnection c, IRequest r, String cid, String d)
at ElmahR.Core.StartupConnection.OnReceived(IRequest request, String connectionId, String data)
at Microsoft.AspNet.SignalR.PersistentConnection.<>c__DisplayClassa.<>c__DisplayClassc.<ProcessRequest>b__7()
at Microsoft.AspNet.SignalR.TaskAsyncHelper.FromMethod(Func`1 func)<---
Any idea what might be configured incorrectly for it to throw this error? Is is something I need to change with Razor?
This is what I see:
Related
I am getting below error in SpecFlow (2.1.o) in VS 2107 in one of the steps in feature file. Should it be something related to SpecFlow framework issue?
But I don't have this error in other features. They are working fine.
Error in XXXXfeature.cs file:
Test method ABC.Api.Bdd.Tests.Features.V2.InstantTrackerFeature.InstantTrackerReturnsA500ErrorResponseWhenErrorScenariosOccur threw exception:
System.InvalidCastException: Object must implement IConvertible.
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at TechTalk.SpecFlow.Bindings.StepArgumentTypeConverter.ConvertSimple(Type typeToConvertTo, Object value, CultureInfo cultureInfo)
at TechTalk.SpecFlow.Bindings.StepArgumentTypeConverter.ConvertSimple(IBindingType typeToConvertTo, Object value, CultureInfo cultureInfo)
at TechTalk.SpecFlow.Bindings.StepArgumentTypeConverter.Convert(Object value, IBindingType typeToConvertTo, CultureInfo cultureInfo)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ConvertArg(Object value, IBindingType typeToConvertTo)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.<>c__DisplayClass38_0.<GetExecuteArguments>b__0(Object arg, Int32 argIndex)
at System.Linq.Enumerable.<SelectIterator>d__5`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.GetExecuteArguments(BindingMatch match)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep()
at TechTalk.SpecFlow.TestRunner.CollectScenarioErrors()
at ABC.Api.Bdd.Tests.Features.V2.InstantTrackerFeature.ScenarioCleanup()
at ABC.Api.Bdd.Tests.Features.V2.InstantTrackerFeature.InstantTrackerReturnsA500ErrorResponseWhenErrorScenariosOccur() in C:\ABC.API\ABC.Api.Bdd.Tests\features\v2\InstantTracker.feature:line 36
The reason for the error was missing StepArgumentTransformation. as below.
[StepArgumentTransformation]
public IList<MovesStaging> TransformMovesStaging(Table identifiers)
{
return identifiers.Rows.Select(row => new MovesStaging
{
PartitionKey = ParseTableRowFieldAsString(row, "PartitionKey"),
RowKey = ParseTableRowFieldAsString(row, "RowKey"),
Timestamp = ParseTableRowFieldAsTimeStampUtc(row, "Timestamp"),
Status = ParseTableRowFieldAsString(row, "Status"),
ExpiryDate = ParseTableRowFieldAsDateTimeUtc(row, "ExpiryDate")
}).ToList();
}
Basically whenever you try to insert data through feature file you need to have this.
I came across similar type of question after that. I missed the question perhaps due to the subject.
I am trying to migrate a Team Project from TFS 2015 to Visual Studio Team Services. I connected to both the Source and Destination, selected the Team Project, mapped my users, and then when validating the Migration Summary a NullReferenceException is thrown.
The following was found in the OVSMU.log file:
2016-07-29 10:33:20,674 [1] ERROR Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at TFSMigrationUI.ViewModel.MigrationSummeryViewModel.worker_RunWorkerCompleted(Object sender, RunWorkerCompletedEventArgs e) in c:\Project_CheckOut\TFSMigration\TFSMigrationUI\ViewModel\MigrationSummeryViewModel.cs:line 1096
at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted(RunWorkerCompletedEventArgs e)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Has anyone seen a similar problem?
I have a storage queue to which I post messages constructed using the CloudQueueMessage(byte[]) constructor. I then tried to process the messages in a webjob function with the following signature:
public static void ConsolidateDomainAuditItem([QueueTrigger("foo")] CloudQueueMessage msg)
I get a consistent failure with exception
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Program.ConsolidateDomainAuditItem ---> System.InvalidOperationException: Exception binding parameter 'msg' ---> System.Text.DecoderFallbackException: Unable to translate bytes [FF] at index -1 from specified code page to Unicode.
at System.Text.DecoderExceptionFallbackBuffer.Throw(Byte[] bytesUnknown, Int32 index)
at System.Text.DecoderExceptionFallbackBuffer.Fallback(Byte[] bytesUnknown, Int32 index)
at System.Text.DecoderFallbackBuffer.InternalFallback(Byte[] bytes, Byte* pBytes)
at System.Text.UTF8Encoding.GetCharCount(Byte* bytes, Int32 count, DecoderNLS baseDecoder)
at System.String.CreateStringFromEncoding(Byte* bytes, Int32 byteLength, Encoding encoding)
at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)
at Microsoft.WindowsAzure.Storage.Queue.CloudQueueMessage.get_AsString()
at Microsoft.Azure.WebJobs.Host.Storage.Queue.StorageQueueMessage.get_AsString()
at Microsoft.Azure.WebJobs.Host.Queues.Triggers.UserTypeArgumentBindingProvider.UserTypeArgumentBinding.BindAsync(IStorageQueueMessage value, ValueBindingContext context)
at Microsoft.Azure.WebJobs.Host.Queues.Triggers.QueueTriggerBinding.<BindAsync>d__0.MoveNext()
Looking at the code of UserTypeArgumentBindingProvider.BindAsync, it clearly expects to be passed a message whose body is a JSON object. And the UserType... of the name also implies that it expects to bind a POCO.
Yet the MSDN article How to use Azure queue storage with the WebJobs SDK clearly states that
You can use QueueTrigger with the following types:
string
A POCO type serialized as JSON
byte[]
CloudQueueMessage
So why is it not binding to my message?
The WebJobs SDK parameter binding relies heavily on magic parameter names. Although [QueueTrigger(...)] string seems to permit any parameter name (and the MSDN article includes as examples logMessage, inputText, queueMessage, blobName), [QueueTrigger(...)] CloudQueueMessage requires that the parameter be named message. Changing the name of the parameter from msg to message fixes the binding.
Unfortunately, I'm not aware of any documentation which states this explicitly.
Try this instead:
public static void ConsolidateDomainAuditItem([QueueTrigger("foo")] byte[] message)
CloudQueueMessage is a wrapper, usually the bindings get rid of the wrapper and allow you to deal with the content instead.
I'm using Proxem wrapper for Stanford Parser and I'm facing problem with Parsing in ASP.NET MVC 3 and 4 application. It throws
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Proxem.Antelope.Parsing.Sentence.a(List`1 A_0)
at Proxem.Antelope.Parsing.Sentence..ctor(SerializationInfo info, StreamingContext ctxt)
--- End of inner exception stack trace ---
In WPF and console application it works fine.
I fixed it. Constructor Parser(string path) is invoking constructor Parser(string path, int poolsize) with poolsize value = 1. Using constructor Parser(string path, int poolsize) with values -> Parser(yourPath, 0) make it work with MVC and WCF.
I created a basic .NET 4.0 application and referenced the Saxon assemblies. Here is the list of dll's I referenced in the project.
saxon9.dll
saxon9api.dll
IKVM.OpenJDK.ClassLibrary.dll
IKVM.Runtime.dll
The code for the application is as follows:
Sub Main()
Console.WriteLine("Trying to instantiate SaxonProcessor...")
Try
Dim SaxonProcessor As Saxon.Api.Processor = New Saxon.Api.Processor()
Catch ex As Exception
Console.WriteLine("Error: " & ex.Message & ex.StackTrace)
Console.Read()
End Try
Console.WriteLine("Saxon instantiated successfully!")
Console.Read()
End Sub
When I run this application on our IIS machine, I get the following output:
Trying to instantiate SaxonProcessor...
Saxon instantiated successfully!
I then created a basic web application project and referenced the same files as the windows application. I deployed the web application to a virtual directory that contains all the referenced assemblies. I put the following code inside my Default.aspx page:
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Write("Trying to instantiate SaxonProcessor...")
Try
Dim SaxonProcessor As Saxon.Api.Processor = New Saxon.Api.Processor()
Response.Write("Saxon instantiated successfully!")
Catch ex As Exception
Response.Write("Error: " & ex.Message & ex.StackTrace)
End Try
End Sub
End Class
When I load the page, it gives me this exception:
Trying to instantiate SaxonProcessor...Error: The type initializer for 'IKVM.NativeCode.java.lang.Thread' threw an exception. at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize, Object loader) at java.lang.Class.forName0(String , Boolean , ClassLoader ) at java.lang.Class.forName(String className) at net.sf.saxon.dotnet.DotNetExtensionFunctionFactory.class$(String x0) at net.sf.saxon.dotnet.DotNetExtensionFunctionFactory..ctor(Configuration config) at net.sf.saxon.dotnet.DotNetPlatform.initialize(Configuration config) at net.sf.saxon.Configuration.init() at net.sf.saxon.Configuration..ctor() at Saxon.Api.Processor..ctor() at BealSaxxon._Default.Page_Load(Object sender, EventArgs e) in C:\Users\u0147101\Desktop\BealSaxxon\BealSaxxon\Default.aspx.vb:line 9
FULL STACKTRACE FROM IIS MACHINE:
System.TypeInitializationException: The type initializer for 'IKVM.NativeCode.java.lang.Thread' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'java.io.BufferedInputStream' threw an exception. ---> java.lang.RuntimeException: java.lang.IllegalAccessException: Class java.util.concurrent.atomic.AtomicReferenceFieldUpdater can not access a member of class java.io.BufferedInputStream with modifiers "volatile" ---> java.lang.IllegalAccessException: Class java.util.concurrent.atomic.AtomicReferenceFieldUpdater can not access a member of class java.io.BufferedInputStream with modifiers "volatile"
at sun.reflect.misc.ReflectUtil.ensureMemberAccess(Class currentClass, Class memberClass, Object target, Int32 modifiers)
at java.util.concurrent.atomic.AtomicReferenceFieldUpdater.AtomicReferenceFieldUpdaterImpl..ctor(Class , Class , String )
--- End of inner exception stack trace ---
at java.util.concurrent.atomic.AtomicReferenceFieldUpdater.AtomicReferenceFieldUpdaterImpl..ctor(Class , Class , String )
at java.util.concurrent.atomic.AtomicReferenceFieldUpdater.newUpdater(Class tclass, Class vclass, String fieldName)
at java.io.BufferedInputStream..cctor()
--- End of inner exception stack trace ---
at java.io.BufferedInputStream.__<clinit>()
at java.lang.System.initializeSystemClass()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at IKVM.NativeCode.java.lang.Thread..cctor()
--- End of inner exception stack trace ---
at IKVM.NativeCode.java.lang.Class.forName0(String name, Boolean initialize, Object loader)
at java.lang.Class.forName(String className)
at net.sf.saxon.dotnet.DotNetExtensionFunctionFactory.class$(String x0)
at net.sf.saxon.dotnet.DotNetExtensionFunctionFactory..ctor(Configuration config)
at net.sf.saxon.dotnet.DotNetPlatform.initialize(Configuration config)
at net.sf.saxon.Configuration.init()
at net.sf.saxon.Configuration..ctor()
at Saxon.Api.Processor..ctor()
at EDG.Transforms..ctor()
at EDG.Main..ctor(NameValueCollection applicationSettings, List`1 exceptionList)
at EDG.EGallery..ctor(NameValueCollection ConfigurationSettings, List`1 ExceptionList)
Has anyone seen this exception before? I've searched extensively on Google but nobody seems to have had this specific exception. I'm thinking it's a permissions problem with IIS, but I don't know for sure. The application pool this application is running under is setup with a machine administrator.
I think this can be 2 types of causes.
One of the IKVM dll is missing. Add all dll of IKVM to test if this solve the problem.
IKVM is compiled for .NET 2 and not version 4. You need to add a version mapping to your app.config.
In this situation, it was a product called OpNET that was interfering with apps using the JVM. Once its services and processes were stopped, the Saxon assembly worked fine.