-->
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: ConcurrentMap NoClassDefFoundError running in Java 1.4
PostPosted: Fri Apr 09, 2010 3:05 pm 
Newbie

Joined: Fri Apr 09, 2010 2:53 pm
Posts: 1
Hello,

I am attempting to get Hibernate to run using Java 1.4 (COTS limitation).

I have been trying to get the sample application running in my environment, but I get a NoClassDefFoundError: java/util/concurrent/ConcurrentMap at SessionFactoryImpl.<init> (SessionFactoryImpl.java:204)

I see that that class was added in Java 5. How can I get around this so it works in my environment? I could not find any specific 1.4 steps to use hibernate.

I assume maybe some library needs to be included, or I am using the wrong hibernate distribution? I just downloaded the hibernate-distribution-3.5.0-Final-dist.zip.

Hopefully it is something silly I just don't know

My classpath has:
my 1.4 jre (IBM Websphere 6.0 jre)
hibernate3.jar
javaassist-3.9.0.GA.jar
antlr-2.7.6.jar
common-collections-3.1.jar
dom4j-1.6.1.jar
jta-1.1.jar
slf4j-api-1.5.8.jar
log4j-1.1.13.jar
slf4j-jdk14-1.5.11.jar
ojdbc14.jar


Top
 Profile  
 
 Post subject: Re: ConcurrentMap NoClassDefFoundError running in Java 1.4
PostPosted: Sat Apr 10, 2010 4:56 am 
Newbie

Joined: Fri Apr 09, 2010 5:32 pm
Posts: 7
nobody answer here , don't waste your time !!!!!!!!!


Top
 Profile  
 
 Post subject: Re: ConcurrentMap NoClassDefFoundError running in Java 1.4
PostPosted: Tue Jun 22, 2010 11:19 am 
Newbie

Joined: Fri Apr 09, 2010 6:56 am
Posts: 2
Hi, looking into the sources I've found this, in org.hibernate.impl.SessionFactoryImpl:

Code:
Statistics concurrentStatistics = null;
   try {
      Class concurrentStatsClass = ReflectHelper.classForName("org.hibernate.stat.ConcurrentStatisticsImpl");
      Constructor constructor = concurrentStatsClass.getConstructor(new Class[]{SessionFactoryImplementor.class});
      concurrentStatistics = (Statistics) constructor.newInstance(new Object[]{this});
      log.trace("JDK 1.5 concurrent classes present");
   } catch (Exception noJava5) {
      log.trace("JDK 1.5 concurrent classes missing");
   }

   if (concurrentStatistics != null) {
      this.statistics = concurrentStatistics;
   } else {
      this.statistics = new StatisticsImpl(this);
   }


...but NoClassDefFoundError is NOT an Exception, is an Error!!!
So, the catch block won't ever work!

I'll try asap to open an issue segnalation to Jira, but the site seems to be down.. :(

Bye!

Francesco


Top
 Profile  
 
 Post subject: Re: ConcurrentMap NoClassDefFoundError running in Java 1.4
PostPosted: Thu Jul 22, 2010 6:19 am 
Newbie

Joined: Fri Apr 09, 2010 6:56 am
Posts: 2
Seems like the new release (3.5.4) fixes the problem.
I'll give it a try as soon as I can.

Bye!


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.