-
1. Re: Route does not start in JBoss 5.1
davsclaus Nov 25, 2011 9:47 AM (in response to labo32_delaboe)Total 0 routes, of which 0 is started.
Camel says there is 0 routes
Do you use to refer to your Java RouteBuilder classes by the bean id.
Then it should work without any package scanning.
-
2. Re: Route does not start in JBoss 5.1
njiang Nov 27, 2011 10:02 PM (in response to labo32_delaboe)I just released the camel-extra 2.8.0 which is based on Camel 2.8.3.
You can find the mvn repo here
Can you give it a try ?
-
3. Re: Route does not start in JBoss 5.1
njiang Nov 27, 2011 10:07 PM (in response to labo32_delaboe)I just released the camel-extra 2.8.0 which is based on Camel 2.8.3.
You can find the mvn repo here
Can you give it a try ?
-
4. Re: Route does not start in JBoss 5.1
labo32_delaboe Nov 28, 2011 4:18 AM (in response to njiang)The route does not start with the new camel-jboss
My implementation class looks like
package test.camel; import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.spi.PackageScanClassResolver; import org.apache.camel.spring.Main; import org.apachextras.camel.jboss.JBossPackageScanClassResolver; public class TestConfigRoute extends RouteBuilder { public static void main(String[] args) throws Exception{ new Main().run(args); } public void configure() { PackageScanClassResolver jbossResolver = new JBossPackageScanClassResolver(); CamelContext context = new DefaultCamelContext(); context.setPackageScanClassResolver(jbossResolver); from("cxfrs://bean://rsServer") .to("bean:metaDataBean?method=getMetaData") .to("freemarker:configFreemarker.ftl") .to("log:IN?showHeaders=true"); } }
and my applicationContext
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:ctx="http://www.springframework.org/schema/context" xmlns:cxf="http://camel.apache.org/schema/cxf" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd "> <import resource="classpath:META-INF/cxf/cxf.xml"></import> <cxf:rsServer id="rsServer" serviceClass="test.camel.TestConfigService"></cxf:rsServer> <camelContext trace="false" xmlns="http://camel.apache.org/schema/spring"> <package>test.camel</package> </camelContext> <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource"> ..... </bean> <bean id="metaDataBean" class="de.uit.eai.camel.MetaDataBean"> <constructor-arg ref="dataSource"></constructor-arg> </bean> </beans>
web.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- location of spring xml files --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <!-- the listener that kick-starts Spring --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>cxf</servlet-name> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Camel servlet --> <servlet> <servlet-name>CamelServlet</servlet-name> <servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Camel servlet mapping --> <servlet-mapping> <servlet-name>CamelServlet</servlet-name> <url-pattern>/camel/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>cxf</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> </web-app>
pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>test.camel</groupId> <artifactId>camel-test</artifactId> <version>1.0-SNAPSHOT</version> <name>Camel-Config</name> <packaging>war</packaging> <properties> <spring.version>3.0.5.RELEASE</spring.version> <camel.version>2.8.3</camel.version> </properties> <dependencies> <!-- Camel Dependencies --> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-spring</artifactId> <version>${camel.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-servlet</artifactId> <version>${camel.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-freemarker</artifactId> <version>${camel.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-cxf</artifactId> <version>${camel.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jackson</artifactId> <version>${camel.version}</version> <scope>compile</scope> </dependency> <!-- Spring Web --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> <scope>compile</scope> </dependency> <!-- logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.2.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache-extras.camel-extra</groupId> <artifactId>camel-jboss</artifactId> <version>2.8.0</version> <scope>compile</scope> </dependency> </dependencies> <repositories> <repository> <id>camel-extra-release</id> <name>Camel Extra Maven repository of releases</name> <url>http://svn.codespot.com/a/apache-extras.org/camel-extra/maven2/releases</url> </repository> </repositories> <build> <defaultGoal>install</defaultGoal> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- plugin so you can run mvn jetty:run --> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>7.4.5.v20110725</version> <configuration> <webAppConfig> <contextPath>/</contextPath> </webAppConfig> <scanIntervalSeconds>10</scanIntervalSeconds> </configuration> </plugin> </plugins> </build> </project>
-
5. Re: Route does not start in JBoss 5.1
labo32_delaboe Nov 28, 2011 4:29 AM (in response to davsclaus)The way using
to refer to your Java RouteBuilder classes works fine.
Thanks
labo
-
6. Re: Route does not start in JBoss 5.1
davsclaus Nov 28, 2011 6:35 AM (in response to labo32_delaboe)You should configure the jboss class resolver in the Spring applicationContext.xml file as documented here
http://camel.apache.org/camel-jboss.html
Then remove the jboss related code your inserted in the RouteBuilder as its not needed.
-
7. Re: Route does not start in JBoss 5.1
njiang Nov 28, 2011 9:17 PM (in response to labo32_delaboe)The camel context that you create in the TestConfigRoute configure method will not be used to load the route.
Willem