如何在 Netbeans (6.9) 中将现有企业项目从 Java EE5 升级到 Java EE 6

发布于 2024-09-13 16:27:11 字数 138 浏览 5 评论 0原文

该项目有一个 EJB 模块和一个 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.

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何必那么矫情 2024-09-20 16:27:11

显然事情并没有那么复杂。它通过修改以下文件对我有用:

/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

相同的操作:

/-ejb/nbproject/project.properties< /strong>

<项目名称>/<项目名称>-war/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">

Apparently it's not that complicated. It worked for me by modifying the following files:

<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

Repeat the same for:

<project-name>/<project-name>-ejb/nbproject/project.properties

<project-name>/<project-name>-war/nbproject/project.properties

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">

to

<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">

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">

to

<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">
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文