1 Reply Latest reply on May 9, 2006 4:28 PM by balteo

    JAXRPCException The service interface does not implement jav

    balteo

      Hello,
      I am trying to call a web service. I have the following code in my servlet:

      
      /*
       * ServletWSClient.java
       *
       * Created on 9 mai 2006, 12:32
       */
      
      package pack;
      
      import java.io.*;
      import java.net.*;
      
      import javax.servlet.*;
      import javax.servlet.http.*;
      
      /**
       *
       * @author Administrator
       * @version
       */
      public class ServletWSClient extends HttpServlet {
      
       /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
       * @param request servlet request
       * @param response servlet response
       */
       protected void processRequest(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
       response.setContentType("text/html;charset=UTF-8");
       PrintWriter out = response.getWriter();
       String s = null;
       try { // This code block invokes the myOperation operation on web service
       s = getEJBWebServiceOneSEIPort().myOperation("fsdqsqdsf");
       } catch(java.rmi.RemoteException ex) {
       ex.printStackTrace();
       } catch(Exception ex) {
       ex.printStackTrace();
       }
      
       out.println("<html>");
       out.println("<head>");
       out.println("<title>Servlet ServletWSClient</title>");
       out.println("</head>");
       out.println("<body>");
       out.println(s);
       out.println("<h1>Servlet ServletWSClient at " + request.getContextPath () + "</h1>");
       out.println("</body>");
       out.println("</html>");
      
       out.close();
       }
      
       // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
       /** Handles the HTTP <code>GET</code> method.
       * @param request servlet request
       * @param response servlet response
       */
       protected void doGet(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
       processRequest(request, response);
       }
      
       /** Handles the HTTP <code>POST</code> method.
       * @param request servlet request
       * @param response servlet response
       */
       protected void doPost(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
       processRequest(request, response);
       }
      
       /** Returns a short description of the servlet.
       */
       public String getServletInfo() {
       return "Short description";
       }
       // </editor-fold>
      
       private pack.EJBWebServiceOne getEJBWebServiceOne() {
       pack.EJBWebServiceOne eJBWebServiceOne = null;
       //System.out.println("-->"+eJBWebServiceOne.getClass().getInterfaces().toString());
      
       try {
       javax.naming.InitialContext ic = new javax.naming.InitialContext();
       eJBWebServiceOne = (pack.EJBWebServiceOne) ic.lookup("java:comp/env/service/EJBWebServiceOne");
       } catch(javax.naming.NamingException ex) {
       ex.printStackTrace();
       }
       return eJBWebServiceOne;
       }
      
       private pack.EJBWebServiceOneSEI getEJBWebServiceOneSEIPort() {
       pack.EJBWebServiceOneSEI eJBWebServiceOneSEIPort = null;
       try {
       eJBWebServiceOneSEIPort = getEJBWebServiceOne().getEJBWebServiceOneSEIPort();
       } catch(javax.xml.rpc.ServiceException ex) {
       ex.printStackTrace();
       }
       return eJBWebServiceOneSEIPort;
       }
      
      
      
      }
      
      
      
      



      Here is what I get:

      
      15:39:09,890 INFO [STDOUT] javax.naming.NamingException: Could not dereference object [Root excepti
      on is javax.xml.rpc.JAXRPCException: The service interf
      ace does not implement javax.xml.rpc.Service: pack.EJBWebServiceOne]
      15:39:09,890 INFO [STDOUT] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(Nam
      ingContext.java:1135)
      15:39:09,890 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:690)
      15:39:09,890 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:701)
      15:39:09,890 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      15:39:09,890 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      15:39:09,890 INFO [STDOUT] at pack.ServletWSClient.getEJBWebServiceOne(ServletWSClient.java:84)
      
      15:39:09,890 INFO [STDOUT] at pack.ServletWSClient.getEJBWebServiceOneSEIPort(ServletWSClient.j
      ava:94)
      15:39:09,890 INFO [STDOUT] at pack.ServletWSClient.processRequest(ServletWSClient.java:32)
      15:39:09,890 INFO [STDOUT] at pack.ServletWSClient.doGet(ServletWSClient.java:59)
      15:39:09,890 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      15:39:09,890 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      ApplicationFilterChain.java:252)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
      ionFilterChain.java:173)
      15:39:09,890 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHead
      erFilter.java:81)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      ApplicationFilterChain.java:202)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
      ionFilterChain.java:173)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrap
      perValve.java:213)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardCont
      extValve.java:178)
      15:39:09,890 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomP
      rincipalValve.java:39)
      15:39:09,890 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Sec
      urityAssociationValve.java:159)
      15:39:09,890 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContext
      Valve.java:59)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostVal
      ve.java:126)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportVal
      ve.java:105)
      15:39:09,890 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngin
      eValve.java:107)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter
      .java:148)
      15:39:09,906 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.
      java:856)
      15:39:09,906 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.p
      rocessConnection(Http11Protocol.java:744)
      15:39:09,906 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpE
      ndpoint.java:527)
      15:39:09,906 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlav
      eWorkerThread.java:112)
      15:39:09,906 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
      15:39:09,906 INFO [STDOUT] Caused by: javax.xml.rpc.JAXRPCException: The service interface does not
       implement javax.xml.rpc.Service: pack.EJBWebServiceOne
      
      15:39:09,906 INFO [STDOUT] at org.jboss.webservice.client.ServiceObjectFactory.getObjectInstanc
      e(ServiceObjectFactory.java:256)
      15:39:09,906 INFO [STDOUT] at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.ja
      va:304)
      15:39:09,906 INFO [STDOUT] at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.
      java:1110)
      15:39:09,906 INFO [STDOUT] at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(Nam
      ingContext.java:1127)
      15:39:09,906 INFO [STDOUT] ... 29 more
      15:39:09,906 INFO [STDOUT] java.lang.NullPointerException
      15:39:09,906 INFO [STDOUT] at pack.ServletWSClient.getEJBWebServiceOneSEIPort(ServletWSClient.j
      ava:94)
      15:39:09,906 INFO [STDOUT] at pack.ServletWSClient.processRequest(ServletWSClient.java:32)
      15:39:09,906 INFO [STDOUT] at pack.ServletWSClient.doGet(ServletWSClient.java:59)
      15:39:09,906 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      15:39:09,906 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      ApplicationFilterChain.java:252)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
      ionFilterChain.java:173)
      15:39:09,906 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHead
      erFilter.java:81)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
      ApplicationFilterChain.java:202)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicat
      ionFilterChain.java:173)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrap
      perValve.java:213)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardCont
      extValve.java:178)
      15:39:09,906 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomP
      rincipalValve.java:39)
      15:39:09,906 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Sec
      urityAssociationValve.java:159)
      15:39:09,906 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContext
      Valve.java:59)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostVal
      ve.java:126)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportVal
      ve.java:105)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngin
      eValve.java:107)
      15:39:09,906 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter
      .java:148)
      15:39:09,906 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.
      java:856)
      15:39:09,906 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.p
      rocessConnection(Http11Protocol.java:744)
      15:39:09,906 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpE
      ndpoint.java:527)
      15:39:09,906 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlav
      eWorkerThread.java:112)
      15:39:09,906 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
      
      
      
      




      I am POSITIVE that the eJBWebServiceOne object implements javax.rpc.Service. because I checked it. Then what's wrong?

      Thanks in advance,

      Julien.

      ps. this is a repost as my message subject line got truncated.

        • 1. I found the part of the solution to my problem
          balteo

          Hello,

          I realized that additional jars (jaxrpc jars) were packaged in the war and this must have been the source of my problems: there must have been two javax.xml.rpc.Service classes in contention.

          Now I would be very grateful if someone could tell me how to resolve class contention problems with jboss.

          Thanks in advance,

          Julien.