My app just started blowing up on startup after upgrading to latest MongoDB drivers. Using Wildfly 19, JDK14, and I've confirmed that at compile time jdk.net.* are available. Clearly they're either not making it into the runtime environment or there is a security issue. My guess is that the module is being blocked, but I've not been able to figure out how to get access to it.
Log output:
13:28:07,673 INFO [org.mongodb.driver.cluster] (cluster-ClusterId{value='5f304e47acf25e32b55f0c16', description='null'}-srv-cluster0-hpilc.azure.mongodb.net) Adding discovered server cluster0-shard-00-00-hpilc.azure.mongodb.net:27017 to client view of cluster
13:28:07,675 INFO [org.mongodb.driver.cluster] (cluster-ClusterId{value='5f304e47acf25e32b55f0c16', description='null'}-srv-cluster0-hpilc.azure.mongodb.net) Adding discovered server cluster0-shard-00-01-hpilc.azure.mongodb.net:27017 to client view of cluster
13:28:07,783 INFO [org.mongodb.driver.cluster] (cluster-ClusterId{value='5f304e47acf25e32b55f0c16', description='null'}-cluster0-shard-00-02-hpilc.azure.mongodb.net:27017) Exception in monitor thread while connecting to server cluster0-shard-00-02-hpilc.azure.mongodb.net:27017: com.mongodb.MongoException: java.lang.NoClassDefFoundError: jdk/net/ExtendedSocketOptions
at deployment.goa.war//com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:157)
at deployment.goa.war//com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.lookupServerDescription(DefaultServerMonitor.java:188)
at deployment.goa.war//com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:144)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.NoClassDefFoundError: jdk/net/ExtendedSocketOptions
at deployment.goa.war//com.mongodb.internal.connection.SocketStreamHelper.setExtendedSocketOptions(SocketStreamHelper.java:83)
at deployment.goa.war//com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:53)
at deployment.goa.war//com.mongodb.internal.connection.SocketStream.initializeSocket(SocketStream.java:79)
at deployment.goa.war//com.mongodb.internal.connection.SocketStream.open(SocketStream.java:65)
at deployment.goa.war//com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:143)
... 3 more
Caused by: java.lang.ClassNotFoundException: jdk.net.ExtendedSocketOptions from [Module "deployment.goa.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)
... 8 more```
Figured it out. In the Wildfly standalone.xml file add
<global-modules>
<module name="jdk.net" slot="main" />
</global-modules>
inside of the block
Using Wildfly 10.1, JDK 8. Adding the following block to the file jboss-deployment-structure.xml inside the dependencies section solved the problem.
<system export="true">
<paths>
<path name="jdk/net"/>
</paths>
</system>
Related
I use wildfly-25.0.1.Final. I can't test the microprofile-health quickstart :
Failed to define class org.wildfly.quickstarts.microprofile.health.DatabaseConnectionHealthCheck in Module "deployment.microprofile-health.war" from Service Module Loader: java.lang.NoClassDefFoundError: Failed to link org/wildfly/quickstarts/microprofile/health/DatabaseConnectionHealthCheck (Module "deployment.microprofile-health.war" from Service Module Loader): org/eclipse/microprofile/health/HealthCheck
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1095)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
at org.jboss.modules.Module.loadModuleClass(Module.java:753)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
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)
at org.jboss.as.weld#25.0.1.Final//org.jboss.as.weld.WeldModuleResourceLoader.classForName(WeldModuleResourceLoader.java:68)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadClass(AnnotatedTypeLoader.java:83)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.bootstrap.AnnotatedTypeLoader.loadAnnotatedType(AnnotatedTypeLoader.java:63)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.bootstrap.FastAnnotatedTypeLoader.loadAnnotatedType(FastAnnotatedTypeLoader.java:108)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:87)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:55)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.bootstrap.ConcurrentBeanDeployer$1.doWork(ConcurrentBeanDeployer.java:52)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
at org.jboss.weld.core#3.1.8.Final//org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
But the problem disappears if I start wildfly with standalone-microprofile.xml. Unfortunately, the quickstart doesn't say so.
So it looks like the microprofile.health-smallrye has disappeared in wildfly-25.0.1 standalone.xml (it was there in wildfly-20.0.1).
My question is : how to add the microprofile.health-smallrye to an existing standalone.xml ?
It looks like there was a bug filed for this, but it was fixed in WildFly 25. That said I do not see the reference in the default README.
That said it does require the standalone-microprofile.xml. You can also add the subsystem with CLI to standalone.xml and runt it that way as well. The following CLI commands will add the microprofile-health-smallrye to any configuration you start with that does not already include the subsystem.
/extension=org.wildfly.extension.microprofile.health-smallrye:add
/subsystem=microprofile-health-smallrye:add
I have an EJB 3.2 project that I integrated into my wildfly server. Then I interrogate my project using an RMI client, the tables are generated and the addition in the DBMS goes without problem but when I try to recover from the database I have this error message:
javax.ejb.EJBException: Failed to read response
at org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation$MethodCallResultProducer.getResult(EJBClientChannel.java:1221)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:592)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:56)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:133)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:114)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:78)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:172)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:594)
at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:528)
at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:938)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:177)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:112)
at com.sun.proxy.$Proxy0.listeEmployes(Unknown Source)
at com.clientbanque.programme.ClientBanque.main(ClientBanque.java:59)
Caused by: java.lang.ClassNotFoundException: org.hibernate.collection.internal.PersistentBag
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:123)
at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:104)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:1022)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1355)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:220)
at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1853)
at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1767)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1395)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:220)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadCollectionObject(RiverUnmarshaller.java:176)
at org.jboss.marshalling.river.RiverUnmarshaller.readCollectionData(RiverUnmarshaller.java:850)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:726)
at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:205)
at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
at org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation$MethodCallResultProducer.getResult(EJBClientChannel.java:1202)
... 22 more
If you can tell me where the problem is coming from. I will be grateful
thank you in advance
Looks like the ejb call results contain reference to hibernate-core class. Try adding a jboss module dependency for hibernate-core module to your project.
For example, in your project WEB-INF/jboss-deployment-structure.xml, or META-INF/jboss-deployment-structure.xml,
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
I have created zuul proxy application using spring boot and I am able to deploy it as a spring boot and war in Wildfly server by making some changes in pom and SpringApplication class file.
Structure of my ear :
MyEE.ear
|
|__gatewayzull.war
|_WEB-INF/lib/all jar for spring boot application
|
|__EJB.jar
|
|__XX.war
|
|lib/all jar (which also includes spring jars)
I have done some changes in pom.xml to deploy spring application war in WildFly server and It is working as expected.
When I tried to add gatewayzull.war in MyEE.ear and deploy it in Wildfly server, I am getting this exception
10:08:47,108 INFO [com.hummingbird.gateway.HbgatewayApplication] (MSC service thread 1-4) No active profile set, falling back to default profiles: default
10:08:47,119 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (MSC service thread 1-4) Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#51640e39: startup date [Thu Jun 01 10:08:47 UTC 2017]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext#50b75933
....
....
....
....
10:08:56,635 WARN [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (MSC service thread 1-4) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector
10:08:56,711 ERROR [org.springframework.boot.SpringApplication] (MSC service thread 1-4) Application startup failed: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:546) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:286) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
.....
.....
.....
Caused by: java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector
at org.springframework.util.Assert.isAssignable(Assert.java:376) [spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.util.Assert.isAssignable(Assert.java:359) [spring-core-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:124) [spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE]
at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:511) [spring-context-4.3.2.RELEASE.jar:4.3.2.RELEASE]
... 30 more
WildFly was trying to start Gatewayapplication but failed to start it.
jar inside gatewayzull.war.WEB-INF.lib not loaded.
deployment.MyEE.ear.lib also has spring related jar. I have added exclusion tag in jboss-deplyment-structure.xml inorder to exclude while loading but this also did not helps.
Snipper of jboss.xml :
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
..
..
<sub-deployment name="gateway.war">
<exclusions>
<module name="deployment.MyEE.ear.XX.war" />
<module name="deployment.MyEE.ear.EJB.jar" />
<module name="deployment.MyEE.ear.lib" />
<module name="javax.ws.rs.api" />
</exclusions>
<exclude-subsystems>
<subsystem name="jaxrs" />
</exclude-subsystems>
</sub-deployment>
</jboss-deployment-structure>
I am assuming that core issue would be due to application server not able to load jar inside war/web-inf/lib and in turn server not intializing SpringBootServeletIntializer.
Any idea to resolve this ?
I have a fresh installed Wildfly 10 application server running in standalone mode. I need to deploy a project requiring the MySQL JDBC driver.
I installed the driver following the tutorial found at JDBC Driver Setup (I have chosen the module installation). After restarting WildFly, in console.log I read:
INFO [org.jboss.as.connector.subsystems.datasources] (ServerService
Thread Pool -- 33) WFLYJCA0005: Deploying non-JDBC-compliant driver
class com.mysql.jdbc.Driver (version 5.1)
INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6)
WFLYJCA0018: Started Driver service with driver-name = mysql
It seems all good, but I can't get a connection for the database.
I'm using this piece of code:
Class.forName("com.mysql.jdbc.Driver");
Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/dbName?user=someUser&password=somePass");
The first line throws the exception:
com.mysql.jdbc.Driver from [Module
"deployment.someProject-1.0.0.war:main
from Service Module Loader]"
If I comment out the first line, I get No suitable driver exception.
Do you have any idea? Thanks in advice
You need to add a dependency for your WAR on the MySQL module you just created.
There are two ways, use a MANIFEST.MF file in the WAR with a line Dependencies: com.mysql
Or use a jboss-dependencies XML file like:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.mysql" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Both should be placed in the META-INF directory of the WAR file. There should be Maven plugins available to create both for you.
I have an idea.
As far as I know in WildFly modules are not seen to the apps by default.
And I suppose that you need to make your app know about the MySql module.
If you have WAR than need to create file jboss-deployment-structure.xml in WEB-INF folder with content like this:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="mysql" />
</dependencies>
</deployment>
</jboss-deployment-structure>
im trying to migrate my JBOSS 5.1 application to JBOSS 7.0.2. In admin console i select deployments -> add content and my .war and try to enable it.
I already resolved some problems, but cant figure out this one: (in short, in long at the end)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.ZaprogsProject.war:main" from Servic
e Module Loader]
I copied to JBOSS7\standalone\lib\ the following files:
spring-aop-3.0.5.RELEASE.jar
spring-asm-3.0.5.RELEASE.jar
spring-beans-3.0.5.RELEASE.jar
spring-context-3.0.5.RELEASE.jar
spring-context-support-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar
spring-expression-3.0.5.RELEASE.jar
spring-jdbc-3.0.5.RELEASE.jar
spring-orm-3.0.5.RELEASE.jar
spring-test-3.0.5.RELEASE.jar
spring-tx-3.0.5.RELEASE.jar
spring-web-3.0.5.RELEASE.jar
spring-webmvc-3.0.5.RELEASE.jar
I have read this: https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7 (Debug and resolve ClassNotFoundExceptions and NoClassDefFoundErrors) but cant find a solution for me and still getting the same error. Can anyone help?
22:19:12,091 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."ZaprogsProject.war".INSTALL: o
rg.jboss.msc.service.StartException in service jboss.deployment.unit."ZaprogsProject.war".INSTALL: Failed to process phase INSTALL of deployment "ZaprogsProject
.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]
at java.lang.Thread.run(Thread.java:722) [:1.7.0]
Caused by: java.lang.RuntimeException: Failed to load class org.springframework.web.context.ContextLoaderListener
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:141)
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:122)
at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
at org.jboss.as.ee.component.ComponentDescription.createConfiguration(ComponentDescription.java:153)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:70)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.ZaprogsProject.war:main" from Servic
e Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
at java.lang.Class.forName0(Native Method) [:1.7.0]
at java.lang.Class.forName(Class.java:264) [:1.7.0]
at org.jboss.as.ee.component.deployers.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:139)
... 11 more
JBoss AS 7 does class-loading in a diff way.
All classes in the WAR are loaded with the same class loader. This means classes packaged in the WEB-INF/lib are treated the same as classes in WEB-INF/classes.
Hence it works for you.
But as you have said correctly your WEB-INF/lib is bloated.This would not be the correct way.
You would need to make a module :
Goto modules folder, make folder structure with main folder and put your jar and modules.xml with entries in it.
Something like :
<main-class name="org.jboss.msc.Version"/>
<resources>
<resource-root path="jboss-msc-1.0.1.GA.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.modules"/>
<!-- Optional deps -->
<module name="javax.inject.api" optional="true"/>
<module name="org.jboss.threads" optional="true"/>
<module name="org.jboss.vfs" optional="true"/>
</dependencies>
You would also need to update MANIFEST as well.
Details are here :
https://docs.jboss.org/author/display/MODULES/Module+descriptors
I would not put those JARs in that directory. Try them in your WAR file's WEB-INF/lib. The class loader will find them there.
You need to understand that all Java EE app servers use a hierarchy of class loaders: bootstrap, server, application. JBoss wasn't finding that class when it needed to.
There is a major change Jboss 7 when compared to previous versions.If you want to access any libraries outside your war file, it should be installed as module.
Check https://docs.jboss.org/author/display/MODULES/Introduction
In this case you should install Spring as module and specify the name of the module as dependency in your application's manifest file(check Manifest module information)
In case the issue started occurring all of a sudden(just like in my case), deleting the application (MyApp) physically from #JBOSS_HOME#\standalone\deployments\ MyApp.war worked for me.