In a JEE app deployed in Wildfly 18.0.1.Final with OpenJDK 64-Bit Server VM 11.0.15+9-LTS, I run into a ClassNotFoundException on java.net.http.HttpResponse (actually, one of the dependency is using it, and fails on java.net.http.HttpResponse$BodyHandler but I tried using java.net.http.HttpResponse directly in my code and ran into the same issue).
I tried to add the java.net.http module in WEB-INF/jboss-deployment-structure.xml in the WAR but it does not change a thing.
<jboss-deployment-structure>
<module name="deployment.java.net.http" />
</jboss-deployment-structure>
The stacktrace ends with:
Caused by: java.lang.NoClassDefFoundError: java/net/http/HttpResponse$BodyHandler at deployment.orbis-events-4u.war//io.apicurio.registry.rest.client.impl.RegistryClientImpl.<init>(RegistryClientImpl.java:67)
at deployment.orbis-events-4u.war//io.apicurio.registry.rest.client.impl.RegistryClientImpl.<init>(RegistryClientImpl.java:63)
at deployment.orbis-events-4u.war//io.apicurio.registry.rest.client.RegistryClientFactory.create(RegistryClientFactory.java:34)
at deployment.orbis-events-4u.war//io.apicurio.registry.serde.AbstractSchemaResolver.configure(AbstractSchemaResolver.java:84)
at deployment.orbis-events-4u.war//io.apicurio.registry.serde.DefaultSchemaResolver.configure(DefaultSchemaResolver.java:59)
at deployment.orbis-events-4u.war//io.apicurio.registry.serde.SchemaResolverConfigurer.configure(SchemaResolverConfigurer.java:75)
at deployment.orbis-events-4u.war//io.apicurio.registry.serde.AbstractKafkaSerDe.configure(AbstractKafkaSerDe.java:68)
at deployment.orbis-events-4u.war//io.apicurio.registry.serde.avro.AvroKafkaSerializer.configure(AvroKafkaSerializer.java:81)
at deployment.orbis-events-4u.war//org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:375)
... 62 more
Caused by: java.lang.ClassNotFoundException: java.net.http.HttpResponse$BodyHandler from [Module "deployment.orbis-events-4u.war" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 71 more
I'm very surprised that access to java.net.http module is not available out of the box.
Is there something I can do in the configuration of my app?
Is it a known WF issue?
The content of jboss-deployment-structure.xml I was using is incorrect.
Issue is solved with the following content:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="java.net.http"/>
</dependencies>
</deployment>
I am trying to upgrade my application from JBoss 7 to WildFly10, and I am getting a warning:
[0m[33m13:53:36,641 WARN [org.jboss.as.dependency.private] (MSC service thread 1-6)
WFLYSRV0018: Deployment "deployment.mywar.war" is using a private module
("org.jboss.as.jmx:main") which may be changed or removed in future versions
without notice.
The module is mentioned in jboss-deployment-structure.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure >
<deployment>
<dependencies>
<module name="org.jboss.as.jmx"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
how is called the new module for jmx? I tried to replace that with org.jboss.remoting-jmx but then I got
Invocation of init method failed;
nested exception is javax.management.JMRuntimeException:
Failed to load MBeanServerBuilder class org.jboss.as.jmx.PluggableMBeanServerBuilder:
java.lang.ClassNotFoundException: org.jboss.as.jmx.PluggableMBeanServerBuilder
according to WildFly forum it means nothing, see quote (source)
You got warning message as you are using internal "non-public" modules
from application server. Which just tells you that you should be
careful with this.
While deploying app.war (Struts 1.x) on my Wildfly this information appears:
Cannot upload deployment: {"WFLYCTL0080: Failed services" =>
{"jboss.deployment.unit.\"app.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"app.war\".POST_MODULE: WFLYSRV0153: Failed to
process phase POST_MODULE of deployment \"app.war\" Caused by:
java.lang.RuntimeException: WFLYSRV0177: Error getting reflective
information for class org.ajaxtags.tags.AjaxDisplayTag with
ClassLoader ModuleClassLoader for Module \"deployment.app.war:main\"
from Service Module Loader Caused by: java.lang.NoClassDefFoundError:
au/id/jericho/lib/html/Segment Caused by:
java.lang.ClassNotFoundException: au.id.jericho.lib.html.Segment from
[Module \"deployment.app.war:main\" from Service Module Loader]"}}
I have downloaded jericho-html-2.6.1-sources.jar and placed this as a module into ${wf-dir}\modules\system\layers\base\au\id\jericho\lib\html\main\ with an module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="au.id.jericho.lib.html">
<resources>
<resource-root path="jericho-html-2.6.1-sources.jar"/>
</resources>
<dependencies>
</dependencies>
</module>
And there's still same issue...
Thanks for any help! :)
This was fixed by changing build system from Ant to Maven - looks like Wildfly has some problem while resolving directory conventions. On Glassfish 3.1.1 this worked with Ant
Hello All Please help,
I've tried everything. I'm trying to deploy a Seam project on WildFly Jboss new server. I'm getting errors tho. I put the ear file in WildFly-8.2.0Final then create a ear.dodeploy file and wait for it to automatically run it. The Services with missing/unavailable dependencies is the error I need to get around. I get this following error:
15:46:12,061 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "Atlast2.3.ear")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher.ValidatorFactory is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher.Validator is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations.Validator is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations]",
"jboss.persistenceunit.\"Atlast2.3.ear/Atlast2.3.jar#Atlast2.3\".__FIRST_PHASE__ is missing [jboss.naming.context.java.\"Atlast2.3Datasource\"]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations.InAppClientContainer is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations.InstanceName is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations.ValidatorFactory is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.EjbSynchronizations]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher.InstanceName is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher]",
"jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher.InAppClientContainer is missing [jboss.naming.context.java.comp.\"Atlast2.3\".jboss-seam.TimerServiceDispatcher]"
]}
15:46:12,301 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018559: Deployed "Atlast2.3.ear" (runtime-name : "Atlast2.3.ear")
15:46:12,302 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014776: Newly corrected services:
service jboss.naming.context.java.module."Atlast2.3"."Atlast2.3.war" (new available)
service jboss.naming.context.java.module."Atlast2.3".jboss-seam (new available)
service jboss.persistenceunit."Atlast2.3.ear/Atlast2.3.jar#Atlast2.3".__FIRST_PHASE__ (new available)
When migrating a Seam 2.3 EAR application to WildFly 9, I was able to resolve the WFLYCTL0180: Services with missing/unavailable dependencies
error analogous to the one above by deploying the Seam JAR after the EJB JAR. This can be configured in the EAR META-INF/application.xml:
<application xmlns="http://java.sun.com/xml/ns/javaee" version="6">
<initialize-in-order>true</initialize-in-order>
<module>
<ejb>myapp-ejb.jar</ejb>
</module>
<module>
<ejb>jboss-seam-2.3.1.Final.jar</ejb>
</module>
...
</application>
It may be sufficent to set initialize-in-order to false, but I need this option set to true because there are multiple WARs in this EAR.
The java.lang.IllegalStateException was solved in my case by installing and activating JSF 2.1 instead of JSF 2.2 bundled with WildFly. This is explained here and here in detail; it boils down to these steps:
git clone git://github.com/wildfly/wildfly.git
cd wildfly
git checkout 9.0.1.Final
./build.sh
cd jsf/multi-jsf-installer
mvn -Djsf-version=2.1.29 -Pmojarra-2.x clean assembly:single
mv target/install-mojarra-2.1.29.zip target/install-mojarra-2.1.29.cli
[Start WildFly in another console: bin/standalone.sh]
bin/jboss-cli.sh -c "deploy target/install-mojarra-2.1.29.cli"
Restart WildFly and verify that the new version appears:
bin/jboss-cli.sh -c --commands="/subsystem=jsf/:list-active-jsf-impls"
To ensure that the correct version is used, both of the following changes were necessary in my case:
In the EAR META-INF/jboss-deployment-structure.xml:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="javax.faces.api" export="true" slot="mojarra-2.1.29" />
<module name="com.sun.jsf-impl" export="true" slot="mojarra-2.1.29" />
<module name="org.jboss.as.jsf-injection" export="true" slot="mojarra-2.1.29" />
...
</dependencies>
</deployment>
</jboss-deployment-structure>
In the WAR WEB-INF/web.xml:
<context-param>
<param-name>org.jboss.jbossfaces.JSF_CONFIG_NAME</param-name>
<param-value>mojarra-2.1.29</param-value>
</context-param>
I did not create the spring bean name with TimerServiceDispatcher in my application. But, the JBoss throw exception because of TimerServiceDispatcher is already defined in this module.
I don't know what is the problem. What I am missing? What I need to do?
My application use Seam 2.3, Spring 3.0 and JPA 2.0. I don't use EJB.
11:29:01,531 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "MRBS.war"
11:29:04,217 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."MRBS.war".PARSE: org.jboss.msc.service.StartExcept
ion in service jboss.deployment.unit."MRBS.war".PARSE: Failed to process phase PARSE of deployment "MRBS.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_23]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_23]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_23]
Caused by: java.lang.IllegalArgumentException: JBAS011046: A component named 'TimerServiceDispatcher' is already defined in this module
at org.jboss.as.ee.component.EEModuleDescription.addComponent(EEModuleDescription.java:137)
at org.jboss.as.ejb3.deployment.processors.EJBComponentDescriptionFactory.addComponent(EJBComponentDescriptionFactory.java:60)
at org.jboss.as.ejb3.deployment.processors.SessionBeanComponentDescriptionFactory.processSessionBeans(SessionBeanComponentDescriptionFactory.java:157)
at org.jboss.as.ejb3.deployment.processors.SessionBeanComponentDescriptionFactory.processAnnotations(SessionBeanComponentDescriptionFactory.java:86)
at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:
58)
at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDeploymentUnitProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
11:29:04,230 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "MRBS.war" was rolled back with failure message {"JBAS014671: Failed servi
ces" => {"jboss.deployment.unit.\"MRBS.war\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MRBS.war\".PARSE: Failed to process phase PARSE of d
eployment \"MRBS.war\""}}
11:29:04,292 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment MRBS.war in 61ms
11:29:04,294 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."MRBS.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MRBS.war".
PARSE: Failed to process phase PARSE of deployment "MRBS.war"
jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="org.hibernate" export="true"/>
<module name="javax.faces.api" export="true" />
<module name="com.sun.jsf-impl" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="org.hibernate.validator" export="true"/>
</dependencies>
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>
Deplyment Structure
MRBS.war
-index.html
+web-page-pakage
+META-INF
+WEB-INF
+classes
+lib
aopalliance.jar
commons-beanutils.jar
commons-codec.jar
commons-lang-2.5.jar
drools-compiler.jar
drools-core.jar
drools-decisiontables.jar
drools-templates.jar
eclipselink.jar
el-api.jar
guava.jar
guice.jar
hibernate-ehcache.jar
httpclient.jar
httpcore.jar
javax.persistence_2.0.1.v201006031150.jar
jboss-el.jar
jboss-seam-debug.jar
jboss-seam-excel.jar
jboss-seam-ioc.jar
jboss-seam-mail.jar
jboss-seam-pdf.jar
jboss-seam-ui.jar
jboss-seam.jar
junit-4.8.1.jar
log4j-1.2.14.jar
mysql-connector-java-5.1.6-bin.jar
primefaces-3.3.1.jar
sac.jar
spring-aop.jar
spring-asm.jar
spring-beans.jar
spring-context.jar
spring-core.jar
spring-expression.jar
spring-jdbc.jar
spring-orm.jar
spring-tx.jar
spring-web.jar
urlrewritefilter.jar
xercesImpl.jar
xml-apis.jar
-components.xml
-faces-config.xml
-jboss-deployment-structure.xml
-pages.xml
-web.xml
I had a bean annotated with #Singleton and #Stateless that triggered this error. My code was of course wrong but the message and posts like this lead me down the wrong path for a while.
I know the answer to this one. Spent weeks with JBoss Support on it due to my stubborness. They plan on providing fix or at least better messaging with EAP 6.2.x release.
The problem arises with the EJB Annotation preprocessors - which take your war, and the libs compiled into it and scans them for EJB annotations. Some Jar files can have an entry in the Manifest for "Classpath: ." (or whatever but with '.' as one of the entries). This causes the annotation preprocessor to idiotically process all the jar files in the web-inf lib again. Finally it will get around to a jar file with an EJB annotation in it that it has already seen, because it was already processed earlier - this causes it to complain with "A component Named xxx is already defined".
So the most frustrating part here is that it's probably some old jar file that you don't even care about that has this unnecessary Classpath manifest entry in it - and causes JBoss to recurse on itself.
I had the same problem but for me none of the suggested solutions helped.
I noticed that the EJB JAR was present twice (newest version and older version) in the WEB.WAR.
This was because the maven clean operation on the parent project in eclipse didn't cascade to the child projects.
I fixed it by doing a simple "mvn clean" on the child project.
I had the same problem in IntelliJ. The reason was that IntelliJ created a WAR file with my classes both in WEB-INF/classes AND as a separate Jar file in WEB-INF/lib.
It took me some time to find out why IntelliJ did this.
The reason lay in the dialogue File -> Project Structure -> Artifacts:
After removing the 'vertrag-ui-war' compile output, the error did not occur anymore.
P.S. I have no idea why IntelliJ made this setting - I definitively did not set this.
Running the Maven goals:
wildfly:undeploy
clean
wildfly:deploy
helped in our case:
[ERROR] Caused by: java.lang.IllegalArgumentException: WFLYEE0040: A component named 'xxx' is already defined in this module"}}
Removing #Singleton fixed this error for me. No idea why though.
The problem is not that you dint create TimeServiceDispatcher it is a class part of seam framework org.jboss.seam.async.TimerServiceDispatcher , its a seam fw class.
Now about the error.
These kind of error occur when there are conflicts in libraries provided with application and by server. Its seriously very common with JBoss 7.1 and very frustrating as well.
You need to know
What all Libraries and there version are u packaging inside your application ?
what all of above libraries and version are provided by JBoss 7.1
Now for libraries that are on both side
check for version
if version of application and JBoss is same , then remove that jar from Application (suggested) (else you can configure in the deployment-structure.xml which one to use)
if version of application jar and jboss is different, in that case , you will need to configure in deployment descriptor which one to pick.
While copy pasting and creating new components, I forgot to update the value that the #Stateless(value) annotation accept in the new components. This meant I had two components with the same name and I got this error. Hope it helps someone.
It can be caused by a previous version of the jar being deployed instead of the correct one. It was solved when I deleted all the contents of the target folder.
The answers helped me locate the root cause of my issue.
I am using Arquillian and I was adding to the Web archive a class through the
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "myejb.jar")
.addPackages(true, "a.package.name")
and as a maven dependency
File[] files = Maven.resolver()
.addDependencies(
MavenDependencies.createDependency("G:A:V", ScopeType.COMPILE, false),
Hence the previously described error.
I left only the maven dependency and the error disappeared.