-->
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.  [ 5 posts ] 
Author Message
 Post subject: Urgent problem with sf.hibernate.util.ReflectHelper
PostPosted: Mon Mar 14, 2005 4:57 am 
Newbie

Joined: Fri Sep 10, 2004 3:02 am
Posts: 2
Location: Germany
Hi all,

i have a strange problem while deploying my app to the production system. The application blocks after i try to access the database.


On my development system i get the following messages:

2005-03-14 07:30:07,578; DEBUG; sf.hibernate.impl.SessionFactoryImpl; instantiating session factory with properties: { ...

2005-03-14 08:36:37,718; INFO ; sf.hibernate.util.ReflectHelper; reflection optimizer disabled for: com.oerag.auftragsabwicklung.model.entity.CCDefect, StackOverflowError: null


On the production system there is no output after the 'instantiating session factory' message.

I am using Hibernate 2.1, DB2, Java 1.4.2 and Tomcat 5.0.28. The os on the production system is AIX 5.2, my development system works with Windows NT 4.

Any ideas? If so please answer fast because i have to show the app to my boss today.

Thanks,
Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 6:01 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Try to dissable "reflection optimizer" in hibernate.properties (it makes no sence on JDK 1.4.2 anyway) and send "CCDefect.java" file to baliuka at yahoo.com, "StackOverflowError" means bug in cglib.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 6:19 am 
Newbie

Joined: Fri Sep 10, 2004 3:02 am
Posts: 2
Location: Germany
Hi again,

thank you baliukas for your fast response.

I disabled the "reflection optimizer" in the hibernate configuration file with

<property name="hibernate.cglib.use_reflection_optimizer">false</property>.

Now i don't get an error message on the development system but the problem on the production system still exists. It seems that the error message has nothing to do with my real problem.

Nonetheless here is the code of CCDefect. It's a simple pojo:

package com.oerag.auftragsabwicklung.model.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.oerag.auftragsabwicklung.model.exception.ClearCaseException;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;


public class CCDefect implements Serializable
{
private int id;
private String defectId;
private String name;
private CCUser ersteller;
private Date erstelltAm;
private CCState status;
private CCProject projekt;


// Class Methods --------------------------------------------------------------------

public static CCDefect getDefectForNummer(Session session, String nummer) throws ClearCaseException
{
try
{
return (CCDefect)session.createQuery("from CCDefect defect where defect.id = :nummer")
.setInteger("nummer", Integer.parseInt(nummer))
.uniqueResult();
}
catch (HibernateException e)
{
throw new ClearCaseException(e);
}
}


public static List getDefects(Session session) throws ClearCaseException
{
try
{
return session.createQuery("from CCDefect d where d.status is not null and d.ersteller is not null order by submit_date").list();
}
catch (HibernateException e)
{
throw new ClearCaseException(e);
}
}


// Constructors ---------------------------------------------------------------------

public CCDefect()
{
super();
}


// Accessors ------------------------------------------------------------------------

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


public int getId()
{
return this.id;
}


public void setDefectId(String defectId)
{
this.defectId = defectId;
}


public String getDefectId()
{
return this.defectId;
}


public void setName(String name)
{
this.name = name;
}


public String getName()
{
return this.name;
}


public void setErsteller(CCUser ersteller)
{
this.ersteller = ersteller;
}


public CCUser getErsteller()
{
return this.getErsteller();
}


public void setErstelltAm(Date erstelltAm)
{
this.erstelltAm = erstelltAm;
}


public Date getErstelltAm()
{
return this.getErstelltAm();
}


public void setStatus(CCState status)
{
this.status = status;
}


public CCState getStatus()
{
return this.status;
}


public void setProjekt(CCProject projekt)
{
this.projekt = projekt;
}


public CCProject getProjekt()
{
return this.projekt;
}


public String getNummer()
{
return "" + this.getId();
}


// Logic ----------------------------------------------------------------------------

public String toString()
{
return this.getName() + " / " + this.getStatus() + " / " + this.getProjekt();
}
}


And here the mapping:

<?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.oerag.auftragsabwicklung.model.entity">

<class name="CCDefect" table="defect">

<id name="id" type="integer" column="dbid">
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value</param>
<param name="max_lo">1</param>
</generator>
</id>

<property name="defectId" type="string" column="id" not-null="true"/>
<property name="name" type="string" column="headline" not-null="true"/>
<property name="erstelltAm" type="date" column="submit_date" not-null="true"/>


<many-to-one name="ersteller" class="CCUser" not-null="false">
<column name="owner"/>
</many-to-one>

<many-to-one name="status" class="CCState" not-null="false">
<column name="state"/>
</many-to-one>

<many-to-one name="projekt" class="CCProject" not-null="false">
<column name="ucm_project"/>
</many-to-one>

</class>

</hibernate-mapping>


Thank you,
Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 7:40 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Try to print all stack traces for threads to stdout, It depends on OS and I am not sure about AIX (it can be kill -3, but it doe's not work on some platforms) or try to connect using jdb.

http://www.unixville.com/~moazam/storie ... heJvm.html

oliver.mondry wrote:
Hi again,

thank you baliukas for your fast response.

I disabled the "reflection optimizer" in the hibernate configuration file with

<property name="hibernate.cglib.use_reflection_optimizer">false</property>.

Now i don't get an error message on the development system but the problem on the production system still exists. It seems that the error message has nothing to do with my real problem.

Nonetheless here is the code of CCDefect. It's a simple pojo:

package com.oerag.auftragsabwicklung.model.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.oerag.auftragsabwicklung.model.exception.ClearCaseException;

import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;


public class CCDefect implements Serializable
{
private int id;
private String defectId;
private String name;
private CCUser ersteller;
private Date erstelltAm;
private CCState status;
private CCProject projekt;


// Class Methods --------------------------------------------------------------------

public static CCDefect getDefectForNummer(Session session, String nummer) throws ClearCaseException
{
try
{
return (CCDefect)session.createQuery("from CCDefect defect where defect.id = :nummer")
.setInteger("nummer", Integer.parseInt(nummer))
.uniqueResult();
}
catch (HibernateException e)
{
throw new ClearCaseException(e);
}
}


public static List getDefects(Session session) throws ClearCaseException
{
try
{
return session.createQuery("from CCDefect d where d.status is not null and d.ersteller is not null order by submit_date").list();
}
catch (HibernateException e)
{
throw new ClearCaseException(e);
}
}


// Constructors ---------------------------------------------------------------------

public CCDefect()
{
super();
}


// Accessors ------------------------------------------------------------------------

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


public int getId()
{
return this.id;
}


public void setDefectId(String defectId)
{
this.defectId = defectId;
}


public String getDefectId()
{
return this.defectId;
}


public void setName(String name)
{
this.name = name;
}


public String getName()
{
return this.name;
}


public void setErsteller(CCUser ersteller)
{
this.ersteller = ersteller;
}


public CCUser getErsteller()
{
return this.getErsteller();
}


public void setErstelltAm(Date erstelltAm)
{
this.erstelltAm = erstelltAm;
}


public Date getErstelltAm()
{
return this.getErstelltAm();
}


public void setStatus(CCState status)
{
this.status = status;
}


public CCState getStatus()
{
return this.status;
}


public void setProjekt(CCProject projekt)
{
this.projekt = projekt;
}


public CCProject getProjekt()
{
return this.projekt;
}


public String getNummer()
{
return "" + this.getId();
}


// Logic ----------------------------------------------------------------------------

public String toString()
{
return this.getName() + " / " + this.getStatus() + " / " + this.getProjekt();
}
}


And here the mapping:

<?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.oerag.auftragsabwicklung.model.entity">

<class name="CCDefect" table="defect">

<id name="id" type="integer" column="dbid">
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value</param>
<param name="max_lo">1</param>
</generator>
</id>

<property name="defectId" type="string" column="id" not-null="true"/>
<property name="name" type="string" column="headline" not-null="true"/>
<property name="erstelltAm" type="date" column="submit_date" not-null="true"/>


<many-to-one name="ersteller" class="CCUser" not-null="false">
<column name="owner"/>
</many-to-one>

<many-to-one name="status" class="CCState" not-null="false">
<column name="state"/>
</many-to-one>

<many-to-one name="projekt" class="CCProject" not-null="false">
<column name="ucm_project"/>
</many-to-one>

</class>

</hibernate-mapping>


Thank you,
Oliver


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 8:13 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
BTW "-XX:MaxPermSize=256M" can help too (if it is related to reflection).


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