You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tim Dudgeon <td...@gmail.com> on 2015/06/25 19:10:32 UTC

nonsense ClassCastException

I'm trying to run some routes in tomcat using the servlet component 
(CamelHttpTransportServlet in the web.xml)
In a simple example I've got it running fine, but when I try this in the 
real example I get a startup exception that makes no sense at all.

Marking servlet CamelServlet as unavailable
Servlet [CamelServlet] in web application [/job-services] threw load() 
exception
java.lang.ClassCastException: 
org.apache.camel.component.servlet.CamelHttpTransportServlet cannot be 
cast to javax.servlet.Servlet
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at 
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


Clearly CamelHttpTransportServlet can be cast to javax.servlet.Servlet.
Anyone got any ideas what to look at for this?

Tim


Re: nonsense ClassCastException

Posted by Tim Dudgeon <td...@gmail.com>.
Yes, seems so. I fixed it by managing the dependencies, but what was 
happening made no sense to me as two seemingly "identical" setups 
behaved differently.

Tim

On 26/06/2015 11:21, Henryk Konsek wrote:
> Hi,
>
> It looks like you have incompatible Servlet API jars included in your WAR.
> So your jars do not match the API used by your Tomcat.
>
> Cheers!
>
> czw., 25.06.2015 o 19:11 użytkownik Tim Dudgeon <td...@gmail.com>
> napisał:
>
>> I'm trying to run some routes in tomcat using the servlet component
>> (CamelHttpTransportServlet in the web.xml)
>> In a simple example I've got it running fine, but when I try this in the
>> real example I get a startup exception that makes no sense at all.
>>
>> Marking servlet CamelServlet as unavailable
>> Servlet [CamelServlet] in web application [/job-services] threw load()
>> exception
>> java.lang.ClassCastException:
>> org.apache.camel.component.servlet.CamelHttpTransportServlet cannot be
>> cast to javax.servlet.Servlet
>> at
>>
>> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
>> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
>> at
>>
>> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262)
>> at
>>
>> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550)
>> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>> at
>>
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
>> at
>>
>> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>> at java.lang.Thread.run(Thread.java:745)
>>
>>
>> Clearly CamelHttpTransportServlet can be cast to javax.servlet.Servlet.
>> Anyone got any ideas what to look at for this?
>>
>> Tim
>>
>>


Re: nonsense ClassCastException

Posted by Henryk Konsek <he...@gmail.com>.
Hi,

It looks like you have incompatible Servlet API jars included in your WAR.
So your jars do not match the API used by your Tomcat.

Cheers!

czw., 25.06.2015 o 19:11 użytkownik Tim Dudgeon <td...@gmail.com>
napisał:

> I'm trying to run some routes in tomcat using the servlet component
> (CamelHttpTransportServlet in the web.xml)
> In a simple example I've got it running fine, but when I try this in the
> real example I get a startup exception that makes no sense at all.
>
> Marking servlet CamelServlet as unavailable
> Servlet [CamelServlet] in web application [/job-services] threw load()
> exception
> java.lang.ClassCastException:
> org.apache.camel.component.servlet.CamelHttpTransportServlet cannot be
> cast to javax.servlet.Servlet
> at
>
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148)
> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
> at
>
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5262)
> at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5550)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
> at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
>
> Clearly CamelHttpTransportServlet can be cast to javax.servlet.Servlet.
> Anyone got any ideas what to look at for this?
>
> Tim
>
>