Possible errors when running batch jobs with WildFly 12
cfang Apr 5, 2018 10:24 PMI recently ran into the following errors when running a batch job web app with WildFly 12. Basically it failed to clone the batch job definition object with jboss-marshalling 2.0.4.Final. The easiest fix is to upgrade your Java version to 1.8.0_161 or later.
Another option is to switch to a recent version of jboss-marshalling (e.g., 2.0.5.Final). It worked with my batch test app, but I'm not 100% sure about its full implication. So as in any dependency upgrade, there is always risks involved.
java.lang.IllegalStateException: Constructor is unexpectedly inaccessible
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:78)
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:222)
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:195)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:457)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:231)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:137)
at org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:361)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:140)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:217)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:227)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:67)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1349)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Constructor is unexpectedly inaccessible
at org.jboss.marshalling.reflect.SerializableClass.invokeConstructorNoException(SerializableClass.java:377)
at org.jboss.marshalling.reflect.SerializableClass.callNonInitConstructor(SerializableClass.java:332)
at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:248)
at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:130)
at org.jboss.marshalling.cloner.SerializingCloner.cloneFields(SerializingCloner.java:391)
at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:311)
at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:279)
at org.jboss.marshalling.cloner.SerializingCloner.initSerializableClone(SerializingCloner.java:279)
at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:254)
at org.jboss.marshalling.cloner.SerializingCloner.clone(SerializingCloner.java:130)
at org.jberet.util.BatchUtil.clone(BatchUtil.java:132)
at org.jberet.runtime.JobExecutionImpl.<init>(JobExecutionImpl.java:84)
at org.jberet.repository.InMemoryRepository.createJobExecution(InMemoryRepository.java:194)
at org.wildfly.extension.batch.jberet.job.repository.JobRepositoryService.createJobExecution(JobRepositoryService.java:119)
at org.wildfly.extension.batch.jberet.job.repository.InMemoryJobRepositoryService.createJobExecution(InMemoryJobRepositoryService.java:37)
at org.jberet.operations.AbstractJobOperator.startJobExecution(AbstractJobOperator.java:436)
at org.jberet.operations.AbstractJobOperator.access$000(AbstractJobOperator.java:61)
at org.jberet.operations.AbstractJobOperator$1.invoke(AbstractJobOperator.java:147)
at org.jberet.operations.AbstractJobOperator$1.invoke(AbstractJobOperator.java:143)
at org.jberet.operations.AbstractJobOperator.invokeTransaction(AbstractJobOperator.java:464)
at org.jberet.operations.AbstractJobOperator.start(AbstractJobOperator.java:143)
at org.jberet.operations.AbstractJobOperator.start(AbstractJobOperator.java:103)
at org.wildfly.extension.batch.jberet.deployment.JobOperatorService.start(JobOperatorService.java:230)
at org.jberet.operations.DelegatingJobOperator.start(DelegatingJobOperator.java:67)
at org.jberet.rest.service.JobService.start(JobService.java:59)
at org.jberet.rest.resource.JobResource.start(JobResource.java:72)
at org.jberet.rest.resource.JobResource$Proxy$_$$_WeldClientProxy.start(Unknown Source)
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.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:511)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:402)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:366)