Issue
if use
session.get(String entityName, Serializable id),
return UnknownEntityTypeException: Unable to locate persister error,
but if use
session.get(Class clazz, Serializable id),
no error. I google similar error and most mention the cause is missing the mapping class in hibernate.cfg.xml or missing @Entity annotation in POJO class, but I check that I have all entered, so why still have "Unable to locate persister" error?
the code and setting is as follow:
hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
.....
<mapping class="hk.xxx.slis.model.SliInstrPublishing" />
.....
</session-factory>
</hibernate-configuration>
POJO class
package hk.xxx.slis.model;
// Generated 19 Nov 2023, 1:53:51 am by Hibernate Tools 4.3.6.Final
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;
/**
* SliInstrPublishing generated by hbm2java
*/
@Entity
@Table(name = "SLI_INSTR_PUBLISHING")
public class SliInstrPublishing implements java.io.Serializable {
private long instrKey;
private SliInstr sliInstr;
private String lastRecTxnUserId;
private Date lastRecTxnDate;
public SliInstrPublishing() {
}
public SliInstrPublishing(SliInstr sliInstr, String lastRecTxnUserId, Date lastRecTxnDate) {
this.sliInstr = sliInstr;
this.lastRecTxnUserId = lastRecTxnUserId;
this.lastRecTxnDate = lastRecTxnDate;
}
@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "sliInstr"))
@Id
@GeneratedValue(generator = "generator")
@Column(name = "INSTR_KEY", unique = true, nullable = false, precision = 10, scale = 0)
public long getInstrKey() {
return this.instrKey;
}
public void setInstrKey(long instrKey) {
this.instrKey = instrKey;
}
@OneToOne(fetch = FetchType.LAZY)
@PrimaryKeyJoinColumn
public SliInstr getSliInstr() {
return this.sliInstr;
}
public void setSliInstr(SliInstr sliInstr) {
this.sliInstr = sliInstr;
}
@Column(name = "LAST_REC_TXN_USER_ID", nullable = false, length = 32)
public String getLastRecTxnUserId() {
return this.lastRecTxnUserId;
}
public void setLastRecTxnUserId(String lastRecTxnUserId) {
this.lastRecTxnUserId = lastRecTxnUserId;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LAST_REC_TXN_DATE", nullable = false, length = 11)
public Date getLastRecTxnDate() {
return this.lastRecTxnDate;
}
public void setLastRecTxnDate(Date lastRecTxnDate) {
this.lastRecTxnDate = lastRecTxnDate;
}
}
ApplicationContext.xml
<!-- Configuring SessionFactory Bean -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="packagesToScan" value="hk.xxx.slis.model" />
<property name="configLocation" value="classpath:hibernate.cfg.xml" />
</bean>
calling code
public SliInstrPublishing findById(Long id) {
log.debug("getting SliInstrPublishing instance with id: " + id);
try {
//SliInstrPublishing instance = (SliInstrPublishing) this.getHibernateSession()
//.get(SliInstrPublishing.class, id);
SliInstrPublishing instance = (SliInstrPublishing) this.getHibernateSession()
.get("SliInstrPublishing", id); // <-- error here
if (instance == null) {
log.debug("get successful, no instance found");
} else {
log.debug("get successful, instance found");
}
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
StackTrace
11:20:35,411 ERROR [hk.xxx.slis.dao.SliInstrPublishingDao] (default task-5) get failed: org.hibernate.UnknownEntityTypeException: Unable to locate persister: SliInstrPublishing
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.metamodel.internal.MetamodelImpl.locateEntityPersister(MetamodelImpl.java:731)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.internal.SessionImpl.locateEntityPersister(SessionImpl.java:3060)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.internal.SessionImpl.access$1700(SessionImpl.java:210)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.<init>(SessionImpl.java:2781)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.<init>(SessionImpl.java:2768)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.internal.SessionImpl.byId(SessionImpl.java:1218)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.hibernate.internal.SessionImpl.get(SessionImpl.java:1101)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//hk.xxx.slis.dao.SliInstrPublishingDao.findById(SliInstrPublishingDao.java:91)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//com.sun.proxy.$Proxy174.findById(Unknown Source)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//hk.xxx.slis.service.PublishService.getInstrPublishing(PublishService.java:1500)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:366)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//com.sun.proxy.$Proxy189.getInstrPublishing(Unknown Source)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//hk.xxx.slis.controller.AdminPublishController.publish(AdminPublishController.java:262)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at [email protected]//javax.servlet.http.HttpServlet.service(HttpServlet.java:523)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at [email protected]//javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at [email protected]//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:155)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:94)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//hk.xxx.slis.security.WebSEALAuthenticationFilter.doFilter(WebSEALAuthenticationFilter.java:101)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358)
at deployment.SLISEAR-0.0.1-SNAPSHOT.ear.SLIS-0.0.1-SNAPSHOT.war//org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271)
at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at [email protected]//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
at [email protected]//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at [email protected]//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
at [email protected]//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at [email protected]//org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at [email protected]//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
at [email protected]//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
at [email protected]//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at [email protected]//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at [email protected]//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at [email protected]//io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at [email protected]//io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at [email protected]//io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at [email protected]//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at [email protected]//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at [email protected]//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
at [email protected]//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at [email protected]//io.undertow.server.handlers.MetricsHandler.handleRequest(MetricsHandler.java:64)
at [email protected]//io.undertow.servlet.core.MetricsChainHandler.handleRequest(MetricsChainHandler.java:59)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130)
at [email protected]//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at [email protected]//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at [email protected]//org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1530)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78)
at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99)
at [email protected]//io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
at [email protected]//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:841)
at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at [email protected]//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280)
at java.base/java.lang.Thread.run(Thread.java:829)
Solution
When you don't explicitly specify the entity-name it will default to the FQN (the full classname of the entity). So you should be using either hk.xxx.slis.model.SliInstrPublishing or specify the name attribute of the @Entity annotation to override this. Like @Entity(name="SliInstrPublishing").
This is also mentioned in the documentation of the @Entity annotation.
(Optional) The entity name. Defaults to the unqualified name of the entity class. This name is used to refer to the entity in queries. The name must not be a reserved literal in the Java Persistence query language.
Answered By - M. Deinum
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.