Camel 3.0.0 marshal component doesn't allow ref attribute

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel 3.0.0 marshal component doesn't allow ref attribute

Gerald Kallas - mailbox.org
Dear community,

I've following snippet

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
...
<bean id="jsonDataformat" class="org.apache.camel.model.dataformat.JsonDataFormat">
...
<marshal ref="jsonDataformat" />

While deploying I'm getting

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'ref' is not allowed to appear in element 'marshal'.

In Spring XML of older Camel installation the ref attribute works. What I'm doing wrong here?

Many tx in advance for any hints.

Best
- Gerald
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.0.0 marshal component doesn't allow ref attribute

Claus Ibsen-2
Hi

Use <custom ref="xx"> to refer to a custom data format (eg its custom
when its a <bean>)

<marshal>
   <custom ...>
</marshal>


On Mon, Jan 6, 2020 at 9:57 AM Gerald Kallas <[hidden email]> wrote:

>
> Dear community,
>
> I've following snippet
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> ...
> <bean id="jsonDataformat" class="org.apache.camel.model.dataformat.JsonDataFormat">
> ...
> <marshal ref="jsonDataformat" />
>
> While deploying I'm getting
>
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'ref' is not allowed to appear in element 'marshal'.
>
> In Spring XML of older Camel installation the ref attribute works. What I'm doing wrong here?
>
> Many tx in advance for any hints.
>
> Best
> - Gerald



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.0.0 marshal component doesn't allow ref attribute

Claus Ibsen-2
Hi

Btw you can do this in 2.x also, and the ref attribute was also
deprecated on 2.x
https://github.com/apache/camel/blob/camel-2.x/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java#L135

On Mon, Jan 6, 2020 at 10:04 AM Claus Ibsen <[hidden email]> wrote:

>
> Hi
>
> Use <custom ref="xx"> to refer to a custom data format (eg its custom
> when its a <bean>)
>
> <marshal>
>    <custom ...>
> </marshal>
>
>
> On Mon, Jan 6, 2020 at 9:57 AM Gerald Kallas <[hidden email]> wrote:
> >
> > Dear community,
> >
> > I've following snippet
> >
> > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> > ...
> > <bean id="jsonDataformat" class="org.apache.camel.model.dataformat.JsonDataFormat">
> > ...
> > <marshal ref="jsonDataformat" />
> >
> > While deploying I'm getting
> >
> > Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'ref' is not allowed to appear in element 'marshal'.
> >
> > In Spring XML of older Camel installation the ref attribute works. What I'm doing wrong here?
> >
> > Many tx in advance for any hints.
> >
> > Best
> > - Gerald
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.0.0 marshal component doesn't allow ref attribute

Gerald Kallas - mailbox.org
Thanks, Claus.

Further, how can I define the data format in Blueprint XML. This ..

        <!-- define Jackson data format -->
        <dataFormats>
                <json id="jackson" library="Jackson" />
        </dataFormats>

doesn't work as "dataFormats" isn't allowed.

This ..

        <!-- define Jackson data format -->
        <bean id="json" class="org.apache.camel.spi.DataFormat.JsonDataFormat">
                <property name="library" value="Jackson"></property>
        </bean>

requires (osgi.wiring.package=org.apache.camel.spi.DataFormat).

Best
- Gerald

> Claus Ibsen <[hidden email]> hat am 6. Januar 2020 um 10:09 geschrieben:
>
>
> Hi
>
> Btw you can do this in 2.x also, and the ref attribute was also
> deprecated on 2.x
> https://github.com/apache/camel/blob/camel-2.x/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java#L135
>
> On Mon, Jan 6, 2020 at 10:04 AM Claus Ibsen <[hidden email]> wrote:
> >
> > Hi
> >
> > Use <custom ref="xx"> to refer to a custom data format (eg its custom
> > when its a <bean>)
> >
> > <marshal>
> >    <custom ...>
> > </marshal>
> >
> >
> > On Mon, Jan 6, 2020 at 9:57 AM Gerald Kallas <[hidden email]> wrote:
> > >
> > > Dear community,
> > >
> > > I've following snippet
> > >
> > > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> > > ...
> > > <bean id="jsonDataformat" class="org.apache.camel.model.dataformat.JsonDataFormat">
> > > ...
> > > <marshal ref="jsonDataformat" />
> > >
> > > While deploying I'm getting
> > >
> > > Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'ref' is not allowed to appear in element 'marshal'.
> > >
> > > In Spring XML of older Camel installation the ref attribute works. What I'm doing wrong here?
> > >
> > > Many tx in advance for any hints.
> > >
> > > Best
> > > - Gerald
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3.0.0 marshal component doesn't allow ref attribute

Claus Ibsen-2
On Mon, Jan 6, 2020 at 10:25 AM Gerald Kallas <[hidden email]> wrote:

>
> Thanks, Claus.
>
> Further, how can I define the data format in Blueprint XML. This ..
>
>         <!-- define Jackson data format -->
>         <dataFormats>
>                 <json id="jackson" library="Jackson" />
>         </dataFormats>
>

Put them inside <camelContext>
https://camel.apache.org/schema/blueprint/camel-blueprint-3.0.0.xsd


> doesn't work as "dataFormats" isn't allowed.
>
> This ..
>
>         <!-- define Jackson data format -->
>         <bean id="json" class="org.apache.camel.spi.DataFormat.JsonDataFormat">
>                 <property name="library" value="Jackson"></property>
>         </bean>
>
> requires (osgi.wiring.package=org.apache.camel.spi.DataFormat).
>
> Best
> - Gerald
>
> > Claus Ibsen <[hidden email]> hat am 6. Januar 2020 um 10:09 geschrieben:
> >
> >
> > Hi
> >
> > Btw you can do this in 2.x also, and the ref attribute was also
> > deprecated on 2.x
> > https://github.com/apache/camel/blob/camel-2.x/camel-core/src/main/java/org/apache/camel/model/MarshalDefinition.java#L135
> >
> > On Mon, Jan 6, 2020 at 10:04 AM Claus Ibsen <[hidden email]> wrote:
> > >
> > > Hi
> > >
> > > Use <custom ref="xx"> to refer to a custom data format (eg its custom
> > > when its a <bean>)
> > >
> > > <marshal>
> > >    <custom ...>
> > > </marshal>
> > >
> > >
> > > On Mon, Jan 6, 2020 at 9:57 AM Gerald Kallas <[hidden email]> wrote:
> > > >
> > > > Dear community,
> > > >
> > > > I've following snippet
> > > >
> > > > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
> > > > ...
> > > > <bean id="jsonDataformat" class="org.apache.camel.model.dataformat.JsonDataFormat">
> > > > ...
> > > > <marshal ref="jsonDataformat" />
> > > >
> > > > While deploying I'm getting
> > > >
> > > > Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'ref' is not allowed to appear in element 'marshal'.
> > > >
> > > > In Spring XML of older Camel installation the ref attribute works. What I'm doing wrong here?
> > > >
> > > > Many tx in advance for any hints.
> > > >
> > > > Best
> > > > - Gerald
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > http://davsclaus.com @davsclaus
> > > Camel in Action 2: https://www.manning.com/ibsen2
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > http://davsclaus.com @davsclaus
> > Camel in Action 2: https://www.manning.com/ibsen2



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2