1 Reply Latest reply on May 29, 2006 8:55 PM by Suman Grandhi

    Cannot find port in wsdl

    x x Newbie

      as I deploy my application with web services, I get the following error:

      org.jboss.ws.WSException: Cannot find port in wsdl: {http://myhost/myapp/}MyPort
       at org.jboss.ws.metadata.JSR109ServerMetaDataBuilder.buildMetaData(JSR109ServerMetaDataBuilder.java:141)
       at org.jboss.ws.server.WebServiceDeployerJSE.createWebServicesMetaData(WebServiceDeployerJSE.java:187)
       at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:103)
       at org.jboss.ws.server.WebServiceDeployerJSE.create(WebServiceDeployerJSE.java:65)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy40.create(Unknown Source)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
       at org.jboss.deployment.MainDeployer.create(MainDeployer.java:943)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
       at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:260)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
       at $Proxy8.deploy(Unknown Source)
       at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
       at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:504)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:218)
       at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:197)
      
      


      My Webservices.xml:

      <webservices 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://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd" version="1.1">
       <webservice-description>
       <webservice-description-name>MyService</webservice-description-name>
       <wsdl-file>WEB-INF/wsdl/MyWsdl.wsdl</wsdl-file>
       <jaxrpc-mapping-file>WEB-INF/mapping.xml</jaxrpc-mapping-file>
       <port-component>
       <port-component-name>MyService</port-component-name>
       <wsdl-port>MyPort</wsdl-port>
       <service-endpoint-interface>mypack.MyInterface</service-endpoint-interface>
      
       <service-impl-bean>
       <servlet-link>MyBean</servlet-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
      </webservices>
      


      How I fix this error?
      Thank you.

        • 1. Re: Cannot find port in wsdl
          Suman Grandhi Newbie

          I ran into a similar problem when moving from 4.0.4RC1 to the new 4.0.4GA whihc uses JBossWS. I don't know if you used WSTools or not to generate your wsdl, mapping and webservices.xml file. But three is a small difference between the webservice.xml that is generated from JBossWS wiht WSTools and what you formerly are used to with AXIS/JWSDP. But the main problem here is that your port should be fully qualified.

          Try adding the additions in red below.

          <webservices xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:impl='TARGET-NAMESPACE FROM CONFIG.XML FILE'
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd" version="1.1">
          <webservice-description>
          <webservice-description-name>MyService</webservice-description-name>
          <wsdl-file>WEB-INF/wsdl/MyWsdl.wsdl</wsdl-file>
          <jaxrpc-mapping-file>WEB-INF/mapping.xml</jaxrpc-mapping-file>
          <port-component>
          <port-component-name>MyService</port-component-name>
          <wsdl-port>impl:MyPort</wsdl-port>
          <service-endpoint-interface>mypack.MyInterface</service-endpoint-interface>

          <service-impl-bean>
          <servlet-link>MyBean</servlet-link>
          </service-impl-bean>
          </port-component>
          </webservice-description>


          The target namespace addition in red is the value of the attibute targetNamespace (for jwsdp/axis/wscompile) or target-namespace (if using WSTools) you used in your config.xml file when generating the wsdl and mapping files.

          I hope this works for you.