This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Services and the fly likes Jax-WS Webservice leads to ServletException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Web Services
Bookmark "Jax-WS Webservice leads to ServletException" Watch "Jax-WS Webservice leads to ServletException" New topic

Jax-WS Webservice leads to ServletException

Michael Gygli

Joined: Jan 24, 2011
Posts: 2
Hi everyone

I implemented a new Webservice using Maven and Eclipse. That worked, as long as I deployed the war-file directly. But when I try to deploy the webservice(the war-file) as a module of an ear-project, I get the following exception

weblogic.application.ModuleException: [HTTP:101216]Servlet: "xx.MyServiceImpl" failed to preload on startup in Web application: "/xx-ws/myservice".
javax.servlet.ServletException: Servlet class: xx.MyServiceImpl' does not implement javax.servlet.Servlet
at weblogic.servlet.internal.StubSecurityHelper$

In the pom.xml of the EAR-Project I added the webservice project as a dependency and as a Module:


With other modules (which look similar to me) it works.

Where am I wrong? As far as I know a WebService should not need some Servlet Code.

Thanks a lot for your help - I'm running out of ideas!


Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You are correct. The webservice should not need any servlet code, however it looks like it's expecting a servlet. I would check how your are deploying this and verify that you are doing it correctly.

So much trouble in the world -- Bob Marley
Michael Gygli

Joined: Jan 24, 2011
Posts: 2

I did that. The strange thing is, that there are existing projects which work. On the base of the maven settings they are the same. So my guess is that the problem is something that is done in the background by maven or eclipse. I mean, I annotated the Class that implements the webservice as usual (@WebService (name = "...").
In my opinion that should do it!

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Hi Michael,

Your problem seems strange at my first glance.

So my guess is that the problem is something that is done in the background by maven or eclipse.

Can you check in the deployed .ear (presuming the ear containing web service is deployed but throwing exception), if application.xml contains a reference to your .war application? You can troubleshoot better by directly inspecting deployed .ear and by tweaking it manually instead of completely relying on IDE and script.

(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Jax-WS Webservice leads to ServletException
It's not a secret anymore!