4 Replies Latest reply on Nov 13, 2007 4:31 PM by Chris Laprun

    Warning with ServiceObjectFactory with jbossws-native-2.0.1.

    Chris Laprun Master

       

      WARN [org.jboss.ws.core.client.ServiceObjectFactory] Unable to narrow port selection for
      UnifiedPortComponentRef
       serviceEndpointInterface=org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType
       portQName=null
       enableMTOM=false
       portComponentLink=null
       callProperties=[]
       stubProperties=[]
       configName=null
       configFile=null


      what does that mean and how can I fix it?

        • 1. Re: Warning with ServiceObjectFactory with jbossws-native-2.
          Thomas Diesler Master

          Service.getPort(SEI) must be able to retrieve a distinct port definition. Please show us your <service-ref> definitions

           /**
           * Narrow available endpoints by <port-component-ref> declarations.
           * Service.getPort(SEI) must be able to retrieve a distinct port definition.
           */
           protected void narrowPortSelection(UnifiedServiceRefMetaData serviceRef, ServiceMetaData serviceMetaData)
           {
           if (serviceMetaData.getEndpoints().size() > 1)
           {
           Map<String, UnifiedPortComponentRefMetaData> pcrefs = new HashMap<String, UnifiedPortComponentRefMetaData>();
           for (UnifiedPortComponentRefMetaData pcref : serviceRef.getPortComponentRefs())
           {
           String seiName = pcref.getServiceEndpointInterface();
          
           // Constraint#1: within a service-ref it's not allowed to use a SEI across different pcref's
           if (pcrefs.get(seiName) != null)
           throw new WSException("Within a <service-ref> it's not allowed to use a SEI across different <port-component-ref>'s: " + seiName);
          
           pcrefs.put(seiName, pcref);
           }
          
           // Constraint#2: A pcref may only match one EndpointMetaData
           for (String sei : pcrefs.keySet())
           {
           // Narrow available endpoints by port-component-ref declaration
           List<QName> narrowedEndpoints = new ArrayList<QName>();
          
           UnifiedPortComponentRefMetaData pcref = pcrefs.get(sei);
          
           // Constraint#3: Port selection only applies when both SEI and QName are given
           if (pcref.getServiceEndpointInterface() != null && pcref.getPortQName() != null)
           {
           List<QName> pcRef2EndpointMapping = new ArrayList<QName>();
           for (EndpointMetaData epMetaData : serviceMetaData.getEndpoints())
           {
           if (pcref.getServiceEndpointInterface().equals(epMetaData.getServiceEndpointInterfaceName()))
           {
           pcRef2EndpointMapping.add(epMetaData.getPortName());
           }
           }
          
           for (QName q : pcRef2EndpointMapping)
           {
           EndpointMetaData mappedEndpoint = serviceMetaData.getEndpoint(q);
           if (!pcref.getPortQName().equals(mappedEndpoint.getPortName()))
           narrowedEndpoints.add(q);
           }
          
           // Constraint: Dont exclude all of them ;)
           if (pcRef2EndpointMapping.size() > 0 && (pcRef2EndpointMapping.size() == narrowedEndpoints.size()))
           throw new WSException("Failed to narrow available endpoints by <port-component-ref> declaration");
          
           for (QName q : narrowedEndpoints)
           {
           EndpointMetaData removed = serviceMetaData.removeEndpoint(q);
           log.debug("Narrowed endpoint " + q + "(" + removed + ")");
           }
           }
           else
           {
           // TODO: In case there is more then one EMPD this should cause an exception
           log.warn("Unable to narrow port selection for " + pcref);
           }
           }
           }
           }
          


          • 2. Re: Warning with ServiceObjectFactory with jbossws-native-2.
            Chris Laprun Master

             

            "thomas.diesler@jboss.com" wrote:
            Service.getPort(SEI) must be able to retrieve a distinct port definition. Please show us your <service-ref> definitions


            Yes, I figured as much (I looked at that source code as well) but I wasn't quite sure what was wrong in my service definition:

            <service-ref>
             <service-ref-name>service/ServiceDescriptionService</service-ref-name>
             <service-interface>javax.xml.rpc.Service</service-interface>
             <wsdl-file>META-INF/wsdl/wsrp_services.wsdl</wsdl-file>
             <jaxrpc-mapping-file>META-INF/jaxrpc-mappings.xml</jaxrpc-mapping-file>
             <port-component-ref>
             <service-endpoint-interface>org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType</service-endpoint-interface>
             </port-component-ref>
             </service-ref>


            I have four of them all similar to this one. I didn't include any handler definition here.

            • 3. Re: Warning with ServiceObjectFactory with jbossws-native-2.
              Thomas Diesler Master

              If they are all similar they must be disambiguated using the port qname for example

              • 4. Re: Warning with ServiceObjectFactory with jbossws-native-2.
                Chris Laprun Master

                There's only one service definition in my WSDL though. Do I still need to use service-qname?

                <wsdl:definitions targetNamespace="urn:oasis:names:tc:wsrp:v1:wsdl"
                 xmlns:bind="urn:oasis:names:tc:wsrp:v1:bind"
                 xmlns="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                 xmlns:intf="urn:oasis:names:tc:wsrp:v1:intf"
                 xmlns:tns="urn:oasis:names:tc:wsrp:v1:wsdl">
                
                 <import namespace="urn:oasis:names:tc:wsrp:v1:bind" location="wsrp_v1_bindings.wsdl"/>
                
                 <wsdl:service name="WSRPService">
                 <wsdl:port binding="bind:WSRP_v1_Markup_Binding_SOAP" name="WSRPMarkupService">
                 <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
                 </wsdl:port>
                
                 <wsdl:port binding="bind:WSRP_v1_ServiceDescription_Binding_SOAP" name="WSRPServiceDescriptionService">
                 <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
                 </wsdl:port>
                
                 <wsdl:port binding="bind:WSRP_v1_Registration_Binding_SOAP" name="WSRPRegistrationService">
                 <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
                 </wsdl:port>
                
                 <wsdl:port binding="bind:WSRP_v1_PortletManagement_Binding_SOAP" name="WSRPPortletManagementService">
                 <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
                 </wsdl:port>
                 </wsdl:service>
                </wsdl:definitions>