该项目有一个EJB模块&一个网络模块。更改服务器很简单,但我也想切换到EJB 3.1,但我相信我需要更改所有类型的配置文件,因为我无法从项目属性窗口中执行此操作。
任何提示或链接都会提供有用的文档,我们将不胜感激。
谢谢!
答案 0 :(得分:6)
显然它并不复杂。它通过修改以下文件为我工作:
<强> <project-folder>
/ nbproject文件/ project.properties 强>
改变以下几行:
j2ee.platform=1.5
javac.source=1.5
javac.target=1.5
到
j2ee.platform=1.6
javac.source=1.6
javac.target=1.6
重复相同的内容:
<强> <project-name>
/ <project-name>
- EJB / nbproject文件/ project.properties 强>
<强> <project-name>
/ <project-name>
- 战/ nbproject文件/ project.properties 强>
在ejb-jar.xml中更改行:
<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
version = "3.0"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
到
<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
version = "3.1"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
接下来,找到persistence.xml
并更改此行:
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
到
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">