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.