Hi,
I have a class OrderStatusReport with InheritanceType 'JOINED' and i have used the column "service_class" as the discriminator column .Here is the code snippet.
@Table(name = "order_status_report")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="service_class",discriminatorType=DiscriminatorType.STRING)
public class OrderStatusReport implements Serializable {}
Now i have declared one of my sub class as below using the @DiscriminatorValue annotation with value as "Audit"
@Entity
@Table(name="order_status_report")
@DiscriminatorValue(value="Audit")
public class AuditOrderStatusReport extends OrderStatusReport {
/** Creates a new instance of AuditOrderStatusReport */
public AuditOrderStatusReport() {
}
}
Now since one of the records of table 'order_status_report' has the value 'AUDIT'(full capital letters) instead of 'Audit' for the column 'service_class'' i am getting an exception 'Missing class for indicator field value'.Here is a complete stack trace of the exception thrown:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.servlet.jsp.JspException: javax.faces.el.EvaluationException: Error getting property 'orderStatusReports' from bean of type com.zerone.qai.view.AuditHistoryController: Exception [TOPLINK-43] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [AUDIT] of type [class java.lang.String].
Descriptor: RelationalDescriptor(com.zerone.qai.model.OrderStatusReport --> [DatabaseTable(order_status_report)])
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:112)
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.faces.el.EvaluationException: Error getting property 'orderStatusReports' from bean of type com.zerone.qai.view.AuditHistoryController: Exception [TOPLINK-43] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [AUDIT] of type [class java.lang.String].
Descriptor: RelationalDescriptor(com.zerone.qai.model.OrderStatusReport --> [DatabaseTable(order_status_report)])
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:854)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.auditHistoryView_jsp._jspService(auditHistoryView_jsp.java:481)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:112)
root cause
javax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Error getting property 'orderStatusReports' from bean of type com.zerone.qai.view.AuditHistoryController: Exception [TOPLINK-43] (Oracle TopLink Essentials - 2006.8 (Build 060830)): oracle.toplink.essentials.exceptions.DescriptorException
Exception Description: Missing class for indicator field value [AUDIT] of type [class java.lang.String].
Descriptor: RelationalDescriptor(com.zerone.qai.model.OrderStatusReport --> [DatabaseTable(order_status_report)])
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:206)
com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
javax.faces.component.UIData.getValue(UIData.java:527)
javax.faces.component.UIData.getDataModel(UIData.java:856)
javax.faces.component.UIData.setRowIndex(UIData.java:379)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:65)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
javax.faces.component.UIData.encodeBegin(UIData.java:681)
javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:591)
javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:543)
com.sun.faces.taglib.html_basic.DataTableTag.doEndTag(DataTableTag.java:491)
org.apache.jsp.auditHistoryView_jsp._jspx_meth_h_dataTable_0(auditHistoryView_jsp.java:1789)
org.apache.jsp.auditHistoryView_jsp._jspx_meth_h_form_1(auditHistoryView_jsp.java:1276)
org.apache.jsp.auditHistoryView_jsp._jspx_meth_f_view_0(auditHistoryView_jsp.java:552)
org.apache.jsp.auditHistoryView_jsp._jspService(auditHistoryView_jsp.java:456)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:112)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
--------------------------------------------------------------------------------
Can somebody help me with this?Is there any way of giving more than one value for discrimator value annotation?Is there any way of telling to use 'Audit' as @DiscriminatorValue irrespective of the case in which it is given?
[Message sent by forum member 'shreeja_r' (shreeja_r)]
http://forums.java.net/jive/thread.jspa?messageID=219402