classnotfound exception securityassociation wildfly v10 - java

Getting a classNotFound exception on Wildfly 10.0.
Caused by: java.lang.ClassNotFoundException: org.jboss.security.SecurityAssociation from [Module "deployment.employee-app-1.2.1.ear.authorization-service-login-modules-jboss-1.1.2.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
... 36 more
I tried adding the jbosssx jar to my ear but still getting the classNotFound issue. Is it possible to add jar to a dir within Wildfly?
thanks

I couldn't find the exact point in time it happened but org.jboss.security.SecurityAssociation was renamed org.jboss.security.SecurityContextAssociation. Therefore by changing your references to org.jboss.security.SecurityAssociation in authorization-service-login-modules-jboss, you should be good to go.

Related

java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.spi.ProviderImpl

)
I've got a small problem today! I'm trying to deploy an application on a Jboss server (AS 7.0)...
When I'm working on my own computer (localhost), no problem, everything is fine. But after deploying my war on the server when I realize one action I've got an horrible error :
java.util.ServiceConfigurationError: javax.xml.ws.spi.Provider: Provider com.sun.xml.ws.spi.ProviderImpl could not be instantiated: java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.spi.ProviderImpl
java.util.ServiceLoader.fail(ServiceLoader.java:207)
java.util.ServiceLoader.access$100(ServiceLoader.java:164)
java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353)
java.util.ServiceLoader$1.next(ServiceLoader.java:421)
javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
javax.xml.ws.spi.Provider.provider(Provider.java:106)
javax.xml.ws.Service.<init>(Service.java:57)
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.spi.ProviderImpl
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:247)
java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
java.util.ServiceLoader$1.next(ServiceLoader.java:421)
javax.xml.ws.spi.Provider.getProviderUsingServiceLoader(Provider.java:146)
javax.xml.ws.spi.Provider.provider(Provider.java:106)
javax.xml.ws.Service.<init>(Service.java:57)
I'm using Apache CXF and all my jars are maven dependencies in my build path (jaxws-rt 2.2.8, jaxws-api...)
Do you think it may be a problem on the Jboss ? When I deploy this war on a Tomcat I don't have this problem :(
Thanks to all

Getting runtime error while trying to connect mysql from java

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver from [Module "deployment.Sample.war:main" from Service Module Loader].
The above one is my error message.
I have included mysql-connector-java-5.1.35-bin.jar in my class path and it is shown in the libraries as well.
I am using JBoss AS 7.1.0.Final server to run it. How to resolve this error?

ClassNotFoundException after instrumenting with cobertura

