Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Class cast exception when trying to deploy Web Service in web application (Jboss EAP 6.1.1)

    Posted on

    I'm trying to deploy web service in my web application and I get following exception

    JBWEB000309: type JBWEB000066: Exception report
    JBWEB000068: message JBWEB000261: Class my.test.HelloWorldWs is not a Servlet
    JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
    JBWEB000070: exception
    javax.servlet.ServletException: JBWEB000261: Class my.test.HelloWorldWs is not a Servlet
            org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499)
            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:722)
    JBWEB000071: root cause
    java.lang.ClassCastException: my.test.HelloWorldWs cannot be cast to javax.servlet.Servlet
            org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:499)
            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:722)
    JBWEB000072: note JBWEB000073: The full stack trace of the root cause is available in the JBoss Web/7.2.2.Final-redhat-1 logs.
    

    I configure my WEB-INF/web.xml as following

    
        HelloWorldService
        us.gov.treasury.irs.srv.test.HelloWorldWs  
    
    
    
        HelloWorldService
        /test/HelloWorldService
      
    

    and have following configured in WEB-INF/jbossws-cxf.xml

     
    
       
         
           
         
       
    
     
    

    by

    points

    Responses

    Red Hat

    Quick Links

    Help

    Site Info

    Related Sites

    © 2025 Red Hat, Inc.