user3769050
user3769050

Reputation: 29

Deploying a camel project having no main method,web.xml

My project consists of a spring xml(having the camel context, weblogic configuration parameters, jms related configurations) a pojo having the route for camel (whose reference we provide in spring) and an xsl.

My project has to listen on a queue, transform the message and publish it onto another queue. Everything works fine until i try to deploy it. How do i go about deploying it...i do not have a main java class...i tested my code by invoking Main of org.apache.camel.spring.Main.

I have to deploy it onto weblogic since my route consumes from weblogic queue seamlessly. How do i do it?.jar or .war or .ear? And how do i go about creating my .jar or .war or .ear? Remember i have only 3 files in my project structure and a few dependent jars

Upvotes: 1

Views: 523

Answers (1)

Namphibian
Namphibian

Reputation: 12221

You will deploy it as a war file. I have not done this with Weblogic but the steps for Tomcat are listed below:

  1. First make sure that all the needed jars are packaged in your war file.
  2. Bootsrap Spring to your WAR file by adding the following to your web.xml

    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> </web-app>

  3. Add location of your Spring XML file by using the following:

    <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/camel-context.xml</param-value> </context-param>

  4. Package the war with Maven i.e. run the command mvn package

  5. Deploy the war file to the server.

Upvotes: 1

Related Questions