-->
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: Hibernate Error
PostPosted: Mon Dec 05, 2005 8:56 pm 
Newbie

Joined: Wed Aug 17, 2005 10:50 am
Posts: 11
I am getting an error as follows:

[12/5/05 18:33:17:383 CST] 188a5eeb SystemOut O Hibernate: select table1gs0_.SSN as SSN, table1gs0_.FLDR_NUM as FLDR2_8_, table1gs0_.CASE_NUM as CASE3_8_, table1gs0_.CASE_CLM_SEQ_NUM as CASE4_8_, table1gs0_.CaseComments as CaseComm5_8_ from Table1 table1gs0_
[12/5/05 18:33:17:814 CST] 188a5eeb RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.lang.RuntimeException
[12/5/05 18:33:18:896 CST] 188a5eeb WebGroup E SRVE0026E: [Servlet Error]-[exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of ne.dds.caseControl.efi.util.Table1GS.setFolderNumber]: java.lang.RuntimeException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of ne.dds.caseControl.efi.util.Table1GS.setFolderNumber
at ne.dds.caseControl.efi.util.Table1GS.listEvents(Table1GS.java:135)
at ne.dds.caseControl.efi.services.UNQCode.makeUNQCode(UNQCode.java:24)
at ne.dds.caseControl.efi.services.ClmtReceiptGetSet.setClaimReceiptFields(ClmtReceiptGetSet.java:47)
at ne.dds.caseControl.efi.actions.ClaimScreenAction.page(ClaimScreenAction.java:75)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)


Here is the code:
[code]
Table1.java

public List listEvents(HttpServletRequest req)
{
try
{
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();

List result1=session.createQuery("from Table1GS ").list();
return result1;


}
catch (HibernateException e)
{
throw new RuntimeException(e.getMessage());
}
}

public int getFolderNumber() {
return folderNumber;
}


public void setFolderNumber(int i) {
folderNumber = i;
}


UNQCode.java
public void makeUNQCode(ClaimReceiptForm clmRctForm,
HttpServletRequest request)
{
Table1GS t1gs = new Table1GS();
List ls = t1gs.listEvents(request);
}



Table1.hbm.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"D:\neddsWorkspace\neddsWeb\Java Source\hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="ne.dds.caseControl.efi.util.Table1GS" table="Table1" dynamic-update="true" select-before-update="true">
<id name="SSN" column="SSN" type="string" unsaved-value="-1">
<generator class="assigned" />
</id>
<property name="folderNumber" column="FLDR_NUM" type="int"/>
<property name="caseNumber" column="CASE_NUM" type="int"/>
<property name="caseClaimSeqNumber" column="CASE_CLM_SEQ_NUM" type="int"/>
<property name="caseCommnts" column="CaseComments" type="string"/>

</class>
</hibernate-mapping>

[/code]

Can any one let me know why the error is occurring. Thank you very much in advance.

Arun.


Top
 Profile  
 
 Post subject: Re: Hibernate Error
PostPosted: Mon Dec 05, 2005 9:41 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
arunkd6 wrote:
(set hibernate.cglib.use_reflection_optimizer=false for more info)


it's going to be a property in hibernate.cfg.xml


Top
 Profile  
 
 Post subject: Hibernate Error
PostPosted: Tue Dec 06, 2005 11:56 am 
Newbie

Joined: Wed Aug 17, 2005 10:50 am
Posts: 11
Hello Dennis,

set hibernate.cglib.use_reflection_optimizer was set to false still I am getting the same error?

When I run the code as follows in Table1.java, it is not giving me any errors:

List result1=session.createQuery("from Table1GS "+
"as tb1 where " +
" tb1.folderNumber= "+fldrNo+ " and tb1.caseNumber= "+caseNo+
" and
tb1.caseClaimSeqNumber= "+caseClmSeqNo+
" and tb1.claimType
like '"+clmType+"'").list();

But if run as
List result1=session.createQuery("from Table1GS ").list();
I am getting the above error. Any sugguestions will be definitely rated. Thank you,

Arun.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 3:12 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
I'd bet Hibernate is choking when creating an object from one of the rows of Table1 that is filtered out by your working query.

Seems to happen when calling Table1GS.setFolderNumber(). Is that a simple setter or have you added some logic inside it ?

hibernate.cglib.use_reflection_optimizer=false must be set in the hibernate.properties file, if you set it in the xml config file, Hibernate will ignore it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 4:18 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Probably you are trieng to load SQL NULL to java primitive type (it throws NPE). Use primitive wrappers like "java.lang.Integer" for nullable fields.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.