2010-08-09 51 views

回答

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

當更新到Tomcat 7,你應該使用:j2ee.platform = 1.6的Web – Kdeveloper 2011-06-22 20:06:57

相關問題