Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jax-WS Webservice leads to ServletException

 
Michael Gygli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Gygli
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic