WildFly randomly fails to load module when starting - wildfly

Using WildFly 14.0.1 in standalone mode within a Windows-based Docker container it randomly fails to start. It complains about different modules, but sometimes runs correctly. More often than not it fails.
The error reported generally is between loading the following modules:
* org.wildfly.extension.batch.jberet
* org.wildfly.extension.elytron
* org.wildfly.extension.bean-validation
* org.wildfly.extension.messaging-activemq
* org.wildfly.extension.request-controller
And in multiple executions to get this list it worked correctly once.
I've tried essentially the same setup on my host computer, using the same configuration files and it works reliably.
An example error:
10:38:40,597 INFO [org.jboss.as.controller] (Controller Boot Thread) OPVDX002: Failed to pretty print validation error: null
10:38:40,597 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)
at org.jboss.as.server.ServerService.boot(ServerService.java:377)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:372)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module org.wildfly.extension.batch.jberet
at org.jboss.as.controller.parsing.DeferredExtensionContext.load(DeferredExtensionContext.java:100)
at org.jboss.as.server.parsing.StandaloneXml_8.readServerElement(StandaloneXml_8.java:237)
at org.jboss.as.server.parsing.StandaloneXml_8.readElement(StandaloneXml_8.java:137)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:120)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:52)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:122)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:76)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:126)
... 3 more
Caused by: java.util.concurrent.ExecutionException: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.jboss.as.controller.parsing.DeferredExtensionContext.load(DeferredExtensionContext.java:92)
... 10 more
Caused by: javax.xml.stream.XMLStreamException: WFLYCTL0083: Failed to load module
at org.jboss.as.controller.parsing.DeferredExtensionContext.loadModule(DeferredExtensionContext.java:129)
at org.jboss.as.controller.parsing.DeferredExtensionContext.access$000(DeferredExtensionContext.java:44)
at org.jboss.as.controller.parsing.DeferredExtensionContext$1.call(DeferredExtensionContext.java:74)
at org.jboss.as.controller.parsing.DeferredExtensionContext$1.call(DeferredExtensionContext.java:71)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: org.jboss.modules.ModuleNotFoundException: org.wildfly.extension.batch.jberet
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:294)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
at org.jboss.as.controller.parsing.DeferredExtensionContext.loadModule(DeferredExtensionContext.java:111)
... 10 more
When it does work, it begins to deploy the applications waiting in the deployments directory and starts up correctly.

Related

Tomcat 9.0.52 crashes with "java.util.zip.ZipException: invalid LOC header (bad signature)" when started in debug mode - any work-around?

When trying to start Tomcat (9.0.52) in debug mode ("Debug on Server") from Eclipse (v2020-12 (4.18.0) / Build id: 20201210-1552) I get the following error (see full stacktrace further below):
16-Aug-2021 13:52:14.019 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
...
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
...
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
...
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
While the reasons seems clear - there is some issue reading a .jar file - the question I have is:
How can I find out, WHICH .jar is causing this issue? Is there some option to get more info on the root cause: which library (either from Tomcat or which application-jar?) that it tries to read is causing this?
The odd thing is: When I start this up in normal "run" mode in Eclipse or as a Windows Service, then Tomcat as well as the application start up fine. This zip-file problem only happens when I try to start it in debug mode! And - when starting Tomcat from Eclipse - then no .war-file is created but rather Tomcat's classpath is adjusted such, that the class files are used in-situ (i.e. directly from the target directory where they have been compiled to). So there is no additional .jar file created compared to the non-debug mode (which is why I am puzzled why this happens only in debug mode).
Eclipse uses Java 14 (if I am correct) but is configured to compile to 1.8 compatibility and the runtime (i.e. Tomcat and our application) uses Java 1.8 (I have installed the "almost latest" AdoptOpenJDK v1.8 / jdk-8.0.292.10-hotspot).
Tomcat's download page (https://tomcat.apache.org/whichversion.html) claims, that Tomcat 9.0.52 runs with Java "8 and later", so IMHO I should be OK in terms of prereq's.
Any idea how to get the above setup starting up/working in debug mode?
Full stacktrace:
...
16-Aug-2021 13:52:11.275 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1232] milliseconds
16-Aug-2021 13:52:11.343 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
16-Aug-2021 13:52:11.343 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.52]
16-Aug-2021 13:52:11.866 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
16-Aug-2021 13:52:13.860 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [1,954] milliseconds.
16-Aug-2021 13:52:14.019 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet#61322f9d]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:726)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4885)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5023)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
... 21 more
Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: invalid LOC header (bad signature)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:143)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
... 33 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1400(ZipFile.java:60)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:734)
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:434)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at sun.misc.IOUtils.readNBytes(IOUtils.java:180)
at sun.misc.IOUtils.readAllBytes(IOUtils.java:116)
at java.util.jar.JarFile.getBytes(JarFile.java:426)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:193)
at java.util.jar.JarFile.getManifest(JarFile.java:180)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
... 34 more
Later addition: I also tried the entire setup using a Java 11 VM for Tomcat but with the same result. So, this issue with some .jar-file having an invalid header or signature is apparently NOT a Java<=(1.)8 vs. Java >=v9 issue. So I reverted back to Java 1.8.
A day later:
This morning when I tried to restart Tomcat again in debug mode to investigate further, the server started up! No more .zip-file issues! The problem just vanished... :-)
Thanks to all who responded!

