wood burning stoves*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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$ServletInitAction.run(StubSecurityHelper.java:276)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

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: 576

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)
It is sorta covered in the JavaRanch Style Guide.
subject: Jax-WS Webservice leads to ServletException
Similar Threads
JBOSS DeploymentException : Not able to find module file : .war in a .ear file
Could not resolve dependencies for maven project
Ear Building in Maven
Problem with the "mvn test" command missing EJB client jar artifact
maven ear plugin question