Failure while deploying EAR file on Jboss Wildfly - java

I've got an EAR file which contains two wars and multiple jars. I'm using maven-ear-plugin to generate this file.
All jars are added in lib. There are few local jars and I'm adding them directly under EAR file. I've 2 local jars with a different name but contains the same package say abc.jar and xyz.jar
When I deploy this file on server I get following error:
"{\"WFLYCTL0080: Failed services\" => {\"jboss.mbean.service.publish:service=StreamReceiverStartup.start\" => \"org.jboss.msc.service.StartException in service jboss.mbean.service.publish:service=StreamReceiverStartup.start: WFLYSAR0001: Failed to execute legacy service start() method
Caused by: java.lang.reflect.InvocationTargetException
Caused by: java.lang.NoClassDefFoundError: <package_name>/<class_file>
Caused by: java.lang.ClassNotFoundException: <class_file> from [Module \\\"deployment.<ear_file_name>.ear.<jar_name>.jar:main\\\" from Service Module Loader]\"}}"
It's trying to detect from abc.jar instead xyz.jar which contains .
How to resolve this conflict? I tried removing one of the jar files. It results in the same exception but for a different class file, so I cannot discard any of these jars.

This is fixed by removing jars from application.xml

Related

java.lang.NoClassDefFoundError on Docker

When The Program is Ran in the Local PC, it is working fine, but if it is running in the docker throws the following error:
Exception in thread "Thread-16" java.lang.NoClassDefFoundError: org/apache/kafka/common/serialization/Serializer
at org.eclipse.kura.example.configurable.ConfigurableExample$1.run(ConfigurableExample.java:52)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.apache.kafka.common.serialization.Serializer cannot be found by org.eclipse.kura.example.configurable_1.0.0.202201251713
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:484)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 2 more
But this is working fine in the LocalMachine.
What is the issue ?
This may be debugged in following ways:
Ensure that you have all the required dependencies inside your docker container. You may want to check your docker base image first.
Check if you have set the classpath appropriately to include that jar file (kafka-clients).
Validate your entrypoint/cmd which you use to start the service to check if it has the appropriate classpath.
Check your classloader and see why it is not able to load that class.
If your executable is a fat jar file, check if that jar file contains the kafka-clients library where that class is present.

Jboss patch to eap 7.0.,5 | java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider

i am getting below error while doing log in to my application which uses Java 8 and Jboss 7.0.5 (just patched from 7.0.4 to 7.0.5) :
11:57:19,190 ERROR [stderr] (default task-7) Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider 2018-01-02 11:57:19,190 [default task-7] ERROR stderr - Caused by: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
This error has been occuring after applying patch
any help valuable suggestions would be really appriciated!!!
Jboss 7 looks for dependencies in the modules folder. You can't just go in the modules.xml file and add new modules if they don't actually exist.
What you need to do is find out whether there is a jar containing the missing class, if it exist then you need to add a reference to that module from your project, if does not exist, you need to manually download it and copy it to the modules directory and then reference it.
You have several ways you can reference it:
Add a classpath entry to your manifest file: Classpath: com.sun.net
Add a global reference to that module in your standalone.xml by adding a Global module.
For more details, look here.

classloading in Wildfly 9

I am deploying my application to Wildfly 9 and I am getting a strange error that resembles class loading problems. The same war file deploys successfully to Tomcat so I am guessing Wildfly is bundling com.google classes and somehow it is interfering with the bundled libraries in the war file.
First, the error looks like this:
Caused by: java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class com.google.inject.internal.Annotations$AnnotationChecker
at com.google.inject.internal.Annotations$AnnotationChecker.<init>(Annotations.java:104)
at com.google.inject.internal.Annotations.<clinit>(Annotations.java:122)
at com.google.inject.Key.ensureRetainedAtRuntime(Key.java:362)
at com.google.inject.Key.strategyFor(Key.java:354)
at com.google.inject.Key.get(Key.java:222)
at org.eclipse.sisu.wire.ParameterKeys.<clinit>(ParameterKeys.java:28)
at org.eclipse.sisu.wire.DependencyAnalyzer.<init>(DependencyAnalyzer.java:92)
at org.eclipse.sisu.wire.ElementAnalyzer.<init>(ElementAnalyzer.java:87)
at org.eclipse.sisu.wire.WireModule.configure(WireModule.java:74)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:229)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.Guice.createInjector(Guice.java:94)
at com.google.inject.Guice.createInjector(Guice.java:71)
at com.google.inject.Guice.createInjector(Guice.java:61)
and I have both guava-16.0.1.jar and sisu-guice-3.1.0-no_aop.jar inside my war file's lib folder.
so I basically need to solve this issue, whether it is a class loading issue or not.

