Я следую первому руководству по чашке, но застрял в конце главы 4 с этим исключением:
java. sql. SQLException: ошибка при выделении соединения. Причина: соединение не может быть выделено из-за: DERBY SQL ошибка: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRM C: не удалось создать базу данных sun-appserv-samples, подробности см. В следующем исключении .::SQLSTATE : XBM01 :: SQLSTATE: XJ001
На вкладке «Проекты» я выбираю проект firstcup-war
, щелкаю правой кнопкой мыши и выбираю «Выполнить».
Вкладка вывода говорит:
Deploying on GlassFish Server
profile mode: false
debug mode: false
force redeploy: true
In-place deployment at /home/t/NetBeansProjects/firstcup-war/target/firstcup-war
GlassFish Server, deploy, null, false
Вкладка Java Процесс базы данных БД говорит
Fri May 08 21:09:39 CEST 2020 : Security manager installed using the Basic server security policy.
Fri May 08 21:09:39 CEST 2020 : Apache Derby Network Server - 10.14.2.0 - (1828579) started and ready to accept connections on port 1527
Вкладка GlassFi sh Сервер имеет длинный список исключений:
...
Info: EclipseLink, version: Eclipse Persistence Services - 2.7.0.v20170811-d680af5
Warning: RAR5038:Unexpected exception while creating resource for pool DerbyPool. Exception : javax.resource.spi.ResourceAllocationException: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'sun-appserv-samples', see the next exception for details.::SQLSTATE: XBM01::SQLSTATE: XJ001
Warning: RAR5117 : Failed to obtain/create connection from connection pool [ DerbyPool ]. Reason : com.sun.appserv.connectors.internal.api.PoolingException: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'sun-appserv-samples', see the next exception for details.::SQLSTATE: XBM01::SQLSTATE: XJ001
Warning: RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'sun-appserv-samples', see the next exception for details.::SQLSTATE: XBM01::SQLSTATE: XJ001]
Severe: Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'sun-appserv-samples', see the next exception for details.::SQLSTATE: XBM01::SQLSTATE: XJ001
Error Code: 0
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:316)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:147)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:228)
[...]
Severe: Exception while deploying the app [firstcup-war]
Severe: Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'sun-appserv-samples', see the next exception for details.::SQLSTATE: XBM01::SQLSTATE: XJ001
Error Code: 0
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:844)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:216)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:324)
at
...
Severe: Exception while deploying the app [firstcup-war] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.0.v20170811-d680af5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 40000, SQLSTATE: XJ041, SQLERRMC: Failed to create database 'sun-appserv-samples', see the next exception for details.::SQLSTATE: XBM01::SQLSTATE: XJ001
Error Code: 0
Я не уверен, какие части важны, потому что здесь стоит полный журнал: https://pastebin.com/cRE9mVMQ