• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
ws.tms.webservices.base.WSManager.init(WSManager.java:73)
ws.tms.webservices.base.WSManager.init(WSManager.java:120)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
java.lang.Thread.run(Thread.java:662)

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.

Thanks
Vicky
 
I like tacos! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic