Which version of hibernate?  Try the latest 3.5 version?



Luther Baker <[email protected]> 
07/26/2010 06:55 PM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Error integrating with Hibernate and Spring






I'm sure I'm doing something incorrectly. For the most part, I copied
the Spring config file from
http://wicketinaction.com/2009/06/wicketspringhibernate-configuration/
but upon startup, I'm getting the following error. Specifically, I
can't find where the listener type [wicketApplication] is
implemented/exists/read ...

Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in class path
resource [com/fuzzybearings/projx/config/spring.sb.xml]: Invocation of
init method failed; nested exception is
org.hibernate.MappingException: Unrecognized listener type
[wicketApplication]
                 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
                 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
                 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
                 at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
                 at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                 at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
                 at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
                 at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
                 ... 51 more

Both jetty:run and tomcat:run do this.

Thanks in advance for any suggestions,

-Luther




Here is the actual config I am using:

<?xml version="1.0" encoding="UTF-8"?>
<beans default-autowire="autodetect"
    xmlns="http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:aop="http://www.springframework.org/schema/aop";
xmlns:tx="http://www.springframework.org/schema/tx";
    xmlns:context="http://www.springframework.org/schema/context";
    xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
           http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd";>

    <bean id="wicketApplication"
class="com.fuzzybearings.projx.WicketApplication" />

    <bean id="placeholderConfigurer"
 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders" value="false" />
        <property name="systemPropertiesModeName"
value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
        <property name="ignoreResourceNotFound" value="false" />
        <property name="locations">
            <list>

<value>classpath:/com/fuzzybearings/projx/config/application.properties</value>
            </list>
        </property>
    </bean>

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName">
            <value>${jdbc.driver}</value>
        </property>
        <property name="url">
            <value>${jdbc.url}</value>
        </property>
        <property name="username">
            <value>${jdbc.username}</value>
        </property>
        <property name="password">
            <value>${jdbc.password}</value>
        </property>
    </bean>

    <tx:annotation-driven transaction-manager="txManager" />

    <!-- hibernate session factory -->
    <bean id="sessionFactory"
 
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.hbm2ddl.auto">${hibernate.ddl}</prop>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.connection.pool_size">5</prop>
                <prop
key="hibernate.current_session_context_class">thread</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop 
key="hibernate.cglib.use_reflection_optimizer">true</prop>
                <prop
key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
                <prop
key="hibernate.hibernate.cache.use_query_cache">true</prop>
            </props>
        </property>
        <property name="packagesToScan">
                         <list>
                <value>com.fuzzybearings.projx.model</value>
            </list>
        </property>
    </bean>
    <context:component-scan 
base-package="com.fuzzybearings.projx.data.model" />
</beans>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]






Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

Reply via email to