
Originally Posted by
karldmoore
I can't see PropertyPlaceholderConfigurer in your configuration. Is this the same one that's causing the exception?
Sorry, I forget one file.
applicationContext-data.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd"
default-lazy-init="false">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:hibernate.properties</value>
<value>classpath:mail.properties</value>
</list>
</property>
</bean>
<!-- ======================== HIBERNATE, TX, DATASOURCE ======================= -->
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/__postgresAcula"/>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/>
<property name="configLocation" value="/WEB-INF/hibernate.cfg.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="allowCustomIsolationLevels" value="true"/>
</bean>
<bean id="txTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager">
<ref bean="txManager"/>
</property>
</bean>
<aop:config>
<aop:pointcut id="fooServiceMethods" expression="execution(* com.acula.service.impl.*.*(..))"/>
<aop:advisor advice-ref="aculaSecurityInterceptor" pointcut-ref="fooServiceMethods"/>
</aop:config>
<aop:config>
<aop:pointcut id="fooSecureMethod1"
expression="execution(* com.acula.service.impl.UserManagerImpl.saveUser(..))"/>
<aop:pointcut id="fooSecureMethod2"
expression="execution(* com.acula.service.impl.UserManagerImpl.updateUser(..))"/>
<aop:advisor advice-ref="userSecurityAdvice" pointcut-ref="fooSecureMethod1"/>
<aop:advisor advice-ref="userSecurityAdvice" pointcut-ref="fooSecureMethod2"/>
</aop:config>
<!-- enable the configuration of transactional behavior based on annotations -->
<tx:annotation-driven transaction-manager="txManager"/>
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- =========================== DAO ========================= -->
<bean id="userDao" class="com.acula.dao.hibernate.UserDaoHibernate">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate"/>
</property>
</bean>
<bean id="tempRequestDaoHibernate" class="com.acula.dao.hibernate.TempRequestDaoHibernate">
<property name="hibernateTemplate">
<ref bean="hibernateTemplate"/>
</property>
</bean>
<!-- ======================== SERVICES ======================= -->
<bean id="userManager" class="com.acula.service.impl.UserManagerImpl">
<dwr:remote javascript="loginAutoComplete">
<dwr:include method="getAutoComplete"/>
</dwr:remote>
<property name="dao">
<ref bean="userDao"/>
</property>
<property name="sessionRegistry">
<ref bean="sessionRegistry"/>
</property>
</bean>
<bean id="tempRequestManager" class="com.acula.service.impl.TempRequestManagerImpl">
<property name="dao">
<ref bean="tempRequestDaoHibernate"/>
</property>
</bean>
<bean id="aculaPropertiesManager" class="com.acula.service.impl.AculaPropertiesManagerImpl">
<property name="txTemplate">
<ref bean="txTemplate"/>
</property>
</bean>
</beans>
hibernate.properties
Code:
hibernate.connection.url=jdbc:postgresql://localhost:5432/acula
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.username=111
hibernate.connection.password=111
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.search.default.directory_provider=org.hibernate.search.store.FSDirectoryProvider
hibernate.search.default.indexBase=/home/lexius/Documents/acula_data/indexes/
hibernate.search.analyzer=org.apache.lucene.analysis.ru.RussianAnalyzer
hibernate.bytecode.provider=javassist
hibernate.cache.use_query_cache=true
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
hibernate.cache.use_second_level_cache=true
hibernate.jdbc.use_scrollable_resultset=true
hibernate.jdbc.batch_size=20
hibernate.show_sql=true
hibernate.format_sql=true