简体   繁体   中英

org.hibernate.hql.internal.ast.QuerySyntaxException: InspectionRequestEntity is not mapped

I am using Hibernate 5.4.9 with Spring 5.2.2 and PostGreSql. I am Trying to retrieve a list of items from database and populate the Datatable. I am Using annotations so there is no hibernate cfg.xml or hbm.xml file in the project. My Entity class looks like

package co.in.grse.inspectionrequest.entities;

import java.sql.Date;
import java.sql.Timestamp;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(name = "om_mh_inspection_request")
@Cacheable(value = true)
@Cache(region = "login", usage = CacheConcurrencyStrategy.READ_WRITE)
public class InspectionRequestEntity {

@Id
@Column(name="inspect_note_no", nullable = false)
private String inspectionNoteNo;

@Column(name="ins_req_sl_no")
private String serial_no;

@Column(name="qcr_no")
private String qcr_no;

@Column(name="discipline_code")
private String disciplineCode;

@Column(name="discipline_desc")
private String disciplineDesc;

@Column(name="subject_code")
private String subCode;

@Column(name="subject_desc")
private String subDesc;

@Column(name="revision_dt")
private Date revisionDate;

@Column(name="revision_no")
private String revisionNo;

@Column(name="subject")
private String subject;

@Column(name="yard_no")
private String yardNo;

@Column(name="block_unit_no")
private String blockUnitNo;

@Column(name="assembly")
private String assembly;

@Column(name="inspect_dt")
private Date inspectDate;

@Column(name="wot_inspect_dt")
private Date wotInspectDate;

@Column(name="drawing_sketch_no")
private String drawingSketchNo;

@Column(name="supplier_name")
private String supplierName;

@Column(name="venue")
private String venue;

@Column(name="purchase_order_no")
private String purchaseOrderNo;

@Column(name="purchase_order_date")
private Date purchaseOrderDate;

@Column(name="remarks")
private String remarks;

@Column(name="created_by",nullable = false)
private String createdBy;

@Column(name="created_on",nullable = false)
private Date createdOn;

@Column(name="modified_by")
private String modifiedBy;

@Column(name="modified_on")
private Date modifiedOn;

@Column(name="pdf_gen_flg")
private String pdfGenFlag;

@Column(name="del_flg")
private String delFlag;

@Column(name="deleted_on")
private Date deletedOn;

@Column(name="deleted_by")
private String deletedBy;

@Column(name="active_roll")
private String activeRoll;

@Column(name="active_user_id")
private String activeUserId;

@Column(name="ref_doc_path")
private String refDocPath;

@Column(name="doc_cd")
private String docCd;

@Column(name="stage_group_code")
private String stageGroupCode;

@Column(name="stage_group_desc")
private String stageGroupDesc;

@Column(name="yard_sl_no")
private String yardSlNo;

@Column(name="subsystem_code")
private String subSytemCode;

@Column(name="subsystem_desc")
private String subSystemDesc;

@Column(name="system_code")
private String systemCode;

@Column(name="system_desc")
private String systemDesc;

@Column(name="block_code")
private String blockCode;

@Column(name="assembly_code")
private String assemblyCode;

@Column(name="compartment_code")
private String compartmentCode;

@Column(name="compartment_desc")
private String compartmentDesc;

@Column(name="design_weight")
private String designWeight;

@Column(name="dimension")
private String dimension;

@Column(name="ref_inspect_note_no")
private String referenceInspectNoteNo;

@Column(name="deck")
private String deck;

@Column(name="status_desc")
private String statusDesc;

@Column(name="qa_insp_dt")
private Date qaInspectDate;

@Column(name="prod_user_id")
private String prodUserId;

@Column(name="qa_user_id")
private String qaUserId;

@Column(name="wot_user_id")
private String wotUserId;

@Column(name="prod_remarks")
private String prodRemarks;

@Column(name="qa_remarks")
private String qaRemarks;

@Column(name="wot_remarks")
private String wotRemarks;

@Column(name="prod_dt")
private Date prodDate;

@Column(name="qa_dt")
private Date qaDate;

@Column(name="wot_dt")
private Date wotDate;

@Column(name="end_user_id")
private String endUserId;

@Column(name="vendor_code")
private String vendorCode;

/**
 * @return the serial_no
 */
public String getSerial_no() {
    return serial_no;
}

/**
 * @param serial_no the serial_no to set
 */
public void setSerial_no(String serial_no) {
    this.serial_no = serial_no;
}

/**
 * @return the qcr_no
 */
public String getQcr_no() {
    return qcr_no;
}

---- Rest of the Getter and Setter Methods ------    
}

My Repository class looks like

@Repository("inspectionRequestRepo")
@Transactional
public class InspectionRequestRepository {
@PersistenceUnit
private EntityManagerFactory entityManagerFactory;
public int getCountInspectionRequestBySrchParam(searchInspectionRequestVO searchVO) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    StringBuilder builder = new StringBuilder();
    builder.append("select count(u) from InspectionRequestEntity u where u.inspectionNoteNo is not null ");

