Hi What version of Tomcat and JDK are you using?
And make sure to not include any servlet.jar etc in WEB-INF/lib as they are already part of Tomcat, and you may get class loading issues. On Thu, Mar 15, 2012 at 1:41 AM, gsilverman <[email protected]> wrote: > I changed the camel version in the camel-example-servlet-tomcat pom.xml from > the apache-camel-2.8.1 package, and got the following error trying to run > *mvn package tomcat:run*; > > > java.lang.ClassCastException: > org.apache.camel.component.servlet.CamelHttpTransportServlet cannot be cast > to javax.servlet.Servlet > > Here is the revised pom.xml: > > <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> > > <parent> > <groupId>org.apache.camel</groupId> > <artifactId>examples</artifactId> > <version>2.8.1</version> > </parent> > > <artifactId>camel-example-servlet-tomcat</artifactId> > <name>Camel :: Example :: Servlet Tomcat</name> > <description>An example using Camel Servlet with Apache > Tomcat</description> > <packaging>war</packaging> > > <dependencies> > > > <dependency> > <groupId>org.apache.camel</groupId> > <artifactId>camel-core</artifactId> > <version>2.9.1</version> > </dependency> > <dependency> > <groupId>org.apache.camel</groupId> > <artifactId>camel-spring</artifactId> > <version>2.9.1</version> > </dependency> > <dependency> > <groupId>org.apache.camel</groupId> > <artifactId>camel-servlet</artifactId> > <version>2.9.1</version> > </dependency> > > > <dependency> > <groupId>org.springframework</groupId> > <artifactId>spring-web</artifactId> > </dependency> > > > <dependency> > <groupId>log4j</groupId> > <artifactId>log4j</artifactId> > </dependency> > <dependency> > <groupId>org.slf4j</groupId> > <artifactId>slf4j-log4j12</artifactId> > </dependency> > > </dependencies> > > <build> > <plugins> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>tomcat-maven-plugin</artifactId> > <version>1.2-SNAPSHOT</version> > <configuration> > <server>tomcat</server> > </configuration> > </plugin> > > </plugins> > > </build> > > </project> > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Error-cannot-run-camel-servlet-version-2-9-1-in-Tomcat-tp5566624p5566624.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
