[
https://issues.apache.org/jira/browse/DOSGI-55?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834662#action_12834662
]
Matt Inger commented on DOSGI-55:
---------------------------------
I've done some debugging, and this seems to be some sort of classloading issue
going on here. In particular, this particular method in the
{code}org.apache.cxf.jaxws.support.JaxWsServiceConfiguration{code}
class seems to be having issues
{code}
public Boolean isWebMethod(final Method method) {
if (method == null
|| method.getReturnType().equals(Future.class)
|| method.getReturnType().equals(Response.class)
|| method.isSynthetic()) {
return Boolean.FALSE;
}
WebMethod wm = method.getAnnotation(WebMethod.class);
if (wm != null) {
if (wm.exclude()) {
return Boolean.FALSE;
} else {
return Boolean.TRUE;
}
}
if (method.getDeclaringClass().isInterface()) {
return hasWebServiceAnnotation(method);
}
if (implInfo.getSEIClass() == null) {
return hasWebServiceAnnotation(method);
}
return
implInfo.getSEIClass().isAssignableFrom(method.getDeclaringClass());
}
{code}
Specifically, the parts that are looking for the annotations. Take for
instance, the line:
{code}WebMethod wm = method.getAnnotation(WebMethod.class);{code}
Via the debugger, i have verified that the method in question has the
approperiate WebMethod annotation, however, the result of the call above is a
null value, which leads me to believe that the class
loader which is loading the service interface is loading it's own instance of
the javax.jws.WebMethod class. That is getting compared with an instance
loaded by same classloader as the JaxWsServiceConfiguration
class. Since the two classes, though code identical, are located at two
different addresses, they are considered two different classes. As a result,
the method above doesn't believe there are any proper
annotations on the service interface.
I'm not exactly sure why this would be happening as dosgi bundle should be my
only installed bundle with a jaxws implementation, though i will look into
verifying that.
> JAX-WS Frontend generating WSDL with no operations or types
> -----------------------------------------------------------
>
> Key: DOSGI-55
> URL: https://issues.apache.org/jira/browse/DOSGI-55
> Project: CXF Distributed OSGi
> Issue Type: Bug
> Affects Versions: 1.1
> Reporter: Matt Inger
>
> I've setup a web service interface and implementation with the proper
> annotations (@WebService, @WebMethod, @WebParam) and so forth, and deployed
> the dosgi singlebundle distribution into spring dmServer 2.0. When setup for
> the simple frontend with jaxb bindings, I get a somewhat ok result, though
> the generated wsdl exceptions a message payload like this:
> {code}<ns1:addWidget><widgetData>...<widgetData></ns1:addWidget>{code}
> Obviously this is not optimal, so i decided to switch to JAX-WS, and added
> the appropriate package imports in my manifest:
> {code}
> @WebService
> public interface WidgetService {
> @WebMethod
> void addWidget(@WebParam(name="widgetData") WidgetData widgetData);
> }
> {code}
> {code}
> <osgi.import.package>
> javax.jws,
> javax.jws.soap,
> javax.xml.bind.annotation,
> javax.xml.bind.annotation.adapters,
> ...
> </osgi.import.package>
> {code}
> and then set the front end to use jaxws:
> {code}
> <osgi:service ref="WidgetWebService"
> interface="com.fiberlink.service.widget.web.api.WidgetWebService">
> <osgi:service-properties>
> <entry key="service.exported.interfaces"
> value="com.fiberlink.service.widget.web.api.WidgetWebService" />
> <entry key="service.exported.configs" value="org.apache.cxf.ws" />
> <entry key="org.apache.cxf.ws.frontend" value="jaxws" />
> <entry key="org.apache.cxf.ws.databinding" value="jaxb" />
> <entry key="org.apache.cxf.ws.address"
> value="http://localhost:9090/widget" />
> </osgi:service-properties>
> </osgi:service>
> {code}
> I would have expected a proper WSDL to be generated which wanted a payload
> like this:
> {code}<ns1:addWidget><widgetData>...<widgetData></ns1:addWidget>{code}
> However, what I got from the WSDL was this. Posts I have googled on
> indicated there might be something wrong with singlebundle distribution, but
> the links to the solution are expired, and i've had no luck getting the
> multibundle distribution working. Everytime I try to deploy a webservice
> using the multi-bundle distro, it never ends up deploying anything on the
> requested port #. Same with the 1.2 SNAPSHOT version as well. Seems I'm
> running into roadblocks everywhere.
> {code}
> <wsdl:definitions name="WidgetWebServiceService"
> targetNamespace="http://api.web.widget.service.fiberlink.com/"
> xmlns:ns1="http://schemas.xmlsoap.org/soap/http"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:tns="http://api.web.widget.service.fiberlink.com/"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <wsdl:portType name="WidgetWebService">
> </wsdl:portType>
> <wsdl:binding name="WidgetWebServiceServiceSoapBinding"
> type="tns:WidgetWebService">
> <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http" />
> </wsdl:binding>
> <wsdl:service name="WidgetWebServiceService">
> <wsdl:port binding="tns:WidgetWebServiceServiceSoapBinding"
> name="WidgetWebServicePort">
> <soap:address location="http://localhost:9090/widget" />
> </wsdl:port>
> </wsdl:service>
> </wsdl:definitions>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.