2014-01-31 86 views
0

我在嘗試輪詢JPA實體Person時收到以下錯誤。代碼中沒有錯誤。所有的東西都編譯成mvn乾淨的安裝,而Person實體確實存在於net.lr.tutorial.karaf.camel.jpa2jms.model包中。我已經安裝了所有我認爲必要的功能,並且我知道它正確連接到數據庫,因爲它正在爲主鍵創建序列數據庫。Apache Camel - JpaConsumer失敗的輪詢端點

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] 

任何想法?

肖恩

+0

您是否重置了'Person'實體的名稱屬性,即'@Entity(name =「Person」)'? –

+0

是的,我做到了。我的JPA類看起來像 - @Entity(name =「person」) [code] @XmlType @XmlRootElement public class Person {[/ code] –

回答

0

你可以嘗試以下方法:

  • 取出@Entity註釋如果可能的name屬性。
  • 檢查是否在persistence.xml中添加了正確的Person類。它應該是net.lr.tutorial.karaf.camel.jpa2jms.model.Person而不是jms.model.Person

我希望它有幫助。