users@glassfish.java.net

Re: Injection of ref to EJB fails

From: <glassfish_at_javadesktop.org>
Date: Thu, 22 Mar 2007 07:32:04 PST

Hi Ken

Thanks a lot for your very valuable help. I finally moved to deploying all ejb-jar inside one single .ear file, and now everything is working fine.

My next problem is then now, I need to add a new SessionBean that will expose its methods through webservice. The WSDL file is imposed, so I use wsimport to create the artifacts, then create an EJB class to implement the Port I need, package and deploy everything.

If I declare my EJB class as:

@Stateless
@WebService(endpointInterface="net.sourceforge.limbs.wsdl.harvestprotocol.HarvestPortType")
public class HarvestManagerBean implements HarvestPortType {

then, when deploying, the verifier gives an error in GlassFish saying that:
 Test Name : tests.webservices.WSDLFileCheck
         Test Assertion : The wsdl-file element specifies a location of the WSDL description of a set of Web services. The location is relative to the root of the module and must be specified by the developer. Please refer to JSR 109MR Section #5.3.2.1, #7.1.2 for further information.
         Test Description : For [ Limbs3#limbsHarvestEJB.jar#HarvestManagerBeanService#HarvestManagerBean ]
WSDL file does not exist in the archive at URI [ META-INF/wsdl/HarvestManagerBeanService.wsdl ].

so obviously, it's looking for a wsdl file called HarvestManagerBeanService.wsdl, while my wsdl file (the one that's imposed to me) is called HarvestProtocol.wsdl, in that same directory.

Now, if I declare my EJB Class as:
@Stateless
@WebService(endpointInterface="net.sourceforge.limbs.wsdl.harvestprotocol.HarvestPortType",
wsdlLocation="META-INF/wsdl/HarvestProtocol.wsdl")
public class HarvestManagerBean implements HarvestPortType {

then, deployment is successful, but in the GlassFish logs, I find:
[#|2007-03-22T16:24:51.993+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=76;_ThreadName=Thread-277;_RequestID=240a9a5b-b832-4da7-bb33-5b3f3f3ef388;|Two web services are being deployed with the same endpoint URL HarvestManagerBeanService/HarvestManagerBean; The service that gets loaded last will always be the one that is active for this URL|#]

[#|2007-03-22T16:24:52.000+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=76;_ThreadName=Thread-277;java.lang.IllegalArgumentException: java.net.MalformedURLException: no protocol: ;_RequestID=240a9a5b-b832-4da7-bb33-5b3f3f3ef388;|EJB5090: Exception in creating EJB container [java.lang.IllegalArgumentException: java.net.MalformedURLException: no protocol: ]|#]

[#|2007-03-22T16:24:52.000+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=76;_ThreadName=Thread-277;_RequestID=240a9a5b-b832-4da7-bb33-5b3f3f3ef388;|appId=Limbs3 moduleName=limbsHarvestEJB_jar ejbName=HarvestManagerBean|#]

It really looks like GlassFish is taking into account my naming for EJB and webservices. If I look at the webservices.xml generated under domains/domain1/generated/xml...., I see:

<webservice-description>
<display-name>HarvestManagerBeanService</display-name>
<webservice-description-name>HarvestManagerBeanService</webservice-description-name>
<wsdl-file>META-INF/wsdl/HarvestProtocol.wsdl</wsdl-file>
<port-component>
<port-component-name>HarvestManagerBean</port-component-name>
<wsdl-service xmlns="http://harvest.broker.limbs.org/">HarvestManagerBeanService</wsdl-service>
<wsdl-port xmlns:ns1="http://harvest.broker.limbs.org/">ns1:HarvestManagerBeanPort</wsdl-port>
<service-endpoint-interface>net.sourceforge.limbs.wsdl.harvestprotocol.HarvestPortType</service-endpoint-interface>
<service-impl-bean>
<ejb-link>HarvestManagerBean</ejb-link>
</service-impl-bean>
</port-component>
</webservice-description>

and those value do not correspond to the content of my wsdl file at all; in my wsdl, I find:
    <service name="HarvestService">
    <portType name="HarvestPortType">

which is obviously very different from the names generated above.

Would you have any idea of where the problem is? To summarize, what i need to do is to start with a WSDL file and create a new EJB to implement the corresponding methods.

Thanks again

Jean-noel
[Message sent by forum member 'jncolin' (jncolin)]

http://forums.java.net/jive/thread.jspa?messageID=209446