OpenTelemetry .NET 6 OTPL Exporter exception - .net-6.0

I have an ASPNET 6 application to which I've added OpenTelemetry with the OTPL Exporter configured as follows:
services.AddOpenTelemetryTracing(tracerProviderBuilder =>
{
tracerProviderBuilder
.AddOtlpExporter(opt =>
{
opt.Protocol = OtlpExportProtocol.Grpc;
opt.BatchExportProcessorOptions = new BatchExportProcessorOptions<Activity>
{
////MaxExportBatchSize = 16 // Set a low batch size
};
})
.AddSource(serviceName)
.AddSource("MySqlConnector") // Or remove this
.SetResourceBuilder(
ResourceBuilder.CreateDefault()
.AddService(serviceName: serviceName, serviceVersion: serviceVersion)
.AddDetector(new AWSEC2ResourceDetector()))
.AddAWSInstrumentation()
.AddHttpClientInstrumentation()
.AddAspNetCoreInstrumentation()
.AddRedisInstrumentation();
});
And the following packages/versions
<PackageReference Include="OpenTelemetry" Version="1.4.0-alpha.2" />
<PackageReference Include="OpenTelemetry.Contrib.Extensions.AWSXRay" Version="1.2.0" />
<PackageReference Include="OpenTelemetry.Contrib.Instrumentation.AWS" Version="1.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.3.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc9.6" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9.6" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9.6" />
<PackageReference Include="OpenTelemetry.Instrumentation.StackExchangeRedis" Version="1.0.0-rc9.7" />
I have a bunch of integration tests that fail when I run them with the following exception
Exit code is -1073741819 (Fatal error. System.AccessViolationException: Attempted to
read or write protected memory. This is often an indication that other memory is
corrupt.
at System.Runtime.CompilerServices.CastHelpers.IsInstanceOfClass(Void*, System.Object)
at OpenTelemetry.Internal.TagTransformer`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryTransformTag(System.Collections.Generic.KeyValuePair`2<System.String,System.Object>, System.__Canon ByRef)
at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions+TagEnumerationState.ForEach(System.Collections.Generic.KeyValuePair`2<System.String,System.Object>)
at DynamicClass.AllocationFreeForEachDelegate(System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.String,System.Object>>, TagEnumerationState ByRef, ForEachDelegate<System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.String,System.Object>>,System.Collections.Generic.KeyValuePair`2<System.String,System.Object>,TagEnumerationState>)
at OpenTelemetry.Trace.ActivityHelperExtensions+ActivityTagsEnumeratorFactory`1[[OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions+TagEnumerationState, OpenTelemetry.Exporter.OpenTelemetryProtocol, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7bd6737fe5b67e3c]].Enumerate(System.Diagnostics.ActivityEvent, TagEnumerationState ByRef)
at OpenTelemetry.Trace.ActivityHelperExtensions.EnumerateTags[[OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions+TagEnumerationState, OpenTelemetry.Exporter.OpenTelemetryProtocol, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7bd6737fe5b67e3c]](System.Diagnostics.ActivityEvent, TagEnumerationState ByRef)
at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions.ToOtlpEvent(System.Diagnostics.ActivityEvent)
at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions+EventEnumerationState.ForEach(System.Diagnostics.ActivityEvent)
at OpenTelemetry.Trace.ActivityHelperExtensions+ActivityEventsEnumeratorFactory`1[[OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions+EventEnumerationState, OpenTelemetry.Exporter.OpenTelemetryProtocol, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7bd6737fe5b67e3c]].ForEachEventCallback(EventEnumerationState ByRef, System.Diagnostics.ActivityEvent)
at DynamicClass.AllocationFreeForEachDelegate(System.Collections.Generic.IEnumerable`1<System.Diagnostics.ActivityEvent>, EventEnumerationState ByRef, ForEachDelegate<System.Collections.Generic.IEnumerable`1<System.Diagnostics.ActivityEvent>,System.Diagnostics.ActivityEvent,EventEnumerationState>)
at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions.AddBatch(Opentelemetry.Proto.Collector.Trace.V1.ExportTraceServiceRequest, Opentelemetry.Proto.Resource.V1.Resource, OpenTelemetry.Batch`1<System.Diagnostics.Activity> ByRef)
at OpenTelemetry.Exporter.OtlpTraceExporter.Export(OpenTelemetry.Batch`1<System.Diagnostics.Activity> ByRef)
at OpenTelemetry.BatchExportProcessor`1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExporterProc()
at System.Threading.Thread.StartCallback())
This scenario does not reproduce if I do one of two things
Set the MaxExportBatchSize to something small like 16 (default is 512)
Remove the "MySqlConnector" source - I think that I passes if I remove this because it reduces the number of traces that need to be exported.
Any ideas?
Thanks

It appears that a bug has already been logged and a fix is expected in 1.3.1 https://github.com/open-telemetry/opentelemetry-dotnet/issues/3593

Related

Unable to debug Azure Function that targets .NET 5.0

I wrote a simple Azure Function from the template using the .NET CORE 3.1 as target framework.
After that I migrated the target framework to .NET 5.0 using the guide
After the migration I'm not able to debug the Azure Function. I get the usual message "the breakpoint will not currently be hit".
The csproj is this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.2.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
local.settings.json is this:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
}
}
program.cs is this:
class Program
{
static Task Main(string[] args)
{
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(s =>
{
})
.Build();
return host.RunAsync();
}
}
The simple function is:
using System.Threading.Tasks;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
namespace FunctionAppNet50
{
public static class Function1
{
[Function("Function1")]
public static async Task<HttpResponseData> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req)
{
var response = req.CreateResponse(System.Net.HttpStatusCode.OK);
return response;
}
}
}
Is this related to the ".NET isolated process" model or did I do something wrong?
Thanks... found the solution in the suggested articles by marc_c and Douglas.
I installed the Azure Function Core Tools using choco with the command "choco install azure-functions-core-tools-3";
run the function in a shell with "func start –-dotnet-isolated-debug";
attached the debugger at the PID showed in the window
here is an article that similar steps: https://dev.to/kenakamu/debug-net-5-function-with-visual-studio-visual-studio-code-5235

NativeScript AdMob plugin - crash the app on emulator or on playground: Cannot read property 'getRewardedVideoAdInstance' of undefined

I've created a nativescript with angular (drawer template) app and everything works fine.
Using the command tns run android --bundle the app was successfully installed and runned on the Pixel 2 emulator.
The problem was after I installed the admob plugin, using the command tns plugin add nativescript-admob. Immediately app crashed on the emulator.
Bellow the package.json to proff the installation of the admob plugin on my app.
...
"nativescript-admob": "^4.0.1",
...
Nevertheless, I've continued following instructions from here: https://market.nativescript.org/plugins/nativescript-admob
so my AndroidManifest.xml it looks like that:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="__PACKAGE__"
android:versionCode="10000"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name="com.tns.NativeScriptApplication"
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
**<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544/5224354917" />**
<activity
android:name="com.tns.NativeScriptActivity"
android:label="#string/title_activity_kimera"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
android:theme="#style/LaunchScreenTheme">
<meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="#style/AppTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.tns.ErrorReportActivity"/>
</application>
and the browse.component.ts it looks like that:
On the emulator, the app continues to crash,
However, using the nativescript playground (tns preview) the app does not crash but it gives the error: LOG from device Galaxy S9: Error in admob.preloadRewardedVideoAd: TypeError: Cannot read property 'getRewardedVideoAdInstance' of undefin
LOG from device Galaxy S9: admob preloadRewardedVideoAd error: TypeError: Cannot read property 'getRewardedVideoAdInstance' of undefined
import { Component, OnInit } from "#angular/core";
import { RadSideDrawer } from "nativescript-ui-sidedrawer";
import * as app from "tns-core-modules/application";
import * as admob from "nativescript-admob";
#Component({
selector: "Browse",
templateUrl: "./browse.component.html"
})
export class BrowseComponent implements OnInit {
constructor() {
// Use the component constructor to inject providers.
}
ngOnInit(): void {
// Init your component properties here.
admob.preloadRewardedVideoAd({
testing: true,
iosAdPlacementId: "ca-app-pub-XXXXXX/YYYYY2", // add your own
androidAdPlacementId: "ca-app-pub-3940256099942544/5224354917", // add your own
keywords: ["keyword1", "keyword2"], // add keywords for ad targeting
}).then(
() => {
console.log("RewardedVideoAd preloaded");
},
(error) => {
console.log("native-admob preloadRewardedVideoAd error: " + error);
}
)
}
onDrawerButtonTap(): void {
const sideDrawer = <RadSideDrawer>app.getRootView();
sideDrawer.showDrawer();
}
}

Sitefinity 6.0 Upgrade

Currently my sitefinity is working on Version 5.4.
I have to upgrade sitefinity to version 6.3.
I have followed all the steps mentioned in the sitefinity forum. First I upgraded to 6.0 and it worked fine. One small change I did manually was that I had to add a block of code mentioned below to force assembly redirect since even after upgrading, my site was referencing to the older version(5.4.4010.0)
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral"/>
      <bindingRedirect oldVersion="5.4.4010.0" newVersion="6.0.4210.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral"/>
      <bindingRedirect oldVersion="5.4.4010.0" newVersion="6.0.4210.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>
After I updated the above block in my web.config file, the application worked absolutely fine.
Now, as instructed I tried to upgrade to version 6.1 from version 6.0 following the procedures mentioned on the stefinity forum.
After up-gradation I had to modify the the web.config with the code mentioned below:
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral"/>
      <bindingRedirect oldVersion="5.4.4010.0" newVersion="6.2.4900.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral"/>
      <bindingRedirect oldVersion="5.4.4010.0" newVersion="6.2.4900.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral"/>
      <bindingRedirect oldVersion="6.0.4210.0" newVersion="6.2.4900.0"/>
    </dependentAssembly>
    <dependentAssembly>
      <assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral"/>
      <bindingRedirect oldVersion="6.0.4210.0" newVersion="6.2.4900.0"/>
    </dependentAssembly>
  </assemblyBinding>
</runtime>
After this modification, the application works fine however, the product description page does not seem to work. It gives me an error mentioned below.
Server Error in '/' Application.
 
Value cannot be null.
Parameter name: item
 
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: item
 
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: item]
   Telerik.Microsoft.Practices.Unity.Utility.Guard.ArgumentNotNull(Object argumentValue, String argumentName) +68
   Telerik.Sitefinity.Lifecycle.LifecycleDecorator.GetMaster(ILifecycleDataItemGeneric item) +67
   Telerik.Sitefinity.Lifecycle.LifecycleDecorator.Telerik.Sitefinity.Lifecycle.ILifecycleDecorator.GetMaster(ILifecycleDataItem cnt) +61
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Implementations.ProductOptionsPopulator.GetProductVariation(Product product, List`1 selectedAttributeValues) +192
   Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UI.ProductOptionsControl.GetSelectedOptions() +1255
   Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UI.ProductOptionsControl.get_SelectedOptions() +38
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.AddToCartWidget.GetOptionDetails() +322
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.AddToCartWidget.GetProductVariation() +39
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.AddToCartWidget.SwitchVisibilityBasedOnInventory() +45
   Telerik.Sitefinity.Modules.Ecommerce.Orders.Web.UI.AddToCartWidget.InitializeControls(GenericContainer container) +45
   Telerik.Sitefinity.Web.UI.SimpleView.CreateChildControls() +106
   System.Web.UI.Control.EnsureChildControls() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
