lombok 0.10.1. error in Eclipse 3.7 - eclipse

when I try to use the #Data annotation with lombok 0.10.1. in Eclipse: 3.7.0.v20110504-0800-7b7qFVpFEx2XnmYtj_9RfO7
I got this error, can anyone advise?
Lombok annotation handler class lombok.eclipse.handlers.HandleData failed
java.lang.NoSuchMethodError: java/util/Arrays.copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
at lombok.eclipse.handlers.EclipseHandlerUtil.createSuppressWarningsAll(EclipseHandlerUtil.java:514)
at lombok.eclipse.handlers.EclipseHandlerUtil.injectMethod(EclipseHandlerUtil.java:451)
at lombok.eclipse.handlers.HandleEqualsAndHashCode.generateMethods(HandleEqualsAndHashCode.java:227)
at lombok.eclipse.handlers.HandleEqualsAndHashCode.generateEqualsAndHashCodeForType(HandleEqualsAndHashCode.java:116)
at lombok.eclipse.handlers.HandleData.handle(HandleData.java:63)
at lombok.eclipse.HandlerLibrary$AnnotationHandlerContainer.handle(HandlerLibrary.java:73)
at lombok.eclipse.HandlerLibrary.handleAnnotation(HandlerLibrary.java:191)
at lombok.eclipse.TransformEclipseAST$AnnotationVisitor.visitAnnotationOnType(TransformEclipseAST.java:204)
at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:96)
at lombok.eclipse.EclipseAST.traverseChildren(EclipseAST.java:94)
at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:63)
at lombok.eclipse.EclipseAST.traverseChildren(EclipseAST.java:94)
at lombok.eclipse.EclipseNode.traverse(EclipseNode.java:58)
at lombok.eclipse.EclipseAST.traverse(EclipseAST.java:89)
at lombok.eclipse.TransformEclipseAST.go(TransformEclipseAST.java:166)
at lombok.eclipse.TransformEclipseAST.transform(TransformEclipseAST.java:132)
at lombok.eclipse.TransformEclipseAST.transform_swapped(TransformEclipseAST.java:85)
at org.eclipse.jdt.internal.compiler.parser.Parser.endParse(Parser.java:8506)
at org.eclipse.jdt.internal.core.util.CommentRecorderParser.endParse(CommentRecorderParser.java:116)
at org.eclipse.jdt.internal.compiler.SourceElementParser.endParse(SourceElementParser.java:727)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9515)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9731)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9688)
at org.eclipse.jdt.internal.compiler.SourceElementParser.parseCompilationUnit(SourceElementParser.java:921)
at org.eclipse.jdt.internal.core.search.indexing.SourceIndexer.indexDocument(SourceIndexer.java:68)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:72)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:453)
at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:853)
at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:405)
at java.lang.Thread.run(Thread.java:799)

The cause of this problem is that that version of lombok used java6 API, and I suppose you're using java5 to run eclipse. This has been fixed in the 0.10.4 release. The current version is 0.10.6.
Disclosure: I'm one of the core contributors.

Related

How to solve the 'Unable to find Asm for stackmap generation' error on startup of STS?

I am trying to use the Spring Tool Suite 3.8.3 on Ubuntu 16.04. Upon startup I get this error:
An internal error occured during: "Initializing Java Tooling"
with the detailed message:
An internal error occurred during: "Initializing Java Tooling". Unable
to find Asm for stackmap generation (Looking for
'aj.org.objectweb.asm.ClassReader'). Stackmap generation for woven
code is required to avoid verify errors on a Java 1.7 or higher
runtime when weaving type org.eclipse.jdt.core.search.SearchPattern
when weaving classes when weaving
I have to admit that I have no idea what I should do here and I failed to find any pointers online. Any advice or hint is welcome.
It was for me due to the scala plug-in which I have installed a few days back. Uninstall the scala plugin and change to JDK 8 or JDK 11 it will work.
If anyone is still having a similar problem with Eclipse and needs to use Java 11 or higher (Eclipse nowadays seems to require Java 11) then have a look into this plugin as it seems to be required for the kotlin plugin.
https://marketplace.eclipse.org/content/aspectj-development-tools
I think you have installed Java 9 on your system. That's why you are facing compatibility issue and getting the stated errors. I therefore suggest you to degrade your java version to 8 for which it will work well and you wont be facing any error issue in that.
You can install java8 from this link!
I had to downgrade the JRE used to run Eclipse. Downgrading from Java 15 to Java 11 solved the problem.
Use the -vm option in eclipse.ini, eg.
-vm
c:\Dev\jdk-11\bin
My STS did not even start after installing scala plugin. I had to manually delete scala jars and folders from the STS /plugins. After that it started working.

Security Exception While Running TestNG test in Eclipse

