Modularity issues with javaagent in Java 9 - java-9

We have a javaagent written in Java 8 that instruments application code using javassist. There is one simple ClassFileTransformer that instruments java.lang.Error class constructor to record an instantiated error. I am retransforming Error class because it is loaded much before my agent is loaded. The instrumetation code used links java.lang.Error class to classes in agent jar. As java.lang.Error is loaded by bootstrap class loader and that Error is linked to classes in agent jar, I am using -Xbootclasspath/a option to load agent classes as well using bootstrap class loader. This is working fine in Java 8.
Now to Java 9+: Now I am trying to run the same Java 8 agent in Java 9 JVM and running into modularity issues. I am still using -Xbootclasspath/a option because I still have to load the agent classes using bootstrap class loader. As with Java 9 modularity, my agent classes are loaded into unnamed module of bootstrap class loader. Though java.lang.Error class is also loaded by bootstrap class loader but it is part of java.base named module in Java 9 and I am running into below error because unnamed module is not accessible to named java.base module.
Java command line options used are -Xbootclasspath/a:"path-to-agent.jar" and -javaagent:path-to-agent.jar
javassist.CannotCompileException: [source error] no such class: com.sg.agent.ErrorRecorder
at javassist.CtBehavior.insertAfter(CtBehavior.java:877)
at javassist.CtBehavior.insertAfter(CtBehavior.java:792)
at com.sg.agent.ErrorClassTransformer.transform(ErrorClassTransformer.java:60)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:550)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:157)
at com.sg.agent.SGAgent.retransformError(SGAgent.java:362)
at com.sg.agent.SGAgent.premain(SGAgent.java:346)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:500)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:512)
Caused by: compile error: no such class: com.sg.agent.ErrorRecorder
at javassist.compiler.MemberResolver.searchImports(MemberResolver.java:470)
at javassist.compiler.MemberResolver.lookupClass(MemberResolver.java:414)
at javassist.compiler.MemberResolver.lookupClassByJvmName(MemberResolver.java:321)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:683)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
at javassist.compiler.Javac.compileStmnt(Javac.java:567)
at javassist.CtBehavior.insertAfterAdvice(CtBehavior.java:892)
at javassist.CtBehavior.insertAfter(CtBehavior.java:851)
... 15 more
So after some googling I found there are java command line options to overcome these issues. Accordingly, now I am using these below command line options
1) -Xbootclasspath/a:"path-to-agent.jar"
2) -javaagent:path-to-agent.jar
3) --module-path path-to-agent-jar-folder
4) --add-modules sg.agent
5) --add-modules java.base
6) --add-reads java.base=sg.agent
and agent jar file has below contents in it's manifest file.
Manifest-Version: 1.0
Premain-Class: com.sg.agent.SGAgent
Can-Retransform-Classes: true
Created-By: Srinivas
Automatic-Module-Name: sg.agent
Add-Exports: module/package
Add-Opens: module/package
Boot-Class-Path: C:/Test/SGAgent.jar
and now JVM is throwing below error. From the below stacktrace it can be seen that JVM has read sg.agent as a named module but still complaining no such class: com.sg.agent.ErrorRecorder though --add-reads option gives java.base access to sg.agent. And additionally, my jetty server is not starting now.
javassist.CannotCompileException: [source error] no such class: com.sg.agent.ErrorRecorder
at sg.agent/javassist.CtBehavior.insertAfter(CtBehavior.java:877)
at sg.agent/javassist.CtBehavior.insertAfter(CtBehavior.java:792)
at sg.agent/com.sg.agent.ErrorClassTransformer.transform(ErrorClassTransformer.java:60)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:246)
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:550)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:157)
at sg.agent/com.sg.agent.SGAgent.retransformError(SGAgent.java:362)
at sg.agent/com.sg.agent.SGAgent.premain(SGAgent.java:346)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:500)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:512)
Caused by: compile error: no such class: com.sg.agent.ErrorRecorder
at sg.agent/javassist.compiler.MemberResolver.searchImports(MemberResolver.java:470)
at sg.agent/javassist.compiler.MemberResolver.lookupClass(MemberResolver.java:414)
at sg.agent/javassist.compiler.MemberResolver.lookupClassByJvmName(MemberResolver.java:321)
at sg.agent/javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:683)
at sg.agent/javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
at sg.agent/javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at sg.agent/javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
at sg.agent/javassist.compiler.CodeGen.atStmnt(CodeGen.java:330)
at sg.agent/javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
at sg.agent/javassist.compiler.Javac.compileStmnt(Javac.java:567)
at sg.agent/javassist.CtBehavior.insertAfterAdvice(CtBehavior.java:892)
at sg.agent/javassist.CtBehavior.insertAfter(CtBehavior.java:851)
... 15 more
Error: LinkageError occurred while loading main class org.eclipse.jetty.start.Main
java.lang.LinkageError: loader (instance of jdk/internal/loader/ClassLoaders$AppClassLoader): attempted duplicate class definition for name: "org/eclipse/jetty/start/Main"

