3

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!

1 Answer 1

6

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"> 
Sign up to request clarification or add additional context in comments.

1 Comment

When updating to Tomcat 7 you should use: j2ee.platform=1.6-web

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.