Camel Deployment as OSGi bundle issue with ...unable to resolve org.springf
sandy2011 Nov 8, 2011 11:28 AMHi, I am new to Fuse ESB.
I have a Camel Route which works fine when run using mvn Camel:run.
The Route takes consumes HL7 message , processes it and inserts the values to the database.
I am trying to deploy it to OSGI (FUSE ESB 4.4) and the POM.XML is as below and have issues.
I could build the bundle using mvn, but when deployed in osgi I get the following exception 'unable to resolve org.springframework.jdbc.datasource'.
I am not sure what is missing in the POM and I feel the OSGI could not locate the external packages.
Can you please advice!
pom.xml
-
-
CamelContext
-
-
JAVA DSL Route
-
package camelhl7;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.dataformat.HL7DataFormat;
import org.apache.camel.model.dataformat.XStreamDataFormat;
import org.apache.camel.spring.Main;
import ca.uhn.hl7v2.model.v23.message.ADT_A01;
import ca.uhn.hl7v2.model.v23.segment.MSH;
/**
A Camel Router
*/
public class MyRouteBuilder extends RouteBuilder {
/**
A main() so we can easily run these routing rules in our IDE
*/
public static void main(String... args) throws Exception {
Main.main(args);
}
/**
Lets configure the Camel routing rules using Java code...
*/
public void configure() {
// TODO create Camel routes here.
HL7DataFormat hl7 = new HL7DataFormat();
hl7.setValidate(false);
XStreamDataFormat xstream = new XStreamDataFormat();
from("mina:tcp://xxx.xxx.xxx.xxx:61610?sync=true&codec=#hl7codec")
.unmarshal(hl7)
.choice()
.when(header("CamelHL7TriggerEvent").isEqualTo("A31"))
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("We just downloaded: "
+ exchange.getIn().getHeader("CamelFileName"));
Message msg = exchange.getIn();
ADT_A01 adta01=(ADT_A01)msg.getBody();
MSH msh = adta01.getMSH();
String Sending_Application = msh.getMsh3_SendingApplication().getNamespaceID().getValue();
StringBuffer ColumnNames = new StringBuffer();
ColumnNames.append("'");
ColumnNames.append(Sending_Application);
String InsertStmt = "Insert into HL7_MSH_Ver23 values (" ColumnNames.toString()")";
exchange.getIn().setBody(constant(InsertStmt));
}
})
.to("jdbc:testdb")
.setBody(constant("select top 10 * from HL7_MSH_Ver23"))
.to("jdbc:testdb")
.marshal(xstream)
.to("file:target/dboutput?fileName=dbout-$.xml")
.otherwise()
.marshal(hl7)
.to("file:target/messages/others")
.end()
.setBody(constant("MSA|AA|"))
.convertBodyTo(String.class)
.marshal();
}
}
-