    if (searchVO.getSearchMap() != null) {
        Iterator<String> itr = searchVO.getSearchMap().keySet().iterator();

        while (itr != null && itr.hasNext()) {
            String key = itr.next();
            if(searchVO.getSearchMap().get(key) instanceof Date)
            {
                builder.append(" AND (u.");
                builder.append(key);
                builder.append(" = ");
                builder.append(":" + key);
                if(searchVO.getSearchMap().get(key).equals("%"))
                {
                    builder.append(" OR u.");
                    builder.append(key);
                    builder.append(" is null)");
                }else {
                    builder.append(")");
                }
            } else if(searchVO.getSearchMap().get(key) instanceof Integer)
            {
                builder.append(" AND (u.");
                builder.append(key);
                builder.append(" = ");
                builder.append(":" + key);
                if(searchVO.getSearchMap().get(key).equals("%"))
                {
                    builder.append(" OR u.");
                    builder.append(key);
                    builder.append(" is null)");
                }else {
                    builder.append(")");
                }
            }else {
                builder.append(" AND (upper(u.");
                builder.append(key);
                builder.append(") like ");
                builder.append("upper(:" + key + ")");
                if(searchVO.getSearchMap().get(key).equals("%"))
                {
                builder.append(" OR u.");
                builder.append(key);
                builder.append(" is null)");
                }else {
                    builder.append(")");
                }
            }
        }
    }

and I am Getting the Exception:

2021-03-18 11:36:42.595 DEBUG 4200 --- [nio-8083-exec-2] o.s.web.servlet.DispatcherServlet        : 
Failed to complete request: org.springframework.dao.InvalidDataAccessApiUsageException: 
org.hibernate.hql.internal.ast.QuerySyntaxException: InspectionRequestEntity is not mapped [select 
count(u) from InspectionRequestEntity u where u.inspectionNoteNo is not null  AND 
(upper(u.supplierName) like upper(:supplierName) OR u.supplierName is null) AND 
(upper(u.disciplineDesc) like upper(:disciplineDesc) OR u.disciplineDesc is null) AND 
(upper(u.stageGroupDesc) like upper(:stageGroupDesc) OR u.stageGroupDesc is null) AND 
(upper(u.assemblyCode) like upper(:assemblyCode) OR u.assemblyCode is null) AND (upper(u.statusDesc) 
like upper(:statusDesc) OR u.statusDesc is null) AND (upper(u.subSystemDesc) like 
upper(:subSystemDesc) OR u.subSystemDesc is null) AND (upper(u.inspectDate) like upper(:inspectDate) 
OR u.inspectDate is null) AND (upper(u.systemDesc) like upper(:systemDesc) OR u.systemDesc is null) 
AND (upper(u.inspectionNoteNo) like upper(:inspectionNoteNo) OR u.inspectionNoteNo is null) AND 
(upper(u.blockUnitNo) like upper(:blockUnitNo) OR u.blockUnitNo is null) AND (upper(u.yardNo) like 
upper(:yardNo) OR u.yardNo is null)]; nested exception is java.lang.IllegalArgumentException: 
org.hibernate.hql.internal.ast.QuerySyntaxException: InspectionRequestEntity is not mapped [select 
count(u) from InspectionRequestEntity u where u.inspectionNoteNo is not null  AND 
(upper(u.supplierName) like upper(:supplierName) OR u.supplierName is null) AND 
(upper(u.disciplineDesc) like upper(:disciplineDesc) OR u.disciplineDesc is null) AND 
(upper(u.stageGroupDesc) like upper(:stageGroupDesc) OR u.stageGroupDesc is null) AND 
(upper(u.assemblyCode) like upper(:assemblyCode) OR u.assemblyCode is null) AND (upper(u.statusDesc) 
like upper(:statusDesc) OR u.statusDesc is null) AND (upper(u.subSystemDesc) like 
upper(:subSystemDesc) OR u.subSystemDesc is null) AND (upper(u.inspectDate) like upper(:inspectDate) 
OR u.inspectDate is null) AND (upper(u.systemDesc) like upper(:systemDesc) OR u.systemDesc is null) 
AND (upper(u.inspectionNoteNo) like upper(:inspectionNoteNo) OR u.inspectionNoteNo is null) AND 
(upper(u.blockUnitNo) like upper(:blockUnitNo) OR u.blockUnitNo is null) AND (upper(u.yardNo) like 
upper(:yardNo) OR u.yardNo is null)]
2021-03-18 11:36:42.607 ERROR 4200 --- [nio-8083-exec-2] o.a.c.c.C.[.[.[.[dispatcherServlet]      : 
Servlet.service() for servlet [dispatcherServlet] in context with path [/portal] threw exception 
[Request processing failed; nested exception is 
org.springframework.dao.InvalidDataAccessApiUsageException: 
org.hibernate.hql.internal.ast.QuerySyntaxException: InspectionRequestEntity is not mapped [select 
count(u) from InspectionRequestEntity u where u.inspectionNoteNo is not null  AND 
(upper(u.supplierName) like upper(:supplierName) OR u.supplierName is null) AND 
(upper(u.disciplineDesc) like upper(:disciplineDesc) OR u.disciplineDesc is null) AND 
(upper(u.stageGroupDesc) like upper(:stageGroupDesc) OR u.stageGroupDesc is null) AND 
(upper(u.assemblyCode) like upper(:assemblyCode) OR u.assemblyCode is null) AND (upper(u.statusDesc) 
like upper(:statusDesc) OR u.statusDesc is null) AND (upper(u.subSystemDesc) like 
upper(:subSystemDesc) OR u.subSystemDesc is null) AND (upper(u.inspectDate) like upper(:inspectDate) 
OR u.inspectDate is null) AND (upper(u.systemDesc) like upper(:systemDesc) OR u.systemDesc is null) 
AND (upper(u.inspectionNoteNo) like upper(:inspectionNoteNo) OR u.inspectionNoteNo is null) AND 
(upper(u.blockUnitNo) like upper(:blockUnitNo) OR u.blockUnitNo is null) AND (upper(u.yardNo) like 
upper(:yardNo) OR u.yardNo is null)]; nested exception is java.lang.IllegalArgumentException: 
org.hibernate.hql.internal.ast.QuerySyntaxException: InspectionRequestEntity is not mapped [select 
count(u) from InspectionRequestEntity u where u.inspectionNoteNo is not null  AND 
(upper(u.supplierName) like upper(:supplierName) OR u.supplierName is null) AND 
(upper(u.disciplineDesc) like upper(:disciplineDesc) OR u.disciplineDesc is null) AND 
(upper(u.stageGroupDesc) like upper(:stageGroupDesc) OR u.stageGroupDesc is null) AND 
(upper(u.assemblyCode) like upper(:assemblyCode) OR u.assemblyCode is null) AND (upper(u.statusDesc) 
like upper(:statusDesc) OR u.statusDesc is null) AND (upper(u.subSystemDesc) like 
upper(:subSystemDesc) OR u.subSystemDesc is null) AND (upper(u.inspectDate) like upper(:inspectDate) 
OR u.inspectDate is null) AND (upper(u.systemDesc) like upper(:systemDesc) OR u.systemDesc is null) 
AND (upper(u.inspectionNoteNo) like upper(:inspectionNoteNo) OR u.inspectionNoteNo is null) AND 
(upper(u.blockUnitNo) like upper(:blockUnitNo) OR u.blockUnitNo is null) AND (upper(u.yardNo) like 
upper(:yardNo) OR u.yardNo is null)]] with root cause

org.hibernate.hql.internal.ast.QuerySyntaxException: InspectionRequestEntity is not mapped
at org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:169) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:91) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:79) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:331) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3695) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3584) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:720) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:576) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:313) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:261) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:272) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:192) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:144) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:113) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:73) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:155) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:600) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:709) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:809) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23) ~[hibernate-core-5.4.9.Final.jar:5.4.9.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:368) ~[spring-orm-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at com.sun.proxy.$Proxy117.createQuery(Unknown Source) ~[na:na]
at co.in.grsc.dao.InspectionRequestRepository.getCountInspectionRequestBySrchParam(InspectionRequestRepository.java:359) ~[classes/:na]
at co.in.grsc.dao.InspectionRequestRepository$$FastClassBySpringCGLIB$$23b465dd.invoke(<generated>) ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:769) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366) ~[spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at co.in.grsc.dao.InspectionRequestRepository$$EnhancerBySpringCGLIB$$42f77429.getCountInspectionRequestBySrchParam(<generated>) ~[classes/:na]
at co.in.grsc.service.InspectionRequestService.getCountInspectionRequestBySrchParam(InspectionRequestService.java:27) ~[classes/:na]
at co.in.grsc.controller.InspectionRequestController.listInspectionRequestShowDataTable(InspectionRequestController.java:101) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591) [tomcat-embed-core-9.0.29.jar:9.0.29]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.29.jar:9.0.29]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.29.jar:9.0.29]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]

I don't Understand What Iam missing?

Even if you are using annotations, you still need to register your entity classes somewhere.

There are different ways to do this:

  1. in the hibernate.cfg.xml
     <mapping class="co.in.grse.inspectionrequest.entities.InspectionRequestEntity" />
  2. programmatically, using Configuration:
     import org.hibernate.cfg.Configuration; Configuration configuration = constructConfiguration(); configuration.addAnnotatedClass( InspectionRequestEntity.class )
  3. with the persistence.xml if you are using JPA, unless you specify
    <exclude-unlisted-classes>false</exclude-unlisted-classes>

There might be others that I'm missing right now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM