Question

Je reçois une erreur lorsque je crée une application J2EE dans RAD avec WebSphere Server

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'persistence' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:85)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:113)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:202)

EDIT: La persistance générée automatiquement.xml est indiquée ci-dessous:

<?xml version="1.0" encoding="UTF-8"?>
<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">
    <persistence-unit name="PLHService">
        <class>plh.jpa.entity.User</class>
    </persistence-unit>
</persistence>

J'ai essayé d'ajouter les paramètres de connexion à persistance.xml.Cela ne fait pas une différence de
J'ai vérifié un article à http://forum.springsource.org/showthread.php? 89055-JPA-2-0-persistance-xml-ne pas valider mais je n'ai pas utilisé hibernate

Le chemin de construction est le jeu par défaut dans RAD et WebSphere 7.0.

Était-ce utile?

La solution

Le chemin de construction est le jeu par défaut dans RAD et WebSphere 7.0.

Par défaut WebSphere 7.0 utilise une version enveloppée de OpenJPA 1.0.Si vous souhaitez résoudre ce problème d'utilisation 1.0 dans votre fichier persistant.xml ou Basculez le fournisseur de persistance en rad et vous pouviez sinon vous pouvez alternativement Appliquez le pack de fonctionnalités JPA2.0 .

Autres conseils

WebSphere 7.0 prend en charge JPA 2.0.

La réponse est non !! .Comme suggéré par Terrell, vous devez explorer à l'aide du pack de fonctions JPA 2.0 auquel cas, vous devriez pouvoir utiliser JPA 2.0.

Vous devriez aussi regarder ce message

WebSphere 7 et (application) Open-JPA 2

Je vous suggère également de regarder WSJPaversion pour voir le support de JPA dans votre configuration.

http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2fcom.ibm.websphere.jpafep.multiplatform.doc% 2finfo% 2fae% 2fae% 2frejb_wsjpaversion.html & résultat=% 22Newfeat% 22% 20

J'espère que cela vous fournira de bons pointeurs.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top