Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C735A114E8 for ; Mon, 14 Apr 2014 09:54:02 +0000 (UTC) Received: (qmail 14148 invoked by uid 500); 14 Apr 2014 09:54:01 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 13891 invoked by uid 500); 14 Apr 2014 09:54:00 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Delivered-To: moderator for users@camel.apache.org Received: (qmail 2982 invoked by uid 99); 14 Apr 2014 09:45:22 -0000 X-ASF-Spam-Status: No, hits=4.5 required=5.0 tests=HTML_MESSAGE,SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of alf.mateos@gmail.com does not designate 216.139.236.26 as permitted sender) Date: Mon, 14 Apr 2014 02:44:58 -0700 (PDT) From: alfmateos To: users@camel.apache.org Message-ID: In-Reply-To: References: <1397217592719-5750120.post@n5.nabble.com> Subject: Re: camel bindy - @FixedLengthRecord: crlf attribute causes null pointer MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_27036_30679732.1397468698107" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_27036_30679732.1397468698107 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Claus, thanks a lot for your help. Unfortunately, it didn't work... My JBoss version is JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8), can this be the reason why it doesn't work with camel-jboss6? What I did in order to try to make it work was: 1.- Add this dependency: org.apache-extras.camel-extra camel-jboss6 2.11.0 I use camel 2.11.0, don't know if I should use a newer one to get camel-jboss6 working with JBoss AS 7.2.0.Final... 2.- Add this resolver to my bean's xml file. Should I reference this jbossResolver later on? If so, how? 3.- In order to invoke bindy marshalling, I tried both of these ways, with no success: from("direct:bindySegTraMarshalling").marshal().bindy(BindyType.Fixed, "es.gc.epsilon.core.camel.thirdparties.spain.tgss.bindy"); from("direct:bindySegTraMarshalling").marshal().bindy(BindyType.Fixed, SegmentoTra.class); Is it that I missed something on step #1? Thanks in advance... PS: I also saw this article about camel and classloading on Jboss as 7, don't know if you think this can help to get my bindy marsalling working... Thanks again. Alfonso. 2014-04-11 15:29 GMT+02:00 Claus Ibsen-2 [via Camel] < ml-node+s465427n5750128h67@n5.nabble.com>: > 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 <[hidden email]> > 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: [hidden email] > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > hawtio: http://hawt.io/ > fabric8: http://fabric8.io/ > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://camel.465427.n5.nabble.com/camel-bindy-FixedLengthRecord-crlf-attribute-causes-null-pointer-tp5750120p5750128.html > To unsubscribe from camel bindy - @FixedLengthRecord: crlf attribute > causes null pointer, click here > . > NAML > -- View this message in context: http://camel.465427.n5.nabble.com/camel-bindy-FixedLengthRecord-crlf-attribute-causes-null-pointer-tp5750120p5750184.html Sent from the Camel - Users mailing list archive at Nabble.com. ------=_Part_27036_30679732.1397468698107--