Apache Camel - JpaConsumer轮询端点失败

时间:2014-01-31 09:22:44

标签: java jpa apache-camel apache-karaf

我在尝试轮询JPA实体Person时遇到以下错误。代码中没有错误。一切都使用mvn clean install编译好,而且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] 

有什么想法吗?

肖恩

1 个答案:

答案 0 :(得分:0)

您可以尝试以下方法:

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

我希望,这有帮助。