Hi everybody,
I finally decided to switch to Tapestry/Spring/Hibernate and the first
step for me was to try to get Howard's tapestry-spring jar to work.
Besides an error message I don't understand (please see below, any
tips are very welcome!) I've also found a reference to a
"OpenSessionInViewFilter" in the Tapestry wiki
->
http://wiki.apache.org/jakarta-tapestry/FrequentlyAskedQuestions/SpringHibernate
My first question is: Do I need that even if I use the tapestry-spring jar?! :)
My second question is: At the moment my servlet is managed by
org.apache.tapestry.ApplicationServlet (defined in web.xml).
Do I have to change that to a Spring class?
The last question is related to the error message I mentioned above:
---
12:26:57,906 ERROR ContextLoader:205 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'sessionFactory' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested
exception is org.springframework.beans.FatalBeanException: Could not
instantiate class [org.springframework.orm.hibernate3.LocalSessionFactoryBean];
constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
org.springframework.beans.FatalBeanException: Could not instantiate class
[org.springframework.orm.hibernate3.LocalSessionFactoryBean]; constructor threw
exception; nested exception is java.lang.NoClassDefFoundError:
org/dom4j/DocumentException
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.class$(LocalSessionFactoryBean.java:170)
at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.<init>(LocalSessionFactoryBean.java:170)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
at
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:49)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:453)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:333)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
at
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
[...]
---
The (as to my opinion) relevant applicationContext.xml part looks like:
<!-- SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.generate_statistics">false</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
</props>
</property>
</bean>
Whats going wrong here? Please request if you need more information concerning
the rest of my setup.
Thanks in advance,
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]