当我启动我的应用程序时,嵌入式数据库将无法启动它,我得到一个例外。但是当我在Netbeans服务选项卡中启动数据库服务器时,它运行正常。
[EL Info]: 2015-06-08 20:56:46.05--ServerSession(1877045812)--EclipseLink, version: Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd
[EL Severe]: ejb: 2015-06-08 20:56:48.215--ServerSession(1877045812)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLNonTransientConnectionException: java.net.ConnectException : Hiba történt a(z) localhost kiszolgálóhoz való csatlakozás során a(z) 1 527 porton Connection refused: connect üzenettel.
Error Code: 40000
我的persistence.xml文件。
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="SuperVisorServer_PU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.eszik.supervisorserver.entities.Clients</class>
<class>com.eszik.supervisorserver.entities.Logs</class>
<class>com.eszik.supervisorserver.entities.Messages</class>
<class>com.eszik.supervisorserver.entities.Exceptions</class>
<class>com.eszik.supervisorserver.entities.Sessions</class>
<validation-mode>NONE</validation-mode>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/SuperVisor;create=true"/>
<property name="javax.persistence.jdbc.user" value="root"/>
<property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
<property name="javax.persistence.jdbc.password" value="root"/>
<property name="eclipselink.target-database" value="Derby"/>
<property name="eclipselink.ddl-generation" value="create-tables"/>
</properties>
</persistence-unit>
</persistence>