This is my upgrade trace
----------------------------------------
Timestamp: 3/5/2014 6:29:03 AM
Message: PASSED : SiteInitializer: Upgrade to 4100 (method: ReorderAdminMenu_6_0)
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:29:05 AM
Message: PASSED : SiteInitializer: Upgrade to 4100 (method: AddContentLocationsBackendPage)
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:29:05 AM
Message: PASSED : SiteInitializer: Upgrade to 4200 (method: UpgradeBackendTemplatesRemoveIE8Compatibility)
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:30:19 AM
Message: Libraries: Upload mode changed to Silverlight
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:30:38 AM
Message: PASSED : Copy data from sf_ec_product_type.title to sf_ec_product_type.title_
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:30:38 AM
Message: PASSED : Copy data from sf_ec_product_type.title_plural to sf_ec_product_type.title_plural_
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:32:09 AM
Message: PASSED : Scheduling task for updating content locations
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:35:03 AM
Message: PASSED : Updating content locations service
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:53:28 AM
Message: PASSED : SiteInitializer: Upgrade to 4300 (method: Upgrade_InitializeNavigationWidgetTemplates)
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:53:44 AM
Message: PASSED: OpenAccessLibrariesProvider - Prepare 'sf_media_thumbnails' table for upgrade
----------------------------------------
----------------------------------------
Timestamp: 3/5/2014 6:54:20 AM
Message: PASSED WITH WARNINGS: OpenAccessLibrariesProvider: Prepare thumbnails legacy mode: Telerik.OpenAccess.OpenAccessException: SQL exception on 'update sf_media_thumbnails set total_size=DATALENGTH(dta) where dta is not null' : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding..For more details see the error log
----------------------------------------
Can anyone help me out this?
Thanks.
You could try using a tool like Beyond Compare to compare your site files with the vanilla Sitefinity version you're trying to upgrade to. In the folder where you ran the Sitefinity.exe file from the Sitefinity project manager to do the upgrade, there should be a another folder called _EmptyProject. Compare that with your site and make sure all the correct dll's were moved over and that the web.config was updated appropriately.

Mono completely ignores app.config

I've added an app.config file to my project by right-clicking on the solution => Add => New File => Misc => Application Configuration File, and named it "LightmapUpdater.exe.config". "LightmapUpdater.exe" is the name of my executable. Here's what the config file has inside:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<dllmap dll="libIL" target="/opt/local/lib/libil.dylib" />
</configuration>
No matter what mistakes I intentionally make in the file, it keeps ignoring them, not giving me even a single warning. Is it supposed to be that way? Why is it ignoring everything I type in there? How can I make sure that mono looks inside of my config file before compiling? I must be missing some step.
It does work for me. With executable file Test773.exe the file is named Test773.exe.config and the dll mapping specified takes place. Is the file in the same directory as the exe file? Is it marked with a "Copy to output" option in MonoDevelop?
The source code of the application:
using System;
using System.Runtime.InteropServices;
namespace Test773
{
class MainClass
{
public static void Main(string[] args)
{
Funkcja();
}
[DllImport("libIL")]
public static extern void Funkcja();
}
}
The content of the config file is copy pasted from your question. The effect of the execution:
Unhandled Exception:
System.DllNotFoundException: /opt/local/lib/libil.dylib
at (wrapper managed-to-native) Test773.MainClass:Funkcja ()
at Test773.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: /opt/local/lib/libil.dylib
at (wrapper managed-to-native) Test773.MainClass:Funkcja ()
at Test773.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
EDIT:
To trace/debug this you can use MONO_LOG_LEVEL. For example:
MONO_LOG_LEVEL=debug mono Test773.exe | grep config
results in:
Mono: Config attempting to parse: '/usr/lib/mono/4.5/mscorlib.dll.config'.
Mono: Config attempting to parse: '/usr/etc/mono/assemblies/mscorlib/mscorlib.config'.
Mono: Config attempting to parse: '/usr/etc/mono/config'.
Mono: Config attempting to parse: '/home/konrad/.mono/config'.
Mono: Config attempting to parse: '/home/konrad/eksperymenty/Test773/Test773/bin/Debug/Test773.exe.config'.
Mono: Config attempting to parse: '/usr/etc/mono/assemblies/Test773/Test773.config'.

