<mapped-name> in <service-ref> required but not legal?
georgesberscheid Oct 2, 2006 9:58 AMHi,
I'm trying to reference a web service endpoint from an EJB. Since the @WebServiceRef annotation is not yet available in EJB3 RC9 I want to use <service-ref> in ejb-jar.xml:
<service-ref> <service-ref-name>service/myWebService</service-ref-name> <service-interface>com.foo.bar.MyWebService</service-interface> <wsdl-file>META-INF/WebService.wsdl</wsdl-file> <jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file> <port-component-ref> <service-endpoint-interface>com.foo.bar.MyWebServiceEndpoint</service-endpoint-interface> </port-component-ref> </service-ref>
This works nicely when included in the web.xml file of a servlet, but when included in the ejb-jar.xml I get the following exception during deployment:
java.lang.RuntimeException: mapped-name is required for <service-ref> service/myWebService of MyStatelessBean at org.jboss.injection.WebServiceHandler.loadXml(WebServiceHandler.java:48) at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:268) at org.jboss.ejb3.SessionContainer.processMetadata(SessionContainer.java:116) at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:273)
Now, that error message seems pretty clear, however if I add a <mapped-name> tag in <service-ref> (as it's possible in a <resource-ref>) deployment fails with the following exception:
org.jboss.xb.binding.JBossXBException: Failed to parse source: cvc-complex-type.2.4.a: Invalid content was found starting with element 'mapped-name'. One of '{"http://java.sun.com/xml/ns/j2ee":service-qname, "http://java.sun.com/xml/ns/j2ee":port-component-ref, "http://java.sun.com/xml/ns/j2ee":handler}' is expected. @ *unknown*[17,18] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:156) at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:169) at org.jboss.ejb3.metamodel.EjbJarDDObjectFactory.parse(EjbJarDDObjectFactory.java:87) at org.jboss.ejb3.Ejb3HandlerFactory$DDFactory.<init>(Ejb3HandlerFactory.java:44)
What am I supposed to do?
Thanks