-->
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: HELP!! reflection optimizer disabled
PostPosted: Thu Aug 12, 2004 9:11 am 
Newbie

Joined: Thu Aug 12, 2004 7:26 am
Posts: 2
Hi there!

I am pretty new to hibernate but have been asked to resolve this issue with the reflection optimizer getting disabled when loading select domain objects.

I have already looked thru the faqs and the online reference doc to realize that for certain objects Reflection Helper gets disabled and the objects are loaded using reflection.

However, to make our application performant, I would like to do whatever we can on our part to prevent Reflection Helper from getting disabled on these object.

Can someone provide me with some clues as to how to proceed further to prevent reflection helper from getting disabled. Is there some way to order the loading of domain objects? (I am guessing, that may resolve the problem, as most of the objects below are related to each other...)

Any help would be greatly appreciated.


Hibernate version: 2.0

Mapping documents:

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

Full stack trace of any exception that occurs:

11:51:59,293 INFO [SessionFactoryImpl] building session factory

10:59:55,931 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.agreement.ClauseDestination, NullPointerException:null

10:59:55,941 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.rate.CarrierRate, VerifyError: (class: caw/b3xt/dom
ain/rate/CarrierRate$$BulkBeanByCGLIB$$402d9b68, method: setPropertyValues signature: (Ljava/lang/Object;[Ljava/lang/Object;)V) Expecting
to find array of objects or arrays on stack

10:59:56,001 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.user.User, BulkBeanException: null (property setNam
e)

10:59:56,052 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.rate.BaseRate, VerifyError: (class: caw/b3xt/domain
/rate/BaseRate$$BulkBeanByCGLIB$$c658932c, method: setPropertyValues signature: (Ljava/lang/Object;[Ljava/lang/Object;)V) Expecting to fi
nd array of objects or arrays on stack

Name and version of the database you are using:
MS SQL SERVER 2000

Debug level Hibernate log excerpt:

cheer-e)
Dipendra


Top
 Profile  
 
 Post subject: Re: HELP!! reflection optimizer disabled
PostPosted: Thu Aug 12, 2004 10:10 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
dipendra wrote:
10:59:55,931 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.agreement.ClauseDestination, NullPointerException:null

Plese show java class and mapping for caw.b3xt.domain.agreement.ClauseDestination

Quote:
10:59:55,941 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.rate.CarrierRate, VerifyError: (class: caw/b3xt/dom
ain/rate/CarrierRate$$BulkBeanByCGLIB$$402d9b68, method: setPropertyValues signature: (Ljava/lang/Object;[Ljava/lang/Object;)V) Expecting to find array of objects or arrays on stack

mapping and java class for caw.b3xt.domain.rate.CarrierRate....
But you can read .... :)
(Ljava/lang/Object;[Ljava/lang/Object;)V) Expecting to find array of objects or arrays on stack
so as I got you have a setter with Object argument instead of expected array of objects.

Quote:
10:59:56,001 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.user.User, BulkBeanException: null (property setName)

java class and mapping for caw.b3xt.domain.user.User

Quote:
10:59:56,052 INFO [ReflectHelper] reflection optimizer disabled for: caw.b3xt.domain.rate.BaseRate, VerifyError: (class: caw/b3xt/domain
/rate/BaseRate$$BulkBeanByCGLIB$$c658932c, method: setPropertyValues signature: (Ljava/lang/Object;[Ljava/lang/Object;)V) Expecting to fi
nd array of objects or arrays on stack

CGLIB expects array of objects or arrays for argument of some setter.

_________________
Leonid Shlyapnikov


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 10:15 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
It is not the best solution, but if you don't want to change anything in the java code set in the mappings access="field" instead of default access="property". If it helps you, return back all default access="property" and try to find error-prone java class setters and getters.

_________________
Leonid Shlyapnikov


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 13, 2004 4:46 am 
Newbie

Joined: Thu Aug 12, 2004 7:26 am
Posts: 2
Hi,

Below is the code for Clause Destination that caused the Reflection Helper to throw a NPE.....And I will try out setting access to fields and see what happens.

Thanks.




public class ClauseDestination extends IntegerKeyImpl implements Auditable
{

/**
* @deprecated Do not call this method reserved for Hibernate - Flag 'isPersisted' must be set to true!
*/
public ClauseDestination()
{
super();
//setPersisted();
}

public ClauseDestination( AgreementDestination dest )
{
//setTransient();

setAgreementDestination( dest );
}

// --------------------------------------------

private int sequenceNumber = 1;

public int getSequenceNumber()
{
return sequenceNumber;
}

/**
* This is called when the clause is added to the agreement.
*/
public void setSequenceNumber( int sequenceNumber )
{
this.sequenceNumber = sequenceNumber;
}

// --------------------------------------------

private AgreementClause clause;

public AgreementClause getAgreementClause()
{
return this.clause;
}

public void setAgreementClause( AgreementClause clause )
{
this.clause = clause;
}

private Agreement getAgreement()
{
return getAgreementClause().getAgreement();
}

// --------------------------------------------

private AgreementDestination destination;

public AgreementDestination getAgreementDestination()
{
return this.destination;
}

public void setAgreementDestination( AgreementDestination destination )
{
this.destination = destination;
}

// -------------------------------------------

public boolean hasUniqueDestination()
{
AgreementDestination dest = getAgreementDestination();
if ( dest == null ) return false;
return dest.hasUniqueDestination();
}

/**
* Returns the absolute destination of this ag destination.
* @return
*/
public Destination getDestination()
{
AgreementDestination dest = getAgreementDestination();
if ( dest == null ) return null;
return dest.getDestination();
}

// --------------------------------------------

// SAP PRoduct CODE

// =============================================

private Audit audit;

public Audit getAudit()
{
// if the audit record doesnt exist clone the audit of the agreement
if ( audit == null ) this.audit = Audit.duplicate( getAgreement().getAudit() );

return this.audit;
}

public void setAudit( Audit audit )
{
this.audit = audit;
}

// =============================================

/* SQL Which creates all destinations into the clause destination object

SELECT
FROM DestViewScope dvs
INNER JOIN DestVIew dv ON dvs.DestviewScopeID = dv.DestVIewScopeID
WHERE dv.DestinationID = @DestID
AND dvs.DestViewTypeID = 3 --Alter to suit the correct DestViewTypeID!!
*/

}








<?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="caw.b3xt.domain.agreement">

<class name="ClauseDestination" table="ClauseDestination">
<cache usage="nonstrict-read-write"/>

<id name="id" type="integer" column="ClauseDestinationID">
<generator class="identity"/>
</id>

<property name="sequenceNumber" column="ClauseDestinationNumber" type="int"/>

<!-- Link back to the Agreemnt Clause -->
<many-to-one name="agreementClause" class="caw.b3xt.domain.agreement.AgreementClause" column="ClauseID"/>

<!-- Link to the Destination -->
<many-to-one name="agreementDestination" class="caw.b3xt.domain.agreement.AgreementDestination" column="DestViewScopeID"/>

<!-- Auditing Values -->

<component name="audit" class="caw.b3xt.domain.audit.Audit" insert="true" update="true">
<property name="date" column="UpdateDate" type="timestamp"/>
<property name="user" column="UpdateUser" type="string"/>
</component>

<!-- NULL [SAPProductCode] -->

</class>

</hibernate-mapping>


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.