Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,

    Check if your MongoDB is available.

  2. ,

    Check if your MariaDB is running and available.

Solutions on the web

via Java.net JIRA by arunkumar_s, 1 year ago
Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.
via Java.net JIRA by arunkumar_s, 1 year ago
Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused.
via codedmi.com by Unknown author, 2 years ago
Error in allocating a connection. Cause: Connection could not be allocated because: FATAL: database "null" does not exist
via Stack Overflow by Moe
, 2 years ago
Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
via Stack Overflow by Moe
, 2 years ago
Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
via Stack Overflow by user3135185
, 2 years ago
Error in allocating a connection. Cause: org.apache.derby.jdbc.AutoloadedDriver40 cannot be cast to org.apache.derby.jdbc.InternalDriver
java.net.ConnectException: Connection refused	at java.net.PlainSocketImpl.socketConnect(Native Method)	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)	at java.net.Socket.connect(Socket.java:579)	at java.net.Socket.connect(Socket.java:528)	at java.net.Socket.(Socket.java:425)	at java.net.Socket.(Socket.java:208)	at javax.net.DefaultSocketFactory.createSocket(SocketFactory.java:271)	at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)	at java.security.AccessController.doPrivileged(Native Method)	at org.apache.derby.client.net.NetAgent.(Unknown Source)	at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)	at org.apache.derby.client.am.Connection.initConnection(Unknown Source)	at org.apache.derby.client.am.Connection.(Unknown Source)	at org.apache.derby.client.net.NetConnection.(Unknown Source)	at org.apache.derby.client.net.NetConnection40.(Unknown Source)	at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)	at org.apache.derby.jdbc.ClientDataSource.getConnectionX(Unknown Source)	at org.apache.derby.jdbc.ClientDataSource.getConnection(Unknown Source)	at com.sun.gjc.spi.DSManagedConnectionFactory.createManagedConnection(DSManagedConnectionFactory.java:115)	at com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)	at com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907)	at com.sun.enterprise.resource.pool.ConnectionPool.createResource(ConnectionPool.java:1189)	at com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:98)	at com.sun.enterprise.resource.pool.ConnectionPool.addResource(ConnectionPool.java:282)	at com.sun.enterprise.resource.pool.ConnectionPool.createResourceAndAddToPool(ConnectionPool.java:1512)	at com.sun.enterprise.resource.pool.ConnectionPool.createResources(ConnectionPool.java:944)	at com.sun.enterprise.resource.pool.ConnectionPool.initPool(ConnectionPool.java:230)	at com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(ConnectionPool.java:511)	at com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionPool.java:381)	at com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:245)	at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:170)	at com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(ConnectionManagerImpl.java:360)	at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:307)	at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:196)	at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:171)	at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:166)	at com.sun.gjc.spi.base.AbstractDataSource.getConnection(AbstractDataSource.java:114)	at com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl.getConnectionToDefaultSchema(JDBCPersistenceManagerImpl.java:340)	at com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl.isDerby(JDBCPersistenceManagerImpl.java:171)	at com.ibm.jbatch.container.services.impl.JDBCPersistenceManagerImpl.init(JDBCPersistenceManagerImpl.java:132)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.getService(ServicesManagerImpl.java:358)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.access$300(ServicesManagerImpl.java:341)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getService(ServicesManagerImpl.java:261)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getPersistenceManagerService(ServicesManagerImpl.java:292)	at com.ibm.jbatch.container.impl.BatchKernelImpl.(BatchKernelImpl.java:83)	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadService(ServicesManagerImpl.java:404)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader._loadServiceHelper(ServicesManagerImpl.java:377)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.getService(ServicesManagerImpl.java:357)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl$ServiceLoader.access$300(ServicesManagerImpl.java:341)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getService(ServicesManagerImpl.java:261)	at com.ibm.jbatch.container.servicesmanager.ServicesManagerImpl.getBatchKernelService(ServicesManagerImpl.java:307)	at com.ibm.jbatch.container.api.impl.JobOperatorImpl.(JobOperatorImpl.java:72)	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)	at java.lang.Class.newInstance0(Class.java:374)	at java.lang.Class.newInstance(Class.java:327)	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)	at java.util.ServiceLoader$1.next(ServiceLoader.java:445)	at javax.batch.runtime.BatchRuntime$1.run(BatchRuntime.java:52)	at javax.batch.runtime.BatchRuntime$1.run(BatchRuntime.java:47)	at java.security.AccessController.doPrivileged(Native Method)	at javax.batch.runtime.BatchRuntime.getJobOperator(BatchRuntime.java:47)	at org.glassfish.batch.ListBatchJobs.findJobExecutions(ListBatchJobs.java:177)	at org.glassfish.batch.ListBatchJobs.executeCommand(ListBatchJobs.java:118)	at org.glassfish.batch.AbstractListCommand.execute(AbstractListCommand.java:101)	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)	at java.security.AccessController.doPrivileged(Native Method)	at javax.security.auth.Subject.doAs(Subject.java:356)	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)	at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396)	at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:601)	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:217)	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:231)	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:227)	at org.glassfish.jersey.internal.Errors.process(Errors.java:275)	at org.glassfish.jersey.internal.Errors.process(Errors.java:257)	at org.glassfish.jersey.internal.Errors.process(Errors.java:227)	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:191)	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:819)	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:325)	at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:161)	at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)	at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)	at org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231)	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)	at java.lang.Thread.run(Thread.java:722)