Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.ClassCastException: java.lang.Object cannot be cast to javax.xml.rpc.server.ServletEndpoin  RSS feed

Vicky Mittal
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class which implements ServiceLifecycle.

In the init method:

public void init(Object context) throws ServiceException {
endpointContext = (ServletEndpointContext) context;
log = Log.getInstance();

Now I want my existing class to implement the javax.servlet.Servlet and through this I want to achieve the same functionality.

For this I implemented the servlet methods i.e.
public ServletConfig getServletConfig()
public String getServletInfo()
public void init(ServletConfig arg0) throws ServletException
public void service(ServletRequest arg0, ServletResponse arg1)
throws ServletException, IOException

Now from with in the servlet init method I try to invoke the init method for ServiceLifecycle but this doesn;t work and gives the following:

JBWEB000071: root cause</b> <pre>java.lang.ClassCastException: java.lang.Object cannot be cast to javax.xml.rpc.server.ServletEndpointContext

As the line 73, I am trying to do the
endpointContext = (ServletEndpointContext) new Object();

also I tried endpointContext = (ServletEndpointContext) new WSManager();

but I am not sure how to get this working.

Can some one please help me in this.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!