-->
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.  [ 1 post ] 
Author Message
 Post subject: could not insert exception when trying to insert a row
PostPosted: Fri Mar 19, 2010 11:25 am 
Newbie

Joined: Fri Oct 30, 2009 4:30 pm
Posts: 16
Hi

I have an entity Fce which has certain parameters which are defined in the DB as number(1). They take a single numeric integer as a value. Now the entity I have is defined as follows:

@Entity
@Table(name = "FCE", schema = "KARYN")
public class Fce implements java.io.Serializable {

private static final long serialVersionUID = 1L;

private FceId id;
private Short courseTotal;
private String semOrder;
private BigDecimal objective;
private BigDecimal exams;
private BigDecimal assignments;
private BigDecimal lectures;
private BigDecimal discussions;
private BigDecimal relevancy;
private BigDecimal overallRating;
private Date dateEntered;
private String enteredBy;
private String updatedBy;
private Date dateUpdated;
private CourseOffering courseOffering;
}

I am referring to the parameters defined as BigDecimal in this entity. They are defined as Number(1) in the DB. And they are all nullable. Now I am trying to insert a row into the table FCE. And i get the following exception.

java.lang.NoSuchMethodError: edu.cmu.heinz.hcis.entity.Fce.getObjective()Ljava/lang/Short;
javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: java.lang.NoSuchMethodError: edu.cmu.heinz.hcis.entity.Fce.getObjective()Ljava/lang/Short;
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.ejb.EJBTransactionRolledbackException: java.lang.NoSuchMethodError: edu.cmu.heinz.hcis.entity.Fce.getObjective()Ljava/lang/Short;
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:94)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:108)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:117)
at $Proxy256.addFacultyCourseEval(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
at org.javassist.tmp.java.lang.Object_$$_javassist_3.addFacultyCourseEval(Object_$$_javassist_3.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:274)
at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 49 more


It seems like it is expecting Short. The problem is that it does not end there. I have changed it to Short and tried it as well.

Then I get the following error.


------------------------------------------------------------------------------------------------------------------
Hibernate:
select
fce0_.COURSE_NO as COURSE1_46_0_,
fce0_.SECTION as SECTION46_0_,
fce0_.SEMESTER as SEMESTER46_0_,
fce0_.SEQUENCE_NO as SEQUENCE4_46_0_,
fce0_.ASSIGNMENTS as ASSIGNME5_46_0_,
fce0_.COURSE_TOTAL as COURSE6_46_0_,
fce0_.DATE_ENTERED as DATE7_46_0_,
fce0_.DATE_UPDATED as DATE8_46_0_,
fce0_.DISCUSSIONS as DISCUSSI9_46_0_,
fce0_.ENTERED_BY as ENTERED10_46_0_,
fce0_.EXAMS as EXAMS46_0_,
fce0_.LECTURES as LECTURES46_0_,
fce0_.OBJECTIVE as OBJECTIVE46_0_,
fce0_.OVERALL_RATING as OVERALL14_46_0_,
fce0_.RELEVANCY as RELEVANCY46_0_,
fce0_.SEM_ORDER as SEM16_46_0_,
fce0_.UPDATED_BY as UPDATED17_46_0_
from
KARYN.FCE fce0_
where
fce0_.COURSE_NO=?
and fce0_.SECTION=?
and fce0_.SEMESTER=?
and fce0_.SEQUENCE_NO=?
16:52:37,495 INFO [STDOUT] Hibernate:
select
fceins0_.COURSE_NO as COURSE1_57_0_,
fceins0_.FAC_ID as FAC2_57_0_,
fceins0_.SECTION as SECTION57_0_,
fceins0_.SEMESTER as SEMESTER57_0_,
fceins0_.SEQUENCE_NO as SEQUENCE5_57_0_,
fceins0_.ANSWER_N_FEEDBACK as ANSWER6_57_0_,
fceins0_.CRITICAL_THINKING as CRITICAL7_57_0_,
fceins0_.DATE_ENTERED as DATE8_57_0_,
fceins0_.DATE_UPDATED as DATE9_57_0_,
fceins0_.ENTERED_BY as ENTERED10_57_0_,
fceins0_.ENTHUSIASM as ENTHUSIASM57_0_,
fceins0_.OVERALL_RATING as OVERALL12_57_0_,
fceins0_.SEM_ORDER as SEM13_57_0_,
fceins0_.UPDATED_BY as UPDATED14_57_0_
from
KARYN.FCE_INS fceins0_
where
fceins0_.COURSE_NO=?
and fceins0_.FAC_ID=?
and fceins0_.SECTION=?
and fceins0_.SEMESTER=?
and fceins0_.SEQUENCE_NO=?
16:52:37,495 INFO [STDOUT] Hibernate:
select
fceta0_.COURSE_NO as COURSE1_56_0_,
fceta0_.SECTION as SECTION56_0_,
fceta0_.SEMESTER as SEMESTER56_0_,
fceta0_.SEQUENCE_NO as SEQUENCE4_56_0_,
fceta0_.TA_ID as TA5_56_0_,
fceta0_.AVAILABLITY as AVAILABL6_56_0_,
fceta0_.COMMUNICATION as COMMUNIC7_56_0_,
fceta0_.DATE_ENTERED as DATE8_56_0_,
fceta0_.DATE_UPDATED as DATE9_56_0_,
fceta0_.ENTERED_BY as ENTERED10_56_0_,
fceta0_.ENTHUSIASM as ENTHUSIASM56_0_,
fceta0_.OVERALL_RATING as OVERALL12_56_0_,
fceta0_.PATIENCE as PATIENCE56_0_,
fceta0_.SEM_ORDER as SEM14_56_0_,
fceta0_.UPDATED_BY as UPDATED15_56_0_
from
KARYN.FCE_TA fceta0_
where
fceta0_.COURSE_NO=?
and fceta0_.SECTION=?
and fceta0_.SEMESTER=?
and fceta0_.SEQUENCE_NO=?
and fceta0_.TA_ID=?
16:52:37,557 INFO [STDOUT] Hibernate:
insert
into
KARYN.FCE
(ASSIGNMENTS, COURSE_TOTAL, DATE_ENTERED, DATE_UPDATED, DISCUSSIONS, ENTERED_BY, EXAMS, LECTURES, OBJECTIVE, OVERALL_RATING, RELEVANCY, SEM_ORDER, UPDATED_BY, COURSE_NO, SECTION, SEMESTER, SEQUENCE_NO)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
16:52:37,557 INFO [STDOUT] Invalid Value: #0--semester
16:52:37,557 INFO [STDOUT] Invalid Value: #0--courseNo
16:52:37,557 INFO [STDOUT] Invalid Value: #0--section
16:52:37,557 INFO [STDOUT] mode is viewFacCourseEval
16:52:37,636 INFO [STDOUT] Hibernate:
insert
into
KARYN.FCE
(ASSIGNMENTS, COURSE_TOTAL, DATE_ENTERED, DATE_UPDATED, DISCUSSIONS, ENTERED_BY, EXAMS, LECTURES, OBJECTIVE, OVERALL_RATING, RELEVANCY, SEM_ORDER, UPDATED_BY, COURSE_NO, SECTION, SEMESTER, SEQUENCE_NO)
values
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
16:52:37,636 INFO [ShortType] could not bind value '3' to parameter: 1; The statement is closed.
16:52:37,636 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
16:52:37,636 ERROR [JDBCExceptionReporter] The statement is closed.
16:52:37,636 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not insert: [edu.cmu.heinz.hcis.entity.Fce]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:523)
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:114)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:247)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:86)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1406)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:135)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:87)
at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.commit(ServerVMClientUserTransaction.java:146)
at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:52)
at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:603)
at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:341)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:241)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:192)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)

------------------------------------------------------------------------------------------------------------------

If you see this it is trying to insert data into FCE but there is a mismatch from the data I am trying to insert and to the column it is trying to insert it into.

I dont see the reason why there should be this mismatch. I generated the entity through Hibernate Tools. So what is going on here. Kindly do let me know if anyone has any idea.

I would look forward for a quick response on this pls.

thanks
Sai


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.