在我启动Hibernate 5应用程序的那一刻,我发现这些警告就像疯了一样.我怎么能摆脱他们?这是我的配置文件:
org.hibernate.dialect.MySQLDialect
com.mysql.jdbc.Driver
jdbc:mysql://127.0.0.1:3306/telemart
root
php123
这是整个输出:
ant -f /Users/hassan/NetBeansProjects/TeleMart/TeleMart jfxsa-run init: Deleting: /Users/hassan/NetBeansProjects/TeleMart/TeleMart/build/built-jar.properties deps-jar: Updating property file: /Users/hassan/NetBeansProjects/TeleMart/TeleMart/build/built-jar.properties Duplicated project name in import. Project jfx-impl defined first in /Users/hassan/NetBeansProjects/TeleMart/TeleMart/nbproject/jfx-impl.xml and again in /Users/hassan/NetBeansProjects/TeleMart/TeleMart-Preloader/nbproject/jfx-impl.xml TeleMart-Preloader.init: TeleMart-Preloader.deps-jar: Updating property file: /Users/hassan/NetBeansProjects/TeleMart/TeleMart/build/built-jar.properties TeleMart-Preloader.compile: Copying 1 file to /Users/hassan/NetBeansProjects/TeleMart/TeleMart-Preloader/build Copy libraries to /Users/hassan/NetBeansProjects/TeleMart/TeleMart-Preloader/dist/lib. To run this application from the command line without Ant, try: /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java -jar "/Users/hassan/NetBeansProjects/TeleMart/TeleMart-Preloader/dist/TeleMart-Preloader.jar" Deleting directory /Users/hassan/NetBeansProjects/TeleMart/TeleMart-Preloader/dist/lib Detected JavaFX Ant API version 1.3 TeleMart-Preloader.jfx-deployment: TeleMart-Preloader.jar: compile: Deleting directory /Users/hassan/NetBeansProjects/TeleMart/TeleMart/dist/lib Copying 13 files to /Users/hassan/NetBeansProjects/TeleMart/TeleMart/dist/lib Detected JavaFX Ant API version 1.3 jfx-deployment: jar: Copying 25 files to /Users/hassan/NetBeansProjects/TeleMart/TeleMart/dist/run2142585581 jfx-project-run: Executing /Users/hassan/NetBeansProjects/TeleMart/TeleMart/dist/run2142585581/TeleMart.jar using platform /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/bin/java Jan 10, 2016 4:36:32 PM org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.0.6.Final} Jan 10, 2016 4:36:32 PM org.hibernate.cfg.EnvironmentINFO: HHH000206: hibernate.properties not found Jan 10, 2016 4:36:32 PM org.hibernate.cfg.Environment buildBytecodeProvider INFO: HHH000021: Bytecode provider name : javassist Jan 10, 2016 4:36:32 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-configuration. Use namespace http://www.hibernate.org/dtd/hibernate-configuration instead. Support for obsolete DTD/XSD namespaces may be removed at any time. Jan 10, 2016 4:36:33 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final} Jan 10, 2016 4:36:33 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead. Support for obsolete DTD/XSD namespaces may be removed at any time. Jan 10, 2016 4:36:34 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead. Support for obsolete DTD/XSD namespaces may be removed at any time. Jan 10, 2016 4:36:34 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead. Support for obsolete DTD/XSD namespaces may be removed at any time. Jan 10, 2016 4:36:34 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead. Support for obsolete DTD/XSD namespaces may be removed at any time. Jan 10, 2016 4:36:34 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead. Support for obsolete DTD/XSD namespaces may be removed at any time. Jan 10, 2016 4:36:34 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!) Jan 10, 2016 4:36:34 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001005: using driver [null] at URL [jdbc:mysql://127.0.0.1:3306/telemart] Jan 10, 2016 4:36:34 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001001: Connection properties: {user=root, password=****} Jan 10, 2016 4:36:34 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator INFO: HHH10001003: Autocommit mode: false Jan 10, 2016 4:36:34 PM org.hibernate.engine.jdbc.connections.internal.PooledConnections INFO: HHH000115: Hibernate connection pool size: 20 (min=1) Jan 10, 2016 4:36:34 PM org.hibernate.dialect.Dialect INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Tunaki.. 8
问题是您为Hibernate配置声明了一个已弃用的命名空间.它指向
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
什么时候应该指向
http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd
因此,您需要更改Hibernate配置文件的开头(并在所有其他位置编写此URL),如下所示:
至于关于连接池的最后警告,您可以参考这个问题.您需要向类路径添加自定义连接池.一个可能是C3P0,但还有很多其他可用.
问题是您为Hibernate配置声明了一个已弃用的命名空间.它指向
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
什么时候应该指向
http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd
因此,您需要更改Hibernate配置文件的开头(并在所有其他位置编写此URL),如下所示:
至于关于连接池的最后警告,您可以参考这个问题.您需要向类路径添加自定义连接池.一个可能是C3P0,但还有很多其他可用.