Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WAS7 for Developers & annotations

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys

I have been working on an app for a while using Glassfish v3, using Servlets 3.0 with annotations (instead of web.xml) for servlet mappings. Everything works fine but i have been finding Glassfish quite flakey in regards to redeploying the app or removing the app so I decided to download WAS7 for developers and try y app on there.

Now I have deployed it and it's up and running but as soon as I click on a URI I get a 404 error, the only thing I can think that's causing this is that WAS7 doesn't see the annotations!
I can't believe WAS doesn't support Servlet3.0 or annotations, so is there any config I have to do to get this working?

Has anyone successfulyy ran a annotations based app on WAS7?

Cheers in advance

KS
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keith Seller wrote:Now I have deployed it and it's up and running but as soon as I click on a URI I get a 404 error, the only thing I can think that's causing this is that WAS7 doesn't see the annotations!


Well, that sure wouldn't be my first guess at what causes a 404. You might want to step back for a minute and consider some of the more ordinary reasons why that would happen.
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the page is there and it works under Glassfish (same EAR file) also I have another Servlet for general navigation that uses the old web.xml config and that is working.
So my thought is that Websphere isn't reading the url-pattern in the @WebServlet annotation.
 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doing some further research, it doesn't look like WAS7 even supports Servlets3.0, just 2.5, in which case it might explain why it's not getting my

[@WebServlet(name = "TestServlet", urlPatterns = {"/test"}) ]

code!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic