java - Could not resolve placeholder with Spring in a multi-module maven project -


i have headache problem, thought had resolved didn't.

i'm working multi-module maven project, spring , weblogic, among other technologies. there beans placeholders, can fetch database or pom.xml.

right i've have problem particular bean looks this:

... <bean id="idofmybean" abstract="true"     class="path.to.my.class"     p:datasource-ref="path.to.my.datasource"     p:schemaname="${placeholder.that.comes.from.database}"     p:applicationversion="${application.version}"> </bean> ... 

this bean inside project jar project, , jar goes inside ear project.

my parent pom.xml looks this:

... <properties>   ...   <!-- dependencies versions. -->   <spring.version>2.5.6.sec01</spring.version>   <spring.ws.version>1.5.9</spring.ws.version>   <spring.integration.version>1.0.3.release</spring.integration.version>   <hibernate.version>3.5.3-final</hibernate.version>   <slf4j.version>1.6.1</slf4j.version>   <project.build.sourceencoding>utf-8</project.build.sourceencoding>   <application.version>myversion</application.version>   ... </properties> ... 

as far understand, when mvn clean install, placeholder in bean replaced myversion. in fact, if inside ear project, use 7zip that, open jar , xml file contains ben, can see correctly replaced:

... <bean id="idofmybean" abstract="true"     class="path.to.my.class"     p:datasource-ref="path.to.my.datasource"     p:schemaname="${placeholder.that.comes.from.database}"     p:applicationversion="myversion"> </bean> ... 

well, when try start applications, thrown following error:

starting application my-application. <15-jul-2015 08h52' cest> <info> <j2ee deployment spi> <bea-260121> <initiating start operation application, my-application [archive: null], my_cluster .> ..................failed start application status failed current status of deployment: deployment command type: start deployment state       : failed deployment message     : weblogic.application.moduleexception: :org.springframework.beans.factory.beandefinitionstoreexception:invalid bean definition name 'idofmybean' defined in class path resource [path/to/my/bean.xml]: not resolve placeholder 'application.version' no stack trace available. problem invoking wlst - traceback (innermost last):   file "c:\sisii\script\menu_setup.py", line 200, in ?   file "c:\sisii\script\.\lib\menu_system.py", line 110, in run   file "c:\sisii\script\menu_setup.py", line 195, in <lambda>   file "c:\sisii\script\.\lib\config.py", line 2233, in startall   file "c:\users\a554236\appdata\local\temp\wlst_module12913752580026045681.py", line 320, in startapplication     @ weblogic.management.scripting.exceptionhandler.handleexception(exceptionhandler.java:48)     @ weblogic.management.scripting.wlstutils.throwwlstexception(wlstutils.java:188)     @ weblogic.management.scripting.jsr88deployhandler.startapplication(jsr88deployhandler.java:768)     @ weblogic.management.scripting.wlscriptcontext.startapplication(wlscriptcontext.java:844)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25)     @ java.lang.reflect.method.invoke(method.java:597)  weblogic.management.scripting.scriptexception: weblogic.management.scripting.scriptexception: error occured while performing startapplication : failed start application status failed  <15-jul-2015 08h53' cest> <warning> <jndi> <bea-050001> <wlcontext.close() called in different thread 1 in created.> 

how possible?

the problem related question asked before, cannot import correctly maven properties propertiesfactorybean , propertyplaceholderconfigurer in spring, though had resolved, indeed in question there bean had problem, placeholder problem database, , pom.

tell me if need more information.

thanks in advance.

greetings.


Comments