Payara Micro with enhanced classloading?
I have a big war that gets built with a bunch of dependencies, including newer versions of guava, jackson etc. In order to get it to work on Payara Server 5.183, I have added a glassfish-web.xml
file with the <class-loader delegate="false"/>
tag to the WEB-INF folder of my war. This seems to work great in Payara Server and the war runs happily.
I would also like to be able to run my war with Payara Micro, so that it can be bundled up and shared with the team in a reproducible way. But when I use the exact same war and run:
java -jar payara-micro-5.183.jar --deploy myapp.war --domainConfig domain-micro.xml --rootDir domain/
I get the following error which sounds to me like it is probably a classloader issue (although it might not be, I'm happy to also take alternative suggestions):
java.lang.Exception: java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not a subtype
Any suggestions?
EDIT 1:
Java version:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Full stacktrace:
INFO Jsr330Integration:57 - Starting up JSR 330 integration
[2018-11-26T09:11:15.760+0000] [←[1;92mINFO←[0m] [AS-WEB-GLUE-00172] [←[1;94mjavax.enterprise.web←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475760] [levelValue: 800] Loading application [MyApp] at [/MyApp]
[2018-11-26T09:11:15.761+0000] [←[1;93mWARNING←[0m] [AS-EJB-00056] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475761] [levelValue: 900] A system exception occurred during an invocation on EJB Jsr330Integration, method: publi
c java.lang.Object com.mypackage.bean.jsr330.Jsr330Integration.getInstance(java.lang.Class)
[2018-11-26T09:11:15.775+0000] [←[1;93mWARNING←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475775] [levelValue: 900] [[
javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:736)
at com.sun.ejb.containers.AbstractSingletonContainer.instantiateSingletonInstance(AbstractSingletonContainer.java:438)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:219)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:180)
at com.sun.ejb.containers.AbstractSingletonContainer.checkInit(AbstractSingletonContainer.java:410)
at com.sun.ejb.containers.AbstractSingletonContainer._getContext(AbstractSingletonContainer.java:183)
at com.sun.ejb.containers.CMCSingletonContainer._getContext(CMCSingletonContainer.java:116)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy302.getInstance(Unknown Source)
at com.mypackage.bean.jsr330.__EJB31_Generated__Jsr330Integration__Intf____Bean__.getInstance(Unknown Source)
at com.mypackage.manager.impl.VolumeClearingManager.setup(VolumeClearingManager.java:706)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:99)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:713)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:220)
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:442)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy313.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.manager.impl.__EJB31_Generated__VolumeClearingManager__Intf____Bean__.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.cancelOpenVolumeClearingProcesses(StartUpEventHandler.java:247)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.handle(StartUpEventHandler.java:88)
at com.mypackage.bean.timer.TimerBean.timeout(TimerBean.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:953)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1017)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4867)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:836)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:374)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4839)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4827)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4105)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1229)
at com.sun.ejb.containers.EJBTimerService.access$000(EJBTimerService.java:94)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1964)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:564)
at com.sun.ejb.containers.AbstractSingletonContainer.access$000(AbstractSingletonContainer.java:78)
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:734)
... 92 more
Caused by: java.lang.NullPointerException
at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJars(WebappClassLoader.java:2908)
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2761)
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2651)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1067)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1624)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1505)
at com.google.inject.internal.Initializer.<init>(Initializer.java:59)
at com.google.inject.internal.InternalInjectorCreator.<init>(InternalInjectorCreator.java:63)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at com.mypackage.bean.jsr330.Jsr330Integration.setup(Jsr330Integration.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:555)
... 94 more
]]
[2018-11-26T09:11:15.847+0000] [←[1;92mINFO←[0m] [←[1;94mPayaraMicro←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475847] [levelValue: 800]
{
"Instance Configuration": {
"Host": "BS-DEV-75438.eu.ad.mycorp.com",
"Http Port(s)": "8080",
"Https Port(s)": "",
"Instance Name": "Frail-Fusilier",
"Instance Group": "MicroShoal",
"Hazelcast Member UUID": "dddef61b-bd0c-4faa-9167-0e1ffee5730a",
"Deployed": [
{
"Name": "MyApp",
"Type": "war",
"Context Root": "/MyApp"
}
]
}
}
[2018-11-26T09:11:15.894+0000] [←[1;91mSEVERE←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475894] [levelValue: 1000] ejb.stateless_ejbcreate_exception
The class it can't load:
package com.mypackage.bean.jsr330;
import com.mypackage.bean.marketdata.MarketDataHandlerBean;
import com.mypackage.bean.notification.NotificationEngine;
import com.mypackage.bean.rankingdata.LpRankingUpdateHandlerBean;
import com.mypackage.eapi.context.Context;
import com.mypackage.eapi.marketdata.MarketDataHandler;
import com.mypackage.eapi.rankingdata.LpRankingUpdateHandler;
import com.mypackage.interfaces.bgc.integration.IntegrationModule;
import com.mypackage.persistence.dao.DaoHolder;
import com.mypackage.persistence.dao.LegalEntityDao;
import com.mypackage.persistence.dao.StrategyDao;
import com.mypackage.persistence.dao.UserDao;
import com.mypackage.persistence.dao.VolumeClearingDao;
import com.mypackage.persistence.redis.dao.RedisFuturePriceDao;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import java.util.concurrent.ExecutorService;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.enterprise.concurrent.ManagedExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* A little utility to hide Guice implementation of jsr330 so we don't end up using guice specific
* features
*/
@LocalBean
@Singleton
public class Jsr330Integration {
private static final Logger LOG = LoggerFactory.getLogger(Jsr330Integration.class);
private Injector injector;
@Resource
private ManagedExecutorService executor;
@EJB
private MarketDataHandlerBean marketDataHandler;
@EJB
private LpRankingUpdateHandlerBean marketMakerHandlerBean;
@EJB
private NotificationEngine notificationEngine;
@EJB
private TaskRunnerBean taskRunner;
@PostConstruct
public void setup() {
LOG.info("Starting up JSR 330 integration");
injector =
Guice.createInjector(
new IntegrationModule(),
new AbstractModule() {
@Override
protected void configure() {
bind(ExecutorService.class).toInstance(executor);
bind(MarketDataHandler.class).toInstance(marketDataHandler);
bind(LpRankingUpdateHandler.class).toInstance(marketMakerHandlerBean);
bind(NotificationEngine.class).toInstance(notificationEngine);
final DaoHolder instance = DaoHolder.getInstance();
bind(StrategyDao.class).toInstance(instance.getStrategyDao());
bind(RedisFuturePriceDao.class).toInstance(instance.getRedisFuturePriceDao());
bind(UserDao.class).toInstance(instance.getUserDao());
bind(LegalEntityDao.class).toInstance(instance.getLegalEntityDao());
bind(VolumeClearingDao.class).toInstance(instance.getVolumeClearingDao());
bind(TaskRunnerBean.class).toInstance(taskRunner);
}
});
}
@PreDestroy
public void shutdown() {
LOG.info("Shutting down eapi context and all eapi services");
injector.getInstance(Context.class).shutdownServices();
}
public <T> T getInstance(final Class<T> clazz) {
return injector.getInstance(clazz);
}
public <T> T getInstance(final Key<T> var1) {
return injector.getInstance(var1);
}
}
java java-ee payara-micro
add a comment |
I have a big war that gets built with a bunch of dependencies, including newer versions of guava, jackson etc. In order to get it to work on Payara Server 5.183, I have added a glassfish-web.xml
file with the <class-loader delegate="false"/>
tag to the WEB-INF folder of my war. This seems to work great in Payara Server and the war runs happily.
I would also like to be able to run my war with Payara Micro, so that it can be bundled up and shared with the team in a reproducible way. But when I use the exact same war and run:
java -jar payara-micro-5.183.jar --deploy myapp.war --domainConfig domain-micro.xml --rootDir domain/
I get the following error which sounds to me like it is probably a classloader issue (although it might not be, I'm happy to also take alternative suggestions):
java.lang.Exception: java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not a subtype
Any suggestions?
EDIT 1:
Java version:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Full stacktrace:
INFO Jsr330Integration:57 - Starting up JSR 330 integration
[2018-11-26T09:11:15.760+0000] [←[1;92mINFO←[0m] [AS-WEB-GLUE-00172] [←[1;94mjavax.enterprise.web←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475760] [levelValue: 800] Loading application [MyApp] at [/MyApp]
[2018-11-26T09:11:15.761+0000] [←[1;93mWARNING←[0m] [AS-EJB-00056] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475761] [levelValue: 900] A system exception occurred during an invocation on EJB Jsr330Integration, method: publi
c java.lang.Object com.mypackage.bean.jsr330.Jsr330Integration.getInstance(java.lang.Class)
[2018-11-26T09:11:15.775+0000] [←[1;93mWARNING←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475775] [levelValue: 900] [[
javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:736)
at com.sun.ejb.containers.AbstractSingletonContainer.instantiateSingletonInstance(AbstractSingletonContainer.java:438)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:219)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:180)
at com.sun.ejb.containers.AbstractSingletonContainer.checkInit(AbstractSingletonContainer.java:410)
at com.sun.ejb.containers.AbstractSingletonContainer._getContext(AbstractSingletonContainer.java:183)
at com.sun.ejb.containers.CMCSingletonContainer._getContext(CMCSingletonContainer.java:116)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy302.getInstance(Unknown Source)
at com.mypackage.bean.jsr330.__EJB31_Generated__Jsr330Integration__Intf____Bean__.getInstance(Unknown Source)
at com.mypackage.manager.impl.VolumeClearingManager.setup(VolumeClearingManager.java:706)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:99)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:713)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:220)
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:442)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy313.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.manager.impl.__EJB31_Generated__VolumeClearingManager__Intf____Bean__.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.cancelOpenVolumeClearingProcesses(StartUpEventHandler.java:247)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.handle(StartUpEventHandler.java:88)
at com.mypackage.bean.timer.TimerBean.timeout(TimerBean.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:953)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1017)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4867)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:836)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:374)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4839)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4827)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4105)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1229)
at com.sun.ejb.containers.EJBTimerService.access$000(EJBTimerService.java:94)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1964)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:564)
at com.sun.ejb.containers.AbstractSingletonContainer.access$000(AbstractSingletonContainer.java:78)
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:734)
... 92 more
Caused by: java.lang.NullPointerException
at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJars(WebappClassLoader.java:2908)
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2761)
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2651)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1067)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1624)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1505)
at com.google.inject.internal.Initializer.<init>(Initializer.java:59)
at com.google.inject.internal.InternalInjectorCreator.<init>(InternalInjectorCreator.java:63)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at com.mypackage.bean.jsr330.Jsr330Integration.setup(Jsr330Integration.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:555)
... 94 more
]]
[2018-11-26T09:11:15.847+0000] [←[1;92mINFO←[0m] [←[1;94mPayaraMicro←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475847] [levelValue: 800]
{
"Instance Configuration": {
"Host": "BS-DEV-75438.eu.ad.mycorp.com",
"Http Port(s)": "8080",
"Https Port(s)": "",
"Instance Name": "Frail-Fusilier",
"Instance Group": "MicroShoal",
"Hazelcast Member UUID": "dddef61b-bd0c-4faa-9167-0e1ffee5730a",
"Deployed": [
{
"Name": "MyApp",
"Type": "war",
"Context Root": "/MyApp"
}
]
}
}
[2018-11-26T09:11:15.894+0000] [←[1;91mSEVERE←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475894] [levelValue: 1000] ejb.stateless_ejbcreate_exception
The class it can't load:
package com.mypackage.bean.jsr330;
import com.mypackage.bean.marketdata.MarketDataHandlerBean;
import com.mypackage.bean.notification.NotificationEngine;
import com.mypackage.bean.rankingdata.LpRankingUpdateHandlerBean;
import com.mypackage.eapi.context.Context;
import com.mypackage.eapi.marketdata.MarketDataHandler;
import com.mypackage.eapi.rankingdata.LpRankingUpdateHandler;
import com.mypackage.interfaces.bgc.integration.IntegrationModule;
import com.mypackage.persistence.dao.DaoHolder;
import com.mypackage.persistence.dao.LegalEntityDao;
import com.mypackage.persistence.dao.StrategyDao;
import com.mypackage.persistence.dao.UserDao;
import com.mypackage.persistence.dao.VolumeClearingDao;
import com.mypackage.persistence.redis.dao.RedisFuturePriceDao;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import java.util.concurrent.ExecutorService;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.enterprise.concurrent.ManagedExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* A little utility to hide Guice implementation of jsr330 so we don't end up using guice specific
* features
*/
@LocalBean
@Singleton
public class Jsr330Integration {
private static final Logger LOG = LoggerFactory.getLogger(Jsr330Integration.class);
private Injector injector;
@Resource
private ManagedExecutorService executor;
@EJB
private MarketDataHandlerBean marketDataHandler;
@EJB
private LpRankingUpdateHandlerBean marketMakerHandlerBean;
@EJB
private NotificationEngine notificationEngine;
@EJB
private TaskRunnerBean taskRunner;
@PostConstruct
public void setup() {
LOG.info("Starting up JSR 330 integration");
injector =
Guice.createInjector(
new IntegrationModule(),
new AbstractModule() {
@Override
protected void configure() {
bind(ExecutorService.class).toInstance(executor);
bind(MarketDataHandler.class).toInstance(marketDataHandler);
bind(LpRankingUpdateHandler.class).toInstance(marketMakerHandlerBean);
bind(NotificationEngine.class).toInstance(notificationEngine);
final DaoHolder instance = DaoHolder.getInstance();
bind(StrategyDao.class).toInstance(instance.getStrategyDao());
bind(RedisFuturePriceDao.class).toInstance(instance.getRedisFuturePriceDao());
bind(UserDao.class).toInstance(instance.getUserDao());
bind(LegalEntityDao.class).toInstance(instance.getLegalEntityDao());
bind(VolumeClearingDao.class).toInstance(instance.getVolumeClearingDao());
bind(TaskRunnerBean.class).toInstance(taskRunner);
}
});
}
@PreDestroy
public void shutdown() {
LOG.info("Shutting down eapi context and all eapi services");
injector.getInstance(Context.class).shutdownServices();
}
public <T> T getInstance(final Class<T> clazz) {
return injector.getInstance(clazz);
}
public <T> T getInstance(final Key<T> var1) {
return injector.getInstance(var1);
}
}
java java-ee payara-micro
Do you have a full stack trace available for the exception, or was it just reported as an error message? Also, which version of Java are you using?
– skomisa
Nov 25 '18 at 9:23
Hi @skomisa I've added the full stacktrace, java version and the class where it's failing - any thoughts?
– Matt
Nov 26 '18 at 9:38
Sorry, no bright ideas. Since this is working fine for you on the latest version of a full Payara server I can only suggest raising an issue on this with Payara.
– skomisa
Nov 26 '18 at 21:46
add a comment |
I have a big war that gets built with a bunch of dependencies, including newer versions of guava, jackson etc. In order to get it to work on Payara Server 5.183, I have added a glassfish-web.xml
file with the <class-loader delegate="false"/>
tag to the WEB-INF folder of my war. This seems to work great in Payara Server and the war runs happily.
I would also like to be able to run my war with Payara Micro, so that it can be bundled up and shared with the team in a reproducible way. But when I use the exact same war and run:
java -jar payara-micro-5.183.jar --deploy myapp.war --domainConfig domain-micro.xml --rootDir domain/
I get the following error which sounds to me like it is probably a classloader issue (although it might not be, I'm happy to also take alternative suggestions):
java.lang.Exception: java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not a subtype
Any suggestions?
EDIT 1:
Java version:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Full stacktrace:
INFO Jsr330Integration:57 - Starting up JSR 330 integration
[2018-11-26T09:11:15.760+0000] [←[1;92mINFO←[0m] [AS-WEB-GLUE-00172] [←[1;94mjavax.enterprise.web←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475760] [levelValue: 800] Loading application [MyApp] at [/MyApp]
[2018-11-26T09:11:15.761+0000] [←[1;93mWARNING←[0m] [AS-EJB-00056] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475761] [levelValue: 900] A system exception occurred during an invocation on EJB Jsr330Integration, method: publi
c java.lang.Object com.mypackage.bean.jsr330.Jsr330Integration.getInstance(java.lang.Class)
[2018-11-26T09:11:15.775+0000] [←[1;93mWARNING←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475775] [levelValue: 900] [[
javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:736)
at com.sun.ejb.containers.AbstractSingletonContainer.instantiateSingletonInstance(AbstractSingletonContainer.java:438)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:219)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:180)
at com.sun.ejb.containers.AbstractSingletonContainer.checkInit(AbstractSingletonContainer.java:410)
at com.sun.ejb.containers.AbstractSingletonContainer._getContext(AbstractSingletonContainer.java:183)
at com.sun.ejb.containers.CMCSingletonContainer._getContext(CMCSingletonContainer.java:116)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy302.getInstance(Unknown Source)
at com.mypackage.bean.jsr330.__EJB31_Generated__Jsr330Integration__Intf____Bean__.getInstance(Unknown Source)
at com.mypackage.manager.impl.VolumeClearingManager.setup(VolumeClearingManager.java:706)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:99)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:713)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:220)
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:442)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy313.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.manager.impl.__EJB31_Generated__VolumeClearingManager__Intf____Bean__.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.cancelOpenVolumeClearingProcesses(StartUpEventHandler.java:247)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.handle(StartUpEventHandler.java:88)
at com.mypackage.bean.timer.TimerBean.timeout(TimerBean.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:953)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1017)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4867)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:836)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:374)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4839)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4827)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4105)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1229)
at com.sun.ejb.containers.EJBTimerService.access$000(EJBTimerService.java:94)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1964)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:564)
at com.sun.ejb.containers.AbstractSingletonContainer.access$000(AbstractSingletonContainer.java:78)
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:734)
... 92 more
Caused by: java.lang.NullPointerException
at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJars(WebappClassLoader.java:2908)
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2761)
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2651)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1067)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1624)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1505)
at com.google.inject.internal.Initializer.<init>(Initializer.java:59)
at com.google.inject.internal.InternalInjectorCreator.<init>(InternalInjectorCreator.java:63)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at com.mypackage.bean.jsr330.Jsr330Integration.setup(Jsr330Integration.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:555)
... 94 more
]]
[2018-11-26T09:11:15.847+0000] [←[1;92mINFO←[0m] [←[1;94mPayaraMicro←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475847] [levelValue: 800]
{
"Instance Configuration": {
"Host": "BS-DEV-75438.eu.ad.mycorp.com",
"Http Port(s)": "8080",
"Https Port(s)": "",
"Instance Name": "Frail-Fusilier",
"Instance Group": "MicroShoal",
"Hazelcast Member UUID": "dddef61b-bd0c-4faa-9167-0e1ffee5730a",
"Deployed": [
{
"Name": "MyApp",
"Type": "war",
"Context Root": "/MyApp"
}
]
}
}
[2018-11-26T09:11:15.894+0000] [←[1;91mSEVERE←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475894] [levelValue: 1000] ejb.stateless_ejbcreate_exception
The class it can't load:
package com.mypackage.bean.jsr330;
import com.mypackage.bean.marketdata.MarketDataHandlerBean;
import com.mypackage.bean.notification.NotificationEngine;
import com.mypackage.bean.rankingdata.LpRankingUpdateHandlerBean;
import com.mypackage.eapi.context.Context;
import com.mypackage.eapi.marketdata.MarketDataHandler;
import com.mypackage.eapi.rankingdata.LpRankingUpdateHandler;
import com.mypackage.interfaces.bgc.integration.IntegrationModule;
import com.mypackage.persistence.dao.DaoHolder;
import com.mypackage.persistence.dao.LegalEntityDao;
import com.mypackage.persistence.dao.StrategyDao;
import com.mypackage.persistence.dao.UserDao;
import com.mypackage.persistence.dao.VolumeClearingDao;
import com.mypackage.persistence.redis.dao.RedisFuturePriceDao;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import java.util.concurrent.ExecutorService;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.enterprise.concurrent.ManagedExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* A little utility to hide Guice implementation of jsr330 so we don't end up using guice specific
* features
*/
@LocalBean
@Singleton
public class Jsr330Integration {
private static final Logger LOG = LoggerFactory.getLogger(Jsr330Integration.class);
private Injector injector;
@Resource
private ManagedExecutorService executor;
@EJB
private MarketDataHandlerBean marketDataHandler;
@EJB
private LpRankingUpdateHandlerBean marketMakerHandlerBean;
@EJB
private NotificationEngine notificationEngine;
@EJB
private TaskRunnerBean taskRunner;
@PostConstruct
public void setup() {
LOG.info("Starting up JSR 330 integration");
injector =
Guice.createInjector(
new IntegrationModule(),
new AbstractModule() {
@Override
protected void configure() {
bind(ExecutorService.class).toInstance(executor);
bind(MarketDataHandler.class).toInstance(marketDataHandler);
bind(LpRankingUpdateHandler.class).toInstance(marketMakerHandlerBean);
bind(NotificationEngine.class).toInstance(notificationEngine);
final DaoHolder instance = DaoHolder.getInstance();
bind(StrategyDao.class).toInstance(instance.getStrategyDao());
bind(RedisFuturePriceDao.class).toInstance(instance.getRedisFuturePriceDao());
bind(UserDao.class).toInstance(instance.getUserDao());
bind(LegalEntityDao.class).toInstance(instance.getLegalEntityDao());
bind(VolumeClearingDao.class).toInstance(instance.getVolumeClearingDao());
bind(TaskRunnerBean.class).toInstance(taskRunner);
}
});
}
@PreDestroy
public void shutdown() {
LOG.info("Shutting down eapi context and all eapi services");
injector.getInstance(Context.class).shutdownServices();
}
public <T> T getInstance(final Class<T> clazz) {
return injector.getInstance(clazz);
}
public <T> T getInstance(final Key<T> var1) {
return injector.getInstance(var1);
}
}
java java-ee payara-micro
I have a big war that gets built with a bunch of dependencies, including newer versions of guava, jackson etc. In order to get it to work on Payara Server 5.183, I have added a glassfish-web.xml
file with the <class-loader delegate="false"/>
tag to the WEB-INF folder of my war. This seems to work great in Payara Server and the war runs happily.
I would also like to be able to run my war with Payara Micro, so that it can be bundled up and shared with the team in a reproducible way. But when I use the exact same war and run:
java -jar payara-micro-5.183.jar --deploy myapp.war --domainConfig domain-micro.xml --rootDir domain/
I get the following error which sounds to me like it is probably a classloader issue (although it might not be, I'm happy to also take alternative suggestions):
java.lang.Exception: java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not a subtype
Any suggestions?
EDIT 1:
Java version:
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
Full stacktrace:
INFO Jsr330Integration:57 - Starting up JSR 330 integration
[2018-11-26T09:11:15.760+0000] [←[1;92mINFO←[0m] [AS-WEB-GLUE-00172] [←[1;94mjavax.enterprise.web←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475760] [levelValue: 800] Loading application [MyApp] at [/MyApp]
[2018-11-26T09:11:15.761+0000] [←[1;93mWARNING←[0m] [AS-EJB-00056] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475761] [levelValue: 900] A system exception occurred during an invocation on EJB Jsr330Integration, method: publi
c java.lang.Object com.mypackage.bean.jsr330.Jsr330Integration.getInstance(java.lang.Class)
[2018-11-26T09:11:15.775+0000] [←[1;93mWARNING←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475775] [levelValue: 900] [[
javax.ejb.EJBException: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:736)
at com.sun.ejb.containers.AbstractSingletonContainer.instantiateSingletonInstance(AbstractSingletonContainer.java:438)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:219)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:180)
at com.sun.ejb.containers.AbstractSingletonContainer.checkInit(AbstractSingletonContainer.java:410)
at com.sun.ejb.containers.AbstractSingletonContainer._getContext(AbstractSingletonContainer.java:183)
at com.sun.ejb.containers.CMCSingletonContainer._getContext(CMCSingletonContainer.java:116)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy302.getInstance(Unknown Source)
at com.mypackage.bean.jsr330.__EJB31_Generated__Jsr330Integration__Intf____Bean__.getInstance(Unknown Source)
at com.mypackage.manager.impl.VolumeClearingManager.setup(VolumeClearingManager.java:706)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:518)
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:99)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:713)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:220)
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:442)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2627)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:2020)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:90)
at com.sun.proxy.$Proxy313.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.manager.impl.__EJB31_Generated__VolumeClearingManager__Intf____Bean__.cancelOpenVolumeClearings(Unknown Source)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.cancelOpenVolumeClearingProcesses(StartUpEventHandler.java:247)
at com.mypackage.bean.timer.event.handler.StartUpEventHandler.handle(StartUpEventHandler.java:88)
at com.mypackage.bean.timer.TimerBean.timeout(TimerBean.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:953)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1017)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4867)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:836)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundTimeout(SystemInterceptorProxy.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:81)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:895)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:835)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:374)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4839)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4827)
at com.sun.ejb.containers.BaseContainer.callEJBTimeout(BaseContainer.java:4105)
at com.sun.ejb.containers.EJBTimerService.deliverTimeout(EJBTimerService.java:1229)
at com.sun.ejb.containers.EJBTimerService.access$000(EJBTimerService.java:94)
at com.sun.ejb.containers.EJBTimerService$TaskExpiredWork.run(EJBTimerService.java:1964)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.ejb.CreateException: Initialization failed for Singleton Jsr330Integration
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:564)
at com.sun.ejb.containers.AbstractSingletonContainer.access$000(AbstractSingletonContainer.java:78)
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:734)
... 92 more
Caused by: java.lang.NullPointerException
at org.glassfish.web.loader.WebappClassLoader.findResourceInternalFromJars(WebappClassLoader.java:2908)
at org.glassfish.web.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:2761)
at org.glassfish.web.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2651)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1067)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1624)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1505)
at com.google.inject.internal.Initializer.<init>(Initializer.java:59)
at com.google.inject.internal.InternalInjectorCreator.<init>(InternalInjectorCreator.java:63)
at com.google.inject.Guice.createInjector(Guice.java:87)
at com.google.inject.Guice.createInjector(Guice.java:69)
at com.google.inject.Guice.createInjector(Guice.java:59)
at com.mypackage.bean.jsr330.Jsr330Integration.setup(Jsr330Integration.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1047)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:206)
at org.jboss.weld.module.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:72)
at org.jboss.weld.module.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:998)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:417)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:380)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2063)
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:555)
... 94 more
]]
[2018-11-26T09:11:15.847+0000] [←[1;92mINFO←[0m] [←[1;94mPayaraMicro←[0m] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1543223475847] [levelValue: 800]
{
"Instance Configuration": {
"Host": "BS-DEV-75438.eu.ad.mycorp.com",
"Http Port(s)": "8080",
"Https Port(s)": "",
"Instance Name": "Frail-Fusilier",
"Instance Group": "MicroShoal",
"Hazelcast Member UUID": "dddef61b-bd0c-4faa-9167-0e1ffee5730a",
"Deployed": [
{
"Name": "MyApp",
"Type": "war",
"Context Root": "/MyApp"
}
]
}
}
[2018-11-26T09:11:15.894+0000] [←[1;91mSEVERE←[0m] [←[1;94mjavax.enterprise.ejb.container←[0m] [tid: _ThreadID=194 _ThreadName=__ejb-thread-pool2] [timeMillis: 1543223475894] [levelValue: 1000] ejb.stateless_ejbcreate_exception
The class it can't load:
package com.mypackage.bean.jsr330;
import com.mypackage.bean.marketdata.MarketDataHandlerBean;
import com.mypackage.bean.notification.NotificationEngine;
import com.mypackage.bean.rankingdata.LpRankingUpdateHandlerBean;
import com.mypackage.eapi.context.Context;
import com.mypackage.eapi.marketdata.MarketDataHandler;
import com.mypackage.eapi.rankingdata.LpRankingUpdateHandler;
import com.mypackage.interfaces.bgc.integration.IntegrationModule;
import com.mypackage.persistence.dao.DaoHolder;
import com.mypackage.persistence.dao.LegalEntityDao;
import com.mypackage.persistence.dao.StrategyDao;
import com.mypackage.persistence.dao.UserDao;
import com.mypackage.persistence.dao.VolumeClearingDao;
import com.mypackage.persistence.redis.dao.RedisFuturePriceDao;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import java.util.concurrent.ExecutorService;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.enterprise.concurrent.ManagedExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* A little utility to hide Guice implementation of jsr330 so we don't end up using guice specific
* features
*/
@LocalBean
@Singleton
public class Jsr330Integration {
private static final Logger LOG = LoggerFactory.getLogger(Jsr330Integration.class);
private Injector injector;
@Resource
private ManagedExecutorService executor;
@EJB
private MarketDataHandlerBean marketDataHandler;
@EJB
private LpRankingUpdateHandlerBean marketMakerHandlerBean;
@EJB
private NotificationEngine notificationEngine;
@EJB
private TaskRunnerBean taskRunner;
@PostConstruct
public void setup() {
LOG.info("Starting up JSR 330 integration");
injector =
Guice.createInjector(
new IntegrationModule(),
new AbstractModule() {
@Override
protected void configure() {
bind(ExecutorService.class).toInstance(executor);
bind(MarketDataHandler.class).toInstance(marketDataHandler);
bind(LpRankingUpdateHandler.class).toInstance(marketMakerHandlerBean);
bind(NotificationEngine.class).toInstance(notificationEngine);
final DaoHolder instance = DaoHolder.getInstance();
bind(StrategyDao.class).toInstance(instance.getStrategyDao());
bind(RedisFuturePriceDao.class).toInstance(instance.getRedisFuturePriceDao());
bind(UserDao.class).toInstance(instance.getUserDao());
bind(LegalEntityDao.class).toInstance(instance.getLegalEntityDao());
bind(VolumeClearingDao.class).toInstance(instance.getVolumeClearingDao());
bind(TaskRunnerBean.class).toInstance(taskRunner);
}
});
}
@PreDestroy
public void shutdown() {
LOG.info("Shutting down eapi context and all eapi services");
injector.getInstance(Context.class).shutdownServices();
}
public <T> T getInstance(final Class<T> clazz) {
return injector.getInstance(clazz);
}
public <T> T getInstance(final Key<T> var1) {
return injector.getInstance(var1);
}
}
java java-ee payara-micro
java java-ee payara-micro
edited Nov 26 '18 at 9:37
Matt
asked Nov 23 '18 at 9:52
MattMatt
1,96322039
1,96322039
Do you have a full stack trace available for the exception, or was it just reported as an error message? Also, which version of Java are you using?
– skomisa
Nov 25 '18 at 9:23
Hi @skomisa I've added the full stacktrace, java version and the class where it's failing - any thoughts?
– Matt
Nov 26 '18 at 9:38
Sorry, no bright ideas. Since this is working fine for you on the latest version of a full Payara server I can only suggest raising an issue on this with Payara.
– skomisa
Nov 26 '18 at 21:46
add a comment |
Do you have a full stack trace available for the exception, or was it just reported as an error message? Also, which version of Java are you using?
– skomisa
Nov 25 '18 at 9:23
Hi @skomisa I've added the full stacktrace, java version and the class where it's failing - any thoughts?
– Matt
Nov 26 '18 at 9:38
Sorry, no bright ideas. Since this is working fine for you on the latest version of a full Payara server I can only suggest raising an issue on this with Payara.
– skomisa
Nov 26 '18 at 21:46
Do you have a full stack trace available for the exception, or was it just reported as an error message? Also, which version of Java are you using?
– skomisa
Nov 25 '18 at 9:23
Do you have a full stack trace available for the exception, or was it just reported as an error message? Also, which version of Java are you using?
– skomisa
Nov 25 '18 at 9:23
Hi @skomisa I've added the full stacktrace, java version and the class where it's failing - any thoughts?
– Matt
Nov 26 '18 at 9:38
Hi @skomisa I've added the full stacktrace, java version and the class where it's failing - any thoughts?
– Matt
Nov 26 '18 at 9:38
Sorry, no bright ideas. Since this is working fine for you on the latest version of a full Payara server I can only suggest raising an issue on this with Payara.
– skomisa
Nov 26 '18 at 21:46
Sorry, no bright ideas. Since this is working fine for you on the latest version of a full Payara server I can only suggest raising an issue on this with Payara.
– skomisa
Nov 26 '18 at 21:46
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444286%2fpayara-micro-with-enhanced-classloading%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53444286%2fpayara-micro-with-enhanced-classloading%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have a full stack trace available for the exception, or was it just reported as an error message? Also, which version of Java are you using?
– skomisa
Nov 25 '18 at 9:23
Hi @skomisa I've added the full stacktrace, java version and the class where it's failing - any thoughts?
– Matt
Nov 26 '18 at 9:38
Sorry, no bright ideas. Since this is working fine for you on the latest version of a full Payara server I can only suggest raising an issue on this with Payara.
– skomisa
Nov 26 '18 at 21:46