Mule inserting empty payload in JMS queue in catch-exception strategy block

I am simulating a time-out exception (or any other for that sake) when calling external vendor web service. I store the original payload at the start of flow and in catch-exception-strategy, replace the payload with original payload. Payload gets replaced fine, apply XSLT transformer fine, copy the transformed payload to file outbound fine but the strange thing is JMS gets empty message (though message properties are intact). Using Mule 3.3.1 and ActiveMQ. Result is same if Active MQ is replaced by Sonic
<flow name="orderRequirementsToVendor">
<jms:inbound-endpoint queue="order.vendor" />
<set-variable variableName="originalPayload" value="#[message.payload]" />
<outbound-endpoint address="${vendor.ws.url}" mimeType="text/xml" connector-ref="https.connector" responseTimeout="100">
<cxf:proxy-client payload="body" enableMuleSoapHeaders="false">
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor" />
</cxf:inInterceptors>
<cxf:outInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
</cxf:outInterceptors>
</cxf:proxy-client>
</outbound-endpoint>
.
.
.
<choice-exception-strategy>
<catch-exception-strategy>
<logger message="In catch exception strategy. Unknown Exception" level="ERROR" />
<logger message="#[exception.causeException]" level="ERROR" />
<set-payload value="#[flowVars.originalPayload]"/>
<set-property propertyName="exception" value="#[exception.summaryMessage]"/>
<transformer ref="generalErrorTransformer" />
<file:outbound-endpoint path="/outbound/vendor/error/ack-before" outputPattern="out_vendor_transformed_ack_error_beforeStatusQueue[function:dateStamp].xml" />
<jms:outbound-endpoint queue="order.status" />
<file:outbound-endpoint path="/outbound/vendor/error/ack-after" outputPattern="out_vendor_transformed_ack_error_afterStatusQueue[function:dateStamp].xml" />
</catch-exception-strategy>
</choice-exception-strategy>
</flow>
Both ack-before and ack-after has files with correct payload in them but message received in order.status is empty
EDIT:
This is the exception in my logs
2013-05-29 09:12:33,864 ERROR [orderRequirementsToVendor.stage1.02] exception.AbstractExceptionListener (AbstractExceptionListener.java:299) -
********************************************************************************
Message : COULD_NOT_READ_XML_STREAM. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod
Code : MULE_ERROR-42999
--------------------------------------------------------------------------------
Exception stack is:
1. Read timed out (java.net.SocketTimeoutException)
java.net.SocketInputStream:-2 (null)
2. Read timed out (com.ctc.wstx.exc.WstxIOException)
com.ctc.wstx.sw.BaseNsStreamWriter:617 (null)
3. COULD_NOT_READ_XML_STREAM (org.apache.cxf.interceptor.Fault)
org.apache.cxf.databinding.stax.StaxDataBinding$XMLStreamDataWriter:133 (null)
4. COULD_NOT_READ_XML_STREAM. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: PostMethod (org.mule.api.transport.DispatchException)
org.mule.module.cxf.CxfOutboundMessageProcessor:144 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

Resources