You need dom4j.jar in your WEB-INF/lib directory.

-----Original Message-----
From: Andreas Bulling [mailto:[EMAIL PROTECTED] On Behalf Of
Andreas Bulling
Sent: Monday, February 20, 2006 6:33 AM
To: Tapestry users
Subject: tapestry-spring and OpenSessionInViewFilter

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/SpringHiber
nate

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$(LocalSessi
onFactoryBean.java:170)
        at
org.springframework.orm.hibernate3.LocalSessionFactoryBean.<init>(LocalSessi
onFactoryBean.java:170)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces
sorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc
torAccessorImpl.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.instan
tiate(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(Abstra
ctBeanFactory.java:226)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstra
ctBeanFactory.java:147)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInst
antiateSingletons(DefaultListableBeanFactory.java:269)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(Abstr
actApplicationContext.java:320)
        at
org.springframework.web.context.support.AbstractRefreshableWebApplicationCon
text.refresh(AbstractRefreshableWebApplicationContext.java:134)
        at
org.springframework.web.context.ContextLoader.createWebApplicationContext(Co
ntextLoader.java:246)
        at
org.springframework.web.context.ContextLoader.initWebApplicationContext(Cont
extLoader.java:184)
        at
org.springframework.web.context.ContextLoaderListener.contextInitialized(Con
textLoaderListener.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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to