Greetings,
I am using Appfuse 2.0 (Struts2), IDEA 7.0.1, and Tomcat 5.5.23. I have
built the skeleton app in Idea to create a WAR that I copy to
TOMCAT/webapps. I have manually replaced the ${} variables with the values
found in the pom.xml file in jdbc.properties files, but I cannot get rid of
the one regarding "hibernate.dialect".
I have tried doing a clean, and rebuilding, but no luck. I had a number of
errors caused by the ${} that prevented the application from deploying and
running at all, but now it runs, so is this a benign error? Still, I'd like
to understand why it is happening and clean it up if easy to do so.
Also, why are the ${} placeholders not being replaced with the pom.xml
values when I build from IDEA? Is IDEA not invoking Maven behind the scenes
when I use Build > Rebuild Project ?
Thanks in advance.
Jim
Excerpt from catalina.out:
INFO: Deploying web application archive checkles.war
DEBUG [main] StartupListener.contextInitialized(37) | initializing
context...
DEBUG [main] StartupListener.contextInitialized(84) | Remember Me Enabled?
true
DEBUG [main] StartupListener.contextInitialized(85) | Encrypt Passwords?
true
DEBUG [main] StartupListener.contextInitialized(87) | Encryption Algorithm:
SHA
DEBUG [main] StartupListener.contextInitialized(89) | Populating
drop-downs...
DEBUG [main] LookupDaoHibernate.getRoles(20) | retrieving all role names...
DEBUG [main] StartupListener.setupContext(105) | Drop-down initialization
complete [OK]
DEBUG [main] LocaleFilter.init(158) | Initializing filter 'localeFilter'
DEBUG [main] LocaleFilter.init(183) | Filter 'localeFilter' configured
successfully
WARN [main] Settings.getLocale(143) | Settings: Could not parse
struts.locale setting, substituting default VM locale
ERROR [main] ContextLoader.initWebApplicationContext(203) | Context
initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Error
registering bean with name 'sessionFactory' defined in class path resource
[applicationContext-dao.xml]: Circular placeholder reference
'hibernate.dialect' in property definitions
at
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:249)
[...]
applicationContext-dao.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
default-lazy-init="true">
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation"
value="classpath:hibernate.cfg.xml"/>
<property name="hibernateProperties">
<value>
hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
hibernate.query.substitutions=true 'Y', false 'N'
hibernate.cache.use_second_level_cache=true
hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
</value>
<!-- Turn batching off for better error messages under
PostgreSQL -->
<!-- hibernate.jdbc.batch_size=0 -->
</property>
</bean>
<!-- Transaction manager for a single Hibernate SessionFactory
(alternative to JTA) -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- UniversalDao - can be used when doing standard CRUD - made
available
for those who don't mind casting. If you don't want to cast, look
at
'fooDao' below. -->
<bean id="universalDao"
class="com.checkles.app.dao.hibernate.UniversalDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="lookupDao"
class="com.checkles.app.dao.hibernate.LookupDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="userDao"
class="com.checkles.app.dao.hibernate.UserDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<bean id="roleDao"
class="com.checkles.app.dao.hibernate.RoleDaoHibernate">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- If you want to be able to do simple CRUD for new domain objects
without
having to cast, you don't have create a Dao interface and
implementation
for that domain object, you simply have to do the following.
eg... 'fooDao'
<bean id="fooDao"
class="com.checkles.app.dao.hibernate.GenericDaoHibernate">
<constructor-arg value="com.checkles.app.model.Foo"/>
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
You will need to create a Dao interface and implementation for that
domain object if you need more than simple CRUD to occur.
(finders, bulk update/delete, etc.)
-->
<!-- Add new DAOs here -->
</beans>
applicationContext-resources.xml:
<?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"
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">
<!-- For mail settings and future properties files -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
<value>classpath:mail.properties</value>
</list>
</property>
</bean>
<!-- JNDI DataSource for J2EE environments -->
<!--<jee:jndi-lookup id="dataSource"
jndi-name="java:comp/env/jdbc/appfuse"/>-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url"
value="jdbc:mysql://localhost/checkles?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8"/>
<property name="username" value="root"/>
<property name="password" value=""/>
<property name="maxActive" value="100"/>
<property name="maxWait" value="1000"/>
<property name="poolPreparedStatements" value="true"/>
<property name="defaultAutoCommit" value="true"/>
</bean>
</beans>
--
View this message in context:
http://www.nabble.com/Circular-placeholder-reference%3A-hibernate.dialect--How-to-resolve--tf4824841s2369.html#a13804555
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]