This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jax-WS Webservice leads to ServletException" Watch "Jax-WS Webservice leads to ServletException" New topic
Author

Jax-WS Webservice leads to ServletException

Michael Gygli
Greenhorn

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:

...
<webModule>
<groupId>xx</groupId>
<artifactId>MyService</artifactId>
<contextRoot>/xx-ws/myservice</contextRoot>
</webModule>
...
<dependency>
<groupId>xx</groupId>
<artifactId>MyService</artifactId>
<version>0.0.4-SNAPSHOT</version>
<type>war</type>
</dependency>
...


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!

Cheers
Michael

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.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Michael Gygli
Greenhorn

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.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
 
Don't get me started about those stupid light bulbs.
 
subject: Jax-WS Webservice leads to ServletException