我在尝试轮询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]
有什么想法吗?
肖恩
答案 0 :(得分:0)
您可以尝试以下方法:
name
注释的@Entity
属性。Person
类是否添加了正确的persistence.xml
类。它应该是net.lr.tutorial.karaf.camel.jpa2jms.model.Person
而不是jms.model.Person
我希望,这有帮助。