Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9162715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:16:39+00:00 2026-06-17T14:16:39+00:00

I am generating wsdl using java2wsd . My class is public class REWS {…}

  • 0

I am generating wsdl using java2wsd. My class is

public class REWS {...}.

I just added implements HttpSessionListener like so:

public class REWS implements HttpSessionListener {...}

and I started getting the NoClassDefFoundError error for HttpSessionListener.

I can build the REWS class, but once I want to generate stub with java2wsdl I get NoClassDefFoundError.

How to I tell java2wsdl to take HttpSessionListener from /Tomcat/lib/servlet-api.jar? How do I include servlet-api.jar?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:16:40+00:00Added an answer on June 17, 2026 at 2:16 pm

    That is a bad design, indeed.

    First, let’s recall what interfaces are for. Interfaces establish a strong design contract in your class, stronger than declaring the inherited methods "the plain old way". WSDL defines interfaces too, even if java2wsdl works on classes.

    You use interfaces because they are parameters of framework methods, allowing you to provide them your own implementation of a contract. With WSDL, it’s slightly different. The WSDL is the contract and is self-powered. You don’t need anything more in a WSDL except the XSD schemas that are explicitly imported.

    So: why does one implement HttpSessionListener? As stated by documentation, a properly registered session listener is activated by the framework when session changes. Is this part of the design contract of your publicly-accessible web service? Absolutely not!!

    By implementing, you are implicitly exporting to the public two methods that are for internal use, so you are trying (but won’t ever succeed) to declare two additional methods to your public service that handle session changes. That’s not only wrong, but impossible because HttpSessionEvent is simply not exportable to XSD!

    The proposal

    Don’t implement this interface on your WS class. Use your custom implementation as a class member and let it interact with your WS class according to what your web service does. I’m not an expert in Tomcat but web services don’t use session and cookies, so I doubt you’ll ever deal with the session in a web service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm generating a WSDL from a Java class using the @WebService annotation and running
I'm generating Java from WSDL using wsimport (JAX-WS 2.1.3) and need to make it
What is the exact way of generating a Java code using WSDL in a
We're generating Java files from WSDL descripitons using the axis-wsdl2java ant task. <axis-wsdl2java url=${src.dir.etc}/wsdl/BLAH.wsdl
We are using thirdparty wsdl files that we are generating java files with using
I added a service reference in Visual Studio 2010 using following wsdl. It is
I've created a WebService like this: [WebService(Namespace = http://ns)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class
I am generating WSDL/XSD for SOAP services from a UML model using IBM Rational
I have multiple WSDL/XSD files and using JAXB I'm generating it's clients. But there
Just tried to generate java client generation from a WSDL file ( using XFire

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.