Vs Test Failing with 3 errors on Azure Dev Ops Running nUnitTest - azure

I'm using VsTest to run my nUnit test on azure dev ops and getting failures. This runs fine on my local machine but not in the Azure DevOps Release. Here is are errors i'm seeing from the log. Its not giving me much to go off of to track what could be wrong. I thought it might be something in my .runsettings file but this is the same file I use locally which is fine. There are to data collectors that is used by my runsettings file that uses code coverage and the video recorder. I dont know if this is what might be causing the test to fail. If i do want to use that and that might be whats causing is is there a way to download these dlls for the server to use or does these get automatically downloaded with vs tool installer?
Here is the current Task
Copy Files to: $(System.DefaultWorkingDirectory) - succeeds
Visual Studio Test Platform Installer - Installs VS 2017 - succeeds
VSTest - I choose test plan - - Fails
- select test platform to - Installed by Tools Installer
- I select path to my .runsettings file
- I give the override test run parameters
- I check Code coveraged enabled
here is the error i received
Unhandled exception : System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
TestExecution encountered unexpected failures System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
Error: The process 'E:\Agent_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 3762504530
2021-05-07T14:52:00.1569206Z QueryForTaskIntervalInMilliseconds: 3000
2021-05-07T14:52:00.1570380Z MaxQueryForTaskIntervalInMilliseconds: 10000
2021-05-07T14:52:00.1571576Z QueueNotFoundDelayTimeInMilliseconds: 3000
2021-05-07T14:52:00.1598093Z MaxQueueNotFoundDelayTimeInMilliseconds: 50000
2021-05-07T14:52:00.1606607Z ===========================================
2021-05-07T14:52:01.2928251Z Result Attachments will be stored in LogStore
2021-05-07T14:52:01.3427529Z Run Attachments will be stored in LogStore
2021-05-07T14:52:01.8892467Z TestExecutionHost.Execute: Registered TestAgent : 798 : VS2VST05-VS2VST05i-41
2021-05-07T14:52:01.9062609Z Provided settings file:
2021-05-07T14:52:01.9079246Z <?xml version="1.0" encoding="utf-8"?>
2021-05-07T14:52:01.9079831Z <RunSettings>
2021-05-07T14:52:01.9080157Z <!-- Configurations that affect the Test Framework -->
2021-05-07T14:52:01.9084373Z <RunConfiguration>
2021-05-07T14:52:01.9084552Z <MaxCpuCount>1</MaxCpuCount>
2021-05-07T14:52:01.9084824Z <!-- Path relative to directory that contains .runsettings file-->
2021-05-07T14:52:01.9085105Z <ResultsDirectory>.\TestResults</ResultsDirectory>
2021-05-07T14:52:01.9085266Z
2021-05-07T14:52:01.9085400Z <!-- x86 or x64 -->
2021-05-07T14:52:01.9085703Z <!-- You can also change it from the Test menu; choose "Processor Architecture for AnyCPU Projects" -->
2021-05-07T14:52:01.9086015Z <TargetPlatform>x86</TargetPlatform>
2021-05-07T14:52:01.9086158Z
2021-05-07T14:52:01.9086337Z <!-- Framework35 | [Framework40] | Framework45 -->
2021-05-07T14:52:01.9086627Z <TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
2021-05-07T14:52:01.9087680Z
2021-05-07T14:52:01.9087850Z <!-- Path to Test Adapters -->
2021-05-07T14:52:01.9088095Z <TestAdaptersPaths>%SystemDrive%\Temp\foo;</TestAdaptersPaths>
2021-05-07T14:52:01.9088519Z <!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
2021-05-07T14:52:01.9088858Z <!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
2021-05-07T14:52:01.9089157Z <TestSessionTimeout>15000000</TestSessionTimeout>
2021-05-07T14:52:01.9089420Z <TreatNoTestsAsError>true</TreatNoTestsAsError>
2021-05-07T14:52:01.9089626Z </RunConfiguration>
2021-05-07T14:52:01.9089822Z <!-- Configurations for data collectors -->
2021-05-07T14:52:01.9090027Z <DataCollectionRunSettings>
2021-05-07T14:52:01.9090210Z <DataCollectors>
2021-05-07T14:52:01.9090804Z <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
2021-05-07T14:52:01.9091620Z <Configuration>
2021-05-07T14:52:01.9092022Z <CodeCoverage>
2021-05-07T14:52:01.9092187Z <ModulePaths>
2021-05-07T14:52:01.9092348Z <Exclude>
2021-05-07T14:52:01.9092562Z <ModulePath>.*CPPUnitTestFramework.*</ModulePath>
2021-05-07T14:52:01.9092794Z </Exclude>
2021-05-07T14:52:01.9092955Z </ModulePaths>
2021-05-07T14:52:01.9093227Z <!-- We recommend you do not change the following values: -->
2021-05-07T14:52:01.9093579Z <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
2021-05-07T14:52:01.9093914Z <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
2021-05-07T14:52:01.9094217Z <CollectFromChildProcesses>True</CollectFromChildProcesses>
2021-05-07T14:52:01.9094530Z <CollectAspDotNet>False</CollectAspDotNet>
2021-05-07T14:52:01.9094757Z </CodeCoverage>
2021-05-07T14:52:01.9094927Z </Configuration>
2021-05-07T14:52:01.9095114Z </DataCollector>
2021-05-07T14:52:01.9095793Z <DataCollector uri="datacollector://microsoft/VideoRecorder/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder.VideoRecorderDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Screen and Voice Recorder">
2021-05-07T14:52:01.9096694Z <!--Video data collector was introduced in Visual Studio 2017 version 15.5 -->
2021-05-07T14:52:01.9096989Z <Configuration>
2021-05-07T14:52:01.9097297Z <!-- Set "sendRecordedMediaForPassedTestCase" to "false" to add video attachments to failed tests only -->
2021-05-07T14:52:01.9097917Z <MediaRecorder sendRecordedMediaForPassedTestCase="false" xmlns=""> ​
2021-05-07T14:52:01.9098305Z <ScreenCaptureVideo bitRate="512" frameRate="2" quality="20" />​
2021-05-07T14:52:01.9098560Z </MediaRecorder>​
2021-05-07T14:52:01.9100157Z </Configuration>
2021-05-07T14:52:01.9100322Z </DataCollector>
2021-05-07T14:52:01.9100532Z <DataCollector friendlyName="blame" enabled="True">
2021-05-07T14:52:01.9100746Z </DataCollector>
2021-05-07T14:52:01.9100925Z </DataCollectors>
2021-05-07T14:52:01.9101487Z </DataCollectionRunSettings>
2021-05-07T14:52:01.9101720Z <!-- Parameters used by tests at run time -->
2021-05-07T14:52:01.9101885Z
2021-05-07T14:52:01.9102041Z <!-- MSTest adapter -->
2021-05-07T14:52:01.9102188Z <NUnit>
2021-05-07T14:52:01.9102371Z <InternalTraceLevel>Error</InternalTraceLevel>
2021-05-07T14:52:01.9102554Z </NUnit>
2021-05-07T14:52:01.9102666Z
2021-05-07T14:52:01.9102782Z </RunSettings>
2021-05-07T14:52:01.9393681Z Overriding UseVerifiableInstrumentation field to false in the runsettings file.
2021-05-07T14:52:01.9550200Z IsValidServiceResponse: Received None command..Service Workflow is not active
2021-05-07T14:52:02.0476240Z ##[error]Unhandled exception : System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.0485692Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.0486290Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.0486843Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.0487361Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.0487776Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.0488008Z at System.Threading.Tasks.Task.Execute()
2021-05-07T14:52:02.0488240Z --- End of inner exception stack trace ---
2021-05-07T14:52:02.0488490Z at System.AggregateException.Handle(Func`2 predicate)
2021-05-07T14:52:02.0488905Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.ExecuteCurrentPhase(CancellationToken cancellationToken)
2021-05-07T14:52:02.0489423Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Execute(CancellationToken cancellationToken)
2021-05-07T14:52:02.0489864Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Start()
2021-05-07T14:52:02.0490324Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.InitializeAndStartExecutionHost(Boolean debugLogs)
2021-05-07T14:52:02.0490784Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.Execute(Boolean debugLogs)
2021-05-07T14:52:02.0491382Z ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.0491868Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.0492404Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.0492953Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.0493484Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.0493867Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.0494108Z at System.Threading.Tasks.Task.Execute()<---
2021-05-07T14:52:02.0494260Z
2021-05-07T14:52:02.1579135Z ##[error]TestExecution encountered unexpected failures System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.1581938Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.1583067Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.1584187Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.1585236Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.1587079Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.1587869Z at System.Threading.Tasks.Task.Execute()
2021-05-07T14:52:02.1588636Z --- End of inner exception stack trace ---
2021-05-07T14:52:02.1589413Z at System.AggregateException.Handle(Func`2 predicate)
2021-05-07T14:52:02.1590350Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.ExecuteCurrentPhase(CancellationToken cancellationToken)
2021-05-07T14:52:02.1591492Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Execute(CancellationToken cancellationToken)
2021-05-07T14:52:02.1591974Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Start()
2021-05-07T14:52:02.1593219Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.InitializeAndStartExecutionHost(Boolean debugLogs)
2021-05-07T14:52:02.1594214Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.Execute(Boolean debugLogs)
2021-05-07T14:52:02.1595156Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.Program.Main(String[] args)
2021-05-07T14:52:02.1596244Z ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.1597231Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.1597806Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.1607075Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.1608570Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.1609155Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.1610029Z at System.Threading.Tasks.Task.Execute()<---
2021-05-07T14:52:02.1610221Z
2021-05-07T14:52:02.1612560Z
2021-05-07T14:52:02.1613028Z Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.1614180Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.1614742Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.1620575Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.1621740Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.1622351Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.1625627Z at System.Threading.Tasks.Task.Execute()
2021-05-07T14:52:02.1626144Z --- End of inner exception stack trace ---
2021-05-07T14:52:02.1626519Z at System.AggregateException.Handle(Func`2 predicate)
2021-05-07T14:52:02.1627028Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.ExecuteCurrentPhase(CancellationToken cancellationToken)
2021-05-07T14:52:02.1627670Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Execute(CancellationToken cancellationToken)
2021-05-07T14:52:02.1629545Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Start()
2021-05-07T14:52:02.1630375Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.InitializeAndStartExecutionHost(Boolean debugLogs)
2021-05-07T14:52:02.1631959Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.Execute(Boolean debugLogs)
2021-05-07T14:52:02.1632811Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.Program.Main(String[] args)
2021-05-07T14:52:02.1866126Z ##[error]Error: The process 'E:\Agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 3762504530
2021-05-07T14:52:02.1874141Z ##[section]Finishing: VsTest - testPlan
Here is the Yaml file
steps:
task: CopyFiles#2
displayName: 'Copy Files to: $(System.DefaultWorkingDirectory)'
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/_Atlas Automation (Agile) CI 2020/drop/Atlas_Automation_Test/Atlas_Automation_Test/bin/Release'
Contents: |
*.testsettings
*.runsettings
TargetFolder: '$(System.DefaultWorkingDirectory)'
CleanTargetFolder: true
OverWrite: true
flattenFolders: true

Related

Publish Angular-CLI 6 ASP.Core application to Azure

First of All here some Info
Project Angular-CLI ASP.Net Core 2.1
Publish from Visual Studio to Azure WebService
So what i have tried.
I have a running SPA in visual studio it runs fine without any error or warning.
Now i want to publish it to Azure over the build in publish via Visual Studio.
The publish Job show every thing is ok, then i go to the site where it should be hosted.
Now i get the following error:
so there is no complete error message why it was crashed i have found some logfile of the starting of the application:
2018-07-10 16:55:17.799 +00:00 [Information] Starting web host
2018-07-10 16:55:20.691 +00:00 [Information] Azure Web Sites environment detected. Using '"D:\home\ASP.NET\DataProtection-Keys"' as key repository; keys will not be encrypted at rest.
2018-07-10 16:55:22.456 +00:00 [Information] Starting #angular/cli on port 50808...
2018-07-10 16:55:25.208 +00:00 [Error] npm ERR! Error: ENOENT, open 'D:\home\site\wwwroot\ClientApp\dist\node_modules\start\package.json'
2018-07-10 16:55:25.716 +00:00 [Information] Request starting HTTP/1.1 GET http://localhost/
2018-07-10 16:55:28.285 +00:00 [Warning] Failed to determine the https port for redirect.
2018-07-10 16:55:28.301 +00:00 [Error] npm ERR! { [Error: ENOENT, open 'D:\home\site\wwwroot\ClientApp\dist\node_modules\start\package.json']
2018-07-10 16:55:28.575 +00:00 [Error] An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: )) ---> System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout[T](Task1 task, TimeSpan timeoutDelay, String message)
at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task1 baseUriTask, CancellationToken applicationStoppingToken, Boolean proxy404s)
at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
---> (Inner Exception #0) System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)<---
<---
2018-07-10 16:55:28.974 +00:00 [Information] Request finished in 3267.6338ms 500 text/html; charset=utf-8
2018-07-10 16:55:41.654 +00:00 [Information] Request starting HTTP/1.1 GET http://xircuitportal-beta.azurewebsites.net/
2018-07-10 16:55:41.790 +00:00 [Error] An unhandled exception has occurred while executing the request.
System.AggregateException: One or more errors occurred. (One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: )) ---> System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.Extensions.Util.TaskTimeoutExtensions.WithTimeout[T](Task1 task, TimeSpan timeoutDelay, String message)
at Microsoft.AspNetCore.SpaServices.Extensions.Proxy.SpaProxy.PerformProxyRequest(HttpContext context, HttpClient httpClient, Task1 baseUriTask, CancellationToken applicationStoppingToken, Boolean proxy404s)
at Microsoft.AspNetCore.Builder.SpaProxyingExtensions.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. (The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ) ---> System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.<>c.b__2_0(Task1 task)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__278_1(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
---> (Inner Exception #0) System.InvalidOperationException: The NPM script 'start' exited without indicating that the Angular CLI was listening for requests. The error output was: ---> System.IO.EndOfStreamException: Attempted to read past the end of the stream.
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.SpaServices.AngularCli.AngularCliMiddleware.StartAngularCliServerAsync(String sourcePath, String npmScriptName, ILogger logger)<---
<---
2018-07-10 16:55:42.383 +00:00 [Information] Request finished in 728.6751ms 500 text/html; charset=utf-8
The sort of the log: it says that he tried to find the file D:\home\site\wwwroot\ClientApp\dist\node_modules\start\package.json
But the folder doesnt exsist and the package.json is in the ClientApp\dist folder.
All my configuration says that the output of the build is going to ClientApp\dist
So what configureation must i set, that the angular app is running in azure
Here my package.json (the start)
{
"name": "ClientApp",
"version": "0.1.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"serve": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"run": "ng build",
"e2e": "ng e2e"
},
[...]
}
when your need more info of one file or config write it in the comment i provide it than.
I think you need something like:
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "ClientApp/dist";
});

spring integration-sftp inbound adapter with polling facility at server startup

I am trying to sftp file with Spring integration using a maven web projecy
Need a polling facility. If I am starting the SftpInbound.java, the polling is working. Need to have the polling at server start up.
The content of java file and configuration
SftpInbound.java
package com.myproj.integration.bsy.sftp;
import java.io.File;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.file.remote.RemoteFileTemplate;
import org.springframework.integration.file.remote.session.CachingSessionFactory;
import org.springframework.integration.file.remote.session.SessionFactory;
import org.springframework.messaging.Message;
import org.springframework.messaging.PollableChannel;
import org.springframework.scheduling.annotation.Scheduled;
import com.myproj.integration.bsy.sftp.*;
import com.jcraft.jsch.ChannelSftp.LsEntry;
public class SftpInboundReceive {
#Scheduled(fixedRate=5000)
public void inboundSftpPoll(){
ConfigurableApplicationContext context =
new ClassPathXmlApplicationContext("/META-INF/spring/integration/sftp/SftpInboundReceive-context.xml", this.getClass());
RemoteFileTemplate<LsEntry> template = null;
String file1 = "a.txt";
String file2 = "b.txt";
String file3 = "c.bar";
new File("local-dir", file1).delete();
new File("local-dir", file2).delete();
try {
PollableChannel localFileChannel = context.getBean("receiveChannel", PollableChannel.class);
#SuppressWarnings("unchecked")
SessionFactory<LsEntry> sessionFactory = context.getBean(CachingSessionFactory.class);
template = new RemoteFileTemplate<LsEntry>(sessionFactory);
System.out.println("here 1" +template);
SourcePollingChannelAdapter adapter = context.getBean("sftpInbondAdapter",SourcePollingChannelAdapter.class);
adapter.start();
Message<?> received = localFileChannel.receive();
System.out.println("Received first file message 1: " + received);
received = localFileChannel.receive();
System.out.println("Received second file message: " + received);
received = localFileChannel.receive(1000);
System.out.println("Third file was received as expected" +received);
}catch(Exception e){
e.printStackTrace();
}
finally {
SftpUtils.cleanUp(template, file1, file2, file3);
//context.close();
}
}
public static void main(String args[])
{
SftpInboundReceive oInboundReceiveSample = new SftpInboundReceive();
oInboundReceiveSample.inboundSftpPoll();
}
}
The xml file SftpInboundReceive-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-sftp="http://www.springframework.org/schema/integration/sftp"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-4.1.xsd
http://www.springframework.org/schema/integration/sftp http://www.springframework.org/schema/integration/sftp/spring-integration-sftp-4.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.1.xsd">
<!-- <import resource="SftpSampleCommon.xml"/> -->
<context:property-placeholder order="1"
location="classpath:/sftpuser.properties" ignore-unresolvable="true"/>
<bean id="sftpSessionFactory"
class="org.springframework.integration.file.remote.session.CachingSessionFactory">
<constructor-arg ref="defaultSftpSessionFactory" />
</bean>
<!-- host=xxx.xx.128.143 port=22 username=xxxuser passphrase= private.keyfile=classpath:META-INF/keys/sftp_rsa -->
<bean id="defaultSftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${sftp.host}" />
<property name="port" value="${sftp.port}" />
<property name="user" value="${sftp.username}" />
<property name="privateKey" value="${private.keyfile}" />
<property name="privateKeyPassphrase" value="${passphrase}" />
</bean>
<!-- username & password from property file... tested <bean id="defaultSftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="${sftp.host}"/> <property name="port" value="${sftp.port}"/>
<property name="user" value="${sftp.username}"/> <property name="password"
value="${sftp.password}"/> </bean> -->
<!-- hardcoded, username & password... tested <bean id="defaultSftpSessionFactory"
class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="xxx.xx.128.143"/> <property name="port" value="22"/>
<property name="user" value="xxxuser"/> <property name="password" value="xxxuser#123"/>
</bean> -->
<!-- Inbound channel adapter for SFTP call . with poll facility -->
<int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
auto-startup="true" channel="receiveChannel" session-factory="sftpSessionFactory"
local-directory="file:/target/foo" remote-directory="${sftp.inboundremotedir}"
auto-create-local-directory="true" delete-remote-files="false"
filename-pattern="*.txt">
<int:poller fixed-rate="100000" max-messages-per-poll="1" />
</int-sftp:inbound-channel-adapter>
<int:channel id="receiveChannel">
<int:queue />
</int:channel>
</beans>
STackTrace
p-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 5 of 12 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'
16:02:58.368 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 6 of 12 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
16:02:58.368 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
16:02:58.368 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
16:02:58.370 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
16:02:58.371 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.authentication.AnonymousAuthenticationFilter] Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken#9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails#957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
16:02:58.371 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
16:02:58.371 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
16:02:58.371 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
16:02:58.371 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.util.matcher.AntPathRequestMatcher] Checking match of request : '/'; against '/services/employee/*'
16:02:58.371 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.access.intercept.FilterSecurityInterceptor] Public object - authentication not attempted
16:02:58.371 TRACE [http-bio-8080-exec-3][org.springframework.web.context.support.XmlWebApplicationContext] Publishing event in Root WebApplicationContext: org.springframework.security.access.event.PublicInvocationEvent[source=FilterInvocation: URL: /]
16:02:58.372 DEBUG [http-bio-8080-exec-3][org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'org.springframework.integration.internalMessagingAnnotationPostProcessor'
16:02:58.372 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.FilterChainProxy] / reached end of additional filter chain; proceeding with original chain
16:02:58.375 TRACE [http-bio-8080-exec-3][org.springframework.web.servlet.DispatcherServlet] Bound request context to thread: SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper#1b0b34e]
16:02:58.376 DEBUG [http-bio-8080-exec-3][org.springframework.web.servlet.DispatcherServlet] DispatcherServlet with name 'Information Exchange Gateway Integration' processing GET request for [/DummyDataIntg/]
16:02:58.376 TRACE [http-bio-8080-exec-3][org.springframework.web.servlet.DispatcherServlet] Testing handler map [org.springframework.integration.http.inbound.IntegrationRequestMappingHandlerMapping#cdca7] in DispatcherServlet with name 'Information Exchange Gateway Integration'
16:02:58.378 WARN [http-bio-8080-exec-3][org.springframework.web.servlet.PageNotFound] No mapping found for HTTP request with URI [/DummyDataIntg/] in DispatcherServlet with name 'Information Exchange Gateway Integration'
16:02:58.378 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.context.HttpSessionSecurityContextRepository] SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
16:02:58.378 TRACE [http-bio-8080-exec-3][org.springframework.web.servlet.DispatcherServlet] Cleared thread-bound request context: SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper#1b0b34e]
16:02:58.378 DEBUG [http-bio-8080-exec-3][org.springframework.web.servlet.DispatcherServlet] Successfully completed request
16:02:58.378 TRACE [http-bio-8080-exec-3][org.springframework.web.context.support.XmlWebApplicationContext] Publishing event in WebApplicationContext for namespace 'Information Exchange Gateway Integration-servlet': ServletRequestHandledEvent: url=[/DummyDataIntg/]; client=[127.0.0.1]; method=[GET]; servlet=[Information Exchange Gateway Integration]; session=[null]; user=[null]; time=[6ms]; status=[OK]
16:02:58.378 TRACE [http-bio-8080-exec-3][org.springframework.web.context.support.XmlWebApplicationContext] Publishing event in Root WebApplicationContext: ServletRequestHandledEvent: url=[/DummyDataIntg/]; client=[127.0.0.1]; method=[GET]; servlet=[Information Exchange Gateway Integration]; session=[null]; user=[null]; time=[6ms]; status=[OK]
16:02:58.378 DEBUG [http-bio-8080-exec-3][org.springframework.beans.factory.support.DefaultListableBeanFactory] Returning cached instance of singleton bean 'org.springframework.integration.internalMessagingAnnotationPostProcessor'
16:02:58.378 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.access.ExceptionTranslationFilter] Chain processed normally
16:02:58.378 DEBUG [http-bio-8080-exec-3][org.springframework.security.web.context.SecurityContextPersistenceFilter] SecurityContextHolder now cleared, as request processing completed
16:04:37.403 INFO [task-scheduler-4][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\b.txt, headers={timestamp=1420540477403, id=f8c32928-411b-99b7-f4a0-0dd1b119fc44}]]
16:04:37.403 ERROR [task-scheduler-4][org.springframework.integration.handler.LoggingHandler] \target\foo\b.txt
16:06:17.403 INFO [task-scheduler-9][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\brjb.txt, headers={timestamp=1420540577403, id=061634bf-0562-962b-e583-53a302cdb0d4}]]
16:06:17.403 ERROR [task-scheduler-9][org.springframework.integration.handler.LoggingHandler] \target\foo\brjb.txt
16:07:57.403 INFO [task-scheduler-10][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\d.txt, headers={timestamp=1420540677403, id=abea1188-fc5a-15b0-c40c-73ea686a88c0}]]
16:07:57.403 ERROR [task-scheduler-10][org.springframework.integration.handler.LoggingHandler] \target\foo\d.txt
16:09:37.403 INFO [task-scheduler-4][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\g.txt, headers={timestamp=1420540777403, id=461a8e48-6ebf-5d1c-ab3f-ce28e54e00b8}]]
16:09:37.403 ERROR [task-scheduler-4][org.springframework.integration.handler.LoggingHandler] \target\foo\g.txt
16:11:17.403 INFO [task-scheduler-3][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\h.txt, headers={timestamp=1420540877403, id=4cbeeceb-5949-0e1c-1492-45ec17172480}]]
16:11:17.403 ERROR [task-scheduler-3][org.springframework.integration.handler.LoggingHandler] \target\foo\h.txt
16:12:57.403 INFO [task-scheduler-9][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\p.txt, headers={timestamp=1420540977403, id=3767b4bb-4de4-3178-f693-5ac0bd94a766}]]
16:12:57.403 ERROR [task-scheduler-9][org.springframework.integration.handler.LoggingHandler] \target\foo\p.txt
16:14:37.403 INFO [task-scheduler-6][org.springframework.integration.file.FileReadingMessageSource] Created message: [GenericMessage [payload=\target\foo\wiki.txt, headers={timestamp=1420541077403, id=bd3d0082-9788-fc31-1596-ab7a79186c17}]]
16:14:37.403 ERROR [task-scheduler-6][org.springframework.integration.handler.LoggingHandler] \target\foo\wiki.txt
error log in java file**strong text**
20:25:52.807 ERROR [task-scheduler-1][org.springframework.integration.handler.LoggingHandler] org.springframework.messaging.MessagingException: Problem occurred while synchronizing remote to local directory; nested exception is org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:209)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:167)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizingMessageSource.doReceive(AbstractInboundFileSynchronizingMessageSource.java:57)
at org.springframework.integration.endpoint.AbstractMessageSource.receive(AbstractMessageSource.java:64)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.receiveMessage(SourcePollingChannelAdapter.java:124)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:192)
at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:55)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:149)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:298)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:292)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.messaging.MessagingException: Failed to execute on session; nested exception is org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:343)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer.synchronizeToLocalDirectory(AbstractInboundFileSynchronizer.java:167)
... 22 more
Caused by: org.springframework.core.NestedIOException: Failed to list files; nested exception is 2: No such file
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:103)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:50)
at org.springframework.integration.file.remote.session.CachingSessionFactory$CachedSession.list(CachingSessionFactory.java:205)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:171)
at org.springframework.integration.file.remote.synchronizer.AbstractInboundFileSynchronizer$1.doInSession(AbstractInboundFileSynchronizer.java:167)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:334)
... 23 more
Caused by: 2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2846)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2198)
at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2215)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1565)
at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)
at org.springframework.integration.sftp.session.SftpSession.list(SftpSession.java:91)
... 28 more
You need to take a look how to start Spring Context from Web application using web.xml or WebApplicationInitializer for Servlet 3 environment. In this case the SftpInboundReceive-context.xml can be a part of common ApplicationContext and the polling facility (<int-sftp:inbound-channel-adapter>) will start automatically on application startup, which is caused on server start, when the last one see the web context of your application.
Please, read more docs for Spring Framework: http://projects.spring.io/spring-framework/
Spring Integration is just an EIP extension and follow with the same configuration and lifecycle rules.
I see that you just use the SFTP sample from Spring Intregration. You can found there samples for Tomcat and for Spring Boot as well.

Azure: Failed to send bytes to XContainer wad-tracefiles

For some reason I get errors while using Diagnostics in Azure. The code of my (WCF) WebRole is:
public override bool OnStart()
{
// To enable the AzureLocalStorageTraceListner, uncomment relevent section in the web.config
DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
diagnosticConfig.Directories.BufferQuotaInMB = 256;
// Start diagnostics
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfig);
// Write trace line
Trace.WriteLine("CUSTUM TRACE MESSAGE");
// Start instance
return base.OnStart();
}
My Web.config file looks like this:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<system.diagnostics>
<sharedListeners>
<add name="AzureLocalStorage" type="WCFServiceWebRole1.AzureLocalStorageTraceListener, WCFServiceWebRole1"/>
</sharedListeners>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
</sources>
<trace autoflush="true">
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
In the Compute Emulator I see the following error:
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[MonAgentHost] Error: MA EVENT: 2012-06-06T10:01:20.111Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6396
[MonAgentHost] Error: 6624
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\xblobconnection.cpp
[MonAgentHost] Error: XBlobConnection::PutBytesXBlob
[MonAgentHost] Error: 1621
[MonAgentHost] Error: ffffffff80050023
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: Failed to send bytes to XContainer wad-tracefiles
This error repeats several times. The "wad-tracefiles" container is added by the following code in the AzureLocalStorageTraceListener class:
public static DirectoryConfiguration GetLogDirectory()
{
DirectoryConfiguration directory = new DirectoryConfiguration();
directory.Container = "wad-tracefiles";
directory.DirectoryQuotaInMB = 10;
directory.Path = RoleEnvironment.GetLocalResource("WCFServiceWebRole1.svclog").RootPath;
return directory;
}
Why does writing trace messages fails in this scenario? When I look in my Storage with the Azure Storage Explorer the only table I see is the WADDirectoriesTable and not the the WADLogsTable. The "wad-tracefiles" blob does get created but that is not the place where I should find the Trace messages from my code.
Anyone, any idea? Any help is appreciated!
Your first problem is that you haven't used SetCurrentConfiguration() with your GetDefaultInitialConfiguration() to finally save the transfer time and log level. You must use the set of these API as below:
GetDefaultInitialConfiguration()
SetCurrentConfiguration()
OR
GetCurrentConfiguration()
SetCurrentConfiguration()
Because of it the following line based configuration will not be saved in Diagnostics configuration:
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
Use above suggestion and then see what happens.
I would also suggest to just create a very simple web or worker role hello world sample and add general TRACE Message by enabling Azure Diagnostics to see if that give you any error. This will prove if you have any issue with your SDK installation or Azure Storage Emulator or not as well.
Thank you for your reply! The project I am using is a really simple WebRole with only one trace message so I can not strip any code out.
I tried your suggestion and you are right, I do not get any error messages anymore with the following code:
public override bool OnStart()
{
setDiagnostics();
Trace.WriteLine("CUSTUM TRACE MESSAGE");
// Start instance
return base.OnStart();
}
private void setDiagnostics()
{
// Get diagnostics connectionstring
string wadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(wadConnectionString));
// Get the diagnostics configuration of the deployment and its role instances that are currently running
DeploymentDiagnosticManager deploymentDiagnosticManager = new DeploymentDiagnosticManager(cloudStorageAccount, RoleEnvironment.DeploymentId);
RoleInstanceDiagnosticManager roleInstanceDiagnosticManager = cloudStorageAccount.CreateRoleInstanceDiagnosticManager(
RoleEnvironment.DeploymentId,
RoleEnvironment.CurrentRoleInstance.Role.Name,
RoleEnvironment.CurrentRoleInstance.Id);
// Load diagnostics configuration
DiagnosticMonitorConfiguration diagConfig = roleInstanceDiagnosticManager.GetCurrentConfiguration();
// Get the default value if there is no config yet
if (diagConfig == null)
diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
// Enable EventLogs
diagConfig.WindowsEventLog.DataSources.Add("Application!*");
diagConfig.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
diagConfig.WindowsEventLog.BufferQuotaInMB = 128;
// Failed Request Logs
diagConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
diagConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
diagConfig.Directories.BufferQuotaInMB = 128;
// Crash Dumps
CrashDumps.EnableCollection(true);
// Set new configuration
roleInstanceDiagnosticManager.SetCurrentConfiguration(diagConfig);
// Start the DiagnosticMonitor
DiagnosticMonitor.Start(wadConnectionString, diagConfig);
}
When I look in which tables are present in the Azure Storage Explorer I only see the "WADDirectoriesTable" and the "WADWindowsEventLogsTable". Trace messages should come in the "WADLogsTable" right? So I see the Trace message in the Compute Emulator but I do not see them in my storage... any ideas why?

XMLDirectMapping - No conversion value provided

docx4j (which I host) is typically used with the Sun/Oracle JAXB implementation; the classes of interest below were generated using XJC.
Following on from an earlier issue which the MOXy guys kindly fixed, I'm continuing to try to get it working with EclipseLink MOXy.
With a particular DOM document, I'm now getting:
[Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: Exception [EclipseLink-116] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: No conversion value provided for the value [1] in field [#ns1:val].
Mapping: org.eclipse.persistence.oxm.mappings.XMLDirectMapping[val-->#ns1:val]
Descriptor: XMLDescriptor(org.docx4j.math.CTOnOff --> [])]
at org.eclipse.persistence.jaxb.JAXBBinder.unmarshal(JAXBBinder.java:100)
at org.docx4j.openpackaging.parts.JaxbXmlPartXPathAware.unmarshal(JaxbXmlPartXPathAware.java:211)
at org.docx4j.openpackaging.io.LoadFromZipNG.getRawPart(LoadFromZipNG.java:556)
at org.docx4j.openpackaging.io.LoadFromZipNG.getPart(LoadFromZipNG.java:427)
at org.docx4j.openpackaging.io.LoadFromZipNG.addPartsFromRelationships(LoadFromZipNG.java:350)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:243)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:193)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:301)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:245)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:195)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:178)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:172)
at org.docx4j.samples.OpenAndSaveRoundTripTest.main(OpenAndSaveRoundTripTest.java:60)
Caused by: Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: Exception [EclipseLink-116] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: No conversion value provided for the value [1] in field [#ns1:val].
Mapping: org.eclipse.persistence.oxm.mappings.XMLDirectMapping[val-->#ns1:val]
Descriptor: XMLDescriptor(org.docx4j.math.CTOnOff --> [])
at org.eclipse.persistence.exceptions.XMLMarshalException.unmarshalException(XMLMarshalException.java:109)
at org.eclipse.persistence.internal.oxm.XMLCompositeObjectMappingNodeValue.startElement(XMLCompositeObjectMappingNodeValue.java:328)
at org.eclipse.persistence.oxm.record.UnmarshalRecord.startElement(UnmarshalRecord.java:783)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:147)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.handleChildNodes(DOMReader.java:250)
at org.eclipse.persistence.internal.oxm.record.DOMReader.reportElementEvents(DOMReader.java:148)
at org.eclipse.persistence.internal.oxm.record.DOMReader.parse(DOMReader.java:89)
at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:462)
at org.eclipse.persistence.oxm.XMLBinder.unmarshal(XMLBinder.java:84)
at org.eclipse.persistence.jaxb.JAXBBinder.unmarshal(JAXBBinder.java:89)
... 12 more
Caused by: Exception [EclipseLink-116] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: No conversion value provided for the value [1] in field [#ns1:val].
Mapping: org.eclipse.persistence.oxm.mappings.XMLDirectMapping[val-->#ns1:val]
Descriptor: XMLDescriptor(org.docx4j.math.CTOnOff --> [])
at org.eclipse.persistence.oxm.record.UnmarshalRecord.startElement(UnmarshalRecord.java:851)
at org.eclipse.persistence.internal.oxm.XMLRelationshipMappingNodeValue.processChild(XMLRelationshipMappingNodeValue.java:91)
at org.eclipse.persistence.internal.oxm.XMLCompositeObjectMappingNodeValue.startElement(XMLCompositeObjectMappingNodeValue.java:323)
... 36 more
Caused by: Exception [EclipseLink-116] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: No conversion value provided for the value [1] in field [#ns1:val].
Mapping: org.eclipse.persistence.oxm.mappings.XMLDirectMapping[val-->#ns1:val]
Descriptor: XMLDescriptor(org.docx4j.math.CTOnOff --> [])
at org.eclipse.persistence.exceptions.DescriptorException.noFieldValueConversionToAttributeValueProvided(DescriptorException.java:1052)
at org.eclipse.persistence.mappings.converters.ObjectTypeConverter.convertDataValueToObjectValue(ObjectTypeConverter.java:140)
at org.eclipse.persistence.oxm.mappings.XMLDirectMapping.getAttributeValue(XMLDirectMapping.java:287)
at org.eclipse.persistence.internal.oxm.XMLDirectMappingNodeValue.attribute(XMLDirectMappingNodeValue.java:153)
at org.eclipse.persistence.oxm.record.UnmarshalRecord.startElement(UnmarshalRecord.java:834)
... 38 more
That was with JAXBBinder.unmarshall. The same thing occurs if I use JAXBUnmarshaller.unmarshal:
[Exception [EclipseLink-25004] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: Exception [EclipseLink-116] (Eclipse Persistence Services - 2.4.0.v20120529-r11529): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: No conversion value provided for the value [1] in field [#ns1:val].
Mapping: org.eclipse.persistence.oxm.mappings.XMLDirectMapping[val-->#ns1:val]
Descriptor: XMLDescriptor(org.docx4j.math.CTOnOff --> [])]
at org.eclipse.persistence.jaxb.JAXBUnmarshaller.handleXMLMarshalException(JAXBUnmarshaller.java:956)
at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:210)
The XML file causing the breakage may be found at https://gist.github.com/2834081 and org.docx4j.math.CTOnOff is here.
Any suggestions?
Note: I'm the EclipseLink JAXB (MOXy) lead an a member of the JAXB (JSR-222) expert group.
The XML document being unmarshalled is actually invalid. If the value in the ns1:val attribute is changed to match the allowed enum values then everything works as expected.
XML File
Line 95 of the xml doc is this
<m:radPr>
<m:degHide m:val="1" />
STOnOff
1 is not a valid value...should be "on" or "off"
#XmlType(name = "ST_OnOff")
#XmlEnum
public enum STOnOff {
#XmlEnumValue("on")
ON("on"),
#XmlEnumValue("off")
OFF("off");
private final String value;
}
CTRadPr
public class CTRadPr implements Child
{
protected CTOnOff degHide;
protected CTCtrlPr ctrlPr;
...
}
CTOnOff
#XmlType(name = "CT_OnOff")
public class CTOnOff implements Child
{
#XmlAttribute(namespace = "http://schemas.openxmlformats.org/officeDocument/2006/math")
protected STOnOff val;
There is a bug in MOXy related to handling the invalid value. What MOXy should do is when it spots the invalid value it should report an error to the ValidationEventHandler. If the ValidationEventHandler handles the event then a value will not be set for the corresponding field/property. When you try this with the JAXB RI you will see that the invalid values are not populated in the object model
You can use the following bug to track our progress on this issue:
http://bugs.eclipse.org/381217
UPDATE
We have fixed bug 381217 in the EclipseLink 2.4.0 stream. You can download a nightly label from the following location:
http://www.eclipse.org/eclipselink/downloads/nightly.php
Note: With the fix, MOXy will report a validation event for the invalid attribute value just as it would for an invalid element value. This is different) behaviour from the JAXB-RI which throws validation events for invalid elements but not invalid attributes. I believe the RI behaviour is a bug.

How to configure logging in Spring.NET using log4net?

I would like use from Spring.NET Aspect library Logging aspect together with log4Net.
I found this article how to use log4Net with Common Logging API.
My test application is console and based on .NET 4.0 Client profile.
1st Attempt
So I refer in my project these libraries:
Spring.Core version 1.3.2.40943, runtime v4.0.30319
Spring.AOP version 1.3.2.40943, runtime v4.0.30319
Common.Logging version: 1.2.0.0, runtime v1.0.3705
Assemblies above I have from Program Files\Spring.NET 1.3.2\bin\net\4.0
log4net version: 1.2.10.0, runtime v2.0.50727
I couldn’t find assembly Common.Logging.Log4Net.dll in Program Files\Spring.NET 1.3.2\bin
\net\4.0 so I download this assembly from SourceForge:
Common.Logging.Log4Net version 2.0.0.0 runtime v2.0.50727
I configured logger in app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
</sectionGroup>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<log4net>
<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ConsoleAppender" />
</root>
<logger name="myLogger">
<level value="DEBUG" />
</logger>
</log4net>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
</objects>
</spring>
</configuration>
and tried this:
ILog log = LogManager.GetLogger("myLogger");
log.Error("hello world");
I got this runtime error:
{"Could not configure Common.Logging from configuration section
'common/logging'."}
Inner exception:
{"An error occurred creating the configuration section handler for
common/logging: Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net' (E:\C#
PROJECTS\STUDY\SPRING.NET\SpringNet.Aspects\LoggingWithLog4Net\bin\Debug\LoggingWithLog4Net.vshost.exe.Config
line 18)"}
StackTrace:
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[]
keys, SectionInput input, Boolean isTrusted, FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult) at
System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord
factoryRecord, SectionRecord sectionRecord, Object parentResult,
Boolean getLkg, Boolean getRuntimeObject, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String
configKey, Boolean getLkg, Boolean checkPermission, Boolean
getRuntimeObject, Boolean requestIsHere, Object& result, Object&
resultRuntimeObject) at
System.Configuration.BaseConfigurationRecord.GetSection(String
configKey) at
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String
sectionName) at
System.Configuration.ConfigurationManager.GetSection(String
sectionName) at
System.Configuration.ConfigurationSettings.GetConfig(String
sectionName) at
Common.Logging.ConfigurationReader.GetSection(String sectionName)
at Common.Logging.LogManager.BuildLoggerFactoryAdapter()
2nd Attempt
I think problem must be in version of assembly Common.Logging.Log4Net version 2.0.0.0 runtime v2.0.50727. Because I used Common.Logging version: 1.2.0.0, runtime v1.0.3705.
So I changed Common.Logging version from 1.2.0.0 to 2.0.0.0. I used Common.Logging from SourceForge.
And tested again. I got this error:
Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net'
Inner exception:
{"Could not load file or assembly 'Common.Logging.Log4Net' or one of
its dependencies. The system cannot find the file
specified.":"Common.Logging.Log4Net"}
StackTrace:
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName,
ObjectHandleOnStack type) at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at
System.RuntimeType.GetType(String typeName, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase) at
Common.Logging.ConfigurationSectionHandler.ReadConfiguration(XmlNode
section) in
c:\CCNet\netcommon\trunk\modules\Common.Logging\src\Common\Common.Logging\Logging\ConfigurationSectionHandler.cs:line
130
3rd and last attempt
Finally I found assembly Common.Logging.Log4Net version 1.2.0.2 in spring examples so I used it.
Common.Logging.Log4Net version 1.2.0.2
Common.Logging version 1.2.0.0
log4Net 1.2.10.0
Tested and got again error:
{"Could not configure Common.Logging from configuration section
'common/logging'."}
Inner exception:
{"An error occurred creating the configuration section handler for
common/logging: Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net' (E:\C#
PROJECTS\STUDY\SPRING.NET\SpringNet.Aspects\LoggingWithLog4Net\bin\Debug\LoggingWithLog4Net.vshost.exe.Config
line 18)"}
StackTrace:
{"Unable to create type
'Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter,
Common.Logging.Log4Net'"}
I am really confuse what I do bad? Some problem with assemblies version?
For Spring.NET 1.3.2 you should use:
Common.Logging 2.0.0
Common.Logging.Log4Net 2.0.0
log4net 1.2.10
Make sure the last two log4net dll's are copied to the output directory. Since your code doesn't reference it directly, they might not be copied by Visual Studio.
Also, instead of
<resource uri="config://springs/objects"/>
Try
<resource uri="config://spring/objects"/>
In your config file the sectionGroup name is "spring", NOT "springs". I copied from yours to make mine work and got in the same problem. Finally figured out why.
Hope that helps!
Another possibility is:
Common.Logging 2.1.1
Common.Logging.Log4Net 2.1.1
log4net 1.2.10
I recommend skipping Common.Logging 2.1.0 as it did throw this exception when reading perfectly valid app.config section:
"Unable to cast object of type 'System.Configuration.DefaultSection' to type 'System.Configuration.AppSettingsSection'."
Installing 2.1.1 fixed the problem.

Resources