You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gareth <g0...@yahoo.co.uk> on 2007/04/16 13:58:25 UTC

http://wiki.apache.org/tapestry/Tapestry4Spring - JarekWoloszyn's solution for tapestry 4 on version 4.1.1

Hi,

Following instructions on the Wiki seemed a good way to get my GUI interfacing onto hibernate instead of "inMemory" collections that I have been using to build it so far, but I've run into a problem with I believe hivemind  with which I'd be grateful of a little help.  Many Thanks.

The solution to which I refer seemed very clear so I opted to follow the instructions given, however I get a NullPointerException when I try to display the homepage of my application.  I have investigated and this is because the BeanFactory returned by this code is null.

/** For injection. */

      public final void setBeanFactoryHolder(SpringBeanFactoryHolder beanFactoryHolder) {

        _beanFactoryHolder = beanFactoryHolder;

      }



      protected SessionFactory lookupSessionFactory(WebRequest request) {

        if (logger.isDebugEnabled()) {

          logger.debug("Using SessionFactory '" + getSessionFactoryBeanName()

              + "' for OpenSessionInViewFilter");

        }

        return (SessionFactory) _beanFactoryHolder.getBeanFactory().getBean(

            getSessionFactoryBeanName(), SessionFactory.class);

      }

I have followed the simple steps that he provided to the letter, but maybe I needed to be a little more thoughtful... I initialize this bean factory as per his instructions - 

<set-object property="beanFactoryHolder" value="service:hivemind.lib.DefaultSpringBeanFactoryHolder"/>

Should I be substituting in something else in its place?

I have the following section, but I'm not sure what to use from it (if anything)... thanks

<contribution configuration-id="hivemind.ApplicationDefaults">
        <default symbol="hivemind.lib.spring-bean-factory" value="service-property:app.SpringContextFactory:appContext"/>
    </contribution>

    <service-point id="SpringContextFactory">
        Create WebApplicatonContext for Spring
        <invoke-factory>
            <construct class="SpringContextFactory">
                <set-service property="servletContext" service-id="tapestry.globals.ServletContext"/>
            </construct>
        </invoke-factory>
    </service-point>


 



      ___________________________________________________________ 
Yahoo! Mail is the world's favourite email. Don't settle for less, sign up for
your free account today http://uk.rd.yahoo.com/evt=44106/*http://uk.docs.yahoo.com/mail/winter07.html