1 2 Previous Next 27 Replies Latest reply on Jun 18, 2007 2:45 PM by Clinton Pringle

    JBossWS Plugin gen code problem

    Kalvin Liang Newbie

      Hello,

      I am getting an error when deploying the following walkthrough example.

      http://www.soapui.org/jbossws/topdown_example.html

      Here is the error log:

      22:08:26,306 WARN [PortComponentMetaData] <wsdl-port> element in webservices.xml not namespace qualified: :HelloWorldPort
      22:08:26,540 WARN [JSR109ServerMetaDataBuilder] Adding wsdl targetNamespace to: {http://www.example.org/HelloWorld/}:HelloWorldPort
      22:08:26,556 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.0.5.GA_ejb3/server/default/deploy/HelloWorld.war
      org.jboss.ws.WSException: Cannot find port in wsdl: {http://www.example.org/HelloWorld/}:HelloWorldPort

      I think the problem is in the webservices.xml, which is generated when publishing the implementation class (helloworld.impl.HelloWorld) as web serveic. Below is the WSDL port value found in the generated webservices.xml file.

      <wsdl-port>:HelloWorldPort</wsdl-port>

      So, I repeated a few times of the entire walkthrough, and make sure that I didn't type the leading colon in the "WSDL Port to use" field of the "Publish as WebService" dialog box. However, the results were the same. Is this a bug in the wstools or the JBossWS Eclipse plugin?

      Thanks,
      Kalvin

      P.S. My environment is JBossIDE 2.0.0.Beta2, JBossAS 4.0.5.GA, java version 1.5.0_06 and MS Windows XP Professional.

        • 1. Re: JBossWS Plugin gen code problem
          Ole Matzura Novice

          Hi Kalvin,

          it's a bug in the plugin I believe.. please check thegenerated webservices.xml file and remove the leading ":" in the wsdl-port element.. this is fixed in the nightly builds..

          hope this helps!

          regards,

          /Ole
          eviware.com

          • 2. Re: JBossWS Plugin gen code problem
            Mark Rosenthal Newbie

            Hello Ole,

            I have the same environment as described above.
            I have created and tested a stateless session bean.

            I want to add a service endpoint to this session bean. I did the following:
            1. Enable JBossWS nature
            2. Right click on the SessionBean and choose: JBossWS->Publish as Web Service.
            3. In the 'Publish as WebService' dialog, on the Basic tab, I choose Interface 'javax.ejb.SessionBean',
            4. For 'Deploy as', I choose 'EJB'.
            5. On the Advanced tab, for 'Package' I choose "MyBean.war'
            6. I hit the 'Generate'
            I receive the following wstools error in the console log:

            Running JBossWS wstools for [DemoProject]
            directory: C:\Documents and Settings\Mark\workspace2\DemoProject
            command: cmd.exe /C C:\jboss-4.0.5.GA\bin\wstools.bat -cp build/classes -config C:\DOCUME~1\Mark\LOCALS~1\Temp\wstools-config8176.xml -dest C:\Documents and Settings\Mark\workspace2\DemoProject\ejbModule
            ========================================================================="
            .
            WSTools Environment
            .
            JBOSS_HOME: C:\jboss-4.0.5.GA\bin\\..
            .
            JAVA: C:\Program Files\Java\jdk1.5.0_06\bin\java
            .
            JAVA_OPTS:
            .
            ========================================================================="
            .
            Exception in thread "main" org.jboss.ws.WSException: A service endpoint interface should extend Remote
            at org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder.buildMetaData(ToolsUnifiedMetaDataBuilder.java:82)
            at org.jboss.ws.tools.metadata.ToolsUnifiedMetaDataBuilder.<init>(ToolsUnifiedMetaDataBuilder.java:69)
            at org.jboss.ws.tools.JavaToWSDL.generate(JavaToWSDL.java:298)
            at org.jboss.ws.tools.helpers.ToolsHelper.handleJavaToWSDLGeneration(ToolsHelper.java:122)
            at org.jboss.ws.tools.WSTools.process(WSTools.java:132)
            at org.jboss.ws.tools.WSTools.generate(WSTools.java:120)
            at org.jboss.ws.tools.WSTools.main(WSTools.java:61)


            Regards

            • 3. Re: JBossWS Plugin gen code problem
              Ole Matzura Novice

              Hi!

              You need to extract the methods you want to expose from your EJB into a seperate interface that extends Remote, ie if you have a "doIt" method in your EJB, refactor it into an interface ("Refactor/Extract Interface"), then make sure that the interface extends Remote and the interfaces methods throw RemoteException (this is a JAX-RPC requirement I think..).. Then when you rerun the "Publish as WebService" dialog, select the generated interface instead of SessionBean..

              Hope this helps!

              regards,

              /Ole

              • 4. Re: JBossWS Plugin gen code problem
                Mark Rosenthal Newbie

                Hello Ole,
                After extracting the interface, I got farther, but this is the result now:

                Running JBossWS wstools for [DemoProject]
                directory: C:\Documents and Settings\Mark\workspace2\DemoProject
                command: cmd.exe /C C:\jboss-4.0.5.GA\bin\wstools.bat -cp build/classes -config C:\DOCUME~1\Mark\LOCALS~1\Temp\wstools-config3273.xml -dest C:\Documents and Settings\Mark\workspace2\DemoProject\ejbModule
                ========================================================================="
                .
                 WSTools Environment
                .
                 JBOSS_HOME: C:\jboss-4.0.5.GA\bin\\..
                .
                 JAVA: C:\Program Files\Java\jdk1.5.0_06\bin\java
                .
                 JAVA_OPTS:
                .
                ========================================================================="
                .
                Failed to update deployment descriptor
                


                Regards

                • 5. Re: JBossWS Plugin gen code problem
                  Ole Matzura Novice

                  Hi!

                  hmm.. I'm not sure what this error actually means.. (ie why it failed..), could you please check the contents of the generated wstools config (C:\DOCUME~1\Mark\LOCALS~1\Temp\wstools-config3273.xml) if there are some strange path entries?

                  regards,

                  /Ole

                  • 6. Re: JBossWS Plugin gen code problem
                    Mark Rosenthal Newbie

                    Hello Ole,

                    Here is the content of wstools-config3273.xml:

                    <?xml version="1.0" encoding="UTF-8"?>
                    <jbos:configuration xmlns:jbos="http://www.jboss.org/jbossws-tools">
                    <jbos:java-wsdl>
                    <jbos:service endpoint="com.acme.PowerService" style="document" parameter-style="wrapped" name="PowerService"/>
                    <jbos:namespaces target-namespace="urn:com.acme" type-namespace="urn:com.acme.types"/>
                    <jbos:mapping file="jaxrpc-mapping.xml"/>
                    <jbos:webservices ejb-link="PowerService"/>
                    </jbos:java-wsdl>
                    </jbos:configuration>


                    Regards

                    • 7. Re: JBossWS Plugin gen code problem
                      Mark Rosenthal Newbie

                      Some additional information:

                      There are validation errors in the generated jaxrpc-mapping.xml and webservices.xml files.

                      Their default namespace url references xsds that contain errors:
                      "http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd" and
                      "http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd"

                      It seems that both of these schemas are unable to reference "j2ee_1_4.xsd"



                      • 8. Re: JBossWS Plugin gen code problem
                        Ole Matzura Novice

                        ok thanks..

                        What path have you set to your ejb-jar.xml file in the deploy tabs' "Deployment Descriptor" field?

                        regards!

                        /Ole

                        • 9. Re: JBossWS Plugin gen code problem
                          Mark Rosenthal Newbie

                          Ole,

                          Here is my deployment descriptor path from the 'Basic' tab of the 'Publish as WebService' dialog.

                          C:\Documents and Settings\Mark\workspace2\DemoProject\ejbModule\META-INF\ejb-jar.xml


                          Thanks!
                          -Mark

                          • 10. Re: JBossWS Plugin gen code problem
                            Mark Rosenthal Newbie

                            And here is the content of ejb-jar.xml

                            <?xml version="1.0" encoding="UTF-8"?>
                            
                            <ejb-jar id="ejb-jar_1" 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/ejb-jar_2_1.xsd" version="2.1">
                            
                             <description><![CDATA[DemoProject generated by eclipse wtp xdoclet extension.]]></description>
                             <display-name>DemoProject</display-name>
                            
                             <enterprise-beans>
                            
                             <!-- Session Beans -->
                             <session id="Session_Power">
                             <description><![CDATA[An EJB named Power]]></description>
                             <display-name>Power</display-name>
                            
                             <ejb-name>Power</ejb-name>
                            
                             <home>com.acme.PowerHome</home>
                             <remote>com.acme.Power</remote>
                             <local-home>com.acme.PowerLocalHome</local-home>
                             <local>com.acme.PowerLocal</local>
                             <ejb-class>com.acme.PowerSession</ejb-class>
                             <session-type>Stateless</session-type>
                             <transaction-type>Container</transaction-type>
                            
                             </session>
                            
                             <!--
                             To add session beans that you have deployment descriptor info for, add
                             a file to your XDoclet merge directory called session-beans.xml that contains
                             the <session></session> markup for those beans.
                             -->
                            
                             <!-- Entity Beans -->
                             <!--
                             To add entity beans that you have deployment descriptor info for, add
                             a file to your XDoclet merge directory called entity-beans.xml that contains
                             the <entity></entity> markup for those beans.
                             -->
                            
                             <!-- Message Driven Beans -->
                             <!--
                             To add message driven beans that you have deployment descriptor info for, add
                             a file to your XDoclet merge directory called message-driven-beans.xml that contains
                             the <message-driven></message-driven> markup for those beans.
                             -->
                            
                             </enterprise-beans>
                            
                             <!-- Relationships -->
                            
                             <!-- Assembly Descriptor -->
                             <!--
                             To specify your own assembly descriptor info here, add a file to your
                             XDoclet merge directory called assembly-descriptor.xml that contains
                             the <assembly-descriptor></assembly-descriptor> markup.
                             -->
                            
                             <assembly-descriptor id="AssemblyDescriptor_1">
                             <!--
                             To specify additional security-role elements, add a file in the merge
                             directory called ejb-security-roles.xml that contains them.
                             -->
                            
                             <!-- method permissions -->
                             <!--
                             To specify additional method-permission elements, add a file in the merge
                             directory called ejb-method-permissions.ent that contains them.
                             -->
                            
                             <!-- transactions -->
                             <!--
                             To specify additional container-transaction elements, add a file in the merge
                             directory called ejb-container-transactions.ent that contains them.
                             -->
                            
                             <!-- finder transactions -->
                            
                             <!-- message destinations -->
                             <!--
                             To specify additional message-destination elements, add a file in the merge
                             directory called ejb-message-destinations.ent that contains them.
                             -->
                            
                             <!-- exclude list -->
                             <!--
                             To specify an exclude-list element, add a file in the merge directory
                             called ejb-exclude-list.xml that contains it.
                             -->
                             </assembly-descriptor>
                            
                             <ejb-client-jar>DemoProjectClient.jar</ejb-client-jar>
                            
                            </ejb-jar>
                            


                            • 11. Re: JBossWS Plugin gen code problem
                              Mark Rosenthal Newbie

                              Ole,

                              I note the <ejb-class> element fomr ejb-jar.xml references 'PowerSession', the concrete implementation of the abstract 'PowerBean' class.

                              I added my business methods to 'PowerBean', not 'PowerSession'. The EAR produced by JBossIDE deployed and I was able to test with it. I extracted the interface from 'PowerBean', not 'PowerSession'. The xdoclet @ejb.interface-method tags moved from 'PowerBean' to 'PowerService', the newly extracted interface, during the refactor process.

                              Thanks again,
                              -Mark

                              • 12. Re: JBossWS Plugin gen code problem
                                Ole Matzura Novice

                                Hi,

                                ok.. does this mean that it is working now or should I continue my bug-hunt?

                                regards!

                                /Ole

                                • 13. Re: JBossWS Plugin gen code problem
                                  Mark Rosenthal Newbie

                                  Hi Ole,

                                  Sorry...

                                  When I said that I was able to test with it, I meant using an RMI client.

                                  Still no luck with wstools.

                                  Thanks,
                                  -Mark

                                  • 14. Re: JBossWS Plugin gen code problem
                                    Ole Matzura Novice

                                    ok Mark,

                                    I think this is a bug in the handling of th ejb-jar.xml file.. I'll get back to you when I have some more info (and a fix hopefully.. )..

                                    thanks for your feedback so far!

                                    regards,

                                    /Ole

                                    1 2 Previous Next