How to upgrade an existing enterprise project from Java EE5 to Java EE 6 in Netbeans (6.9)

The project has an EJB module and a web module. Changing the server is very simple, but I would also like to switch to EJB 3.1, but I believe that I need to change all the configuration files, since I cannot do this from the project window (s).

Any advice or links to useful documentation are welcome.

Thank!

+3
source share
1 answer

Apparently, this is not so difficult. It worked for me, 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

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

Source: https://habr.com/ru/post/1758718/


All Articles