You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by vsv001 <ve...@gmail.com> on 2011/05/17 20:16:07 UTC

Error: Can not do a getPort on a port added via addPort()

 I am a newbie to cxf. I am seeing the error message 


ServiceDescription.updateEndpointDescription: Can not do a getPort on a port
added via addPort().  


My code is . I get the error during the getPort call.

  Service SISservice = Service.create(SIS_SERVICE_NAME);
  SISservice.addPort(SIS_PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,
_primaryServiceEndpoint);
  CWSSIC = SISservice.getPort(SIS_PORT_NAME, ICWSServiceInformation.class);	



javax.xml.ws.WebServiceException:
ServiceDescription.updateEndpointDescription: Can not do a getPort on a port
added via addPort().  PortQN:
{http://schemas.ipcommerce.com/CWS/v2.0/ServiceInformation}ServiceInfoProcessing_ICWSServiceInformation
	at
org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
	at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
	at
org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:118)
	at
org.apache.axis2.jaxws.description.impl.ServiceDescriptionImpl.updateEndpointDescription(ServiceDescriptionImpl.java:487)
	at
org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.updateEndpoint(DescriptionFactoryImpl.java:354)
	at
org.apache.axis2.jaxws.description.DescriptionFactory.updateEndpoint(DescriptionFactory.java:178)
	at
org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:556)
	at
org.apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java:479)
	at javax.xml.ws.Service.getPort(Unknown Source)


I appreciate your help.

Thank you


--
View this message in context: http://cxf.547215.n5.nabble.com/Error-Can-not-do-a-getPort-on-a-port-added-via-addPort-tp4404350p4404350.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Error: Can not do a getPort on a port added via addPort()

Posted by vsv001 <ve...@gmail.com>.
I am using cxf 2.3.4 version . 

Thank you


--
View this message in context: http://cxf.547215.n5.nabble.com/Error-Can-not-do-a-getPort-on-a-port-added-via-addPort-tp4404350p4409476.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Error: Can not do a getPort on a port added via addPort()

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Which cxf version you're using?
Freeman
On 2011-5-19, at 上午10:55, vsv001 wrote:

> Thank you.
>  I realised my mistake after i posted here. I am trying to integrate  
> cxf
> with our project.
>
>
>
>
> java.lang.NullPointerException
> 	at
> org 
> .apache.cxf.jaxb.JAXBDataBinding.createContext(JAXBDataBinding.java: 
> 559)
> 	at
> org 
> .apache 
> .cxf 
> .jaxb 
> .JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:497)
> 	at  
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java: 
> 324)
> 	at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .AbstractServiceFactoryBean 
> .initializeDataBindings(AbstractServiceFactoryBean.java:86)
> 	at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .ReflectionServiceFactoryBean 
> .buildServiceFromClass(ReflectionServiceFactoryBean.java:442)
> 	at
> org 
> .apache 
> .cxf 
> .jaxws 
> .support 
> .JaxWsServiceFactoryBean 
> .buildServiceFromClass(JaxWsServiceFactoryBean.java:680)
> 	at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .ReflectionServiceFactoryBean 
> .initializeServiceModel(ReflectionServiceFactoryBean.java:505)
> 	at
> org 
> .apache 
> .cxf 
> .service 
> .factory 
> .ReflectionServiceFactoryBean 
> .create(ReflectionServiceFactoryBean.java:242)
> 	at
> org 
> .apache 
> .cxf 
> .jaxws 
> .support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java: 
> 202)
> 	at
> org 
> .apache 
> .cxf 
> .frontend 
> .AbstractWSDLBasedEndpointFactory 
> .createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
> 	at
> org 
> .apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java: 
> 90)
> 	at
> org 
> .apache 
> .cxf 
> .frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java: 
> 144)
> 	at
> org 
> .apache 
> .cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java: 
> 133)
> 	at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:464)
> 	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:331)
> 	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:318)
> 	at javax.xml.ws.Service.getPort(Unknown Source)
> 	at SampleApplication.SampleApp.setupEndpoints(SampleApp.java:1140)
> 	at SampleApplication.SampleApp.signOnWithToken(SampleApp.java:177)
> 	at SampleApplication.main.main(main.java:35)
>
>
>
> I get this error after the same piece of code. Any pointers for  
> fixing it
> would be great. I appreciate your help.
>
> Thank You
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Error-Can-not-do-a-getPort-on-a-port-added-via-addPort-tp4404350p4408599.html
> Sent from the cxf-user mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference









Re: Error: Can not do a getPort on a port added via addPort()

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, May 18, 2011 10:55:33 PM vsv001 wrote:
> Thank you.
>   I realised my mistake after i posted here. I am trying to integrate cxf
> with our project.
> 

Can you double check that you have a jaxb-impl jar on the classpath and are 
not trying to use the JAXB impl built into the JDK?

I definitely see an issue at that line in the code that is causing the "real" 
exception to be lost. I'll get that fixed.

Dan


