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
Java Apache Camel-JpaConsumer轮询终结点失败_Java_Jpa_Apache Camel_Apache Karaf - Fatal编程技术网

Java Apache Camel-JpaConsumer轮询终结点失败

Java Apache Camel-JpaConsumer轮询终结点失败,java,jpa,apache-camel,apache-karaf,Java,Jpa,Apache Camel,Apache Karaf,我在尝试轮询JPA实体人员时遇到以下错误。代码中没有错误。通过mvn干净安装,一切都可以编译,并且Person实体确实存在于net.lr.tutorial.karaf.camel.jpa2jms.model包中。我已经安装了所有我认为必要的功能,我知道它正确地连接到数据库,因为它正在为主键创建序列数据库 2014-01-30 21:33:59,848 | WARN | jms.model.Person | JpaConsumer | 125 - o

我在尝试轮询JPA实体人员时遇到以下错误。代码中没有错误。通过mvn干净安装,一切都可以编译,并且Person实体确实存在于net.lr.tutorial.karaf.camel.jpa2jms.model包中。我已经安装了所有我认为必要的功能,我知道它正确地连接到数据库,因为它正在为主键创建序列数据库

2014-01-30 21:33:59,848 | WARN  | jms.model.Person | JpaConsumer                      |  
125 - org.apache.camel.camel-core - 2.12.0 | Consumer   
Consumer[jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person?consumer.delay=3500] 
failed polling endpoint: 
Endpoint[jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person?consumer.delay=3500]. 
Will try again at next poll. Caused by: 
[org.apache.openjpa.persistence.ArgumentException - An error occurred while parsing the 
query filter "select x from Person x". Error message: The name "Person" is not a 
recognized entity or identifier. Perhaps you meant Person, which is a close match. Known 
entity names: [Person]] 
<openjpa-2.1.1-r422266:1148538 nonfatal user error> 
org.apache.openjpa.persistence.ArgumentException: An error occurred while parsing the 
query filter "select x from Person x". Error message: The name "Person" is not a 
recognized entity or identifier. Perhaps you meant Person, which is a close match. Known 
entity names: [Person] 
2014-01-30 21:33:59848 | WARN | jms.model.Person | JpaConsumer |
125-org.apache.camel.camel-core-2.12.0 |消费者
消费者[jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person?consumer.delay=3500] 
轮询终结点失败:
端点[jpa://net.lr.tutorial.karaf.camel.jpa2jms.model.Person?consumer.delay=3500]. 
将在下次投票时重试。原因:
[org.apache.openjpa.persistence.ArgumentException-解析
查询筛选器“从人员x中选择x”。错误消息:名称“人员”不是
可识别的实体或标识符。可能您指的是人,这是一个非常匹配的人。已知
实体名称:[个人]]
org.apache.openjpa.persistence.ArgumentException:解析
查询过滤器“从人员x中选择x”。错误消息:名称“Person”不是
公认的实体或标识符。也许你指的是一个人,这是一场势均力敌的比赛。已知的
实体名称:[个人]
有什么想法吗


肖恩

您可以尝试以下方法:

  • 如果可能,请删除
    @实体
    注释的
    名称
    属性
  • 检查是否将正确的
    Person
    类添加到
    persistence.xml
    。它应该是
    net.lr.tutorial.karaf.camel.jpa2jms.model.Person
    而不是
    jms.model.Person

希望有帮助。

您是否重置了
个人
实体的name属性,即
@entity(name=“Person”)
?是的。我的JPA类看起来像-@Entity(name=“person”)[code]@XmlType@XmlRootElement公共类person{[/code]