我是从Java EE开始的,我根本不明白我的问题在哪里。 我需要帮助请:) 我的persistence.xml存在问题
这里是我的persistence.xml
<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="2.0">
<persistence-unit name="QuickStarter-PU" transaction-type="RESOURCE_LOCAL">
<provider>
org.hibernate.ejb.HibernatePersistence
</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DIALECT" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="root" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/QuickStarter" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
</properties>
</persistence-unit>
</persistence>
这是我的错误
我不明白我试图与我的数据库连接的问题,但没有办法.. 如果有人有想法欢迎:)谢谢
24 nov. 2013 00:04:33 org.apache.catalina.core.ApplicationContext log
GRAVE: StandardWrapper.Throwable
javax.persistence.PersistenceException: Invalid persistence.xml.
Error parsing XML (line-1 : column -1): cvc-complex-type.4: Attribute 'value' must appear on element 'property'.
Error parsing XML (line-1 : column -1): cvc-complex-type.2.1: Element 'property' must have no character or element information item [children], because the type's content type is empty.
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:145)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:169)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:317)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.quickStarter.util.PersistenceManager.getEntityManagerFactory(PersistenceManager.java:14)
at com.quickStarter.dao.DaoFactory.getUserDao(DaoFactory.java:32)
at com.quickStarter.servlet.inscriptionUser.init(inscriptionUser.java:22)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
24 nov. 2013 00:04:33 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Exception lors de l'allocation pour la servlet com.quickStarter.servlet.inscriptionUser
javax.persistence.PersistenceException: Invalid persistence.xml.
Error parsing XML (line-1 : column -1): cvc-complex-type.4: Attribute 'value' must appear on element 'property'.
Error parsing XML (line-1 : column -1): cvc-complex-type.2.1: Element 'property' must have no character or element information item [children], because the type's content type is empty.
at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:145)
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:169)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:317)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.quickStarter.util.PersistenceManager.getEntityManagerFactory(PersistenceManager.java:14)
at com.quickStarter.dao.DaoFactory.getUserDao(DaoFactory.java:32)
at com.quickStarter.servlet.inscriptionUser.init(inscriptionUser.java:22)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:865)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:136)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)