You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by scott macri <ha...@gmail.com> on 2011/07/19 05:10:13 UTC

-**- Hibernate Session Not Found -**-

Hello,
I am very new to hibernate, tapestry and eclipse.  However, I've been
developing in Java for quite some time and have worked with both
spring and struts(1+2).

I am attempting to complete the Tapestry5 tutorial on the apache
website.  However, I am having an issue with hibernate, tapestry and
HSQLDB.  I have followed the steps exactly in the tutorial, but am
getting the following error when trying to run the CreateAddress page
in the tutorial:

java.lang.RuntimeException
java.lang.ClassNotFoundException: caught an exception while obtaining
a class file for com.mindfullynourished.hcp.pages.person.CreatePerson
java.lang.ClassNotFoundException
caught an exception while obtaining a class file for
com.mindfullynourished.hcp.pages.person.CreatePerson

exception
    org.apache.tapestry5.ioc.internal.OperationException:
javassist.NotFoundException: org.hibernate.Session

org.apache.tapestry5.ioc.internal.OperationException
javassist.NotFoundException: org.hibernate.Session

trace

        Constructing instance of page class
com.mindfullynourished.hcp.pages.person.CreatePerson
        Creating ComponentAssembler for
com.mindfullynourished.hcp.pages.person.CreatePerson
        Transforming component class
com.mindfullynourished.hcp.pages.person.CreatePerson

javassist.NotFoundException
org.hibernate.Session

Yes, the hibernate3 jar is in my WEB-INF/lib folder.  The folder did
not exist so I had to create it.  Also, the jar is in my build path.
I am not certain why the hibernate Session is not being seen.  Please
help.  Any tips or advice would be greatly appreciated.

It seems like a simple enough issue, but there are some serious
differences with tapestry and standard struts web apps.  The main
difference is that tap runs as a filter.

Here is the CreateAddress.java code:

package org.apache.tapestry5.tutorial.pages.address;

import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.hibernate.annotations.CommitAfter;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.tutorial.entities.Address;
import org.apache.tapestry5.tutorial.pages.Index;
import org.hibernate.Session;

public class CreateAddress
{
    @Property
    private Address address;

    @Inject
    private Session session;

    @InjectPage
    private Index index;

    @CommitAfter
    Object onSuccess()
    {
        session.persist(address);

        return index;
    }
}


Thanks..... :)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: -**- Hibernate Session Not Found -**-

Posted by Scott Macri <sc...@gmail.com>.
Awesome!  Worked great!  Thanks.

I agree, tapestry is far better than struts.

On 7/19/11 4:36 PM, Thiago H. de Paula Figueiredo wrote:
> On Tue, 19 Jul 2011 00:10:13 -0300, scott macri 
> <ha...@gmail.com> wrote:
>
>> Hello,
>
> Hi!
>
>> I am attempting to complete the Tapestry5 tutorial on the apache
>> website.  However, I am having an issue with hibernate, tapestry and
>> HSQLDB.
>
> The tutorial uses Maven, so add the m2eclipse plugin to Eclipse (not 
> needed in 3.7) and let Maven handle the classpath for you.
>
>> differences with tapestry and standard struts web apps.
>
> Struts sucks very hard.
>
>> The main difference is that tap runs as a filter.
>
> It almost doesn't make a difference when you use Tapestry, but it's 
> quite handy in some situations.
>


-- 
Scott Macri
www.MindfullyNourished.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: -**- Hibernate Session Not Found -**-

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 19 Jul 2011 00:10:13 -0300, scott macri <ha...@gmail.com>  
wrote:

> Hello,

Hi!

> I am attempting to complete the Tapestry5 tutorial on the apache
> website.  However, I am having an issue with hibernate, tapestry and
> HSQLDB.

The tutorial uses Maven, so add the m2eclipse plugin to Eclipse (not  
needed in 3.7) and let Maven handle the classpath for you.

> differences with tapestry and standard struts web apps.

Struts sucks very hard.

> The main difference is that tap runs as a filter.

It almost doesn't make a difference when you use Tapestry, but it's quite  
handy in some situations.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: -**- Hibernate Session Not Found -**-

Posted by Scott Macri <Sc...@MindfullyNourished.com>.
Sorry, my class is CreatePerson, not CreateAddress.  However, it is
identical and I have the same error for both.   Thanks.

public class CreatePerson
> {
>    @Property
>    private Person person;
>
>    @Inject
>    private Session session;
>
>    @InjectPage
>    private Index index;
>
>    @CommitAfter
>    Object onSuccess()
>    {
>        session.persist(person);
>
>        return index;
>    }
> }

On Mon, Jul 18, 2011 at 11:10 PM, scott macri <ha...@gmail.com> wrote:
> Hello,
> I am very new to hibernate, tapestry and eclipse.  However, I've been
> developing in Java for quite some time and have worked with both
> spring and struts(1+2).
>
> I am attempting to complete the Tapestry5 tutorial on the apache
> website.  However, I am having an issue with hibernate, tapestry and
> HSQLDB.  I have followed the steps exactly in the tutorial, but am
> getting the following error when trying to run the CreateAddress page
> in the tutorial:
>
> java.lang.RuntimeException
> java.lang.ClassNotFoundException: caught an exception while obtaining
> a class file for com.mindfullynourished.hcp.pages.person.CreatePerson
> java.lang.ClassNotFoundException
> caught an exception while obtaining a class file for
> com.mindfullynourished.hcp.pages.person.CreatePerson
>
> exception
>    org.apache.tapestry5.ioc.internal.OperationException:
> javassist.NotFoundException: org.hibernate.Session
>
> org.apache.tapestry5.ioc.internal.OperationException
> javassist.NotFoundException: org.hibernate.Session
>
> trace
>
>        Constructing instance of page class
> com.mindfullynourished.hcp.pages.person.CreatePerson
>        Creating ComponentAssembler for
> com.mindfullynourished.hcp.pages.person.CreatePerson
>        Transforming component class
> com.mindfullynourished.hcp.pages.person.CreatePerson
>
> javassist.NotFoundException
> org.hibernate.Session
>
> Yes, the hibernate3 jar is in my WEB-INF/lib folder.  The folder did
> not exist so I had to create it.  Also, the jar is in my build path.
> I am not certain why the hibernate Session is not being seen.  Please
> help.  Any tips or advice would be greatly appreciated.
>
> It seems like a simple enough issue, but there are some serious
> differences with tapestry and standard struts web apps.  The main
> difference is that tap runs as a filter.
>
> Here is the CreateAddress.java code:
>
> package org.apache.tapestry5.tutorial.pages.address;
>
> import org.apache.tapestry5.annotations.InjectPage;
> import org.apache.tapestry5.annotations.Property;
> import org.apache.tapestry5.hibernate.annotations.CommitAfter;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.apache.tapestry5.tutorial.entities.Address;
> import org.apache.tapestry5.tutorial.pages.Index;
> import org.hibernate.Session;
>
> public class CreateAddress
> {
>    @Property
>    private Address address;
>
>    @Inject
>    private Session session;
>
>    @InjectPage
>    private Index index;
>
>    @CommitAfter
>    Object onSuccess()
>    {
>        session.persist(address);
>
>        return index;
>    }
> }
>
>
> Thanks..... :)
>



-- 
Scott A. Macri
Certified Health Coach, AADP
Mindfully Nourished
Scott@MindfullyNourished.com
www.MindfullyNourished.com
(703) 334-8167

All that we are is the result of what we have thought.
The mind is everything. What we think we become.
Buddha

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org