Getting org.apache.camel.NoTypeConversionAvailableException in JBoss Fuse - jaxb

I'm getting the error below in JBoss Fuse.
Can someone tell me what's the reason that's causing this issue?
And is there a way to resolve it?
java.io.IOException: org.apache.camel.NoTypeConversionAvailableException: No type converter available to convert from type: com.abc.ws.ABC to the required type: java.io.InputStream with value com.abc.ws.ABC#7644b2af at org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:153) :
<dataFormats>
<jaxb contextPath="generated" id="generated"/>
<jaxb contextPath="com.abc.ws" encoding="UTF-8" id="ABC"
partClass="com.abc.ws.ABC" prettyPrint="true"/>
</dataFormats>
<route autoStartup="true" id="LogCreateOrgRequest">
<from id="_from10" uri="seda:logOrganisationRequest"/>
<process id="_process17" ref="AbcProcessor"/>
<marshal id="_marshal1" ref="ABC"/>
<convertBodyTo id="_convertBodyTo2" type="java.lang.String"/>
<setBody id="_setBody18">
<simple> Request - [${date:now:yyyy-MM-dd'T'HH:mm:ss.SSS.Z}]\nTransactionID
- ${exchangeProperty.CAFNo}\n${body}\n</simple>
</setBody>
<to id="_to40" pattern="InOut" uri="file:/opt/logs/demographicSetup/ABC?
keepLastModified=true&fileExist=Append&fileName=CreateOrgRequest-${date:now:yyyyMMdd}.txt&readLock=changed"/>
</route>`

Related

appcmd.exe to list IIS config section attribute is returning an ERROR message:Unknown attribute

I am running this command as admin in elevated prompt:
%systemroot%\system32\inetsrv\appcmd list config "website" /section:requestFiltering /text:AllowDoubleEscaping
It returns error message: ERROR (message:Unknown attribute ""AllowDoubleEscaping"". Replace with -? for help.)
So I next ran the following command:
%systemroot%\system32\inetsrv\appcmd set config -section:requestFiltering -?
It returned this output and yes, I can see that the allowDoubleEscaping is missing
ERROR ( message:-allowHighBitCharacters
-unescapeQueryString
-removeServerHeader
-fileExtensions.allowUnlisted
-fileExtensions.applyToWebDAV
-fileExtensions.[fileExtension='string'].fileExtension
-fileExtensions.[fileExtension='string'].allowed
-requestLimits.maxAllowedContentLength
-requestLimits.maxUrl
-requestLimits.maxQueryString
-requestLimits.headerLimits.[header='string'].header
-requestLimits.headerLimits.[header='string'].sizeLimit
-verbs.allowUnlisted
-verbs.applyToWebDAV
-verbs.[verb='string'].verb
-verbs.[verb='string'].allowed
-hiddenSegments.applyToWebDAV
-hiddenSegments.[segment='string'].segment
-alwaysAllowedUrls.[url='string'].url
-alwaysAllowedQueryStrings.[queryString='string'].queryString
-denyUrlSequences.[sequence='string'].sequence
-denyQueryStringSequences.[sequence='string'].sequence
-filteringRules.[name='string'].name
-filteringRules.[name='string'].scanUrl
-filteringRules.[name='string'].scanQueryString
-filteringRules.[name='string'].scanAllRaw
-filteringRules.[name='string'].denyUnescapedPercent
-filteringRules.[name='string'].scanHeaders.[requestHeader='string'].requestHeader
-filteringRules.[name='string'].appliesTo.[fileExtension='string'].fileExtension
-filteringRules.[name='string'].denyStrings.[string='string'].string
So which files is appcmd actually checking for these? I went ahead and checked the C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml file and it does have this attribute defined in there. This seems to be the only place this is defined, so I am confused where else its not finding this attribute to throw the error??
<sectionSchema name="system.webServer/security/requestFiltering">
<attribute name="allowDoubleEscaping" type="bool" defaultValue="false" />
<attribute name="allowHighBitCharacters" type="bool" defaultValue="true" />
<attribute name="unescapeQueryString" type="bool" defaultValue="true" />

NLog.Targets.Splunk - Possible to get rid of the "Properties" wrap?

In: NLog.Targets.Splunk
https://github.com/AlanBarber/NLog.Targets.Splunk
When use the nlog configuration with:
includeEventProperties="true"
or if I have:
includeEventProperties="false" and use:
<contextproperty name="host" layout="${machinename}" />
<contextproperty name="threadid" layout="${threadid}" />
<contextproperty name="logger" layout="${logger}" />
I get the logs in the following format (properties wrapped in "Properties"):
{"Level":"Info","MessageTemplate":"ApiRequest","RenderedMessage":"ApiRequest","Properties":{"httpMethod":"GET","statusCode":200}, ...}
Is it possible to get rid of the Properties-wrap, and have it more flat?
{ "Level": "Info", "httpMethod": "GET", "statusCode":200, ... }
Many thanks! :-)

Test NG Cucumber Parallel Automation with Dynamic test tags and param

I am currently looking to run multiple test in cucumber in parallel using testng and I successfully managed to do that.
Now my requirement is rather than having multiple Test TAGS in the testNG file with different parameters take it from the maven command line. So I can do automation without editing the testNg.xml file. Is there a way to achieve it? Please find my current testng.xml configuration.
testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Testng Cucumber Suite" thread-count="2" parallel="tests">
<!-- In order to run test cases please copy and one test and add make sure you add relevant parameters -->
<test name="Run_Nexus_06">
<parameter name="deviceName" value="Google Nexus 6" />
<parameter name="platformVersion" value="6.0" />
<classes>
<class name="cucumber.mobile.ParallelRunner">
</class>
</classes>
</test>
<test name="Run_Google_Pixel">
<parameter name="deviceName" value="Google Pixel" />
<parameter name="platformVersion" value="7.1" />
<classes>
<class name="cucumber.mobile.ParallelRunner">
</class>
</classes>
</test>
</suite>
Runner Class :
#CucumberOptions(plugin = {"pretty", "html:target/html/", "json:target/cucumber.json", "junit:TEST-all.xml"},
features = "src/test/resources/features/SignUp.feature", glue = {"steps"}, tags = {"#Mobile"})
public class ParallelRunner extends Hook{
List<Object[]> data;
//<parameter name="deviceName" value="Google Pixel" />
// <parameter name="platformVersion" value="7.1" />
#BeforeTest
#Parameters({"deviceName","platformVersion"})
public void bb(String deviceName, String platformVersion){
Device device = new Device();
device.setDeviceName(deviceName);
device.setOsVersion(platformVersion);
DeviceFactory.setDevice(device);
System.out.println("Device" + deviceName + "Os Version" + platformVersion + " " + Thread.currentThread().getId());
}
}
I was glad that I found this post. Very useful if anyone trying to achieve the same thing. Dynamic Test ng IAlterSuiteListener
Maven command :> mvn compile test -DdeviceFlavors="Google Nexus 6","Google Pixel" -DdeviceOsFlavors="6.0","7.1" -Dsurefire.suiteXmlFiles=testng.xml

Log4Net not displaying an accurate Timestamp

I'm logging an Azure-based webapp using a Log4Net CSV appender with:
I'm seeing multiple entries with an identical timestamp - clearly not logging the actual instant of a given event on the server:
2018-03-19 21:59:52.000 OrderId: 191096 Starts to validate, multi:
2018-03-19 21:59:52.000 OrderId: 191096 validation request:
2018-03-19 21:59:52.000 OrderId: 191096 passed validation. AuthKey:6128994
2018-03-19 21:59:52.000 OrderId: 191096 Single starts
2018-03-19 21:59:52.000 OrderId: 191096 submits:
2018-03-19 21:59:52.000 SaveOrderChanges: 191096
2018-03-19 21:59:52.000 SaveOrderChanges: 191096
I had thought perhaps it take to do with when the logs are written out to file vs. when the entry is literally generated but unless I'm mis-reading the context, this answer indicates otherwise.
Clearly I have something misconfigured. My CSV is built using code found at: http://element533.blogspot.com/2010/05/writing-to-csv-using-log4net.html
Full appender:
<appender name="CsvFileAppender" type="log4net.Appender.FileAppender">
<file value="D:/home/logfiles/log4netCSV.log" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<appendToFile value="true"/>
<threshold value="INFO" />
<layout type=" myWeb.CsvPatternLayout, myWeb">
<header value="DateTime,Thread,Level,Logger,Message,Exception
" />
<conversionPattern value="%date%newfield[%thread]%newfield %-5level%newfield% %property{Ip} _+ %aspnet-request{ASP.NET_SessionId} _+ %logger %newfield%message%newfield%exception%endrow" />
</layout>
</appender>
It is very strange that your dates are showing
2018-03-19 21:59:52.000
The default format is Iso8601 and separator between second and milisec is a comma:
https://github.com/apache/logging-log4net/blob/master/src/DateFormatter/Iso8601DateFormatter.cs#L26
I recommend you to use explicit dates:
%date{yyyy-MM-dd HH:mm:ss.fff}
Also if you want a CSV file you need to separate the values with commas:
<conversionPattern value="%date{yyyy-MM-dd HH:mm:ss.fff},[%thread],%level,..." />
Update:
I just tested this on Azure to see if it had anything to do, and it shows correctly:
http://swagger-net-test.azurewebsites.net/log4net.log
I have two log actions one right after the other and they do show different time stamps
DateTime,Thread,Level,Logger,Message
2018-04-08 13:19:48.658,[20],INFO,Swagger_Test.Controllers.LogController,Test1
2018-04-08 13:19:48.689,[20],ERROR,Swagger_Test.Controllers.LogController,Test2

Variable in WildFly: Cannot resolve expression on Linux

My setting
standalone.conf.bat
set "DBO_PATH_CONFIG=D:/test"
set "MOBILE_KEYSTORE=jboss.mobile.keystore"
standalone.conf
set "DBO_PATH_CONFIG=/opt/!!!"
set "MOBILE_KEYSTORE=jboss.mobile.keystore"
standalone.xml
<security-realm name="SslRealm">
<server-identities>
<ssl>
<keystore path="${env.DBO_PATH_CONFIG}/${env.MOBILE_KEYSTORE}" keystore-password="rmi+ssl"/>
</ssl>
</server-identities>
</security-realm>
Properties
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
<simple name="java:/propertiesFileName" value="NONE" />
<simple name="java:/propertiesFileNameV1" value="${env.DBO_PATH_CONFIG}/V1.properties" />
<simple name="java:/propertiesFileNameV2" value="${env.DBO_PATH_CONFIG}/V2.properties" />
</bindings>
<remote-naming />
</subsystem>
On Windows all works fine but on Linux I have this error:
10:57:34,512 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("core-service" => "management"),
("security-realm" => "SslRealm")
]) - failure description: "WFLYCTL0211: Cannot resolve expression '${env.DBO_PATH_CONFIG}/${env.MOBILE_KEYSTORE}'"
How to solve this problem?
On Linux it's export not set. I also don't think you can have a directory called !!!. ! has a special meaning in bash.

Resources