0

我在#arquillian Freenode IRC 频道上询问有关问题

Arquillian JPA 教程:无法创建类 org.jboss.arquillian.test.impl.EventTestRunnerAdaptor 的新实例

当用户告诉我他成功运行时

https://github.com/arquillian/arquillian-examples/tree/master/arquillian-persistence-tutorial

所以我做了

git clone https://github.com/arquillian/arquillian-examples.git

然后在 Eclipse 中,我单击 File->Import->Existing Maven Projects 并选择子目录

arquillian-examples/arquillian-persistence-tutorial

Eclipse 完成导入项目后,我在文件中获取

/src/test/java/org/arquillian/example/GamePersistenceTest.java

第 146 行,错误消息

Game_ 无法解析为变量

我能做些什么?在我尝试页面开头的链接时,这并没有发生。我没有更改从 git repo 下载的任何文件。

文件夹树

.
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── org
│   │   │       └── arquillian
│   │   │           └── example
│   │   │               └── Game.java
│   │   └── resources
│   │       └── META-INF
│   │           └── persistence.xml
│   └── test
│       ├── java
│       │   └── org
│       │       └── arquillian
│       │           └── example
│       │               └── GamePersistenceTest.java
│       ├── resources
│       │   ├── arquillian.launch
│       │   ├── arquillian.xml
│       │   └── jbossas-ds.xml
│       ├── resources-glassfish-embedded
│       │   ├── glassfish-resources.xml
│       │   ├── logging.properties
│       │   └── test-persistence.xml
│       ├── resources-glassfish-remote
│       │   └── test-persistence.xml
│       └── resources-jbossas-managed
│           └── test-persistence.xml
└── target
    ├── classes
    │   ├── META-INF
    │   │   ├── MANIFEST.MF
    │   │   ├── maven
    │   │   │   └── org.arquillian.example
    │   │   │       └── arquillian-persistence-tutorial
    │   │   │           ├── pom.properties
    │   │   │           └── pom.xml
    │   │   └── persistence.xml
    │   └── org
    │       └── arquillian
    │           └── example
    │               └── Game.class
    └── test-classes
        ├── arquillian.launch
        ├── arquillian.xml
        ├── glassfish-resources.xml
        ├── jbossas-ds.xml
        ├── logging.properties
        ├── org
        │   └── arquillian
        │       └── example
        │           └── GamePersistenceTest.class
        └── test-persistence.xml

30 directories, 24 files
4

1 回答 1

0

The _Game class in that example is generated by the Hibernate JPA 2 metamodel generator (hibernate-jpamodelgen) that is defined as a dependency in the project POM. You'll now need to generate the metamodel by employing one the options outlined in the metamodel generator reference guide.

You could use Eclipse itself by configuring the annotation processing phase. Or you could modify the POM to use the maven-compiler-plugin configuration specified in the guide, to run as part of your build.

于 2013-10-16T12:40:33.690 回答