I trying to understand what is that error. It starts to happen when I put the mongoDB in another instance.
The error has a big message, but it doesn't say anything, and there's no action known which triggers it.
AT Tue Jan 12 19:34:31 UTC 2016 BY :[java.lang.Thread.getStackTrace(Thread.java:1552), com.sun.enterprise.loader.ASURLClassLoader.done(ASURLClassLoader.java:216), com.sun.enterprise.loader.ASURLClassLoader.preDestroy(ASURLClassLoader.java:184), org.glassfish.javaee.full.deployment.EarClassLoader.preDestroy(EarClassLoader.java:114), org.jvnet.hk2.internal.ServiceLocatorImpl.preDestroy(ServiceLocatorImpl.java:956), org.jvnet.hk2.internal.ServiceLocatorImpl.preDestroy(ServiceLocatorImpl.java:940), org.glassfish.internal.data.ApplicationInfo.clean(ApplicationInfo.java:451), com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:1071), com.sun.enterprise.v3.server.ApplicationLifecycle.undeploy(ApplicationLifecycle.java:1099), org.glassfish.deployment.admin.UndeployCommand.execute(UndeployCommand.java:412), com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539), com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535), java.security.AccessController.doPrivileged(Native Method), javax.security.auth.Subject.doAs(Subject.java:360), com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534), com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565), com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557), java.security.AccessController.doPrivileged(Native Method), javax.security.auth.Subject.doAs(Subject.java:360), com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556), com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464), com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109), com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846), com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722), org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:404), org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234), sun.reflect.GeneratedMethodAccessor419.invoke(Unknown Source), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:497), org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81), org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151), org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:171), org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152), org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104), org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:387), org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:331), org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:103), org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271), org.glassfish.jersey.internal.Errors$1.call(Errors.java:271), org.glassfish.jersey.internal.Errors$1.call(Errors.java:267), org.glassfish.jersey.internal.Errors.process(Errors.java:315), org.glassfish.jersey.internal.Errors.process(Errors.java:297), org.glassfish.jersey.internal.Errors.process(Errors.java:267), org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297), org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254), org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028), org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:365), org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:173), org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:179), com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459), com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167), org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201), org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175), org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235), org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201), org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133), org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112), org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77), org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231), org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201), org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133), org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112), org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77), org.glassfish.grizzly.portunif.PUFilter.handleRead(PUFilter.java:231), org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284), org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201), org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133), org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112), org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77), org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561), org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112), org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117), org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56), org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137), org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565), org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545), java.lang.Thread.run(Thread.java:745)] Parent -> org.glassfish.internal.api.DelegatingClassLoader@7cbe8ac6 was requested to find class org.bson.codecs.EncoderContext$1 after done was invoked from the following stack trace java.lang.Throwable at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:825) at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:742) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.bson.codecs.EncoderContext.(EncoderContext.java:27) at org.bson.codecs.EncoderContext$Builder.build(EncoderContext.java:67) at com.mongodb.connection.RequestMessage.addDocument(RequestMessage.java:168) at com.mongodb.connection.CommandMessage.encodeMessageBody(CommandMessage.java:69) at com.mongodb.connection.RequestMessage.encode(RequestMessage.java:132) at com.mongodb.connection.CommandHelper.sendMessage(CommandHelper.java:88) at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32) at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:186) at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:134) at java.lang.Thread.run(Thread.java:745) ]]
Error message image:
Edit:
People from Payara Server github issue helped me to find the problem. I have used the ServletContextListener to kill the mongo connections before the deploy. Now, I'll wait some time to see if the problem is solved. Code bellow:
@Log
@WebListener
public class AppServletContextListener implements ServletContextListener {
@Inject
MongoClientProvider mongo;
@Override
public void contextDestroyed(ServletContextEvent arg) {
log.info("ServletContextListener destroyed");
DbUtils.closeMongoConnections(mongo);
}
@Override
public void contextInitialized(ServletContextEvent arg) {
log.info("ServletContextListener started");
}
}
.
public class DbUtils {
public static void closeMongoConnections(MongoClientProvider mongo) {
mongo.getDeletedGroups().getManager().close();
mongo.getMessages().getManager().close();
mongo.getGameficationInfos().getManager().close();
mongo.getDgsa().getManager().close();
mongo.getRisa().getManager().close();
mongo.getExpiredEmailLinks().getManager().close();
}
}