-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: do I need polled connection ?
PostPosted: Fri Apr 01, 2005 4:45 am 
Newbie

Joined: Fri Apr 01, 2005 4:29 am
Posts: 3
I am new to Hibernate and I am trying to run the Cat example from version 3.
I am using also Tomcat 5.5.7 and Java 1.5.

Do I need DBCP connection pooling as a must?
I didn't setup one.

I just want to use "hibernate.cfg.xml" like:

<hibernate-configuration>

<session-factory>

<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="connection.url">jdbc:mysql://xxx/xxx</property>
<property name="connection.username">root</property>
<property name="connection.password">xxx</property>

<property name="show_sql">false</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>

</session-factory>

</hibernate-configuration>


Then I want to use it in a jsp test:

=== jsp ===

SessionFactory sf;
Session s;
Transaction transaction;

try{
sf = new Configuration().configure().buildSessionFactory();

s = sf.openSession();

transaction = s.beginTransaction();

Cat princess = new Cat();
princess.setName("Princess");
princess.setSex('F');
princess.setWeight(7.4f);

s.save(princess);

transaction.commit();

s.close();

} catch (HibernateException e) { throw new ServletException(e); }

===

But the sessionFactory failes to create:
java.lang.NoClassDefFoundError
org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:111)
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:166)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:53)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


Is it because I do not have a pooled connection or I need something more in my "hibernate.cfg.xml"?

Thank you.


Top
 Profile  
 
 Post subject: yep
PostPosted: Fri Apr 01, 2005 8:52 am 
Newbie

Joined: Fri Apr 01, 2005 4:29 am
Posts: 3
it works now,

just that jta.jar is required.


Top
 Profile  
 
 Post subject: add
PostPosted: Fri Apr 01, 2005 8:53 am 
Newbie

Joined: Fri Apr 01, 2005 4:29 am
Posts: 3
in quickstart.html, in the documentation,

it should be marked as required.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 01, 2005 8:58 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
The documentation points you to README.txt in the lib directory - jta.jar is _NOT_ required on all deployment platforms.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.