Skip to content

Commit

Permalink
chore: restore RestConfiguration
Browse files Browse the repository at this point in the history
Signed-off-by: Hantsy Bai <[email protected]>
  • Loading branch information
hantsy committed Apr 12, 2021
1 parent 8d94418 commit 344eb55
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
Binary file not shown.
27 changes: 27 additions & 0 deletions cargo-tracker-data/cargo-tracker-database.trace.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
2021-04-12 10:15:23 jdbc[3]: exception
org.h2.jdbc.JdbcSQLNonTransientConnectionException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-200]
at deployment.cargo-tracker.war//org.h2.message.DbException.getJdbcSQLException(DbException.java:622)
at deployment.cargo-tracker.war//org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
at deployment.cargo-tracker.war//org.h2.message.DbException.get(DbException.java:205)
at deployment.cargo-tracker.war//org.h2.message.DbException.get(DbException.java:181)
at deployment.cargo-tracker.war//org.h2.message.DbException.get(DbException.java:170)
at deployment.cargo-tracker.war//org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1514)
at deployment.cargo-tracker.war//org.h2.jdbcx.JdbcXAConnection$PooledJdbcConnection.checkClosed(JdbcXAConnection.java:472)
at deployment.cargo-tracker.war//org.h2.jdbc.JdbcConnection.checkClosedForWrite(JdbcConnection.java:1500)
at deployment.cargo-tracker.war//org.h2.jdbc.JdbcConnection.rollback(JdbcConnection.java:556)
at deployment.cargo-tracker.war//org.h2.jdbcx.JdbcXAConnection$PooledJdbcConnection.close(JdbcXAConnection.java:452)
at [email protected]//org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.destroy(BaseWrapperManagedConnection.java:494)
at [email protected]//org.jboss.jca.adapters.jdbc.xa.XAManagedConnection.destroy(XAManagedConnection.java:229)
at [email protected]//org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener.destroy(AbstractConnectionListener.java:637)
at [email protected]//org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.shutdown(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1069)
at [email protected]//org.jboss.jca.core.connectionmanager.pool.AbstractPool.shutdown(AbstractPool.java:945)
at [email protected]//org.jboss.jca.core.connectionmanager.AbstractConnectionManager.shutdown(AbstractConnectionManager.java:321)
at [email protected]//org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.stopService(AbstractDataSourceService.java:236)
at [email protected]//org.jboss.as.connector.subsystems.datasources.XaDataSourceService.stopService(XaDataSourceService.java:72)
at [email protected]//org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$1.run(AbstractDataSourceService.java:190)
at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at [email protected]//org.jboss.threads.JBossThread.run(JBossThread.java:513)
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@
<artifactId>jakarta.jakartaee-api</artifactId>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.33</version>
<scope>provided</scope>
</dependency>

<!-- Required by Java SE 9+ -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.eclipse.cargotracker.application.util;

import org.glassfish.jersey.server.ServerProperties;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import java.util.HashMap;
Expand All @@ -12,11 +14,7 @@ public class RestConfiguration extends Application {
@Override
public Map<String, Object> getProperties() {
Map<String, Object> properties = new HashMap<String, Object>();
// properties.put(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
// for portable in other application servers.
// see:
// https://eclipse-ee4j.github.io/jersey.github.io/apidocs/latest/jersey/org/glassfish/jersey/server/ServerProperties.html#BV_SEND_ERROR_IN_RESPONSE
properties.put("jersey.config.beanValidation.enableOutputValidationErrorEntity.server", true);
properties.put(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
return properties;
}
}

0 comments on commit 344eb55

Please sign in to comment.