8 Replies Latest reply on Dec 5, 2006 8:51 PM by astona

    Can't build jbossws samples

    dannox02

      I've been trying to get my web services working on Jboss 4.0.4CR2 and have had no luck at all :-(

      First I can't compile the sample files or my own examples with Ant. When I run the build I get the following error:

      compile15:
       [javac] Compiling 6 source files to D:\jbossws-samples-1.0.0.GA\jbossws-samp
      les-1.0.0.GA\output\classes
       [javac] D:\jbossws-samples-1.0.0.GA\jbossws-samples-1.0.0.GA\jsr181pojo\java
      \org\jboss\test\ws\samples\jsr181pojo\JSEBean01.java:34: incompatible types
       [javac] found : javax.jws.WebService
       [javac] required: java.lang.annotation.Annotation
       [javac] @WebService(name = "EndpointInterface", targetNamespace = "http://or
      g.jboss.ws/samples/jsr181pojo", serviceName = "TestService")
       [javac] ^
       [javac] D:\jbossws-samples-1.0.0.GA\jbossws-samples-1.0.0.GA\jsr181pojo\java
      \org\jboss\test\ws\samples\jsr181pojo\JSEBean01.java:35: incompatible types
       [javac] found : javax.jws.soap.SOAPBinding
       [javac] required: java.lang.annotation.Annotation
       [javac] @SOAPBinding(style = SOAPBinding.Style.RPC)
       [javac] ^
       [javac] D:\jbossws-samples-1.0.0.GA\jbossws-samples-1.0.0.GA\jsr181pojo\java
      \org\jboss\test\ws\samples\jsr181pojo\JSEBean01.java:35: duplicate annotation
       [javac] @SOAPBinding(style = SOAPBinding.Style.RPC)
       [javac] ^
       [javac] D:\jbossws-samples-1.0.0.GA\jbossws-samples-1.0.0.GA\jsr181pojo\java
      \org\jboss\test\ws\samples\jsr181pojo\JSEBean01.java:38: incompatible types
       [javac] found : javax.jws.WebMethod
       [javac] required: java.lang.annotation.Annotation
       [javac] @WebMethod
       [javac] ^
       [javac] Note: D:\jbossws-samples-1.0.0.GA\jbossws-samples-1.0.0.GA\common\ja
      va\org\jboss\test\ws\JBossWSTest.java uses unchecked or unsafe operations.
       [javac] Note: Recompile with -Xlint:unchecked for details.
       [javac] 4 errors
      
      BUILD FAILED
      D:\jbossws-samples-1.0.0.GA\jbossws-samples-1.0.0.GA\common\imported-build.xml:1
      23: Compile failed; see the compiler error output for details.
      


      I am using ant 1.6.5, JDK 1.5.0 and JBoss 4.0.4CR2. Any ideas what is causing this error?

      Thanks,

        • 1. Re: Can't build jbossws samples
          dannox02

          Also this example is from trying to build the jsr181pojo example. However I get the same problem even with examples I write myself.

          • 2. Re: Can't build jbossws samples
            thomas.diesler

            jbossws-1.0.0.GA is targeted for jboss-4.0.4.

            Do you also see this issue with the latest from Branch_4_0?

            cvs co -r Branch_4_0 jboss-4.0.x
            cd jboss-4.0.x
            build/build.sh
            


            • 3. Re: Can't build jbossws samples
              ramcisjboss

              you should use this library jbossws14.jar, it contains the classes that you need.
              Hope that this helps you.

              • 4. Re: Can't build jbossws samples
                dannox02

                Thanks,

                I upgraded to the GA release for ws and it is working fine now.

                • 5. Re: Can't build jbossws samples
                  lewisd

                  I'm having this same problem trying to build my own code, or the ejb3 examples in 4.0.4.GA.
                  I can do "build/build.sh", but it looks like it doesn't actually compile the examples.
                  From inside jboss-4.0.4.GA-src/ejb3/docs/tutorial/webservice, if I execute ant, I get a bunch of exceptions like this:

                  [javac] /home/lewisd/download/java/jboss/jboss-4.0.4.GA-src/ejb3/docs/tutorial/webservice/src/org/jboss/tutorial/webservice/bean/Calculator.java:31: incompatible types
                  [javac] found : javax.jws.WebService
                  [javac] required: java.lang.annotation.Annotation
                  [javac] @WebService
                  

                  Any idea why?

                  • 6. Re: Can't build jbossws samples
                    adrian.andrei

                    The reason is due to usage of jbossws14.jar instead of the jbossws.jar found in jbossws14.sar that comes with the example. The difference is that the latter has annotations extended from org.jboss.lang.Annotation instead of the java.jang one. After I modified the JBOSS configuration with the ws files from the example I was able to compile. Please replace the jbossws14-client.jar with the jbossws-client.jar from the examples and you will be able to compile.

                    • 7. Re: Can't build jbossws samples
                      mike.daleiden

                      I am trying to get a very simple web service to compile, but am running into the same problem where the compiler is not finding org.jboss.lang.Annotation.

                      I am using the jbossws14.jar from the jbossws14.sar that was packaged with JBoss 4.0.4.GA.

                      What is the issue and how do I resolve it? I really need to get my web services prototyped, as we are in the process of implementing a new architecture that relies on these web services.

                      Thanks in advance.

                      • 8. Re: Can't build jbossws samples
                        astona

                        I ran into this same problem. There were suggestions to add jbossretro-rt.jar (which has org.jboss.lang.Annotation), but that just led to other problems.

                        It looks like $jboss/server/default/deploy/jbossws14.sar is built for JDK 1.4, not 1.5.

                        You can go and get a new jbossws release, and patch the JBoss 4.0.4 (in my case 4.0.5) install ... Go to jboss.org, and follow the links to download the latest greatest JBossWS.

                        I can compile ... not sure if it runs yet :)