users@glassfish.java.net

Re: sun-ejb-jar.xml <webservice-endpoint> gets overidden at deployment by annotation values

From: Vijay Ramachandran <Vijay.Ramachandran_at_Sun.COM>
Date: Wed, 12 Apr 2006 12:54:44 -0700

Hi Mark,

As per 109, the port-component-name is @WebService.name. If there is no
@WebService.name, then it defaults to endpoint impl class name

So if you change the <port-component-name> in sun-ejb-jar.xml to
MyHelloPortType (which is your @WebService.name), then the
endpoint-address-uri should be taken properly.

Can you please confirm if this fixes your problem ?

Thanks

Vijay

On Wed, 2006-04-12 at 12:26, Mark Hansen wrote:
> My understanding is that deployment descriptor values should overide
> annotations. However, I am experiencing the opposite behavoir in the
> following deployment.
>
> I create an EJB-WAR to deploy a web service (EJB endpoint) for the
> following class:
>
> @WebService(serviceName="MyHelloService", name="MyHelloPortType",
> portName="MyHelloServicePort")
> @Stateless(name="MyHelloEJB")
> public class Hello {
>
> public String sayHello(String s) {
> return "Hello: " + s;
>
> }
>
> }
>
>
> Here is the sun-ejb-jar.xml that I package with this class in the EJB-JAR:
>
> <sun-ejb-jar>
> <enterprise-beans>
> <ejb>
> <ejb-name>MyHelloEJB</ejb-name>
> <webservice-endpoint>
> <port-component-name>MyHelloEJB</port-component-name>
> <endpoint-address-uri>/deployssb/Hello</endpoint-address-uri>
> </webservice-endpoint>
> </ejb>
> </enterprise-beans>
> </sun-ejb-jar>
>
>
> However, when I deploy the EJB-JAR, the web service endpoint is at the
> the following URI: /MyHelloService/MyHelloPortType and, furthermore the
> following sun-ejb-jar has been generated (in the
> $GLASSFISH_HOME/glassfish/domains/domain1/generated/xml directory):
>
> <sun-ejb-jar>
> <enterprise-beans>
> <unique-id>75030031306981376</unique-id>
> <ejb>
> <ejb-name>MyHelloEJB</ejb-name>
> <pass-by-reference>false</pass-by-reference>
> <is-read-only-bean>false</is-read-only-bean>
> <refresh-period-in-seconds>-1</refresh-period-in-seconds>
> <cmt-timeout-in-seconds>0</cmt-timeout-in-seconds>
> <gen-classes/>
> <webservice-endpoint>
> <port-component-name>MyHelloPortType</port-component-name>
>
> <endpoint-address-uri>/MyHelloService/MyHelloPortType</endpoint-address-uri>
> <service-qname>
> <namespaceURI>http://samples/</namespaceURI>
> <localpart>MyHelloService</localpart>
> </service-qname>
> <debugging-enabled>true</debugging-enabled>
> </webservice-endpoint>
> </ejb>
> </enterprise-beans>
> </sun-ejb-jar>
>
> As you can see here, the endpoint-address-uri value that I provided in
> my sun-ejb-jar.xml has been overidden by a URI derived from the
> annotations. I believe that this behavior is incorrect, and that the
> endpoint-addrees-uri value provided in the original sun-ejb-jar.xml
> should overide the annotations. Otherwise, how can you specify an
> endpoint address when deploying an EJB endpoint? The only GlassFish
> mechanism for that is to use the sun-ejb-jar.xml deployment descriptor.
>
> Please let me know if I am mistaken.
>
> Thanks,
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>