Mule 'jersey:resources' Element: binding is not allowed to be child of element component - mule

I see following error in Anypoint studio, while working with 'jersey:resources' component of Mule as per Mule Documentation.
I understand this types of errors are due to not defining the schema. But here in this case, though schema defined, still points out the error as "not allowed to be child of element component".
Can any one help me in fixing this.?
Anypoint Studio Details:
Anypoint Studio January 2015 Release
Version: 5.0.2
Build Id: 201502251307
thanks
--Mohammad Rafiq.

The binding element is defined as:
<xsd:complexType name="pojoBindingType">
<xsd:sequence>
<xsd:element ref="abstract-outbound-endpoint" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="interface" use="required" type="substitutableClass">
<xsd:annotation>
<xsd:documentation>
The interface to be injected. A proxy will be created that implements this interface by calling out to the endpoint.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="method" use="optional">
<xsd:annotation>
<xsd:documentation>
The method on the interface that should be used. This can be omitted if the interface has a single method.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
But you are trying to put a flow-ref element in it. This can't work. Add a vm:inbound-endpoint in the TransformationFlow and replace the flow-ref with a vm:outbound-endpoint connected to the vm:inbound-endpoint.
Reference material: http://www.mulesoft.org/documentation/display/current/Component+Bindings

Related

Use Microsoft.Data.SqlClient as the nLog dbprovider

