2012/8/28 Knute Snortum <[email protected]>:
> If this is the wrong mailing list for tomcat7-maven-plugin, could someone
> direct me to the right place?
Yes, this is the list.
> I'm developing a Vaadin web app in Eclipse Juno on Windows 7 and I'm using
> the tomcat7-maven-plugin 2.0-beta-1 to help in development by running the app
> in Tomcat inside of the IDE -- or I'm trying. The error I'm getting is:
>
> org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean
> definition with name 'dataSource' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: Could not resolve placeholder
> 'db.driverClassName' in string value [${db.driverClassName}]
>
> "applicationContext.xml" is my Spring context file. I have placeholders in
> it to point to the correct database based on Maven profiles and filtering.
> So a piece of applicationContext.xml looks like this:
>
> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
> <property name="driverClassName"
> value="${db.driverClassName}" />
> <property name="url" value="${db.url}" />
> <property name="username" value="${db.username}" />
> <property name="password" value="${db.password}" />
> <property name="maxActive" value="10" />
> <property name="maxIdle" value="1" />
> </bean>
>
> As you can see, Tomcat (or Spring?) is finding the dataSource bean that does
> not have the placeholders replaced yet.
Usually it is Spring job to resolve those.
(It has nothing to to with Tomcat or Maven).
See org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
> The odd thing is that in the war file and the directory under target that the
> war file is created from, all the place holders have been correctly
> substituted. I can see them in an editor. The context file with the
> placeholders is the one still sitting in my development folder.
>
> So my question is, why isn't the Tomcat plugin seeing the context file in the
> war file or folder? And if it looks in the development folder for the file,
> can Maven filtering work with the plugin?.
>
> Below is part of the messages created by Maven et al in my IDE console. I've
> left out the clean and testing messages and most of the stacktrace, which I
> think is from Spring anyway:
>
> (...)
> 28.08.2012 10:14:01 ERROR (ContextLoader.java:307) - Context initialization
> failed
> org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean
> definition with name 'dataSource' defined in ServletContext resource
> [/WEB-INF/applicationContext.xml]: Could not resolve placeholder
> 'db.driverClassName' in string value [${db.driverClassName}]
>
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]