-->
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.  [ 1 post ] 
Author Message
 Post subject: java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.v
PostPosted: Thu Jul 26, 2012 1:54 am 
Newbie

Joined: Thu Jul 26, 2012 1:47 am
Posts: 2
While trying to build the session factory I get this. Very little turns up in an Internet search. But it's got me dead-in-the-water for weeks now. Thanks.

java.lang.NoSuchMethodError: org.hibernate.cfg.Environment.verifyProperties(Ljava/util/Map;)V
at org.hibernate.service.ServiceRegistryBuilder.buildServiceRegistry(ServiceRegistryBuilder.java:244)


Using Hibernate version:

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.1.1.Final</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.1.Final</version>
</dependency>


---------------------

public class HibernateUtils {

private static final String DATABASE_HOST = "host_to_db";

private static SessionFactory factory;
private static ServiceRegistry serviceRegistry;

public static void init() {
Configuration config = getConfiguration();
config.configure();

serviceRegistry = new ServiceRegistryBuilder().applySettings(
config.getProperties()).buildServiceRegistry();

config.setSessionFactoryObserver(new SessionFactoryObserver() {

@Override
public void sessionFactoryCreated(SessionFactory factory) { }

@Override
public void sessionFactoryClosed(SessionFactory factory) {
ServiceRegistryBuilder.destroy(serviceRegistry);
}
});

factory = config.buildSessionFactory(serviceRegistry);
}

-------------------------------------

Here are my hibernate dependencies as shown in Netbeans:

They are: (BTW - I get the same error if I just use hibernate-core without c3p0)
hibernate-c3p0-4.1.1.Final.jar c3p0-0.9.1.jar (via hibernate-c3p0)
hibernate-commons-annotations-4.0.1.Final.jar (via hibernate-core)
hibernate-core-4.1.1.Final.jar (via hibernate-c3p0)
hibernate-jpa-2.0-api-1.0.1.Final.jar (via hibernate-core)
javassist-3.15.0-GA.jar (via hibernate-c3p0)
jboss-logging-3.1.0.GA.jar (via hibernate-c3p0)
jboss-transaction-api_1.1_spec-1.0.0.Final.jar (via hibernate-c3p0)
xml-apis-1.0.b2.jar (via hibernate-c3p0)


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

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.