You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Pallavi G S <ra...@gmail.com> on 2016/01/27 11:43:01 UTC

Camel beanio mapping file outside the war

 0
down vote
favorite
1
	

I'm using camel beanio component to marshal and unmarshal the data inside
the file.

<beanio id="myBeanio" mapping="classpath:beanio-mapping-file-config.xml"
            streamName="myStreamName" />

It is working fine in tomcat but not working in jboss. So I need to keep the
beanio mapping xml outside the war file. By mentioning actual path of
mapping xml file for mapping attribute, it is working fine. But I need to
get the beanio mapping xml path from environment variable or from properties
file. So with below changes,

<beanio id="myBeanio"
mapping="file:${env:env_var_name}/beanio-mapping-file-config.xml"
            streamName="myStreamName" />

or

<beanio id="myBeanio"
mapping="file:{{prop_name}}/beanio-mapping-file-config.xml"
            streamName="myStreamName" />

I'm getting org.apache.camel.RuntimeCamelException:
java.io.FileNotFoundException

The environment variable/property is not getting replaced with the actual
value. Camel version used is 2.12.1

How do I solve this problem?




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-beanio-mapping-file-outside-the-war-tp5776784.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel beanio mapping file outside the war

Posted by Claus Ibsen <cl...@gmail.com>.
Its fixed in a earlier release - I cannot remember which one. Try to upgrade

On Thu, Jan 28, 2016 at 6:46 AM, Pallavi G S <ra...@gmail.com> wrote:
> Thank you for the reply.
>
> The camel version used in the application is 2.12.1.And this syntax does not
> work as it is fixed in 2.17.0.
>
> Is there any alternative for version 2.12.1 to atleast read the property
> value from the properties file?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-beanio-mapping-file-outside-the-war-tp5776784p5776875.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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

Re: Camel beanio mapping file outside the war

Posted by Pallavi G S <ra...@gmail.com>.
Thank you for the reply.

The camel version used in the application is 2.12.1.And this syntax does not
work as it is fixed in 2.17.0.

Is there any alternative for version 2.12.1 to atleast read the property
value from the properties file?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-beanio-mapping-file-outside-the-war-tp5776784p5776875.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel beanio mapping file outside the war

Posted by lb <lb...@gmail.com>.
I've tested the following snippet on camle 2.17-SNAPSHOT and it works
as expected:

<dataFormats>
  <beanio id="myBeanio" mapping="file:{{java.io.tmpdir}}/mappings.xml"
streamName="employeeFile"/>
</dataFormats>

<dataFormats>
  <beanio id="myBeanio" mapping="file:{{env:TMPDIR}}/mappings.xml"
streamName="employeeFile"/>
</dataFormats>

On Wed, Jan 27, 2016 at 2:04 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Yes this i not possible. You cannot refer to ENV in the mapping field in beanio.
>
> That would require an ENH which I have logged:
> https://issues.apache.org/jira/browse/CAMEL-9540
>
> On Wed, Jan 27, 2016 at 11:43 AM, Pallavi G S <ra...@gmail.com> wrote:
>>  0
>> down vote
>> favorite
>> 1
>>
>>
>> I'm using camel beanio component to marshal and unmarshal the data inside
>> the file.
>>
>> <beanio id="myBeanio" mapping="classpath:beanio-mapping-file-config.xml"
>>             streamName="myStreamName" />
>>
>> It is working fine in tomcat but not working in jboss. So I need to keep the
>> beanio mapping xml outside the war file. By mentioning actual path of
>> mapping xml file for mapping attribute, it is working fine. But I need to
>> get the beanio mapping xml path from environment variable or from properties
>> file. So with below changes,
>>
>> <beanio id="myBeanio"
>> mapping="file:${env:env_var_name}/beanio-mapping-file-config.xml"
>>             streamName="myStreamName" />
>>
>> or
>>
>> <beanio id="myBeanio"
>> mapping="file:{{prop_name}}/beanio-mapping-file-config.xml"
>>             streamName="myStreamName" />
>>
>> I'm getting org.apache.camel.RuntimeCamelException:
>> java.io.FileNotFoundException
>>
>> The environment variable/property is not getting replaced with the actual
>> value. Camel version used is 2.12.1
>>
>> How do I solve this problem?
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Camel-beanio-mapping-file-outside-the-war-tp5776784.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2

Re: Camel beanio mapping file outside the war

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

Yes this i not possible. You cannot refer to ENV in the mapping field in beanio.

That would require an ENH which I have logged:
https://issues.apache.org/jira/browse/CAMEL-9540

On Wed, Jan 27, 2016 at 11:43 AM, Pallavi G S <ra...@gmail.com> wrote:
>  0
> down vote
> favorite
> 1
>
>
> I'm using camel beanio component to marshal and unmarshal the data inside
> the file.
>
> <beanio id="myBeanio" mapping="classpath:beanio-mapping-file-config.xml"
>             streamName="myStreamName" />
>
> It is working fine in tomcat but not working in jboss. So I need to keep the
> beanio mapping xml outside the war file. By mentioning actual path of
> mapping xml file for mapping attribute, it is working fine. But I need to
> get the beanio mapping xml path from environment variable or from properties
> file. So with below changes,
>
> <beanio id="myBeanio"
> mapping="file:${env:env_var_name}/beanio-mapping-file-config.xml"
>             streamName="myStreamName" />
>
> or
>
> <beanio id="myBeanio"
> mapping="file:{{prop_name}}/beanio-mapping-file-config.xml"
>             streamName="myStreamName" />
>
> I'm getting org.apache.camel.RuntimeCamelException:
> java.io.FileNotFoundException
>
> The environment variable/property is not getting replaced with the actual
> value. Camel version used is 2.12.1
>
> How do I solve this problem?
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-beanio-mapping-file-outside-the-war-tp5776784.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



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