Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jpa java.lang.IllegalArgumentException:托管类型中不存在属性[state_id][EntityTypeImpl@530144602:城市]_Jpa_Identity_Illegalargumentexception - Fatal编程技术网

Jpa java.lang.IllegalArgumentException:托管类型中不存在属性[state_id][EntityTypeImpl@530144602:城市]

Jpa java.lang.IllegalArgumentException:托管类型中不存在属性[state_id][EntityTypeImpl@530144602:城市],jpa,identity,illegalargumentexception,Jpa,Identity,Illegalargumentexception,我是javaEE的新手。最近,我正在使用jax-rs开发restfulweb服务,并使用JPA处理数据库,使用Netbeans作为IDE,使用TomeEE作为Web服务器 关于我的问题, 我有一个叫做cities的表格,它有3列: 身份证,州号,姓名 (state_id定义为另一列的外键,称为states) 我想选择所有具有特定州id的城市,例如在表中,存在1000行,其州id为8 这是我的JPA代码: public List<T> findByStateID(Short i

我是javaEE的新手。最近,我正在使用jax-rs开发restfulweb服务,并使用JPA处理数据库,使用Netbeans作为IDE,使用TomeEE作为Web服务器

关于我的问题, 我有一个叫做cities的表格,它有3列:

身份证,州号,姓名

(state_id定义为另一列的外键,称为states)

我想选择所有具有特定州id的城市,例如在表中,存在1000行,其州id为8

这是我的JPA代码:

    public List<T> findByStateID(Short id){
        javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery(entityClass);
        javax.persistence.criteria.Root<T> r = cq.from(entityClass);
        cq.select(r);
        cq.where(getEntityManager().getCriteriaBuilder().equal(r.get("state_id"), id));
        return getEntityManager().createQuery(cq).getResultList();
    }

以下是城市实体类:

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author seyed
 */
@Entity
@Table(name = "cities")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cities.findAll", query = "SELECT c FROM Cities c"),
    @NamedQuery(name = "Cities.findById", query = "SELECT c FROM Cities c WHERE c.id = :id"),
    @NamedQuery(name = "Cities.findByName", query = "SELECT c FROM Cities c WHERE c.name = :name")})
public class Cities implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Short id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 65)
    @Column(name = "name")
    private String name;
    @JoinColumn(name = "state_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private States stateId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "city")
    private Collection<Users> usersCollection;

    public Cities() {
    }

    public Cities(Short id) {
        this.id = id;
    }

    public Cities(Short id, String name) {
        this.id = id;
        this.name = name;
    }

    public Short getId() {
        return id;
    }

    public void setId(Short id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public States getStateId() {
        return stateId;
    }

    public void setStateId(States stateId) {
        this.stateId = stateId;
    }

    @XmlTransient
    public Collection<Users> getUsersCollection() {
        return usersCollection;
    }

    public void setUsersCollection(Collection<Users> usersCollection) {
        this.usersCollection = usersCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cities)) {
            return false;
        }
        Cities other = (Cities) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Cities[ id=" + id + " ]";
    }

}

查询默认使用java名称。如果您有疑问,可以设置jpa元模型生成器,并且可以使用属性的类型化版本而不是字符串。

查询默认使用java名称。如果您有疑问,您可以设置jpa元模型生成器,并且您将能够使用属性的类型化版本而不是字符串。

因为jpa/hibernate使用属性名称而不是列名,所以您必须使用
私有状态stateId
而不是
私有状态stateId

因此,您必须将
equal(r.get(“stateId”),id))
更改为
equal(r.get(“stateId”),id))

`因为jpa/hibernate使用属性名称而不是列名,所以您必须使用
私有状态stateId
而不是
私有状态stateId

因此,您必须将
equal(r.get(“stateId”),id))
更改为
equal(r.get(“stateId”),id))

`

