-->
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.  [ 2 posts ] 
Author Message
 Post subject: "reflection optimizer disabled" - why?
PostPosted: Mon May 16, 2005 11:57 pm 
Regular
Regular

Joined: Wed May 11, 2005 11:57 pm
Posts: 80
I'm trying to figure out why I'm getting this message at startup:

May 16, 2005 11:50:06 PM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: com.prosc.test.EmailAddress, CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
May 16, 2005 11:50:06 PM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: com.prosc.test.PhoneNumber, CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
May 16, 2005 11:50:06 PM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: com.prosc.test.MailingAddress, CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
May 16, 2005 11:50:06 PM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: com.prosc.test.Person, CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
May 16, 2005 11:50:06 PM net.sf.hibernate.util.ReflectHelper getBulkBean
INFO: reflection optimizer disabled for: com.prosc.test.Cat, CodeGenerationException: java.lang.reflect.InvocationTargetException-->null

Here is the source code from one of the simplest classes mentioned, EmailAddress. I've stripped out all the custom stuff that I've done in this class except for the barebones stuff, and I'm still getting the same message. Here is the the code, after removing commented lines:

Code:
package com.prosc.test;

public class EmailAddress {
    private long id;
    private String label;
    private String emailAddress;

    public EmailAddress() {}

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String newValue) {
        this.label = newValue;
    }

    public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String newValue) {
        this.emailAddress = newValue;
    }
}


Here is the Hibernate mapping file for EmailAddress:

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping package="com.prosc.test" >
    <class name="EmailAddress">
        <id name="id" type="long" unsaved-value="0" >
            <column name="id" not-null="true"/>
            <generator class="native"/>
        </id>

        <property name="label" />
        <property name="emailAddress" />
    </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: SOLVED
PostPosted: Mon Jul 18, 2005 9:21 am 
Regular
Regular

Joined: Wed May 11, 2005 11:57 pm
Posts: 80
Found the problem by setting breakpoints in the hibernate source code:

I had used jarsigner to sign all of my jar files (including cglib). My application classes were running from regular .class files, not .jar files, and when CGLIB tried to make a dynamic proxy, it used the same certificate as its owned signed jar files. This did not match the classes it was subclassing, which had no certificate, and so it failed.

The solution was to replace the signed CGLIB jar file (in fact, all the support jars for the application) with unsigned jars during development, and make a separate signed copy for deployment.


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