WAS v8.5 > Reference > Troubleshooting tips

JAX-RPC Web services command-line tools troubleshooting

Use these tips to troubleshoot WSDL2Java and Java2WSDL command-line tools used when we develop JAX-RPC web services.

Each section in this topic is a problem that you might experience while using the WSDL2Java or Java2WSDL tool. A solution is provided to help troubleshoot the problem.

The .Net client does not reflect a web service method with Vector-type parameters. The following exception displays when running the .NET client for a web service:

System.InvalidOperationException: Method AnnuityInteropService.wsListAnnuityByHolder cannot be reflected.
System.InvalidOperationException: There was an error reflecting wsListAnnuityByHolderResult.
System.InvalidOperationException: The Form property might not be unqualified when an explicit namespace property is available.   

The problem is exposed when the server-side method returns a Vector and the style of the WSDL file is document/literal and the Form is unqualified. The unqualified Form is always generated for the document/literal style because elementFormDefault="unqualified" by default.

A problem exists in the .NET framework that can generate a web service proxy class not valid when the web service methods contain certain arrays as parameters. The framework adds an XmlArrayAttribute attribute to the parameter, and the attribute constructor contains an "Form=Unqualified" and a namespace definition. While the attribute is valid, it is not valid to combine these two aspects of the attribute, causing the System.InvalidOperationException exception.

To avoid this problem, do not use Vector parameters in a web service method that is deployed into WebSphere Application Server. Vector parameters in a web service method do not work with a .Net client or a Java collection type.

When you run the Endpoint Enabler tool on a Hyper Threading-enabled machine, an error is reported in the Tasks view against the Enterprise Application project. The Enterprise Application project cannot be deleted until you restart the workbench.

This problem can occur if a race condition exists between the automatic build and the EJB project validator.

To resolve the problem, turn off the workbench automatic build before running the Endpoint Enabler tool, and turn it back on afterwards.

Java Specification Requests (JSR) 109 specification validation errors occur when deploying an EAR file containing a WSDL file with http, jms and ejb bindings generated by the Java2WSDL command-line tool.

The JSR 109 specification requires each port component defined in the webservices.xml deployment descriptor file to refer to unique <servlet-class> elements in web.xml file for a JavaBeans implementation, or a unique <session> element in ejb-jar.xml file for an EJB implementation. The servlet and session EJB are located in the webservices.xml file represented by <servlet-link> or <ejb-link> element.

The WSDL2Java command-line tool maps the ports found in a WSDL file to port components that are in the generated webservices.xml file. If a single web service has multiple bindings, in addition to a port for each of these bindings, the webservices.xml file contains multiple port components that should all point to the same EJB module(<session>) or JavaBeans (<servlet-class>) implementation. Because of the JSR 109 restrictions, the webservices.xml file is not valid and errors can occur during the deployment process.

The following example displays the error:

Error in <module> : CHKW6030E: Implementation class <class> referred to by port 
components<port1> and <port2>. (JSR109 1.0: 7.1.2).                            
Here is the error with sample data:
Error in WebSvcsInSession20EJB.jar : CHKW6030E: Implementation class WSMultiProtocol 
referred to by port components WSMultiProtocolJMS and WSMultiProtocolEJB.(JSR109 1.0: 7.1.2).                            

We can work around the restriction by creating multiple <session> EJB definitions within the ejb-jar.xml file that all point to the same implementation class, home interface and remote interface. We can still use the same classes, but the ejb-jar.xml file <session> definitions that reference the classes and the interfaces must be duplicated.

The following is an example of the webservices.xml file. Look for the classes and interfaces:

