Hi

You may still need to use camel-jboss to have the package scanning
work in the EAP container.
https://camel.apache.org/camel-jboss.html

Ideally in the future we migrate camel-bindy so it does no longer do
package scanning so you would need to configure the .class up front.
But then it works for everybody.

eg part of the work is that you specify the class which you do

  from("direct:bindySegTraMarshalling").marshal().bindy(BindyType.Fixed,
            SegmentoTra.class);

But there is still some logic in bindy that relies on the package scanning.




On Fri, Apr 11, 2014 at 1:59 PM, alfmateos <[email protected]> wrote:
>
>
> I use camel 2.11.0 with JBoss 6.1 EAP, and I use this route:
>
>     from("direct:bindySegTraMarshalling").marshal().bindy(BindyType.Fixed,
>             SegmentoTra.class);
>
> The SegmentoTra.class is annotated like this:
>
> @FixedLengthRecord(length = 70, paddingChar = ' ', crlf="WINDOWS")
> public class SegmentoTra {
>
>   @DataField(pos = 1, length = 3)
>   private String cabeceraSegmento = "TRA";
>
> But I get this error:
>
> 13:47:35,095 ERROR [org.apache.camel.processor.DefaultErrorHandler] (Camel
> (processesCamelContext) thread #3 - seda://afiQueue) Failed delivery for
> (MessageId: ID-alfonso-mbp-2-local-62630-1397215413330-0-4 on ExchangeId:
> ID-alfonso-mbp-2-local-62630-1397215413330-0-3). Exhausted after delivery
> attempt: 1 caught: java.lang.NullPointerException:
> java.lang.NullPointerException
>         at
> org.apache.camel.dataformat.bindy.util.ConverterUtils.*getByteReturn(ConverterUtils.java:41)
> *[camel-bindy-2.11.0.jar:2.11.0]
>         at
> org.apache.camel.dataformat.bindy.fixed.BindyFixedLengthDataFormat.marshal(BindyFixedLengthDataFormat.java:78)
> [camel-bindy-2.11.0.jar:2.11.0]
>         at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:59)
> [camel-core-2.11.0.jar:2.11.0]
> ...
> ...
>
> The error shows up when I execute the route inside JBoss but outside
> eclipse. But when I use JBoss Tools to add a new server pointing to my jboss
> installation, and I deploy my solution by using Add/Remove on JBoss then
> everything works like a charm.
>
> I was debuging the code of bindy, and it looks like that it's not able to
> load the class that is annotated... It doesn't get inside the "if (record !=
> null)" of this method of the class BindyFixedLengthRecord:
>
>     private void initFixedLengthRecordParameters() {
>
>         for (Class<?> cl : models) {
>
>             // Get annotation @FixedLengthRecord from the class
>             FixedLengthRecord record =
> cl.getAnnotation(FixedLengthRecord.class);
>
>            * if (record != null) *{
>                 LOG.debug("Fixed length record: {}", record);
>
>                 // Get carriage return parameter
>                 crlf = record.crlf();
>                 LOG.debug("Carriage return defined for the CSV: {}", crlf);
>
>                 // Get hasHeader parameter
>                 hasHeader = record.hasHeader();
>                 LOG.debug("Has Header: {}", hasHeader);
>
>                 // Get skipHeader parameter
>                 skipHeader = record.skipHeader();
>
>
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/camel-bindy-FixedLengthRecord-crlf-attribute-causes-null-pointer-tp5750120.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to