5 Replies Latest reply on Jan 14, 2010 12:49 PM by Peter Johnson

    Endpoint  not registering

    David Palmer Newbie

      having a bit of a problem getting a web service to work. (using jboss as 5.0.1 ga on mac os x)

       

      i have a simple pojo, with the @WebService annotion, and a very simple method annotated with the @WebMethod annotation. my web.xml simply defines a servlet who's class points to my pojo (as per the specification for jax-ws)

       

      now, when i go to deploy the war, jboss deploys it, but the endpoint is never rigistered, and i never see the console output that the wsdl is being published. my console simply ends with:

       

      16:16:56,507 INFO  [TomcatDeployment] deploy, ctxPath=/my-war

       

      i've been all over google, but my google-fu is failing me here. i can't seem to figure out what would be preventing jboss from identifying this as a web service.

       

      my implementation class:

       

      import javax.jws.WebMethod;
      import javax.jws.WebService;


      @WebService
      public class TestService {
         
          @WebMethod
          public String echo (String message) {
              return "I was told to tell you this: " + message;
          }
      }

       

      and here's my web.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <display-name>alico-fs-ws</display-name>
        <servlet>
          <servlet-name>foobar</servlet-name>
          <servlet-class>com.foo.services.TestService</servlet-class>
        </servlet>
        <servlet-mapping>
          <servlet-name>foobar</servlet-name>
          <url-pattern>/*</url-pattern>
        </servlet-mapping>
        <listener>
          <listener-class>
            org.springframework.web.context.ContextLoaderListener
          </listener-class>
        </listener>
        <context-param>
          <param-name>contextConfigLocation</param-name>
          <param-value>/WEB-INF/applicationContext.xml</param-value>
        </context-param>
      </web-app>

       


      i am most likely doing something dumb, and i'm really tired and blah blah, i just can't see it. so, anyone see what i'm missing?

       

      (btw, the editor in this forum is painful, truly and completely painful)

        • 1. Re: Endpoint  not registering
          Peter Johnson Master

          Try changing the DTD version of web.xml to 2.5:

           

          <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
            version="2.5"
          >

           

          I agree with your comments about the editor - I have grown to detest it in the last several weeks. It just gets in your way and makes things that used to be very easy extremely difficult (examples: I hate the spell checker because I always forget to click its button - Firefox always automatically underlined misspelled words but not in this editor!!!; and how do I go about identifying source with  a "code" tag??? )

          1 of 1 people found this helpful
          • 2. Re: Endpoint  not registering
            David Palmer Newbie

            Try changing the DTD version of web.xml to 2.5

             

            as you suggested, i tried changing it to 2.5, and i also tried just nuking out the whole schema designation and just use <web-app> both to no avail

             

            (oh isn't that cute, i type in colon-open-parans and this helpful editor changed that to the frown emoticon... and was kind enough to switch back to italics when i broke on to a new line... how helpful)

            • 3. Re: Endpoint  not registering
              Peter Johnson Master

              Also try changing your sevlet mapping, I don't know if a '*' is allowed:

               

                <servlet-mapping>
                  <servlet-name>foobar</servlet-name>
                  <url-pattern>/foo</url-pattern>
                </servlet-mapping>

               

              Also, drop the listener and the conetext-param. I'm not sure if they are causing a problem or not, but why take a chance when you don't absolutely need them.

              • 4. Re: Endpoint  not registering
                David Palmer Newbie

                peterj wrote:

                 

                Also try changing your sevlet mapping, I don't know if a '*' is allowed:

                 

                  <servlet-mapping>
                    <servlet-name>foobar</servlet-name>
                    <url-pattern>/foo</url-pattern>
                  </servlet-mapping>

                 

                Also, drop the listener and the conetext-param. I'm not sure if they are causing a problem or not, but why take a chance when you don't absolutely need them.

                 

                hmm, tried both (removing spring's listener) and changing the url pattern, no dice . in the real world i'll have to have spring in there (so i'm glad that wasn't the problem)

                • 5. Re: Endpoint  not registering
                  Peter Johnson Master

                  Well, I am stumped. I used your code (with my suggested changes) and deployed it:

                   

                  09:41:38,210 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=foo,endpoint=foobar
                  09:41:38,283 INFO  [TomcatDeployment] deploy, ctxPath=/foo
                  09:41:39,458 INFO  [WSDLFilePublisher] WSDL published to: file:/C:/opt/jboss/as/jboss-5.0.1.GA/serve
                  r/foo/data/wsdl/foo.war/TestServiceService504811253484387295.wsdl

                   

                  Which version of the JDK are you using? Did you download the version of JBoss AS that matches the JDK version (the one with -jdk6- in it is for JDK 6, the other is for JDK 5)?

                   

                  Did you try going to http://localhost:8080/jbossws/services to see if the web service was really registered?

                   

                  Here's the web.xml (the source file matches yours exactly, with the addition of the "package com.foo.services;" line which you did not post):

                   

                  <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                    version="2.5"
                  >
                    <servlet>
                      <servlet-name>foobar</servlet-name>
                      <servlet-class>com.foo.services.TestService</servlet-class>
                    </servlet>
                    <servlet-mapping>
                      <servlet-name>foobar</servlet-name>
                      <url-pattern>/foo</url-pattern>
                    </servlet-mapping>
                  </web-app>