You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Henry Saputra <he...@gmail.com> on 2010/05/07 08:49:18 UTC

[SCA] Seeing class cast exception TuscanyServletFilter cannot be cast to javax.servlet.Filter when running SCA store-webapp sample app

Hi All,

When I tried to run SCA sample-store-webapp sample app from
sca-java-2.x/trunk/samples/store-webapp using "mvn tomcat:run" command I saw
this weird class cast exception:

INFO: Starting tomcat server
May 6, 2010 10:09:13 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
May 6, 2010 10:09:15 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter tuscany
java.lang.ClassCastException:
org.apache.tuscany.sca.host.webapp.TuscanyServletFilter cannot be cast to
javax.servlet.Filter
    at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)
    at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
    at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

Its weird because org.apache.tuscany.sca.host.webapp.TuscanyServletFilter
implements javax.servlet.Filter so its should be a safe cast.
I tried to google this error but couldnt find any link about it.

Has anyone else seen this stack?

- Henry

Re: [SCA] Seeing class cast exception TuscanyServletFilter cannot be cast to javax.servlet.Filter when running SCA store-webapp sample app

Posted by ant elder <an...@apache.org>.
On Fri, May 7, 2010 at 8:47 AM, Luciano Resende <lu...@gmail.com> wrote:
> On Fri, May 7, 2010 at 12:24 AM, ant elder <an...@gmail.com> wrote:
>>
>> There are a bunch of issues with this sample, the one you're seeing is
>> due to the servlet api jar getting included in the webapp dependencies
>> which conflicts with the one used by the tomcat plugin, but fixing
>> that wont get far as there are others issues and fixing those will
>> eventually find that impl.widget doesn't work in webapps -
>> http://apache.markmail.org/message/dobhps4tgblcyzn5
>>
>
> The impl.widget has been fixed couple days ago and should be working
> fine with both embedded and hosted environments.
>

Putting aside the point about moving to JAX-RS for a moment that
doesn't appear to be the case when i try it, are there any testcases
or samples using it that work?

   ...ant

Re: [SCA] Seeing class cast exception TuscanyServletFilter cannot be cast to javax.servlet.Filter when running SCA store-webapp sample app

Posted by Luciano Resende <lu...@gmail.com>.
On Fri, May 7, 2010 at 12:24 AM, ant elder <an...@gmail.com> wrote:
>
> There are a bunch of issues with this sample, the one you're seeing is
> due to the servlet api jar getting included in the webapp dependencies
> which conflicts with the one used by the tomcat plugin, but fixing
> that wont get far as there are others issues and fixing those will
> eventually find that impl.widget doesn't work in webapps -
> http://apache.markmail.org/message/dobhps4tgblcyzn5
>

The impl.widget has been fixed couple days ago and should be working
fine with both embedded and hosted environments.




--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Re: [SCA] Seeing class cast exception TuscanyServletFilter cannot be cast to javax.servlet.Filter when running SCA store-webapp sample app

Posted by ant elder <an...@gmail.com>.
There are a bunch of issues with this sample, the one you're seeing is
due to the servlet api jar getting included in the webapp dependencies
which conflicts with the one used by the tomcat plugin, but fixing
that wont get far as there are others issues and fixing those will
eventually find that impl.widget doesn't work in webapps -
http://apache.markmail.org/message/dobhps4tgblcyzn5

IMHO instead of spending time fixing that we should change the samples
to use one of the JAX-RS extensions we have now in 2.x and not promote
the old 1.x approaches.

   ...ant

On Fri, May 7, 2010 at 7:49 AM, Henry Saputra <he...@gmail.com> wrote:
> Hi All,
>
> When I tried to run SCA sample-store-webapp sample app from
> sca-java-2.x/trunk/samples/store-webapp using "mvn tomcat:run" command I saw
> this weird class cast exception:
>
> INFO: Starting tomcat server
> May 6, 2010 10:09:13 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
> May 6, 2010 10:09:15 PM org.apache.catalina.core.StandardContext filterStart
> SEVERE: Exception starting filter tuscany
> java.lang.ClassCastException:
> org.apache.tuscany.sca.host.webapp.TuscanyServletFilter cannot be cast to
> javax.servlet.Filter
>     at
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)
>     at
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
>     at
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
>     at
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
>     at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
>     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
>     at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
>
> Its weird because org.apache.tuscany.sca.host.webapp.TuscanyServletFilter
> implements javax.servlet.Filter so its should be a safe cast.
> I tried to google this error but couldnt find any link about it.
>
> Has anyone else seen this stack?
>
> - Henry
>