This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

java.lang.ClassCastException cannot be cast to javax.servlet.Filter

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
this is my first attempt at building and deploying an application using a pom.xml file. I'm able to build my project succ, but wen I deploy it to tomcat server
I get the following errors:-

SEVERE: Exception starting filter springSecurityFilterChain
java.lang.ClassCastException: org.springframework.web.filter.DelegatingFilterProxy cannot be cast to javax.servlet.Filter

SEVERE: Exception starting filter PrimeFaces FileUpload Filter
java.lang.ClassCastException: org.primefaces.webapp.filter.FileUploadFilter cannot be cast to javax.servlet.Filter

Searching the internet I found that I should remove any dependency on servlet-api jar file. I found that paypal-core jar has a dependency on
servlet-api jar so I included the following:-



but I'm still getting the above errors. I also noticed that I use the following in my pom.xml file


but if I remove this my build will not work

I have got no idea how to resolve this issue.

pom.xml
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you need a jar for compilation, but you don't want it packaged inside your runtime artifact (war file), you should set the scope to provided.
 
Mat Anthony
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jayesh
 
reply
    Bookmark Topic Watch Topic
  • New Topic