Related

Hive not starting up

I am trying to get hive started on my Linux system. It gives the following error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.hadoop.hive.ql.plan.TableDesc.setProperties(TableDesc.java:133)
at org.apache.hadoop.hive.ql.plan.TableDesc.<init>(TableDesc.java:71)
at org.apache.hadoop.hive.ql.plan.PlanUtils.getDefaultTableDesc(PlanUtils.java:458)
at org.apache.hadoop.hive.ql.exec.Utilities.<clinit>(Utilities.java:681)
at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:709)
at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:654)
at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:586)
at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:553)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:750)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private volatile java.lang.String java.net.URI.string accessible: module java.base does not "opens java.net" to unnamed module #3e849b9e
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at org.apache.hadoop.hive.common.StringInternUtils.<clinit>(StringInternUtils.java:57)
... 16 more
I am unable to figure out why this is happening. I even changed the JAVA version to 8 on my system, but the error persists.
I know I'm too late but here's the solution that worked for me in Intellij for the same problem:
Please add "--add-opens java. Base/java.net=ALL-UNNAMED" to your VM option.
For intellij : Open Run/debug Configurations > Create an application for your file if its already not there > Add VM Option > add this config in VM "--add-opens java. Base/java.net=ALL-UNNAMED"

Creating Kafka Custom Authorizer with Spring?

I have setup a customer authorizer by setting below properties in server.properties
authorizer.class.name= {package_name}.myAuthorizer
And myAuthorizer.java implements from kafka.security.auth.Authorizer
And included the myAuthorizer.jar in the libs directory.
It is working as expected but I am wondering if I can include the application properties using Dependency Injection.
I have tried to migrate the current working myAuthorizer to Spring project and running on the IDE is successful, but in the broker I am getting this exception:
java.lang.ClassNotFoundException: {package_name}.myAuthorizer
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at org.apache.kafka.common.utils.Utils.loadClass(Utils.java:374)
at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:363)
at kafka.security.authorizer.AuthorizerUtils$.createAuthorizer(AuthorizerUtils.scala:38)
at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1417)
at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1273)
at kafka.server.KafkaServerStartable$.fromProps(KafkaServerStartable.scala:34)
at kafka.Kafka$.main(Kafka.scala:68)
at kafka.Kafka.main(Kafka.scala)
For the custom Authorizer, can I build as Spring Java project? Or should I leave it as Java project?

How do I add dependencies to my custom Gradle plugin?

