-->
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.  [ 3 posts ] 
Author Message
 Post subject: What Jars do I need to include in my classpath
PostPosted: Tue Feb 03, 2009 4:35 am 
Newbie

Joined: Mon Feb 02, 2009 3:36 pm
Posts: 3
Location: Ireland
Hi,

I'm using JBOSS as my JEE application server, which uses Hibernate as the JPA implementation. I'm also using a MYSQL DB, I'm getting ClassNotFoundException after ClassNotFoundException after including almost any jar I could find, but not getting anywhere, can anyone help as to what Jars I do need?

Hibernate version: 3.0

Mapping documents:

persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd" version="1.0">

<persistence-unit name="DBMSInfo">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.archive.autodetection" value="class" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/DBMSInfo" />
<property name="hibernate.connection.username" value="root" />
<property name="hibernate.connection.password" value="root" />
<property name="hibernate.c3p0.min_size" value="5" />
<property name="hibernate.c3p0.max_size" value="20" />
<property name="hibernate.c3p0.timeout" value="3000" />
<property name="hibernate.c3p0.max_statements" value="50" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
</persistence-unit>
</persistence>


hibernate.cg.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://localhost:3306/DBMSInfo</property>
<property name="connection.username">ecolcar</property>
<property name="connection.password">ecolcar</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="current_session_context_class">thread</property>
<!-- this will show us all sql statements -->
<property name="hibernate.show_sql">true</property>
<!-- mapping files NOTICE WE HAVE NONE-->
</session-factory>
</hibernate-configuration>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

08:13:08,806 INFO Version:15 - Hibernate Annotations 3.2.1.GA
08:13:08,821 INFO Environment:514 - Hibernate 3.2.6
08:13:08,821 INFO Environment:547 - hibernate.properties not found
08:13:08,821 INFO Environment:681 - Bytecode provider name : cglib
08:13:08,837 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
08:13:08,931 INFO Version:286 - Hibernate EntityManager 3.4.0.GA
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.addProperties(Ljava/util/Properties;)Lorg/hibernate/cfg/AnnotationConfiguration;
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:756)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at sware.dbms.businesstier.DbmsBean.<init>(DbmsBean.java:50)
at sware.dbms.clienttier.Driver.main(Driver.java:21)



Name and version of the database you are using: MySQL 5.0

The generated SQL (show_sql=true): None

Debug level Hibernate log excerpt: ??


Regards

Col


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2009 9:58 am 
Newbie

Joined: Fri Jan 30, 2009 5:08 pm
Posts: 17
Location: Florida
These are the jars I have, and I am getting connected and for the most part everything is working, mapping issues:

Some of these may be from the Flex Data Services stuff, so you may not need all of them.


antlr-2.7.6.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
commons-httpclient-3.0.1.jar
concurrent.jar
dom4j-1.6.1.jar
ejb3-persistence.jar
hibernate3.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
javassist-3.4.GA.jar
jta-1.1.jar
log4j-1.2.15.jar
mysql-connector-java-5.1.6-bin.jar
slf4j-api-1.5.2.jar
slf4j-log4j12-1.5.2.jar
xalan.jar


Top
 Profile  
 
 Post subject: Still not working
PostPosted: Sat Feb 14, 2009 10:51 am 
Newbie

Joined: Mon Feb 02, 2009 3:36 pm
Posts: 3
Location: Ireland
Hi,

Thanks for the reply...it is still not compiling now I am getting the following error.

Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named DBMSInfo

Thanks

Col

P.S sorry for the late response


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.