JBoss Deployment error: Caused by: java.lang.RuntimeException: .war module listed in application.xml does not exist within .ear

I am using jboss-5.1.0.GA and jdk1.6. I have my stock.ear in C:\atgcertenv20120601\jboss-5.1.0.GA\server\AllStocks\deploy\stock.ear.While running getting deployment error.Find the following error trace.
15:41:17,518 ERROR [ProfileDeployAction] Failed to add deployment: stock.ear
org.jboss.deployers.spi.DeploymentException: Exception determining structure: Ab
stractVFSDeployment(stock.ear)
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentExcept
ion(DeploymentException.java:49)
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers
.determineStructure(AbstractStructuralDeployers.java:85)
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineStructure(
MainDeployerImpl.java:1004)
at org.jboss.deployers.plugins.main.MainDeployerImpl.determineDeployment
Context(MainDeployerImpl.java:440)
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainD
eployerImpl.java:390)
at org.jboss.deployers.plugins.main.MainDeployerImpl.addDeployment(MainD
eployerImpl.java:300)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter
.addDeployment(MainDeployerAdapter.java:86)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction
.install(ProfileDeployAction.java:61)
at org.jboss.system.server.profileservice.repository.AbstractProfileActi
on.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileServ
ice.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
ctControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractContr
oller.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(Abstra
ctController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abstr
actController.java:984)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:822)
at org.jboss.dependency.plugins.AbstractController.change(AbstractContro
ller.java:553)
at org.jboss.system.server.profileservice.repository.AbstractProfileServ
ice.activateProfile(AbstractProfileService.java:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(
ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:
461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: Error determining structure: stock.ear
at org.jboss.deployment.EARStructure.determineStructure(EARStructure.jav
a:293)
at org.jboss.deployers.vfs.plugins.structure.StructureDeployerWrapper.de
termineStructure(StructureDeployerWrapper.java:73)
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.
doDetermineStructure(VFSStructuralDeployersImpl.java:196)
at org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl.
determineStructure(VFSStructuralDeployersImpl.java:221)
at org.jboss.deployers.structure.spi.helpers.AbstractStructuralDeployers
.determineStructure(AbstractStructuralDeployers.java:77)
... 21 more
Caused by: java.lang.RuntimeException: stk_bootstrap.war module listed in applic
ation.xml does not exist within .ear vfsfile:/C:/jboss-5.1.0.GA/server/AllStocks/deploy/ stock.ear/
at org.jboss.deployment.EARStructure.determineStructure(EARStructure.jav
a:272)
... 25 more
The war is really inside the ear? You can open the .ear with WinRAR or something similar and check.
Are you using Eclipse? If you turn off automatic build in Eclipse it doesn't create the war or ejb.jar before the packaging of the ear.
You could do it manually or enable it under Project -> Build Automatically.
Have you included the .war in the .ear project? Right click on the project, properties and check under 'Deployment Assembly'.

<HTTP> <BEA-101163> <Could not load user defined listener:

I have modified an EAR for Weblogic 10 ( BEA 10 )which is already running on BEA 8..
I am getting the following error while deploying the EAR..
[HTTP:101163]Could not load user defined listener: com.xxx.xxxx.jmx.LifecycleListener java.lang.NoClassDefFoundError: com/tibco/sdk/MException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) at java.lang.Class.getConstructor0(Class.java:2671) at java.lang.Class.newInstance0(Class.java:321) at java.lang.Class.newInstance(Class.java:303) at weblogic.servlet.internal.WebComponentContributor.getNewInstance(WebComponentContributor.java:187) at weblogic.servlet.internal.WebComponentContributor.createListenerInstance
Have you faced this error ?Please help me...
From the Exception it seems that some library is missing from your ear file. Make sure that com.xxx.xxxx.jmx.LifecycleListener is a valid package and included correctly in your ear.
If you are developing and building the ear with JDeveloper make sure you add this lib in your application resources. If you do this manualy make sure that this lib exists in your WEB-INF/lib folder

Categories

Resources