java - Run Maven webapp on server from Eclipse with properties injection from profile -
I'm Eclipse & amp; To develop the Spring + hibernate webpip, I have several profiles in my pom.xml: application.properties: applicationContext.xml: Using the Tomcat7 Maven plugin, deployment is fine through How can I run my project in the embedded logs and get logs in the console Thanks for the help. found! As I am using the Mewen Eclipse Plugin, I have a "Maven" entry (Project & gt; Properties & gt; Maven) under the A property property. I just had to activate the "Development" profile and it worked! pom.xml with different properties that I inject a
.properties file. This file is used in the
applicationContext.xml to configure the spring, and when I want to launch the application, I am forced to deploy the template that runs outside Eclipse. Here is some part of my code:
...
... # JDBC information # Some properties are my .m2 / settings. Xml jdbc.driver.classname = $ {db.driverClassName} jdbc.url = $ {db.url} / $ {db.name} $ {db.params} jdbc.user = $ {db.username} JDBC. Pass = $ {db.password} ...
...
mvn tomcat7: deployed , but when I "right-click"
Due to: java.lang.IllegalArgumentException: 'Placeholder could not resolve db.driverClassName; As on & gt run server ", I get a lot of exceptions related to the placeholder org.springframework.util at org.springframework.util.PropertyPlaceholderHelper.parseStringValue (PropertyPlaceholderHelper.java:161) on Org.springframework .atil.PropertyPlaceholderHelper.replaceplaceholder (propertyPlaceholderHelper.java:1225) in string value "$ {db.driverClassName}" on .plertyPlaceholderHelper.parseStringValue (propertyPlaceholderHelper.java:173) org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders (orb .springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholder at (AbstractPropertyResolver.java:180) (AbstractPropertyResolver.java:145) Org.springframework.context.support.PropertyS at oursplaceholderConfigurer $ 2.resolveStringValue (propertySourcesPla CeholderConfigurer.java167) org.springframework.beans.resolveStringValue at (BeanDefinitionVisitor.java:282) org.springframework.beans.factory.config.BeanDefinitionVisitor.resolveValue (BeanDefinitionVisitor.java): 204) org Org.springframework on org.springframework.beans.factory.config.BeanDefinitionVisitor.visitBeanDefinition (BeanDefinitionVisitor.java:82) on .springframework.beans.factory.config.BeanDefinitionVisitor.visitPropertyValues (BeanDefinitionVisitor.java:141) Beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties (PlaceholderConfigurerSupport.java:206) ... 17 more
Log / Catalina Out
Comments
Post a Comment