velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Velocity, StringResourceLoader and Tomcat
Date Mon, 23 Apr 2007 16:15:58 GMT
It appears to mean that multiple StringResourceLoaders are being
initialized and the later ones are blowing up.   StringResourceLoader
uses a static RepositoryFactory.  Unfortunately i think this means
that you can really only have one StringResourceLoader per
classloader.  Sorry about this, it's a new feature and apparently
hasn't had all its usecases tested.

i'll ping the dev list about this and/or try and look into it more
myself.  there should be a way to use multiple
StringResourceLoaders...

in the meantime, you may want to make sure your app only instantiates
one VelocityEngine that uses a StringResourceLoader.

On 4/23/07, Tino Schöllhorn <t.schoellhorn@plattform-gmbh.de> wrote:
> Hi,
>
> we are using Tomcat, Spring and Velocity 1.5. A first application
> (without Tomcat) is running fine - it just uses Velocity to parse an
> simple "Hello World" template which we provide in the
> StringResourceRepository.
>
> But as soon as we want to integrate this in our web-application we
> encounter the following error:
>
> Error creating bean with name 'velocityEngine' defined in class path
> resource [appCxt-kernelBase.xml]: Invocation of init method failed;
> nested exception is java.lang.IllegalStateException: The
> RepositoryFactory has already been initialized!
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1148)
>         ....
>
>
> Does anyone know what the problem might be?
>
> With regards
> Tino
>
> ps:
>
> We are using the follwowing spring-bean configuration:
>
> <bean id="velocityEngine"
>                         class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
>
>     <property name="velocityProperties">
>         <props>
>         <prop key="resource.loader">string</prop>
>          <prop key="string.resource.loader.class">
> org.apache.velocity.runtime.resource.loader.StringResourceLoader
>            </prop>
>          </props>
>     </property>
> </bean>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message