tomcat 서버에 spring mvc webapp를 배포하려고합니다. 나는 maven-jetty-plugin을 사용하여 로컬에서 테스트를 해왔다. 그러나 나는 내가받을 Tomcat 서버에 WAR 파일을 배포 할 때 ... 이것은 내 부두 플러그인과 협력Tomcat 서버가있는 외부 속성 로더
<context:property-placeholder ignore-resource-not-found="true" ignore-unresolvable="true"/>
<bean id="modelPropertyPlaceholder" class="org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
<property name="searchContextAttributes" value="true"/>
<property name="contextOverride" value="true"/>
<property name="ignoreResourceNotFound" value="true"/>
<property name="ignoreUnresolvablePlaceholders" value="true"/>
<property name="locations">
<list>
<value>classpath:default.model.properties</value>
<value>file:/etc/app/app.properties</value>
<value>${config}</value>
</list>
</property>
</bean>
: 내 스프링 구성에서 나는 속성 자리 표시 자 사용하고, 외부 파일에서 내 특성을 당겨 다음 오류 :
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
내 외부 속성 파일에 드라이버 클래스와 연결 URL이 정의되어 있습니다.
이jndi.jpa.rms.datasource=jdbc/testDS
rms.db.driver=com.mysql.jdbc.Driver
rms.db.url=jdbc:mysql://testdatabaseurl:3306/test
rms.db.user=sa
rms.db.password=asfdas
rms.db.checkconnsql=select 1
rms.hibernate.generateddl=false
rms.hibernate.showsql=true
rms.hibernate.dbdialect=org.hibernate.dialect.MySQLDialect
업데이트 : 너무로
그것은 그 바람둥이가 픽업을 수행 보인다 외부 특성 파일 :
14:23:09.803 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'modelPropertyPlaceholder'
14:23:09.810 [main] INFO o.s.w.c.s.ServletContextPropertyPlaceholderConfigurer - Loading properties file from class path resource [default.model.properties]
14:23:09.810 [main] INFO o.s.w.c.s.ServletContextPropertyPlaceholderConfigurer - Loading properties file from URL [file:/etc/app/app.properties]
14:23:09.810 [main] INFO o.s.w.c.s.ServletContextPropertyPlaceholderConfigurer - Loading properties file from ServletContext resource [/${config}]
14:23:09.811 [main] WARN o.s.w.c.s.ServletContextPropertyPlaceholderConfigurer - Could not load properties from ServletContext resource [/${config}]: Could not open ServletContext resource [/${config}]
나는 바람둥이가 연결 URL을 따기되지 않는 이유를 모르겠어요 및 운전사. 바람둥이 문제입니까, 아니면 뭔가 빠졌습니까? 감사합니다
속성 파일은 tomcat 환경에 전혀 없습니다. 그들은 동일한 기계에 있지만 다른 디렉토리에 있습니다. Tomcat 인스턴스에서 속성 (구성)을 가져 오려고했습니다. 내 default.properties (classpath에 포함되어 있으며, mysql에서 mysql을 사용하는 것 외에는 동일한 구성 옵션을 가짐)이라고 말했듯이 모든 키를 가지고 있다고 확신합니다. –
Ok,하지만 왜 결정 했습니까? 'ServletContextPropertyPlaceholderConfigurer'를 사용 하시겠습니까? 그 재산 자리 표시자는 충분하다고 생각합니다. –