> 
> 
> 
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxb.JAXBDataBinding.createContext(JAXBDataBinding.java:559)
> 	at
> org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBin
> ding.java:497) at
> org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:324)
> at
> org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBin
> dings(AbstractServiceFactoryBean.java:86) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFro
> mClass(ReflectionServiceFactoryBean.java:442) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(
> JaxWsServiceFactoryBean.java:680) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServi
> ceModel(ReflectionServiceFactoryBean.java:505) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflecti
> onServiceFactoryBean.java:242) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFac
> toryBean.java:202) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
> tractWSDLBasedEndpointFactory.java:101) at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
> 	at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBea
> n.java:144) at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.jav
> a:133) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:464)
> at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:331) at
> org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:318) at
> javax.xml.ws.Service.getPort(Unknown Source)
> 	at SampleApplication.SampleApp.setupEndpoints(SampleApp.java:1140)
> 	at SampleApplication.SampleApp.signOnWithToken(SampleApp.java:177)
> 	at SampleApplication.main.main(main.java:35)
> 
> 
> 
> I get this error after the same piece of code. Any pointers for fixing it
> would be great. I appreciate your help.
> 
> Thank You
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Error-Can-not-do-a-getPort-on-a-port-added
> -via-addPort-tp4404350p4408599.html Sent from the cxf-user mailing list
> archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Error: Can not do a getPort on a port added via addPort()

Posted by vsv001 <ve...@gmail.com>.
Thank you. 
  I realised my mistake after i posted here. I am trying to integrate cxf
with our project.


  

java.lang.NullPointerException
	at
org.apache.cxf.jaxb.JAXBDataBinding.createContext(JAXBDataBinding.java:559)
	at
org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:497)
	at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:324)
	at
org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:442)
	at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:680)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:505)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:242)
	at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)
	at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
	at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
	at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:144)
	at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:133)
	at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:464)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:331)
	at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:318)
	at javax.xml.ws.Service.getPort(Unknown Source)
	at SampleApplication.SampleApp.setupEndpoints(SampleApp.java:1140)
	at SampleApplication.SampleApp.signOnWithToken(SampleApp.java:177)
	at SampleApplication.main.main(main.java:35)



I get this error after the same piece of code. Any pointers for fixing it
would be great. I appreciate your help. 

Thank You

--
View this message in context: http://cxf.547215.n5.nabble.com/Error-Can-not-do-a-getPort-on-a-port-added-via-addPort-tp4404350p4408599.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Error: Can not do a getPort on a port added via addPort()

Posted by Freeman Fang <fr...@gmail.com>.
Hi,
 From the stacktrace, you're using axis2 jaxws implementation but not  
cxf.
You need remove axis2 from your dependency and add cxf-rt-frontend- 
jaxws dependency if you're using maven pom.xml.
Or remove axis2  jar from your classpath and ensure cxf-rt-frontend- 
jaxws.jar is in the classpath.

Freeman
On 2011-5-18, at 上午2:16, vsv001 wrote:

> I am a newbie to cxf. I am seeing the error message
>
>
> ServiceDescription.updateEndpointDescription: Can not do a getPort  
> on a port
> added via addPort().
>
>
> My code is . I get the error during the getPort call.
>
>  Service SISservice = Service.create(SIS_SERVICE_NAME);
>  SISservice.addPort(SIS_PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,
> _primaryServiceEndpoint);
>  CWSSIC = SISservice.getPort(SIS_PORT_NAME,  
> ICWSServiceInformation.class);	
>
>
>
> javax.xml.ws.WebServiceException:
> ServiceDescription.updateEndpointDescription: Can not do a getPort  
> on a port
> added via addPort().  PortQN:
> {http://schemas.ipcommerce.com/CWS/v2.0/ 
> ServiceInformation}ServiceInfoProcessing_ICWSServiceInformation
> 	at
> org 
> .apache 
> .axis2 
> .jaxws 
> .ExceptionFactory.createWebServiceException(ExceptionFactory.java:173)
> 	at
> org 
> .apache 
> .axis2 
> .jaxws 
> .ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
> 	at
> org 
> .apache 
> .axis2 
> .jaxws 
> .ExceptionFactory.makeWebServiceException(ExceptionFactory.java:118)
> 	at
> org 
> .apache 
> .axis2 
> .jaxws 
> .description 
> .impl 
> .ServiceDescriptionImpl 
> .updateEndpointDescription(ServiceDescriptionImpl.java:487)
> 	at
> org 
> .apache 
> .axis2 
> .jaxws 
> .description 
> .impl 
> .DescriptionFactoryImpl.updateEndpoint(DescriptionFactoryImpl.java: 
> 354)
> 	at
> org 
> .apache 
> .axis2 
> .jaxws 
> .description 
> .DescriptionFactory.updateEndpoint(DescriptionFactory.java:178)
> 	at
> org 
> .apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java: 
> 556)
> 	at
> org 
> .apache.axis2.jaxws.spi.ServiceDelegate.getPort(ServiceDelegate.java: 
> 479)
> 	at javax.xml.ws.Service.getPort(Unknown Source)
>
>
> I appreciate your help.
>
> Thank you
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Error-Can-not-do-a-getPort-on-a-port-added-via-addPort-tp4404350p4404350.html
> Sent from the cxf-user mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
Connect at CamelOne May 24-26
The Open Source Integration Conference