You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jblack <jb...@gestalt-llc.com> on 2008/04/22 18:33:06 UTC

Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

I am using the example code from the link below as a reference, but the
webapp fails to initialize with the a stack trace.
http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/ 

I also found a number of examples where the @Webservice annotation has
multiple combinations of the attributes in question, so I'm looking for some
definitive help.

I tried using cxf 2.0.2-incubator, 2.0.4-incubator, 2.0.5-incubator all with
the same issue (on Tomcat 6.0.16).


Apr 22, 2008 11:29:23 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Apr 22, 2008 11:29:28 AM org.apache.catalina.core.StandardContext
listenerStart
SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'userAdd': Invocation of init method failed; nested exception is
javax.xml.ws.WebServiceException: Attributes portName, serviceName and
endpointInterface are not allowed in the @WebService annotation of an SEI.
Caused by: javax.xml.ws.WebServiceException: Attributes portName,
serviceName and endpointInterface are not allowed in the @WebService
annotation of an SEI.
	at
org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplementorInfo.java:291)
	at
org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplementorInfo.java:57)
	at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:253)
	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232)
	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:183)


-- 
View this message in context: http://www.nabble.com/Attributes-portName%2C-serviceName-and-endpointInterface-are-not-allowed-in-the-%40WebService-annotation-tp16824963p16824963.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

Posted by Ian Roberts <i....@dcs.shef.ac.uk>.
jblack wrote:
> I am using the example code from the link below as a reference, but the
> webapp fails to initialize with the a stack trace.
> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/ 
> 
> I also found a number of examples where the @Webservice annotation has
> multiple combinations of the attributes in question, so I'm looking for some
> definitive help.

The serviceName, targetNamespace, portName, etc. belong on the 
@WebService annotation on the interface.  The implementation class 
should just have @WebService(endpointInterface = "interfacename").

Ian

-- 
Ian Roberts               | Department of Computer Science
i.roberts@dcs.shef.ac.uk  | University of Sheffield, UK

Re: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

Posted by Daniel Kulp <dk...@apache.org>.
As Ian and Glen pointed out, some of the attributes on @WebService are 
only allowed on the SEI interface and others are only allowed on the 
implementation.   

IMO, it's kind of bogus.  If certain attributes are only allowed in 
certain areas, they should have had separate annotations for the SEI 
compared with the impl, but that's definitely out of our hands.   That's 
a JWS spec issue.

Dan


On Tuesday 22 April 2008, jblack wrote:
> I am using the example code from the link below as a reference, but
> the webapp fails to initialize with the a stack trace.
> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
>
> I also found a number of examples where the @Webservice annotation has
> multiple combinations of the attributes in question, so I'm looking
> for some definitive help.
>
> I tried using cxf 2.0.2-incubator, 2.0.4-incubator, 2.0.5-incubator
> all with the same issue (on Tomcat 6.0.16).
>
>
> Apr 22, 2008 11:29:23 AM org.apache.catalina.core.ApplicationContext
> log INFO: Initializing Spring root WebApplicationContext
> Apr 22, 2008 11:29:28 AM org.apache.catalina.core.StandardContext
> listenerStart
> SEVERE: Exception sending context initialized event to listener
> instance of class
> org.springframework.web.context.ContextLoaderListener
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'userAdd': Invocation of init method failed;
> nested exception is javax.xml.ws.WebServiceException: Attributes
> portName, serviceName and endpointInterface are not allowed in the
> @WebService annotation of an SEI. Caused by:
> javax.xml.ws.WebServiceException: Attributes portName, serviceName and
> endpointInterface are not allowed in the @WebService annotation of an
> SEI.
> 	at
> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImpl
>ementorInfo.java:291) at
> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplemen
>torInfo.java:57) at
> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:253) at
> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232) at
> org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:183)



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 22 April 2008, jblack4 wrote:
> Got it.  I was actually going in the java -> wsdl direction.
> Since the spec says those 3 attributes are optional, I just dropped
> them all (no longer in SEI or SEI implementation).  Now it just works.
>
> I have not seen an examples setup like this, using a bare @Webservice,
> nor do I know any future ramifications of doing so.  For now, this is
> the direction we are going.

The only real ramification is that the "defaults" are not always ideal 
and sometime result in funny wsdls for the ?wsdl generated wsld.   For 
example, if the interface and the impl are in different packages, they 
would get different namespaces and thus you have a wsdl for the service 
that has to import the wsdl for the portType.    For the most part, the 
defaults work fine, but double check the ?wsdl to make sure it looks OK.

Dan


