You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nick Bryan <ni...@unit3d.tv> on 2022/10/06 20:26:23 UTC

Camel 3.14.5 Windows/Linux Type Converter Problems

Hi,
I'm running with Java 8 (1.8.0_152 on windows 10 and OpenJDK 1.8.0_342 on Ubuntu 22).

I have a very simple route which takes files and puts them on a queue (activemq).

        from(dataPath)
                .log("Processing ${file:name}")
                .convertBodyTo(String.class)
                .to(queueName);

This runs fine under Windows 10/1.8.0_152 but not on Linux. On Linux I get TypeConverter errors:

org.apache.camel.InvalidPayloadException: No body available of type: java.lang.String but has value: GenericFile[/data/to-queues/XXX.xml-1665066664096] of type: org.apache.camel.component.file.GenericFile on: XXX.xml-1665066664096.
Caused by: No type converter available to convert from type: org.apache.camel.component.file.GenericFile to the required type: java.lang.String with value GenericFile[/data/to-queues/XXX.xml-1665066664096].

I've recompiled the source on Linux but still get the same errors.

Going round in circles so any help appreciated
Nick

RE: Camel 3.14.5 Windows/Linux Type Converter Problems

Posted by Nick Bryan <ni...@unit3d.tv>.
Thanks Claus, fixed it.

Nick

-----Original Message-----
From: Claus Ibsen <cl...@gmail.com> 
Sent: 07 October 2022 01:00
To: users@camel.apache.org
Subject: Re: Camel 3.14.5 Windows/Linux Type Converter Problems

Hi

Are you by any chance creating an uber-jar/fat-jar of your Camel applications? If so then mind about this.
https://camel.apache.org/manual/camel-maven-plugin.html#_camelprepare_fatjar

On Thu, Oct 6, 2022 at 3:26 PM Nick Bryan <ni...@unit3d.tv> wrote:

> Hi,
> I'm running with Java 8 (1.8.0_152 on windows 10 and OpenJDK 1.8.0_342 
> on Ubuntu 22).
>
> I have a very simple route which takes files and puts them on a queue 
> (activemq).
>
>         from(dataPath)
>                 .log("Processing ${file:name}")
>                 .convertBodyTo(String.class)
>                 .to(queueName);
>
> This runs fine under Windows 10/1.8.0_152 but not on Linux. On Linux I 
> get TypeConverter errors:
>
> org.apache.camel.InvalidPayloadException: No body available of type:
> java.lang.String but has value:
> GenericFile[/data/to-queues/XXX.xml-1665066664096] of type:
> org.apache.camel.component.file.GenericFile on: XXX.xml-1665066664096.
> Caused by: No type converter available to convert from type:
> org.apache.camel.component.file.GenericFile to the required type:
> java.lang.String with value
> GenericFile[/data/to-queues/XXX.xml-1665066664096].
>
> I've recompiled the source on Linux but still get the same errors.
>
> Going round in circles so any help appreciated Nick
>


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

Re: Camel 3.14.5 Windows/Linux Type Converter Problems

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Are you by any chance creating an uber-jar/fat-jar of your Camel
applications? If so then mind about this.
https://camel.apache.org/manual/camel-maven-plugin.html#_camelprepare_fatjar

On Thu, Oct 6, 2022 at 3:26 PM Nick Bryan <ni...@unit3d.tv> wrote:

> Hi,
> I'm running with Java 8 (1.8.0_152 on windows 10 and OpenJDK 1.8.0_342 on
> Ubuntu 22).
>
> I have a very simple route which takes files and puts them on a queue
> (activemq).
>
>         from(dataPath)
>                 .log("Processing ${file:name}")
>                 .convertBodyTo(String.class)
>                 .to(queueName);
>
> This runs fine under Windows 10/1.8.0_152 but not on Linux. On Linux I get
> TypeConverter errors:
>
> org.apache.camel.InvalidPayloadException: No body available of type:
> java.lang.String but has value:
> GenericFile[/data/to-queues/XXX.xml-1665066664096] of type:
> org.apache.camel.component.file.GenericFile on: XXX.xml-1665066664096.
> Caused by: No type converter available to convert from type:
> org.apache.camel.component.file.GenericFile to the required type:
> java.lang.String with value
> GenericFile[/data/to-queues/XXX.xml-1665066664096].
>
> I've recompiled the source on Linux but still get the same errors.
>
> Going round in circles so any help appreciated
> Nick
>


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