Getting the below error while trying to run the TestNG test in Eclipse Neon . Seems like there is some sort signed content in jar dependency which is blocking this . have no idea what its though ..Any suggestions on how to fix this . Have never faced this before .
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:284)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:238)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:273)
at java.util.jar.JarVerifier.update(JarVerifier.java:228)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
at java.util.jar.JarFile.getInputStream(JarFile.java:450)
at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:162)
at java.net.URL.openStream(URL.java:1045)
at org.testng.remote.RemoteTestNG.getTestNGVersion(RemoteTestNG.java:84)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:39)
[ServiceLoaderHelper] More than one working implementation for 'null', we will use the first one
Exception in thread "main" java.lang.NoSuchMethodError: org.testng.internal.Utils.defaultIfStringEmpty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
at org.testng.remote.AbstractRemoteTestNG.setHost(AbstractRemoteTestNG.java:59)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:122)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:58)
oh, I sort of got your problem, looks like you're using an pretty old version of testng (probably the 5.x), since TestNG eclipse plugin 6.9.12.201607091356, TestNG versions below 6.5.1 are not supported: https://github.com/cbeust/testng-eclipse/blob/master/CHANGES.md#6910
So please upgrade your testng version.
Edit: since TestNG Eclipse Plugin 6.9.13.201609291640, the whole TestNG 6.x series are supported (including 6.0 to 6.5.1), while the TestNG 5.x still not be supported.

maven-scr-plugin fails with SCRDescriptorException "unable to scan files ... Class file format probably not supported by ASM ?"

Using the following dependencies (amongst others, the bundle is supposed to be installed to AEM 6.1)
runtime is java8
maven-scr-plugin 1.15.0
org.apache.felix.scr.annotations: 1.9.8
org.apache.felix.scr.ds-annotations: 1.2.8
I get this exception
Caused by: org.apache.felix.scrplugin.SCRDescriptorException: Unable to scan class files: ...
(Class file format probably not supported by ASM ?)
at org.apache.felix.scrplugin.helper.ClassScanner.processClass(ClassScanner.java:219)
at org.apache.felix.scrplugin.helper.ClassScanner.process(ClassScanner.java:161)
at org.apache.felix.scrplugin.helper.ClassScanner.scanSources(ClassScanner.java:146)
at org.apache.felix.scrplugin.SCRDescriptorGenerator.execute(SCRDescriptorGenerator.java:146)
at org.apache.felix.scrplugin.mojo.SCRDescriptorMojo.execute(SCRDescriptorMojo.java:221)
... 22 more
Caused by: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.objectweb.asm.ClassReader.(Unknown Source)
at org.apache.felix.scrplugin.helper.ClassScanner.processClass(ClassScanner.java:201)
The class in question does not contain any osgi annotations at all, but is merely imported in some other #Component annotated classes.
Did anyone encounter this and found a solution?
I ran into this issue today. This happens when you are running maven-scr-plugin with scanClasses=true option. Older versions of maven-scr-plugin cannot scan classfile generated by java8. you will have to either switch to a newer version of scr plugin (I upgraded to 1.22) or set you maven-compiler-plugin target config to 1.7
I found out that my Felix SCR Annotation Processor plugin that I installed to my Intellij as a prerequisite to using the aem-ide-tooling-4-intellij from headwirecom is causing the issue. It was working for quite a while until today suddenly giving me an issue in running my unit tests (needless to say, there were no changes made in my java, mvn versions or in my IDE).
This forced me to update my java version, intellij version but didn't fix the issue. But disabled the SCR annotation plugin fixed it.
As you can see, this plugin is really old (2014). I hope they will release a newer version soon.

Selecting exact Groovy version in Eclipse Juno

In Eclipse Juno when I try to run Groovy source (that has a main method inside of it) I get:
Caught: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.3.4 and you are trying to load version 2.3.3
Google, surprisingly, turned up nothing. When I go to Project >> Properties >> Groovy Compiler I see that my Groovy compiler is at 2.3, but it doesn't give me the option to select 2.3.3 or 2.3.4.
Any ideas what the fix is?
There is no fix for that. Each groovy-eclipse compiler is a version tweaked to work with eclipse JDT and whatnot. You can try to use other groovy-eclipse versions, which might feature the groovy version you need

Using AspectJ/AJDT in RAD 7.5.5

I'm using RAD 7.5.5. I installed AJDT plugin from the download site:
http://archive.eclipse.org/tools/ajdt/34/update/
I converted one of the existing Java projects to an AspectJ project, added an aspect to print log statements on method start and end of a methodA(), rebuilt the project and deployed.
I'm getting the below exception when methodA() is called:
Exception thrown : java.lang.NoSuchMethodError: org/aspectj/runtime/reflect/Factory.makeMethodSig(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lorg/aspectj/lang/reflect/MethodSignature;
I googled and found this could be caused because of an older version of aspectjrt.jar. But RAD extends Eclipse 3.4 and hence I added the version of AJDT plugin that is compatible with Eclipse 3.4 (/RAD 7.5.5). Any pointers to what could be the problem?
Make sure that aspectjrt.jar is on your classpath. Also, make sure that it is the aspectjrt.jar that comes with AJDT.