I've upgraded an ASP.NET Core application from Entity Framework Core 2.x to 3.1. One consequence was to break nlog as it uses System.Data.SqlClient by default and EF Core 3+ uses Microsoft.Data.SqlClient, which lead to this error being emitted in the nLog internal log file:
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
As System.Data.SqlClient is no longer being maintained and I believe is on the path to obsolescence (in my opinion, this is not Microsoft policy at the time of writing) I would like to configure nLog to use Microsoft.Data.SqlClient instead.
This documentation (https://github.com/NLog/NLog/wiki/Database-target#mysql-and-net-core) states that setting the db provider should do the trick. But it doesn't work. No errors within the nLog log file, but nothing is written to the database. What an I doing wrong?
This is the targets element from my nLog.config:
<targets async="true">
<target xsi:type="Null" name="blackhole" />
<target name="database" xsi:type="Database" dbProvider="Microsoft.Data.SqlClient.SqlConnection, Microsoft.Data.SqlClient">
<connectionString>MyConnectionString</connectionString>
<commandText>
insert into dbo.Log (
Application, Logged, Level, Message,
Logger, Exception
) values (
#Application, #Logged, #Level, #Message,
#Logger, #Exception
);
</commandText>
<parameter name="#application" layout="MyApplication" />
<parameter name="#logged" layout="${date}" />
<parameter name="#level" layout="${level}" />
<parameter name="#message" layout="url: ${aspnet-request-url} | action: ${aspnet-mvc-action} | ${message}" />
<parameter name="#logger" layout="${logger}" />
<parameter name="#exception" layout="${exception:tostring}" />
</target>
</targets>

NLog outputting all fields in `message` property

I'm using NLog with a Redis target. In an older version all of the attributes in my layout used to appear as 1st class data-items when viewing in Kibana.
Since upgrading to the latest version they all appear as a JSON encoded string value against a single data-item named message.
I've tried specifying a JsonLayout for the message value but it has made no difference
<targets async="true">
<target xsi:type="FallbackGroup" name="fallbacklogger" returnToFirstOnSuccess="true">
<target xsi:type="Redis" name="RedisLog" appName="${appName}" environmentKey="EnvironmentName" connectionStringKey="LoggingRedisConnectionString" includeAllProperties="true" keySettingsKey="LoggingRedisKey">
<layout xsi:type="JsonLayout">
<attribute name="message" encode="false">
<layout type="JsonLayout" includeAllProperties="true" includeMdlc="true"></layout>
</attribute>
</layout>
</target>
</target>
</targets>
How do I get these back to first class data-items in Kibana so that I can click the Filter button against them?
Someone at work fixed this problem, he said he upgraded all dependencies to the latest version and then changed the following:

Is it possible to integrate IBM RTC Advisor fields to JAXB

I'm working on IBM RTC Advisors, based on a Workshop provided in http://jazz.net.
Now I´m trying to port the xsd document provided in their OSGi module to annotations+jaxb.
That´s part of the XSD:
<xsd:element name="followup-action" substitutionGroup="process:followup-action"
type="buildOnStateChangeType"/>
<xsd:complexType name="buildOnStateChangeType">
<xsd:annotation>
<xsd:documentation>
This type defines the build on state change type. It is a
subtype of the abstract process:followupActionType. This
restriction, along with the substitutionGroup specification
above, makes it possible to add configuration of the participant
to a project or team area's process configuration. Note the
forward references to the trigger and build types defined below.
Take particular note of the id attribute. It is required and has
a fixed value that points to our operation participant extension.
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:restriction base="process:followupActionType">
<xsd:all>
<xsd:element name="trigger" type="triggerType"
minOccurs="1" maxOccurs="1"/>
<xsd:element name="build" type="buildType" minOccurs="1"
maxOccurs="1"/>
</xsd:all>
<xsd:attribute name="id" type="xsd:string" use="required"
fixed="net.jazz.rtcext.workitem.extensions.service.buildOnStateChange"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="triggerType">
<xsd:annotation>
<xsd:documentation>
This type defines the work item type to be monitored
and the work item state that should trigger the
operation participant.
</xsd:documentation>
</xsd:annotation>
<xsd:all>
<xsd:element name="changed-workitem-type" minOccurs="1"
maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string"
use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="trigger-state" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string"
use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="buildType">
<xsd:annotation>
<xsd:documentation>
This type defines the build to run. At this point, it just
includes the build definition id. In the future, it could
include more information, for example, a list of properties
to pass to the build.
</xsd:documentation>
</xsd:annotation>
<xsd:all>
<xsd:element name="build-definition" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string"
use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
And this is part of the XML from process template:
<followup-action
xmlns="http://net.jazz.rtcext.workitem.extensions.service/server/buildOnStateChange"
description="When the specified work item type changes to the specified state, the
specified build will be requested."
id="net.jazz.rtcext.workitem.extensions.service.buildOnStateChange"
name="Build on State Change">
<trigger>
<changed-workitem-type id="com.ibm.team.apt.workItemType.story"/>
<trigger-state id="com.ibm.team.apt.story.tested"/>
</trigger>
<build>
<build-definition id="our.integration.build.bogus"/>
</build>
</followup-action>
My problem is, how is the best way to port that XSD, to Java Classes with JAXB annotations? I tried reverse engineering using Eclipse (Luna) JAXB support.
Source: https://jazz.net/library/article/1000
Thank you
Sorry, can't comment yet........
Why do you want to do what you describe above? The data described by the XSD is stored in the process configuration and there is a set of API available to access the data from within the extension.

Publishing ClickOnce application using NAnt and MSBuild

I'm attempting to publish a ClickOnce application using an MSBuild task within a NAnt script. The certificate is installed on the machine and I believe it's finding it, as it's now getting past an earlier problem of it not being able to get the certificate itself. However, it's now failing with the error:
[msbuild]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(4512,5):
error MSB4044: The "SignFile" task was not given a value for the
required parameter "CertificateThumbprint"
The task currently is called like this:
<msbuild project="${SourceURL}/pathToProject/project.csproj" verbosity="Minimal">
<property name="Configuration" value="Client" />
<property name="Platform" value="AnyCPU" />
<arg value="/p:ApplicationVersion=${actualVersion}" />
<arg value="/p:CertificateThumbprint=XXX" />
<arg value="/p:ManifestCertificateThumbprint=XXX" />
<arg value="/t:publish" />
</msbuild>
How should I be passing the CertificateThumbprint into the publish task? I'm trying to avoid having to switch directly to using signtool or mage, since I'd like to keep it as close as possible to using Visual Studio directly as possible.

Nesting Apache Tiles Template

So I found this: http://tiles.apache.org/framework/tutorial/advanced/nesting-extending.html
Here is the example:
<definition name="myapp.homepage" template="/layouts/classic.jsp">
<put-attribute name="title" value="Tiles tutorial homepage" />
<put-attribute name="header" value="/tiles/banner.jsp" />
<put-attribute name="menu" value="/tiles/common_menu.jsp" />
<put-attribute name="body">
<definition template="/layouts/three_rows.jsp">
<put-attribute name="one" value="/tiles/headlines.jsp" />
<put-attribute name="two" value="/tiles/topics.jsp" />
<put-attribute name="one" value="/tiles/comments.jsp" />
</definition>
</put-attribute>
<put-attribute name="footer" value="/tiles/credits.jsp" />
</definition>
So I defined this:
<definition name="mgmt.base.layout" extends="base.layout">
<put-attribute name="body">
<definition template="/WEB-INF/mgmt/config/mgmtBody.jsp"/>
<put-attribute name="adminLeft" value="/WEB-INF/mgmt/config/left.jsp"/>
<put-attribute name="adminRight" value="/tiles/blank.html"/>
</definition>
</put-attribute>
</definition>
But the funny part is that, even their own documentation is wrong:
2009-05-12 11:20:56,088 [main] ERROR - org.apache.commons.digester.Digester.error(Digester.java:1635): Parse Error at line 17 column 68: Attribute "name" is required and must be specified for element type "definition". org.xml.sax.SAXParseException: Attribute "name" is required and must be specified for element type "definition".
Even though I define a name for it, it still gives the following error:
2009-05-12 11:35:31,818 [main] ERROR - org.apache.commons.digester.Digester.error(Digester.java:1635): Parse Error at line 21 column 19: The content of element type "put-attribute" must match "null".
org.xml.sax.SAXParseException: The content of element type "put-attribute" must match "null".
What is this mean?!!!!
Changing the DTD version to 2.1 solved my problem!
The schema you use requires that put-attribute is a leaf node, i.e. can't contain child elements - so you can't do that. Find out if a newer version of the schema (must be in Tiles docs or examples) allows for nested tiles templates.
-Kalle
So basically I am using a older version of tiles and using new version schema:
Here is the syntax for older nested schema:
http://tiles.apache.org/2.0/framework/tutorial/advanced/nesting-extending.html