geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor" <jga...@gmail.com>
Subject Re: svn commit: r574694 - in /geronimo/server/trunk: configs/jetty6-deployer/src/main/plan/ configs/jetty6-deployer/src/plan/ configs/tomcat6-deployer/src/main/plan/ configs/tomcat6-deployer/src/plan/ modules/geronimo-cxf/src/main/java/org/apache/ger
Date Fri, 14 Sep 2007 18:56:03 GMT
Ugh... I had a feeling that this filtering will cause problems for
someone. Anyway, in general I think moving the hidden-classes filter
to the CXF deployer is a better solution (to keep it all together and
assuming it has the same effect as when specified in the web container
deployer). But, in this case I don't think this will work right still.
First, in CXF there are two key deployers. One that handles deployment
of web services and another one that handles service references (it's
a naming builder). Both will need the hidden-classes filter (the patch
only updates the web service deployer). However, because the way
currently the naming builders work in Geronimo, the environment of
naming builders is always merged no matter if the application has a
service reference or not (or whatever the naming builder is looking
for). So at the end, even if we moved the hidden-classes filter to the
CXF deployers, the filter will still be injected. So we might need to
fix how the naming builders work or find a better way to deal with
Spring filtering. I'm not sure what's the right solution here.

Jarek

On 9/14/07, Paul McMahan <paulmcmahan@gmail.com> wrote:
> Jarek,  This commit is causing some problems for the new admin
> console plugin because it needs to inherit the spring classes from
> its parent component (pluto-support).   This situation is the inverse
> of the original problem we were hoping to solve where a web-app does
> *not* want to inherit the spring classes :-)
>
> Could we move the springframework hidden-classes filter from the
> tomcat and jetty deployers to the cxf-deployer?   Doing that
> alleviated the problem for me since the console webapp doesn't
> contain any web services, and therefore won't inherit these
> filters.   To me it seems more correct to apply the filters via cxf-
> deployer since cxf's dependency on spring was really the issue.  Here
> is a patch showing what I changed.   If it works OK for you then
> please go ahead and commit or let me know and I will do it.
>
> Index: configs/tomcat6-deployer/src/main/plan/plan.xml
> ===================================================================
> --- configs/tomcat6-deployer/src/main/plan/plan.xml     (revision
> 575651)
> +++ configs/tomcat6-deployer/src/main/plan/plan.xml     (working copy)
> @@ -70,10 +70,7 @@
>                           <type>car</type>
>                       </dependency>
>                   </dependencies>
> -                <hidden-classes>
> -                    <filter>org.springframework.</filter>
> -                    <filter>META-INF/spring</filter>
> -                </hidden-classes>
> +                <hidden-classes/>
>                   <non-overridable-classes>
>                       <filter>java.</filter>
>                       <filter>javax.</filter>
> Index: configs/tomcat6-deployer/src/plan/plan.xml
> ===================================================================
> --- configs/tomcat6-deployer/src/plan/plan.xml  (revision 575651)
> +++ configs/tomcat6-deployer/src/plan/plan.xml  (working copy)
> @@ -70,10 +70,7 @@
>                           <type>car</type>
>                       </dependency>
>                   </dependencies>
> -                <hidden-classes>
> -                    <filter>org.springframework.</filter>
> -                    <filter>META-INF/spring</filter>
> -                </hidden-classes>
> +                <hidden-classes/>
>                   <non-overridable-classes>
>                       <filter>java.</filter>
>                       <filter>javax.</filter>
> Index: configs/jetty6-deployer/src/main/plan/plan.xml
> ===================================================================
> --- configs/jetty6-deployer/src/main/plan/plan.xml      (revision
> 575651)
> +++ configs/jetty6-deployer/src/main/plan/plan.xml      (working copy)
> @@ -170,10 +170,7 @@
>               <type>car</type>
>             </dependency>
>           </dependencies>
> -        <hidden-classes>
> -          <filter>org.springframework.</filter>
> -          <filter>META-INF/spring</filter>
> -        </hidden-classes>
> +        <hidden-classes/>
>           <non-overridable-classes>
>             <filter>java.</filter>
>             <filter>javax.</filter>
> @@ -213,4 +210,4 @@
>     <gbean name="POJOTemplate"
> class="org.apache.geronimo.jetty6.JettyPOJOWebServiceHolder">
>       <attribute name="servletName">dummy</attribute>
>     </gbean>
> -</module>
> \ No newline at end of file
> +</module>
> Index: configs/jetty6-deployer/src/plan/plan.xml
> ===================================================================
> --- configs/jetty6-deployer/src/plan/plan.xml   (revision 575651)
> +++ configs/jetty6-deployer/src/plan/plan.xml   (working copy)
> @@ -130,10 +130,7 @@
>                           <type>car</type>
>                       </dependency>
>                   </dependencies>
> -                <hidden-classes>
> -                    <filter>org.springframework.</filter>
> -                    <filter>META-INF/spring</filter>
> -                </hidden-classes>
> +                <hidden-classes/>
>                   <non-overridable-classes>
>                       <filter>java.</filter>
>                       <filter>javax.</filter>
> Index: configs/cxf-deployer/src/main/plan/plan.xml
> ===================================================================
> --- configs/cxf-deployer/src/main/plan/plan.xml (revision 575651)
> +++ configs/cxf-deployer/src/main/plan/plan.xml (working copy)
> @@ -30,6 +30,10 @@
>                           <type>car</type>
>                       </dependency>
>                   </dependencies>
> +                <hidden-classes>
> +                    <filter>org.springframework.</filter>
> +                    <filter>META-INF/spring</filter>
> +                </hidden-classes>
>               </environment>
>           </xml-attribute>
>       </gbean>
>
>
>
>
>
>
>
> On Sep 11, 2007, at 5:21 PM, gawor@apache.org wrote:
>
> > Author: gawor
> > Date: Tue Sep 11 14:21:15 2007
> > New Revision: 574694
> >
> > URL: http://svn.apache.org/viewvc?rev=574694&view=rev
> > Log:
> > fix the cxf/spring issues by hiding the spring classes and
> > resources from the application classloader and by making cxf to use
> > cxf/car module classloader to load spring resources instead of the
> > application classloader
> >
> > Modified:
> >     geronimo/server/trunk/configs/jetty6-deployer/src/main/plan/
> > plan.xml
> >     geronimo/server/trunk/configs/jetty6-deployer/src/plan/plan.xml
> >     geronimo/server/trunk/configs/tomcat6-deployer/src/main/plan/
> > plan.xml
> >     geronimo/server/trunk/configs/tomcat6-deployer/src/plan/plan.xml
> >     geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/
> > apache/geronimo/cxf/CXFWebServiceContainer.java
> >     geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/
> > apache/geronimo/cxf/client/CXFServiceReference.java
> >
> > Modified: geronimo/server/trunk/configs/jetty6-deployer/src/main/
> > plan/plan.xml
> > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/
> > jetty6-deployer/src/main/plan/plan.xml?
> > rev=574694&r1=574693&r2=574694&view=diff
> > ======================================================================
> > ========
> > --- geronimo/server/trunk/configs/jetty6-deployer/src/main/plan/
> > plan.xml (original)
> > +++ geronimo/server/trunk/configs/jetty6-deployer/src/main/plan/
> > plan.xml Tue Sep 11 14:21:15 2007
> > @@ -170,7 +170,10 @@
> >              <type>car</type>
> >            </dependency>
> >          </dependencies>
> > -        <hidden-classes/>
> > +        <hidden-classes>
> > +          <filter>org.springframework.</filter>
> > +          <filter>META-INF/spring</filter>
> > +        </hidden-classes>
> >          <non-overridable-classes>
> >            <filter>java.</filter>
> >            <filter>javax.</filter>
> >
> > Modified: geronimo/server/trunk/configs/jetty6-deployer/src/plan/
> > plan.xml
> > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/
> > jetty6-deployer/src/plan/plan.xml?
> > rev=574694&r1=574693&r2=574694&view=diff
> > ======================================================================
> > ========
> > --- geronimo/server/trunk/configs/jetty6-deployer/src/plan/plan.xml
> > (original)
> > +++ geronimo/server/trunk/configs/jetty6-deployer/src/plan/plan.xml
> > Tue Sep 11 14:21:15 2007
> > @@ -130,7 +130,10 @@
> >                          <type>car</type>
> >                      </dependency>
> >                  </dependencies>
> > -                <hidden-classes/>
> > +                <hidden-classes>
> > +                    <filter>org.springframework.</filter>
> > +                    <filter>META-INF/spring</filter>
> > +                </hidden-classes>
> >                  <non-overridable-classes>
> >                      <filter>java.</filter>
> >                      <filter>javax.</filter>
> >
> > Modified: geronimo/server/trunk/configs/tomcat6-deployer/src/main/
> > plan/plan.xml
> > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/
> > tomcat6-deployer/src/main/plan/plan.xml?
> > rev=574694&r1=574693&r2=574694&view=diff
> > ======================================================================
> > ========
> > --- geronimo/server/trunk/configs/tomcat6-deployer/src/main/plan/
> > plan.xml (original)
> > +++ geronimo/server/trunk/configs/tomcat6-deployer/src/main/plan/
> > plan.xml Tue Sep 11 14:21:15 2007
> > @@ -70,7 +70,10 @@
> >                          <type>car</type>
> >                      </dependency>
> >                  </dependencies>
> > -                <hidden-classes/>
> > +                <hidden-classes>
> > +                    <filter>org.springframework.</filter>
> > +                    <filter>META-INF/spring</filter>
> > +                </hidden-classes>
> >                  <non-overridable-classes>
> >                      <filter>java.</filter>
> >                      <filter>javax.</filter>
> >
> > Modified: geronimo/server/trunk/configs/tomcat6-deployer/src/plan/
> > plan.xml
> > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/
> > tomcat6-deployer/src/plan/plan.xml?
> > rev=574694&r1=574693&r2=574694&view=diff
> > ======================================================================
> > ========
> > --- geronimo/server/trunk/configs/tomcat6-deployer/src/plan/
> > plan.xml (original)
> > +++ geronimo/server/trunk/configs/tomcat6-deployer/src/plan/
> > plan.xml Tue Sep 11 14:21:15 2007
> > @@ -70,7 +70,10 @@
> >                          <type>car</type>
> >                      </dependency>
> >                  </dependencies>
> > -                <hidden-classes/>
> > +                <hidden-classes>
> > +                    <filter>org.springframework.</filter>
> > +                    <filter>META-INF/spring</filter>
> > +                </hidden-classes>
> >                  <non-overridable-classes>
> >                      <filter>java.</filter>
> >                      <filter>javax.</filter>
> >
> > Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/
> > org/apache/geronimo/cxf/CXFWebServiceContainer.java
> > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/
> > geronimo-cxf/src/main/java/org/apache/geronimo/cxf/
> > CXFWebServiceContainer.java?rev=574694&r1=574693&r2=574694&view=diff
> > ======================================================================
> > ========
> > --- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/
> > apache/geronimo/cxf/CXFWebServiceContainer.java (original)
> > +++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/
> > apache/geronimo/cxf/CXFWebServiceContainer.java Tue Sep 11 14:21:15
> > 2007
> > @@ -132,8 +132,22 @@
> >       * be (re)used in other places.
> >       */
> >      public static Bus getBus() {
> > -        BusFactory.getDefaultBus();
> > +        getDefaultBus();
> >          return new ExtensionManagerBus();
> >      }
> > -
> > +
> > +    /*
> > +     * Ensure the Spring bus is initialized with the CXF module
> > classloader
> > +     * instead of the application classloader.
> > +     */
> > +    public static Bus getDefaultBus() {
> > +        ClassLoader cl = Thread.currentThread
> > ().getContextClassLoader();
> > +        Thread.currentThread().setContextClassLoader
> > (CXFEndpoint.class.getClassLoader());
> > +        try {
> > +            return BusFactory.getDefaultBus();
> > +        } finally {
> > +            Thread.currentThread().setContextClassLoader(cl);
> > +        }
> > +    }
> > +
> >  }
> >
> > Modified: geronimo/server/trunk/modules/geronimo-cxf/src/main/java/
> > org/apache/geronimo/cxf/client/CXFServiceReference.java
> > URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/
> > geronimo-cxf/src/main/java/org/apache/geronimo/cxf/client/
> > CXFServiceReference.java?rev=574694&r1=574693&r2=574694&view=diff
> > ======================================================================
> > ========
> > --- geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/
> > apache/geronimo/cxf/client/CXFServiceReference.java (original)
> > +++ geronimo/server/trunk/modules/geronimo-cxf/src/main/java/org/
> > apache/geronimo/cxf/client/CXFServiceReference.java Tue Sep 11
> > 14:21:15 2007
> > @@ -30,6 +30,7 @@
> >  import org.apache.cxf.jaxws.context.WebServiceContextImpl;
> >  import org.apache.cxf.jaxws.javaee.HandlerChainsType;
> >  import org.apache.geronimo.cxf.CXFHandlerResolver;
> > +import org.apache.geronimo.cxf.CXFWebServiceContainer;
> >  import org.apache.geronimo.gbean.AbstractName;
> >  import org.apache.geronimo.jaxws.HandlerChainsUtils;
> >  import org.apache.geronimo.jaxws.JAXWSAnnotationProcessor;
> > @@ -52,6 +53,7 @@
> >      }
> >
> >      public Object getContent() throws NamingException {
> > +        CXFWebServiceContainer.getDefaultBus();
> >          Object reference = super.getContent();
> >          SAAJInterceptor.registerInterceptors();
> >          return reference;
> >
> >
>
>

Mime
View raw message