Re: pluto 1.1: patch for pluto-portal-driver when upgrading to Spring 2.0M1

"David H. DeWolf" <[email protected]>
Newsgroups gmane.comp.jakarta.pluto.user
Message-ID <[email protected]>
I would prefer to fix this bug another way as this one change requires 
an entirely new dependency and we're trying to keep pluto "light  weight".

Other Thoughts?

David

Stefan Armbruster wrote:
> Hi,
> 
> recently the Spring team released Spring 2.0M1. I tried to use this with 
> pluto-portal-driver. When deploying the portal's war file, an 
> IllegalStateException occured. This is caused by 
> InputStreamResource.getInputStream being called twice. The attached patch 
> uses ServletContextResource instead and solves this problem. This patch also 
> contains the necessary version changes in pom.xml. 
> 
> Regards,
> Stefan
> 
> 
> ------------------------------------------------------------------------
> 
> Index: pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfigurationFactory.java
> ===================================================================
> --- pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfigurationFactory.java	(Revision 359203)
> +++ pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfigurationFactory.java	(Arbeitskopie)
> @@ -20,6 +20,7 @@
>  import org.springframework.beans.factory.xml.XmlBeanFactory;
>  import org.springframework.beans.factory.NoSuchBeanDefinitionException;
>  import org.springframework.core.io.InputStreamResource;
> +import org.springframework.web.context.support.ServletContextResource;
>  
>  import javax.servlet.ServletContext;
>  import java.io.InputStream;
> @@ -106,9 +107,7 @@
>  
>      private XmlBeanFactory getBeanFactory(ServletContext context) {
>          if(beanFactory == null) {
> -            InputStream in =
> -                    context.getResourceAsStream(DRIVER_CONFIG);
> -            beanFactory = new XmlBeanFactory(new InputStreamResource(in, "Driver Configuration"));
> +            beanFactory = new XmlBeanFactory(new ServletContextResource(context, DRIVER_CONFIG));
>          }
>          return beanFactory;
>      }
> Index: pluto-portal-driver/pom.xml
> ===================================================================
> --- pluto-portal-driver/pom.xml	(Revision 359203)
> +++ pluto-portal-driver/pom.xml	(Arbeitskopie)
> @@ -88,15 +88,21 @@
>      <dependency>
>        <groupId>org.springframework</groupId>
>        <artifactId>spring-core</artifactId>
> -      <version>1.2.5</version>
> +      <version>2.0-m1</version>
>        <scope>compile</scope>
>      </dependency>
>      <dependency>
>          <groupId>org.springframework</groupId>
>          <artifactId>spring-beans</artifactId>
> -        <version>1.2.5</version>
> +        <version>2.0-m1</version>
>          <scope>compile</scope>
>      </dependency>
> +    <dependency>
> +        <groupId>org.springframework</groupId>
> +        <artifactId>spring-web</artifactId>
> +        <version>2.0-m1</version>
> +        <scope>compile</scope>
> +    </dependency>
>    </dependencies>
>    <build>
>      <resources>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.