Would you be willing to open a JIRA issue and attach a patch with your
changes to StringResourceLoader?  It would speed up the process of
fixing it. ;)

http://issues.apache.org/jira/browse/VELOCITY

On 4/23/07, Tino Schöllhorn <[EMAIL PROTECTED]> wrote:
Hi,

I looked in the code and your description is exactly the problem. Now I
wrote an StringResourceLoader on my own which works fine.

But the StringResourceLoader would be great if it worked correctly. ;-)

With regards
Tino

Nathan Bubna wrote:
> 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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to