[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5329) NoClassDefFoundError when using Hibernate 3.5 with J2SE 1.4 because of a wrong catch block
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Tue Jun 22 14:36:09 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37536#action_37536 ]
Emmanuel Bernard commented on HHH-5329:
---------------------------------------
Francesco, which Java VM are you using exactly? Can you also attach the full stack trace? Is it failing at this line?
{code}concurrentStatistics = (Statistics) constructor.newInstance(new Object[]{this}){code}
> NoClassDefFoundError when using Hibernate 3.5 with J2SE 1.4 because of a wrong catch block
> ------------------------------------------------------------------------------------------
>
> Key: HHH-5329
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5329
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.5.0-Final
> Environment: Hibernate 3.5, Java SE 1.4 or J2EE 1.3
> Reporter: Francesco Poli
> Assignee: Emmanuel Bernard
> Priority: Blocker
> Fix For: 3.5.x
>
>
> In org.hibernate.impl.SessionFactoryImpl is done this check when looking for concurrent classes during the creation of the SessionFactory:
> 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");
> }
> But what is thrown is a NoClassDefFoundError, which is not an Exception.
> As a consequence, the catch block won't work and the error is propagated to the upper levels of the application.
> I suggest to modify the catch arguments to match the correct type of the thrown object.
> Thank you.
> Bye
> Francesco Poli
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list