Using JBoss AS 7.1.1 I want to get code coverage after testing of my project, deployed as an .war.
It seemingly works as expected until the point where I am starting the server. Here is the error message:
13:20:49,571 SEVERE [net.sourceforge.cobertura.coveragedata.TouchCollector] (MSC service thread 1-8) Exception when registering class: com/project/Creator: java.lang.ClassNotFoundException: com.project.Creator from [Module "org.jboss.as.server:main" from local module loader #30c01f1c (roots: C:\Jboss\jboss-as-7.1.1.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at
An important part may be that without using --auxClasspath argument, I did get errors instrumenting this class because of dependencies. This should be fixed by the mentioned argument though.
Edit:
There are in two situations where I get problems.
During instrumentation, using the following command for instrumentation
C:\cobertura\cobertura-2.0.3\cobertura-instrument.bat" --basedir C:\Jboss\jboss-as-7.1.1.Final\standalone\deployments project.war --datafile C:\Jboss\jboss-as-7.1.1.Final\bin\cobertura.ser --auxClasspath ""C:\workspace\jboss-build\src\com\arbitrage\j2ee\common\dto\TypeData.java
which gives me the error
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.arbitrage.j2ee.common.dto.TypeData
at net.sourceforge.cobertura.instrument.CoberturaClassWriter.getCommonSuperClass(CoberturaClassWriter.java:35)
But, when I start up JBoss, it does so without giving any errors.
However, when I stop JBoss I get this error:
ERROR [stderr] Exception in thread "Thread-45" java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector$ApplyToClassDataLightClassmapListener
In the second case instrumentation goes well with the following command
C:\cobertura\cobertura-2.0.3\cobertura-instrument.bat" addInstrumentationToArchive C:\Jboss\jboss-as-7.1.1.Final\standalone\deployments\screator.war --includeClasses "com.project.*" --datafile C:\Jboss\jboss-as-7.1.1.Final\bin\cobertura.ser --auxClasspath "C:.m2\repository\com\project\1\project-1.jar
Which gives me an OK
INFO: Cobertura: Saved information on 41 classes.
Now the problem occurs when starting up JBoss
SEVERE net.sourceforge.cobertura.coveragedata.TouchCollector Exception when registering class: com/project/Creator: java.lang.ClassNotFoundException: com.project.Creator from [Module "org.jboss.as.server:main" from local module loader #30c01f1 (roots: C:\Jboss\jboss-as-7.1.1.Final\modules)].
etc etc.
I have added -Djboss.shutdown.forceHalt=false to the VM arguments.
Help is much appreciated,
Thanks!

Exception while re-deploying my webapp on tomcat 6

All,
I am having problems redeploying my java webapp packaged as war using maven 3.0 (mvn package) on tomcat 6.0
However if I restart my server completely i donot get this exception and the whole app runs perfectly fine.
Here is the details of catalina log:
WARNING: Error while removing context []
java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable
at org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:263)
at org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterDispatcher.java:238)
at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)
at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3731)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4493)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1035)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Containe rBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.util.ObjectFactoryDestroyable
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 15 more
Pls help..!

Jars in my grails project not being picked up when deployed to tomcat 5.5

I am running a grails test run-app all day with my application and it is fine. I type "grails prod war" to get a war, and dump it in the webapps folder of my tomcat install. Now i get the message like so:
11.11.2010 16:35:11 *ERROR* GrailsExceptionResolver: Executing action [index] of controller [ResumeController] caused e
xception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context (GrailsExceptionResolver.ja
va, line 72)
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [index] of controll
er [ResumeController] caused exception: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Cont
ext
at org.jsecurity.web.servlet.JSecurityFilter.doFilterInternal(JSecurityFilter.java:382)
at org.jsecurity.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:180)
at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize
class org.docx4j.jaxb.Context
... 3 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.docx4j.jaxb.Context
at org.docx4j.openpackaging.contenttype.ContentTypeManager.parseContentTypesFile(ContentTypeManager.java:599)
at org.docx4j.openpackaging.io.LoadFromZipNG.process(LoadFromZipNG.java:199)
at org.docx4j.openpackaging.io.LoadFromZipNG.get(LoadFromZipNG.java:188)
at org.docx4j.openpackaging.packages.OpcPackage.load(OpcPackage.java:188)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(WordprocessingMLPackage.java:169)
at com.iai.skillsdb.DocxHelpers.DocxParser.openDocx4j(DocxParser.java:70)
at ResumeController$_closure8.doCall(ResumeController.groovy:164)
at ResumeController$_closure8.doCall(ResumeController.groovy)
at ResumeController.invokeMethod(ResumeController.groovy)
at ResumeController$_closure1.doCall(ResumeController.groovy:41)
at ResumeController$_closure1.doCall(ResumeController.groovy)
... 3 more
What is causing this? I have the docx4j jar in my WAR for sure, and it is there in the web-inf lib folder as well.
You're getting a java.lang.NoClassDefFoundError, not a java.lang.ClassNotFoundException. The class is being loaded, but a class that it depends on (directly or indirectly via another class) isn't there. You're most likely missing a jar that docx4j requires as a dependency.
Make sure that you have the correct version of docx4j and that there is absolutely no other version of docx4j in your classpath, there may be a version of this lib that did not have the 'Content' class implemented.

Categories