STS 3.8.4 unable to generate setters and getters index:5 size:5 error - spring-tool-suite

In STS version 3.8.3 and 3.8.4, I am unable to generate setters and getters. It is giving the following error:
Generating getters and setters failed Index:5, Size:5

I got the same issue, it's because of lombok dependency.
Open STS.ini, comment #-javaagent:lombok.jar and restart STS.
Now you will be able to generate getters and setters.

Related

Where are ArrayUtils.insert() methods in version 3.12.0

I cannot get Spring Framework ArrayUtils.insert() methods to show in Eclipse. The pom.xml has the 3.12.0 version of org.apache.commons.lang3. I can see the methods under Maven Dependencies. However, in the editor, I cannot get to any of the ArrayUtils.insert() methods. Why would that be?
I tried using org.apache.commons.lang3.ArrayUtils and I was able to see the add() methods but not the addFirst() methods.
Are they dependent on Java version or something? The methods are there plain as day in the Maven Dependencies. But, they're compile errors (not found) when I try to use them.

APT error in eclipse as JSR250: CommonAnnotations for Java

i am getting below APT error in eclipse as JSR250: CommonAnnotations for Java, 2.3: #Resource methods must be setters that follow the standard JavaBeans convention. i.e. void "setProperty( value)" for " property".
Firstly I got the same 256 errors, I created a new workspace and imported maven projects again into new workspace then they reduced to 9 errors.
SCREENSHOT
It seems you are referring multiple repositories in you project. Please check your project .factorypath file. What it is referring ?

UserEntity$Description and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)

I am developing the Spring Boot + MongoDB example and I am getting below error.
I used Lombok to generate setters and getters. I am simply calling the repositoy.findAll() method and giving me the below error.
Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as a fallback.Sat Feb 10 16:49:04 IST 2018There was an unexpected error (type=Internal Server Error, status=500).Could not write JSON: No serializer found for class com.myfi.model.UserEntity$Description and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class com.myfi.model.UserEntity$Description and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0]->com.myfi.model.Tweet["user"]->com.myfi.model.User["entities"]->com.myfi.model.UserEntity["description"])
I was seeing the same issue in my project.
For me, my problem was I was running the application within eclipse, and eclipse was not aware of the lombok annotations. When I added the lombok plugin to eclipse it started working

EclipseLink JPA 2.0. "unknown enum constant javax.persistence.LockModeType.NONE"

I have a Glassfish v3 with a remote EJB. I use this EJB to manipulate a data base using EclipseLink. Regarding this question, i'm now trying to import the EclipseLink jars to my client application as #James suggested.
Here are the jars i have added so far, those jars are those added on the server side of my application.
eclipselink-2.3.2.jar
javax.persistence-2.0.3.jar
org.eclipse.persistence.antlr.jar
org.eclipse.persistence.asm.jar
org.eclipse.persistence.core.jar
org.eclipse.persistence.jpa.jar
org.eclipse.persistence.jpa.jpql_1.0.1.jar
org.eclipse.persistence.jpa.modelgen.jar
org.eclipse.persistence.moxy.jar
org.eclipse.persistence.oracle.jar
But when i try to compile my netbeans module, i got this error:
error: in class file javax/persistence/NamedQuery.class(javax/persistence:NamedQuery.class): unknown enum constant javax.persistence.LockModeType.NONE
Note: Attempting to workaround javac bug #6512707
warning: No processor claimed any of these annotations: [javax.ejb.Remote]
error: in class file javax/persistence/NamedQuery.class(javax/persistence:NamedQuery.class): unknown enum constant javax.persistence.LockModeType.NONE
1 error
Why?
The error seems like you have the JPA 1.0 jar first on your classpath, but need the JPA 2.0 classes.

lombok 0.10.1. error in Eclipse 3.7

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.