>
> Glen Mazza wrote:
> > You're placing those attributes in the SEI (service endpoint
> > interface, which is autogenerated by wsdl2java), which is
> > incorrect--they are supposed to go with the SEI *implementation*
> > (the class that implements it).
> >
> > See sample here: 
> > http://www.jroller.com/gmazza/date/20080417#WFstep6
> >
> > "DoubleItPortTypeImpl" is the SEI impl, the autogenerated
> > "DoubleItPortType" is the SEI.
> >
> > HTH,
> > Glen
> >
> > jblack4 wrote:
> >> I am using the example code from the link below as a reference, but
> >> the webapp fails to initialize with the a stack trace.
> >> 
> >> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
> >> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
> >>
> >> I also found a number of examples where the @Webservice annotation
> >> has multiple combinations of the attributes in question, so I'm
> >> looking for some definitive help.
> >>
> >> I tried using cxf 2.0.2-incubator, 2.0.4-incubator, 2.0.5-incubator
> >> all with the same issue (on Tomcat 6.0.16).
> >>
> >>
> >> Apr 22, 2008 11:29:23 AM
> >> org.apache.catalina.core.ApplicationContext log INFO: Initializing
> >> Spring root WebApplicationContext
> >> Apr 22, 2008 11:29:28 AM org.apache.catalina.core.StandardContext
> >> listenerStart
> >> SEVERE: Exception sending context initialized event to listener
> >> instance of class
> >> org.springframework.web.context.ContextLoaderListener
> >> org.springframework.beans.factory.BeanCreationException: Error
> >> creating bean with name 'userAdd': Invocation of init method
> >> failed; nested exception is javax.xml.ws.WebServiceException:
> >> Attributes portName, serviceName and endpointInterface are not
> >> allowed in the @WebService annotation of an SEI.
> >> Caused by: javax.xml.ws.WebServiceException: Attributes portName,
> >> serviceName and endpointInterface are not allowed in the
> >> @WebService annotation of an SEI.
> >> 	at
> >> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsI
> >>mplementorInfo.java:291) at
> >> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImple
> >>mentorInfo.java:57) at
> >> org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:253)
> >> at
> >> org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232)
> >> at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:183)



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

Posted by jblack4 <th...@accenture.com>.
Got it.  I was actually going in the java -> wsdl direction.
Since the spec says those 3 attributes are optional, I just dropped them all
(no longer in SEI or SEI implementation).  Now it just works.

I have not seen an examples setup like this, using a bare @Webservice, nor
do I know any future ramifications of doing so.  For now, this is the
direction we are going.



Glen Mazza wrote:
> 
> You're placing those attributes in the SEI (service endpoint interface,
> which is autogenerated by wsdl2java), which is incorrect--they are
> supposed to go with the SEI *implementation* (the class that implements
> it).
> 
> See sample here:  http://www.jroller.com/gmazza/date/20080417#WFstep6 
> 
> "DoubleItPortTypeImpl" is the SEI impl, the autogenerated
> "DoubleItPortType" is the SEI.
> 
> HTH,
> Glen
> 
> 
> jblack4 wrote:
>> 
>> I am using the example code from the link below as a reference, but the
>> webapp fails to initialize with the a stack trace.
>>  http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
>> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/ 
>> 
>> I also found a number of examples where the @Webservice annotation has
>> multiple combinations of the attributes in question, so I'm looking for
>> some definitive help.
>> 
>> I tried using cxf 2.0.2-incubator, 2.0.4-incubator, 2.0.5-incubator all
>> with the same issue (on Tomcat 6.0.16).
>> 
>> 
>> Apr 22, 2008 11:29:23 AM org.apache.catalina.core.ApplicationContext log
>> INFO: Initializing Spring root WebApplicationContext
>> Apr 22, 2008 11:29:28 AM org.apache.catalina.core.StandardContext
>> listenerStart
>> SEVERE: Exception sending context initialized event to listener instance
>> of class org.springframework.web.context.ContextLoaderListener
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'userAdd': Invocation of init method failed; nested
>> exception is javax.xml.ws.WebServiceException: Attributes portName,
>> serviceName and endpointInterface are not allowed in the @WebService
>> annotation of an SEI.
>> Caused by: javax.xml.ws.WebServiceException: Attributes portName,
>> serviceName and endpointInterface are not allowed in the @WebService
>> annotation of an SEI.
>> 	at
>> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplementorInfo.java:291)
>> 	at
>> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplementorInfo.java:57)
>> 	at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:253)
>> 	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232)
>> 	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:183)
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Attributes-portName%2C-serviceName-and-endpointInterface-are-not-allowed-in-the-%40WebService-annotation-tp16824963p16826254.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

