如何在Netbeans中将现有企业项目从Java EE5升级到Java EE 6(6.9) [英] How do I upgrade an existing enterprise project from Java EE5 to Java EE 6 in Netbeans (6.9)
问题描述
该项目有一个EJB模块&一个网络模块。更改服务器很简单,但我也想切换到EJB 3.1,但我相信我需要更改所有类型的配置文件,因为我无法从项目属性窗口中执行此操作。
The project has an EJB module & a web module. Changing the server is easy, but I'd like to switch to EJB 3.1 also but I believe I need to change all kind of configuration files since I can't do it from the project properties window(s).
任何提示或链接都会提供有用的文档。
Any tips or links do useful documentation will be greatly appreciated.
谢谢!
推荐答案
显然它并不复杂。它通过修改以下文件为我工作:
Apparently it's not that complicated. It worked for me by modifying the following files:
< project-folder>
/ nbproject / project.properties
更改以下行:
<project-folder>
/nbproject/project.properties
change the following lines:
j2ee.platform=1.5
javac.source=1.5
javac.target=1.5
to
j2ee.platform=1.6
javac.source=1.6
javac.target=1.6
重复相同的内容:
< project-name>
/ < project-name>
-ejb / nbproject / project.properties
<project-name>
/<project-name>
-ejb/nbproject/project.properties
< project-name>
/ < project-name>
-war / nbproject / project.properties
<project-name>
/<project-name>
-war/nbproject/project.properties
在ejb-jar.xml中更改行:
In ejb-jar.xml change the line:
<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
并更改这一行:
Next, find persistence.xml
and change this line:
<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">
这篇关于如何在Netbeans中将现有企业项目从Java EE5升级到Java EE 6(6.9)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!