显示类别
实体.城市
。我猜你在类中的属性是stateId,正如我说的,我在这方面是新手,也许你是对的。我将把Cities实体类show class
entity.Cities
。我猜你在类中的属性是stateId,正如我说的,我在这方面是新手,也许你是对的。当我用netbeans生成JPA时,我将把Cities实体类放在它想要arg的地方(emf和utx),我不知道如何将这个arg jax rs web服务文件传递给JPA。我是说从@GET。。。。当我用netbeans生成JPA时,它想要arg(emf和utx),我不知道如何将这个argjax-rsweb服务文件传递给JPA。我是说从@GET。。。。partIt看起来像是关系辩护中的一个问题:@manytone(optional=false)private States stateId;你能再解释一下吗?这看起来像是你对关系辩护中的一个问题:@ManyToOne(optional=false)private States stateId;你能再解释一下吗?
HTTP Status 500 - Error processing webservice request

type Exception report

message Error processing webservice request

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error processing webservice request
    org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

root cause

java.lang.IllegalArgumentException: The attribute [state_id] is not present in the managed type [EntityTypeImpl@530144602:Cities [ javaType: class entity.Cities descriptor: RelationalDescriptor(entity.Cities --> [DatabaseTable(cities)]), mappings: 4]].
    org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeImpl.getAttribute(ManagedTypeImpl.java:148)
    org.eclipse.persistence.internal.jpa.querydef.FromImpl.get(FromImpl.java:312)
    rest.AbstractFacade.findByStateID(AbstractFacade.java:50)
    rest.CitiesFacadeREST.findByState(CitiesFacadeREST.java:49)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
    org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
    org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
    org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
    org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:236)
    org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:203)
    org.apache.openejb.util.proxy.ProxyEJB$Handler.invoke(ProxyEJB.java:74)
    rest.CitiesFacadeREST$$LocalBeanProxy.findByState(rest/CitiesFacadeREST.java)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.server.cxf.rs.OpenEJBEJBInvoker.performInvocation(OpenEJBEJBInvoker.java:95)
    org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)
    org.apache.openejb.server.cxf.rs.OpenEJBEJBInvoker.invoke(OpenEJBEJBInvoker.java:68)
    org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
    org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:64)
    org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
    org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
    org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:251)
    org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

note The full stack trace of the root cause is available in the Apache Tomcat (TomEE)/8.5.3 (7.0.1) logs.
Apache Tomcat (TomEE)/8.5.3 (7.0.1)
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author seyed
 */
@Entity
@Table(name = "cities")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Cities.findAll", query = "SELECT c FROM Cities c"),
    @NamedQuery(name = "Cities.findById", query = "SELECT c FROM Cities c WHERE c.id = :id"),
    @NamedQuery(name = "Cities.findByName", query = "SELECT c FROM Cities c WHERE c.name = :name")})
public class Cities implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Short id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 65)
    @Column(name = "name")
    private String name;
    @JoinColumn(name = "state_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private States stateId;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "city")
    private Collection<Users> usersCollection;

    public Cities() {
    }

    public Cities(Short id) {
        this.id = id;
    }

    public Cities(Short id, String name) {
        this.id = id;
        this.name = name;
    }

    public Short getId() {
        return id;
    }

    public void setId(Short id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public States getStateId() {
        return stateId;
    }

    public void setStateId(States stateId) {
        this.stateId = stateId;
    }

    @XmlTransient
    public Collection<Users> getUsersCollection() {
        return usersCollection;
    }

    public void setUsersCollection(Collection<Users> usersCollection) {
        this.usersCollection = usersCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cities)) {
            return false;
        }
        Cities other = (Cities) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Cities[ id=" + id + " ]";
    }

}
HTTP Status 500 - Error processing webservice request

type Exception report

message Error processing webservice request

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error processing webservice request
    org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:98)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

root cause

