Sorry. I've answered this myself.

When I went to put @CommitAfter into the class, it wasn't visible. I wasn't
including tapestry-hibernate. The problem went away.

Thanks all,

-Luther



On Sun, Sep 14, 2008 at 1:39 AM, Luther Baker <[EMAIL PROTECTED]> wrote:

> *I am getting a strange error:
> *
> *...Caused by: java.lang.RuntimeException: Error obtaining injected value
> for field com.effectiveprogramming.notebook.pages.Add.hibernate: No service
> implements the interface org.hibernate.Session.
> *
> This implies that hibernate is not visible at runtime. I found a post from
> an early version 5.0.6 with a similar problem ...
>
>
> http://markmail.org/message/3ifhwebig3gv5pmg#query:No%20service%20implements%20the%20interface%20org.hibernate.Session.+page:1+mid:3ifhwebig3gv5pmg+state:results
>
> Unlike this message, I've been using eclipse and myeclipse and tomcat
> successfully now for the past 2 weeks. Just integrating hibernate this
> evening is causing a problem. I'm using my own archetype and the only think
> I can figure is that the pom was built already - so didn't create it in
> eclipse -- but I can see the jars in the WEB-INF/lib deployment directory so
> I can't imagine why the hibernate injection is complaining.
>
> If I comment the Session or the @Inject annotation below, all is fine (but
> I obviously can't persist anything).
>
>
>
>
>
> *The class compiles just fine:
> *
>
> // $Id$
> package com.effectiveprogramming.notebook.pages;
>
> import org.apache.tapestry5.annotations.InjectPage;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.hibernate.Session;
>
> import com.effectiveprogramming.notebook.entities.Note;
>
> /**
>  * @author luther.baker
>  */
> public class Add
> {
>     @Property
>     private Note note;
>
>     @Inject
>     private Session hibernate;
>
>     @InjectPage
>     private Dashboard dashboard;
>
>     Object onSuccess()
>     {
>         hibernate.persist(note);
>
>         return dashboard;
>     }
> }
>
>
>
>
> *A bit more of the exception trace:
>
> *
> - Render queue error in BeginRender[Index:pagelink_0]:
> java.lang.ClassNotFoundException: caught an exception while obtaining a
> class file for com.effectiveprogramming.notebook.pages.Add
>
> <snip>...</snip>
>
> Caused by: java.lang.RuntimeException: Error obtaining injected value for
> field com.effectiveprogramming.notebook.pages.Add.hibernate: No service
> implements the interface org.hibernate.Session.
>     at
> org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:68)
>     at
> $ComponentClassTransformWorker_11c5f890ece.transform($ComponentClassTransformWorker_11c5f890ece.java)
>     at
> $ComponentClassTransformWorker_11c5f890ec5.transform($ComponentClassTransformWorker_11c5f890ec5.java)
>     at
> org.apache.tapestry5.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:168)
>     ... 90 more
> Caused by: java.lang.RuntimeException: No service implements the interface
> org.hibernate.Session.
>     at
> org.apache.tapestry5.ioc.internal.RegistryImpl.getService(RegistryImpl.java:518)
>     at
> org.apache.tapestry5.ioc.internal.ObjectLocatorImpl.getService(ObjectLocatorImpl.java:44)
>     at
> org.apache.tapestry5.internal.services.ServiceInjectionProvider.provideInjection(ServiceInjectionProvider.java:40)
>     at
> $InjectionProvider_11c5f890ed7.provideInjection($InjectionProvider_11c5f890ed7.java)
>     at
> $InjectionProvider_11c5f890ec9.provideInjection($InjectionProvider_11c5f890ec9.java)
>     at
> org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:57)
>     ... 93 more
>
>
> Thoughts?
>

Reply via email to