geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin Sun" <linsun....@gmail.com>
Subject RE: [Fwd: Re: url-pattern issue during Axis2 integration]
Date Wed, 31 Jan 2007 04:29:18 GMT
Hi Dims, that didn't work either.

Here's what I did:

In web.xml:

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

Deploying the war file fine.   Hit
http://localhost:8080/jaxws-war-2.0-SNAPSHOT/servlet/ or
http://localhost:8080/jaxws-war-2.0-SNAPSHOT/servlet/GreeterImpl?wsdl on the
browser, got 404.  Noticed that the url got redirected to
http://localhost:8080/jaxws-war-2.0-SNAPSHOT/// immediately in both cases.

On the other hand, I've got code working to setServicePath to the
url-pattern of the servlet.  With the same war file, I can visit
http://localhost:8080/jaxws-war-2.0-SNAPSHOT/servlet/ and
http://localhost:8080/jaxws-war-2.0-SNAPSHOT/servlet/GreeterImpl?wsdl fine
but I could not constantly get the same good result. :-(

Lin
-----Original Message-----
From: Davanum Srinivas [mailto:davanum@gmail.com] 
Sent: Tuesday, January 30, 2007 5:05 PM
To: Lin Sun
Cc: dev@geronimo.apache.org
Subject: Re: [Fwd: Re: url-pattern issue during Axis2 integration]

I remember a special setting for setServicePath("/") can u please try that
one?

On 1/30/07, Lin Sun <linsun.unc@gmail.com> wrote:
> Something went wrong with my gmail so I didn't see the reply till now.
>
> No, I've tried that yesterday and it didn't work.  I wish it could. :-)
> Basically, you cannot have servicepath set to empty or null.
>
>     public String getServicePath() {
>         if (servicePath == null || servicePath.trim().length() == 0) {
>             throw new IllegalArgumentException("service path cannot be
null
> or empty");
>         }
>         return servicePath.trim();
>     }
>
> Thanks,
> Lin
>
> -------- Original Message --------
> Subject:        Re: url-pattern issue during Axis2 integration
> Date:   Tue, 30 Jan 2007 00:47:12 -0500
> From:   Davanum Srinivas <davanum@gmail.com>
> Reply-To:       dev@geronimo.apache.org, dims@apache.org
> To:     dev@geronimo.apache.org
> References:
<3225.124.43.99.160.1169824874.squirrel@webmail12.pair.com>
> <008901c74430$3518b880$6a01a8c0@raleigh.ibm.com>
>
>
>
> Lin,
>
> Isn't setServicePath("") enough to do the trick?
>
> thanks,
> dims
>
> On 1/30/07, Lin Sun <linsun.unc@gmail.com> wrote:
> > 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
> >
> >
>
>
> --
> Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers
>
>
>
>


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers


Mime
View raw message