Posted by jblack <jb...@gestalt-llc.com>.
Got it.  I was actually going in the java -> wsdl direction.
Since the spec says those 3 attributes are optional, I just dropped them all
(no longer in SEI or SEI implementation).  Now it just works.

I have not seen an examples setup like this, using a bare @Webservice, nor
do I know any future ramifications of doing so.  For now, this is the
direction we are going.




Glen Mazza wrote:
> 
> You're placing those attributes in the SEI (service endpoint interface,
> which is autogenerated by wsdl2java), which is incorrect--they are
> supposed to go with the SEI *implementation* (the class that implements
> it).
> 
> See sample here:  http://www.jroller.com/gmazza/date/20080417#WFstep6 
> 
> "DoubleItPortTypeImpl" is the SEI impl, the autogenerated
> "DoubleItPortType" is the SEI.
> 
> HTH,
> Glen
> 
> 
> jblack4 wrote:
>> 
>> I am using the example code from the link below as a reference, but the
>> webapp fails to initialize with the a stack trace.
>>  http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
>> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/ 
>> 
>> I also found a number of examples where the @Webservice annotation has
>> multiple combinations of the attributes in question, so I'm looking for
>> some definitive help.
>> 
>> I tried using cxf 2.0.2-incubator, 2.0.4-incubator, 2.0.5-incubator all
>> with the same issue (on Tomcat 6.0.16).
>> 
>> 
>> Apr 22, 2008 11:29:23 AM org.apache.catalina.core.ApplicationContext log
>> INFO: Initializing Spring root WebApplicationContext
>> Apr 22, 2008 11:29:28 AM org.apache.catalina.core.StandardContext
>> listenerStart
>> SEVERE: Exception sending context initialized event to listener instance
>> of class org.springframework.web.context.ContextLoaderListener
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'userAdd': Invocation of init method failed; nested
>> exception is javax.xml.ws.WebServiceException: Attributes portName,
>> serviceName and endpointInterface are not allowed in the @WebService
>> annotation of an SEI.
>> Caused by: javax.xml.ws.WebServiceException: Attributes portName,
>> serviceName and endpointInterface are not allowed in the @WebService
>> annotation of an SEI.
>> 	at
>> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplementorInfo.java:291)
>> 	at
>> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplementorInfo.java:57)
>> 	at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:253)
>> 	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232)
>> 	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:183)
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Attributes-portName%2C-serviceName-and-endpointInterface-are-not-allowed-in-the-%40WebService-annotation-tp16824963p16826252.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Attributes portName, serviceName and endpointInterface are not allowed in the @WebService annotation

Posted by Glen Mazza <gl...@gmail.com>.
You're placing those attributes in the SEI (service endpoint interface, which
is autogenerated by wsdl2java), which is incorrect--they are supposed to go
with the SEI *implementation* (the class that implements it).

See sample here:  http://www.jroller.com/gmazza/date/20080417#WFstep6 

"DoubleItPortTypeImpl" is the SEI impl, the autogenerated "DoubleItPortType"
is the SEI.

HTH,
Glen


jblack4 wrote:
> 
> I am using the example code from the link below as a reference, but the
> webapp fails to initialize with the a stack trace.
>  http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/
> http://www.lumidant.com/blog/web-services-tutorial-with-apache-cxf/ 
> 
> I also found a number of examples where the @Webservice annotation has
> multiple combinations of the attributes in question, so I'm looking for
> some definitive help.
> 
> I tried using cxf 2.0.2-incubator, 2.0.4-incubator, 2.0.5-incubator all
> with the same issue (on Tomcat 6.0.16).
> 
> 
> Apr 22, 2008 11:29:23 AM org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring root WebApplicationContext
> Apr 22, 2008 11:29:28 AM org.apache.catalina.core.StandardContext
> listenerStart
> SEVERE: Exception sending context initialized event to listener instance
> of class org.springframework.web.context.ContextLoaderListener
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'userAdd': Invocation of init method failed; nested
> exception is javax.xml.ws.WebServiceException: Attributes portName,
> serviceName and endpointInterface are not allowed in the @WebService
> annotation of an SEI.
> Caused by: javax.xml.ws.WebServiceException: Attributes portName,
> serviceName and endpointInterface are not allowed in the @WebService
> annotation of an SEI.
> 	at
> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.initialise(JaxWsImplementorInfo.java:291)
> 	at
> org.apache.cxf.jaxws.support.JaxWsImplementorInfo.<init>(JaxWsImplementorInfo.java:57)
> 	at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:253)
> 	at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:232)
> 	at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:183)
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Attributes-portName%2C-serviceName-and-endpointInterface-are-not-allowed-in-the-%40WebService-annotation-tp16824963p16825362.html
Sent from the cxf-user mailing list archive at Nabble.com.