geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin Sun" <linsun....@gmail.com>
Subject url-pattern issue during Axis2 integration
Date Tue, 30 Jan 2007 05:33:43 GMT
Hi there,

I have been working on one particular issue related to Axis2 integration
into Geronimo.  Basically the problem is that in the jaxws test, we had to
use /services/* as the url-pattern for the servlet:

<servlet-mapping>
        <servlet-name>cxfPojoServlet</servlet-name>
        <url-pattern>/services/*</url-pattern>
</servlet-mapping>

This is invalid per JSR 109 spec.  There are two problems here:

First, a user will have to use /services as part of the url-pattern.  After
digging into this prob, I found out that the axis2 configurationcontext
default the servicePath to 'services'.   One fix that I can think of
(without a lot of work) is to use the configurationContext.setServicePath
method to override the default 'services' value.  This looks okay to me as
we are building one configurationcontext and one axisservice per
endpointClass.

To do this, I will have to either set url-pattern for the user when none is
specified for the servlet/Implclass, or grab the url-pattern from web.xml.
So I have been studying on how to get the url-pattern for a particular
servlet from Geronimo.  One approach I can think of is:
1) inside Axis2Builder, the module object is passed in when configurePOJO is
called.
2) then I can get the getOriginalSpecDD from webmodule, then use
webModuleBuilder.convertToServletSchema to get the webAppType object.  
3) I can then get the url-pattern from webApp.getServletMappingArray() with
some processing.   

This seems rather complicated to me so please let me know if there is a
better way to do it.  

Second, the url-pattern of the servlet-mapping must be an exact match
pattern (* is not permitted).   I tried to remove the * but I would get 404
when I issue ?wsdl from the browser.  I think this is something we may have
to write code to work around the spec requirement, as a user needs to be
able to run ?wsdl calls using different syntax (like GreeterImpl?wsdl or
test?wsdl...).   For example, a user can only specify 1 (or 0)
servlet-mapping and url-pattern for one servlet in web.xml, but the Axis2
integration code can add other url-patterns to the web deployment plan
(web.xml). I am wondering if there is anyway to overwrite the in- memory
version of servlet-mapping or url-pattern for Geronimo to use (of course,
don't overwrite the original web.xml)?  

Reference doc:
JSR 109 rev 1.2 Page 61 (sec 7.1.2) where it says:
--//--
Servlet Mapping. A developer may optionally specify a servlet-mapping,
In the web.xml deployment descriptor, for a JAX-RPC or JAX-WS Service
Endpoint.
No more than one servlet-mapping may be specified for a servlet that is
linked to by a port-component.
The url-pattern of the servlet-mapping must be an exact match pattern
 (i.e. it must not contain an asterisk ("*")).
--//--

Thanks for any input in advance!

Lin


Mime
View raw message