为什么嵌入式 OpenEJB 无法部署我的应用程序?
我不明白为什么嵌入式 OpenEJB 容器一开始就会失败,并显示非常无信息的消息(抱歉日志很长):
Running com.XXX.MyTest
Apache OpenEJB 3.1.3 build: 20101015-05:42
http://openejb.apache.org/
INFO - openejb.home = [skipped...]
INFO - openejb.base = [skipped...]
INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManager, provider-id=Default Transaction Manager)
INFO - Found PersistenceModule in classpath: [skipped...]/target/classes
INFO - Found EjbModule in classpath: [skipped...]/target/test-classes
INFO - Beginning load: [skipped...]/target/classes
INFO - AltDD persistence.xml -> file:[skipped...]/target/classes/META-INF/test.persistence.xml
INFO - AltDD persistence.xml -> file:[skipped...]/target/classes/META-INF/test.persistence.xml
INFO - Beginning load: [skipped...]/target/test-classes
INFO - Configuring enterprise application: classpath.ear
INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container)
INFO - Auto-creating a container for bean Finder: Container(type=STATELESS, id=Default Stateless Container)
INFO - Configuring PersistenceUnit(name=wid, provider=org.hibernate.ejb.HibernatePersistence)
INFO - Configuring Service(id=Default JDBC Database, type=Resource, provider-id=Default JDBC Database)
INFO - Auto-creating a Resource with id 'Default JDBC Database' of type 'DataSource for 'abc'.
INFO - Configuring Service(id=Default Unmanaged JDBC Database, type=Resource, provider-id=Default Unmanaged JDBC Database)
INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC Database' of type 'DataSource for 'abc'.
INFO - Adjusting PersistenceUnit abc <jta-data-source> to Resource ID 'Default JDBC Database' from 'null'
INFO - Adjusting PersistenceUnit abc <non-jta-data-source> to Resource ID 'Default Unmanaged JDBC Database' from 'null'
INFO - Enterprise application "classpath.ear" loaded.
INFO - Assembling app: classpath.ear
Oct 28, 2010 2:00:20 PM org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.5.6-Final
Oct 28, 2010 2:00:20 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.5.6-Final
Oct 28, 2010 2:00:20 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
Oct 28, 2010 2:00:20 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
Oct 28, 2010 2:00:20 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
Oct 28, 2010 2:00:20 PM org.hibernate.annotations.common.Version <clinit>
INFO: Hibernate Commons Annotations 3.2.0.Final
Oct 28, 2010 2:00:20 PM org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.5.6-Final
Oct 28, 2010 2:00:20 PM org.hibernate.ejb.Ejb3Configuration configure
INFO: Processing PersistenceUnitInfo [
name: abc
...]
INFO - PersistenceUnit(name=abc, provider=org.hibernate.ejb.HibernatePersistence) - provider time 328ms
INFO - Undeploying app: classpath.ear
ERROR - Application could not be deployed: classpath.ear
org.apache.openejb.OpenEJBException: Creating application failed: classpath.ear: org.apache.openejb.persistence.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode;
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:679)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:450)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:368)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:280)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:125)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:60)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:271)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:250)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[skipped...]
您能帮忙吗?谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为您使用的是 OpenEJB 尚不支持的 JPA 2.0,请参阅 此线程 和 OPENEJB-1236 。如果你仔细观察 Jira 问题,看起来这个问题已经在主干中修复了。我只是不知道子任务是否被阻塞或者它是否可以与主干的快照版本一起使用。
That's because you're using JPA 2.0 which is AFAIK not yet supported by OpenEJB, see this thread and OPENEJB-1236. If you look closely at the Jira issue, it looks like this is fixed in the trunk. I just don't if the subtask is blocking or if it would work with a SNAPSHOT version of the trunk.