<webservices>   <webservice-description>     <webservice-description-name>WSMultiProtocolService</webservice-description-name>     <wsdl-file>META-INF/wsdl/WSMultiProtocol.wsdl</wsdl-file>     <jaxrpc-mapping file>META-INF/WSMultiProtocol_mapping.xml</jaxrpc-mapping file>     <port-component>       <port-component-name>WSMultiProtocolEjb</port-component-name>       <wsdl-port>         <namespaceURI>http://ejb.pli.tc.wssvt.ibm.com</namespaceURI>         <localpart>WSMultiProtocolEjb</localpart>       </wsdl-port>       <service-endpoint-interface>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol
   </service-endpoint-interface>       <service-impl-bean>         <ejb-link>WSMultiProtocol</ejb-link>       </service-impl-bean>     </port-component>     <port-component>   <port-component-name>WSMultiProtocolJMS</port-component-name>       <wsdl-port>         <namespaceURI>http://ejb.pli.tc.wssvt.ibm.com</namespaceURI>         <localpart>WSMultiProtocolJMS</localpart>       </wsdlport>       <service-endpoint-interface>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol
   </service-endpoint-interface>       <service-impl-bean>         <ejb-link>WSMultiProtocol_2</ejb-link>       </service-impl_bean>   </port-component>         <port-component>          <port-component-name>WSMultiProtocolJMS</port-component-name>       <wsdl-port>         <namespaceURI>http://ejb.pli.tc.wssvt.ibm.com</namespaceURI>         <localpart>WSMultiProtocolJMS</localpart>       </wsdlport>       <service-endpoint-interface>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol
   </service-endpoint-interface>       <service-impl-bean>         <ejb-link>WSMultiProtocol_3</ejb-link>       </service-impl_bean>   </port-component>  </webservice-description> </webservices> 
The following is an example of the ejb-jar.xml file. Look for the classes and interfaces, and how they are duplicated:
<ejb-jar-id="ejb-jar_ID">  <display-name>WebSvcsInsSession20EJB</display-name>  <enterprise-beans>   <session-id="WSMultiProtocol">    <ejb-name>WSMultiProtocol</ejb-name>    <home>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolHome</home>    <remote>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol</remote>    <ejb-class>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolWebSvcsBean</ejb-class>    <session-type>Stateless</session-type>    <transaction-type>Container</transaction-type>    <ejb-ref-id="EjbRef_1082407586720">     <description></description>     <ejb-ref-name>ejb/BeneficiarySession</ejb-ref-name>     <ejb-ref-type>Session</ejb-ref-type>     <home>com.ibm.wssvt.tc.pli.ejb.BeneficiarySessionHome</home>     <remote>com.ibm.wssvt.tc.pli.ejb.BeneficiarySession</remote>     <ejb-link>PolicySession20EJB.jar#BeneficiarySession</ejb-link>    </ejb-ref>    <ejb-ref-id="EjbRef_1082407586790">     <description></description>     <ejb-ref-name>ejb/PolicySession</ejb-ref-name>     <ejb-ref-type>Session</ejb-ref-type>     <home>com.ibm.wssvt.tc.pli.ejb.PolicySessionHome</home>     <remote>com.ibm.wssvt.tc.pli.ejb.PolicySession</remote>     <ejb-link>PolicySession20EJB.jar#PolicySession</ejb-link>    </ejb-ref>   
  
  <session-id="WSMultiProtocol_2">    <ejb-name>WSMultiProtocol_2</ejb-name>    <home>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolHome</home>    <remote>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol</remote>    <ejb-class>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolWebSvcsBean</ejb-class>    <session-type>Stateless</session-type>    <transaction-type>Container</transaction-type>    <ejb-ref-id="EjbRef_1082407586720_2">     <description></description>     <ejb-ref-name>ejb/BeneficiarySession</ejb-ref-name>     <ejb-ref-type>Session</ejb-ref-type>     <home>com.ibm.wssvt.tc.pli.ejb.BeneficiarySessionHome</home>     <remote>com.ibm.wssvt.tc.pli.ejb.BeneficiarySession</remote>     <ejb-link>PolicySession20EJB.jar#BeneficiarySession</ejb-link>    </ejb-ref>    <ejb-ref-id="EjbRef_1082407586790_2">     <description></description>     <ejb-ref-name>ejb/PolicySession</ejb-ref-name>     <ejb-ref-type>Session</ejb-ref-type>     <home>com.ibm.wssvt.tc.pli.ejb.PolicySessionHome</home>     <remote>com.ibm.wssvt.tc.pli.ejb.PolicySession</remote>     <ejb-link>PolicySession20EJB.jar#PolicySession</ejb-link>    </ejb-ref>   
  
  <session-id="WSMultiProtocol_3">    <ejb-name>WSMultiProtocol_3</ejb-name>    <home>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolHome</home>    <remote>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol</remote>    <ejb-class>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolWebSvcsBean</ejb-class>    <session-type>Stateless</session-type>    <transaction-type>Container</transaction-type>    <ejb-ref-id="EjbRef_1082407586790_3">     <description></description>     <ejb-ref-name>ejb/BeneficiarySession</ejb-ref-name>     <ejb-ref-type>Session</ejb-ref-type>     <home>com.ibm.wssvt.tc.pli.ejb.BeneficiarySessionHome</home>     <remote>com.ibm.wssvt.tc.pli.ejb.BeneficiarySession</remote>     <ejb-link>PolicySession20EJB.jar#BeneficiarySession</ejb-link>    </ejb-ref>    <ejb-ref-id="EjbRef_1082407586790_3">     <description></description>     <ejb-ref-name>ejb/PolicySession</ejb-ref-name>     <ejb-ref-type>Session</ejb-ref-type>     <home>com.ibm.wssvt.tc.pli.ejb.PolicySessionHome</home>     <remote>com.ibm.wssvt.tc.pli.ejb.PolicySession</remote>     <ejb-link>PolicySession20EJB.jar#PolicySession</ejb-link>    </ejb-ref>   </session>

