Hi What web server do you use for the War? Is it jetty or tomcat or something else?
Yeah bindy unfortunately uses that annotation scanning on classpath. There is a ticket to improve this for the future. You can impement a custom yourself that can load in the WAR. http://camel.apache.org/pluggable-class-resolvers.html On Mon, Mar 30, 2015 at 5:06 PM, Ted <na...@pritchard.uk.net> wrote: > Hi, > > I have a self executable Spring Boot (1.2.2) and Camel Boot (2.15.0) > application built as a WAR. My route makes use of Bindy to unmarshal CSV to > my object class. Everything work well when I run the code directly using > Maven (mvn spring-boot:run) or if I run using Eclipse. However if I build > my WAR file and execute that (java -jar myWebApp.war) then I get errors > > java.lang.IllegalArgumentException: The separator has not been defined in > the annotation @CsvRecord or not instantiated during initModel. must be > specified > at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:293) > at > org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:137) > at > org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:67) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77) > at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448) > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) > at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) > at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) > at > org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51) > at > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129) > at > org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77) > at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448) > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) > at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448) > at > org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) > > > In the Camel/Bindy code I can see that > DefaultPackageScanClassResolver.loadImplementationsInJar obviously has > special provision for jar files but what about the equivalent for WAR files? > Class files are located under WEB-INF in war files which means my annotated > classes are not being found. See method > DefaultPackageScanClassResolver.doLoadImplementationsInJar where the code is > attempting to find classes that start with a particular package but will > never find any because the file locations include WEB-INF, which would not > be the case with a jar file. > > Is there another way of doing this or does Bindy need fixing? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Bindy-running-within-a-WAR-tp5765035.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/