javax.persistence.PersistenceException: Exception [EclipseLink-6078] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.QueryException
Exception Description: The class of the argument for the object comparison is incorrect. 
Expression: [
Base entity.Cities] 
Mapping: [org.eclipse.persistence.mappings.ManyToOneMapping[stateId]] 
Argument: [1]
Query: ReadAllQuery(referenceClass=Cities )
    org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:484)
    rest.AbstractFacade.findByStateID(AbstractFacade.java:51)
    rest.CitiesFacadeREST.findByState(CitiesFacadeREST.java:49)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
    org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
    org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
    org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
    org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:236)
    org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:203)
    org.apache.openejb.util.proxy.ProxyEJB$Handler.invoke(ProxyEJB.java:74)
    rest.CitiesFacadeREST$$LocalBeanProxy.findByState(rest/CitiesFacadeREST.java)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.server.cxf.rs.OpenEJBEJBInvoker.performInvocation(OpenEJBEJBInvoker.java:95)
    org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)
    org.apache.openejb.server.cxf.rs.OpenEJBEJBInvoker.invoke(OpenEJBEJBInvoker.java:68)
    org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
    org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:64)
    org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
    org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
    org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:251)
    org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

root cause

Exception [EclipseLink-6078] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.QueryException
Exception Description: The class of the argument for the object comparison is incorrect. 
Expression: [
Base entity.Cities] 
Mapping: [org.eclipse.persistence.mappings.ManyToOneMapping[stateId]] 
Argument: [1]
Query: ReadAllQuery(referenceClass=Cities )
    org.eclipse.persistence.exceptions.QueryException.incorrectClassForObjectComparison(QueryException.java:601)
    org.eclipse.persistence.mappings.OneToOneMapping.buildObjectJoinExpression(OneToOneMapping.java:298)
    org.eclipse.persistence.internal.expressions.RelationExpression.normalize(RelationExpression.java:830)
    org.eclipse.persistence.internal.expressions.SQLSelectStatement.normalize(SQLSelectStatement.java:1474)
    org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildNormalSelectStatement(ExpressionQueryMechanism.java:550)
    org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.prepareSelectAllRows(ExpressionQueryMechanism.java:1722)
    org.eclipse.persistence.queries.ReadAllQuery.prepareSelectAllRows(ReadAllQuery.java:885)
    org.eclipse.persistence.queries.ReadAllQuery.prepare(ReadAllQuery.java:816)
    org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:666)
    org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:911)
    org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:615)
    org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:872)
    org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1134)
    org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:460)
    org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1222)
    org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857)
    org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
    org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:473)
    rest.AbstractFacade.findByStateID(AbstractFacade.java:51)
    rest.CitiesFacadeREST.findByState(CitiesFacadeREST.java:49)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
    org.apache.openejb.monitoring.StatsInterceptor.record(StatsInterceptor.java:181)
    org.apache.openejb.monitoring.StatsInterceptor.invoke(StatsInterceptor.java:100)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:205)
    org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:186)
    org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:85)
    org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:236)
    org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:203)
    org.apache.openejb.util.proxy.ProxyEJB$Handler.invoke(ProxyEJB.java:74)
    rest.CitiesFacadeREST$$LocalBeanProxy.findByState(rest/CitiesFacadeREST.java)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:498)
    org.apache.openejb.server.cxf.rs.OpenEJBEJBInvoker.performInvocation(OpenEJBEJBInvoker.java:95)
    org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
    org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:189)
    org.apache.openejb.server.cxf.rs.OpenEJBEJBInvoker.invoke(OpenEJBEJBInvoker.java:68)
    org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
    org.apache.openejb.server.cxf.rs.AutoJAXRSInvoker.invoke(AutoJAXRSInvoker.java:64)
    org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
    org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
    org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
    org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
    org.apache.openejb.server.cxf.rs.CxfRsHttpListener.doInvoke(CxfRsHttpListener.java:251)
    org.apache.tomee.webservices.CXFJAXRSFilter.doFilter(CXFJAXRSFilter.java:94)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.apache.openejb.server.httpd.EEFilter.doFilter(EEFilter.java:65)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)

note The full stack trace of the root cause is available in the Apache Tomcat (TomEE)/8.5.3 (7.0.1) logs.
Apache Tomcat (TomEE)/8.5.3 (7.0.1)