Wildfly redeployment of war file

I always hit an error when trying to redeploy the same war file into the Wildfly. Anyone know what does the error below means and how to solve it?
Error as below:
Cannot upload deployment: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./warfile" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./warfile: java.lang.RuntimeException: java.lang.IllegalStateException: Exception while trying to start [TaskExecutionSupportServiceApplication] - component skipped Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Exception while trying to start [TaskExecutionSupportServiceApplication] - component skipped Caused by: java.lang.IllegalStateException: Exception while trying to start [TaskExecutionSupportServiceApplication] - component skipped Caused by: org.apache.ftpserver.FtpServerConfigurationException: Failed to bind to address 0.0.0.0/0.0.0.0:21, check configuration Caused by: java.net.BindException: Address already in use: bind"}}
The following line contains the root cause:
org.apache.ftpserver.FtpServerConfigurationException: Failed to bind to address 0.0.0.0/0.0.0.0:21
It looks like you are starting a FTP server on port 21 that is not shutdown when the application is undeployed. The new deployment tries to open the same port and gets an error from the OS.

NPE running a JSF application as a Swarm uberjar

Running Wildfly Swarm with a JSF application results in this NPE:
2016-03-13 08:08:07,370 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 3) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./: java.lang.NullPointerException
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
at java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:1084)
at io.undertow.servlet.spec.ServletContextImpl.<init>(ServletContextImpl.java:131)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:150)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
How can I fix this
It turns out that including the JSF fraction without the Weld fraction causes the NPE. You need the following:
compile 'org.wildfly.swarm:jsf:1.0.0.Beta2'
compile 'org.wildfly.swarm:weld:1.0.0.Beta2'

Error deploying EJBs in Wildfly 8 (JBOSS 8)

I am getting error when I am trying to deploy EJB in Wildfly 8. I am trying to place my ejb.ear file which contains (beans.jar file with all bean and remote classes and meta-inf folder with ejb-jar.xml and jboss.xml) in wildfly8/standalone/deployments folder.
It shows me all the module names and jndi names for all the bean files I have placed. But after showing following is the error I get.
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."ejbs.ear"."beans.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."ejbs.ear"."beans.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "beans.jar" of deployment "ejbs.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.0.0.Final.jar:8.0.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011058: Failed to install component ReportBean
at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:109)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.0.0.Final.jar:8.0.0.Final]
... 5 more
Caused by: java.lang.NullPointerException
at org.jboss.as.ejb3.component.session.SessionBeanObjectViewConfigurator$2.configureDependency(SessionBeanObjectViewConfigurator.java:94)
at org.jboss.as.ejb3.component.session.SessionBeanObjectViewConfigurator$2.configureDependency(SessionBeanObjectViewConfigurator.java:91)
at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deployComponent(ComponentInstallProcessor.java:151)
at org.jboss.as.ee.component.deployers.ComponentInstallProcessor.deploy(ComponentInstallProcessor.java:101)
... 6 more
Can someone please help.
Thanks,
Jack.

resteasy-spring module in jboss wildfly 8

I am having this problem with Wildfly 8 and resteasy-spring.jar (module). i am trying to deploy 2 wars on the same server, if i deploy 1 war it deploys fine, but whenever i add the second war it starts failing (and vice versa) with the following error:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."TaskandTeamManager.war".DEPENDENCIES: org.jboss.msc.service.StartException in service jboss.deployment.unit."TaskandTeamManager.war".DEPENDENCIES: JBAS018733: Failed to process phase DEPENDENCIES of deployment "TaskandTeamManager.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.0.0.Final-SNAPSHOT.jar:8.0.0.Final-SNAPSHOT]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.io.IOException: VFS000017: Filesystem already mounted at mount point ""/C:/servers/jboss/wildfly-8.0.0.Final/modules/system/layers/base/org/jboss/resteasy/resteasy-spring/main/bundled/resteasy-spring.jar""
at org.jboss.as.jaxrs.deployment.JaxrsSpringProcessor.deploy(JaxrsSpringProcessor.java:126)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.0.0.Final-SNAPSHOT.jar:8.0.0.Final-SNAPSHOT]
... 5 more
Caused by: java.io.IOException: VFS000017: Filesystem already mounted at mount point ""/C:/servers/jboss/wildfly-8.0.0.Final/modules/system/layers/base/org/jboss/resteasy/resteasy-spring/main/bundled/resteasy-spring.jar""
at org.jboss.vfs.VFS.mount(VFS.java:127)
at org.jboss.vfs.VFS.doMount(VFS.java:336)
at org.jboss.vfs.VFS.mountZip(VFS.java:360)
at org.jboss.as.jaxrs.deployment.JaxrsSpringProcessor.deploy(JaxrsSpringProcessor.java:119)
... 6 more
I already tried adding a dependencies in jboss-deployment-structure (META-INF), but i get the same error, both projects are using rest-easy and jackson dependencies.
Any help would be greatly appreciated
This is a bug. For now if you add the context param org.jboss.as.jaxrs.disableSpringIntegration=true to your application it should work around it.