I get a NoClassDefFoundError when trying to add a dependency to my custom Gradle plugin, and I haven't found a way to solve it.
Added to the plugin's dependency block:
implementation("org.apache.logging.log4j:log4j-api:2.11.2")
implementation("org.apache.logging.log4j:log4j-core:2.11.2")
Added to the plugin's DeclarationAttributeAltererExtension implementation:
val log = LogManager.getLogger(ReallyAllOpenExtension::class.java)
Here's the full stacktrace:
no.synth.kotlin.plugins.reallyallopen.FunctionalPluginTest > should include plugin via plugins block FAILED
org.gradle.testkit.runner.UnexpectedBuildFailure: Unexpected build execution failure in /var/folders/g4/024g2mzn7jl5s2b2cvg_ythh00016k/T/junit5022572406008108408 with arguments [build]
Output:
> Task :compileKotlin FAILED
e: java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
at no.synth.kotlin.plugins.reallyallopen.ReallyAllOpenExtension.<clinit>(ReallyAllOpenPlugin.kt:106)
at no.synth.kotlin.plugins.reallyallopen.ReallyAllOpenRegistrar.registerProjectComponents(ReallyAllOpenPlugin.kt:79)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:174)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:123)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:413)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:259)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:124)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:54)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:103)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:364)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:105)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:237)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.access$compileIncrementally(IncrementalCompilerRunner.kt:37)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner$compile$2.invoke(IncrementalCompilerRunner.kt:79)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:91)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.execIncrementalCompiler(CompileServiceImpl.kt:597)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.access$execIncrementalCompiler(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:455)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1023)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1065)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1022)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:454)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 44 more
The full implementation and test case is in a separate branch at https://github.com/henrik242/kotlin-really-allopen/tree/unable-to-add-dependencies
Recreate the problem by running ./gradlew clean :kotlin-really-allopen:build :kotlin-really-allopen:publishToMavenLocal :functional-test:build
I suspect your problem is because of known classloader issues with plugins exercised with Gradle's TestKit.
I will paraphrase what that link says: Your plugin and its runtime classpath are loaded with one classloader. The functional test and its classpath are loaded in yet a second different classloader. Such a situation is the classic recipe for NoClassDefFoundErrors. Therefore, when using TestKit with a custom plugin, the plugin's runtime classpath must be explicitly injected into the runtime classpath of the functional test that is exercising the plugin.
The way your project is organized — with the functional test as a subproject — is likely to compound those known classloader issues. It certainly makes things more complicated than they need to be.
The answer to your question, therefore, is: Reorganize your project.
Using the Gradle User Guide as a guide, I simplified your project.
I forked and reorganized it the way Gradle advises.
The fixed code is in the able-to-add-dependencies branch of the fork.

Spring boot remote Websphere EJB call

I have Websphere thin client jars in my classpath and a sample spring boot application. I am unable to make remote ejb call because it is throwing corab exception. I am using oracle jdk1.8 to make websphere ejb call
09:50:28.505 com.ibm.rmi.corba.PluginRegistry instantiatePlugins:119 P=428317:O=0:CT ORBRas[default] java.lang.ClassNotFoundException: com.ibm.ws.wlm.client.WLMClient (no security manager: RMI class loader disabled)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:219)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:152)
at com.sun.corba.se.impl.util.JDKBridge.loadClassM(JDKBridge.java:189)
at com.sun.corba.se.impl.util.JDKBridge.loadClass(JDKBridge.java:86)
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.loadClass(Util.java:602)
at javax.rmi.CORBA.Util.loadClass(Util.java:265)
at com.ibm.rmi.corba.PluginRegistry.instantiatePlugins(PluginRegistry.java:116)
at com.ibm.rmi.corba.ORB.instantiatePlugins(ORB.java:1518)
at com.ibm.rmi.corba.ORB.orbParameters(ORB.java:1423)
at com.ibm.rmi.corba.ORB.set_parameters(ORB.java:1349)
at com.ibm.CORBA.iiop.ORB.set_parameters(ORB.java:1697)
at org.omg.CORBA.ORB.init(ORB.java:353)
at com.ibm.ws.orb.GlobalORBFactory.init(GlobalORBFactory.java:92)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:169)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:64)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:44)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:85)
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 com.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:505)
at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:466)
at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:128)
at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:765)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:164)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiLocatorDelegate.lookup(JndiLoc
The above log shows the corba errors generated by ibm jar files.
java.lang.ClassNotFoundException: com.ibm.ws.wlm.client.WLMClient
Looks like this is the class you're missing.
You'll need to add the com.ibm.ws.wlm.jar to your class path.

java.lang.VerifyError in struts2

I have developed a strut2-spring-hibernate web application.Build is successful but while deploying in tomcat I am getting the following error:
Caused by: java.lang.VerifyError: class org.hibernate.type.WrappedMaterializedBl
obType overrides final method getReturnedClass.()Ljava/lang/Class;
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.7.0_09]
at java.lang.ClassLoader.defineClass(ClassLoader.java:791) ~[na:1.7.0_09]
Please help....
It happens when you have multiple versions of jars added in your maven dependency(mismatch of jar versions),
*Caused by: java.lang.VerifyError: class * so check your maven dependency.
for spring you can find all the dependencies here
for hibernate you can find all the dependencies here
for struts you can find all the dependencies here

Resources