If an application uses functions provided by a particular fix and you remove the fix, the application displays an error message. If you remove a fix, make sure that you retest the applications to check for errors. Redeploy any applications that display an error message because of the missing fix.

For example, suppose you install a fix pack on WAS and you create the stock quote web service, StockQuote. The WSDL2Java command-line tool is used in a deployer role and generates a ServiceLocator class that extends the AgnosticService class.

If you uninstall the fix pack, the application is using a new web services class (AgnosticService) the version of WAS does not support. The application creates the following error:

java.lang.NoClassDefFoundError:
 Error while defining class:
 com.ibm.ws.wsfvt.test.stockquote.StockQuoteServiceLocator
 This error indicates the class:
 com.ibm.webservices.multiprotocol.AgnosticService
 could not be located  while defining the class:
 com.ibm.ws.wsfvt.test.stockquote.StockQuoteServiceLocator                               
You need to redeploy the application on the WAS to emit code that does not use the WAS version not supported by the web services class that we use.

If we use an environment that requires a proxy server to access the Internet during the run of the WSDL2Java command, the WSDL2Java command might not find the Internet information because the proxy server has the potential to time out. For example, if the input WSDL file is located on the Internet instead of a local drive, and you need to retrieve it from the Internet, the WSDL2Java command fails to find the file because the proxy server times out.

We can work around this problem by editing the WSDL2Java.bat file when using a Windows operating system or the WSDL2Java.sh file if you are using a Linux or AIX operating system. These files are located in the <install_root>/WebSphere/AppServer/bin directory.

If we use a Windows operating system, set your proxy host and port values in the WSDL2Java.bat file as follows:

If we use a Linux or AIX operating system, set your proxy host and port values in the WSDL2Java.sh file as follows:

If you run the WSDL2Java command-line tool on a WSDL document containing a JMS-style endpoint web address, for example, jms:/..., the urlprotocols.jar file containing the custom protocol handler for the JMS protocol must be in the CLASSPATH variable statement. The error WSWS3099E: Error: Emitter failure. Invalid endpoint address in port <x> in service <y>: <jms-url-string> is avoided by making sure the urlprotocols.jar file is in the CLASSPATH variable statement.

To add the urlprotocols.jar file to the CLASSPATH variable statement:

On Windows platforms, edit the install_root\bin\setupCmdLine.bat file and locate the line that sets the WAS_CLASSPATH environment variable. Add %install_root%\lib\urlprotocols.jar to the end of the line that sets the WAS_CLASSPATH environment variable.

On Linux, AIX, HP-UX, and Solaris operating systems, edit the install_root/bin/setupCmdLine.sh file and add $install_root/lib/urlprotocols.jar to the end of the line that sets the WAS_CLASSPATH environment variable.

Make sure to use the proper deliminator character for the platform, for example, use a semicolon (;) for Windows platforms and a colon (:) for Linux, AIX, HP-UX, and Solaris operating systems.


Related concepts:

Development and assembly tools


Related


Troubleshooting web services


Reference:

WSDL2Java command for JAX-RPC applications
Java2WSDL command for JAX-RPC applications
Web services specifications and APIs


+

Search Tips   |   Advanced Search