![]() ![]() I looked around in StackOverflow and saw a few questions like this but most of them were due to the libraries they used and were for Android Studio.Īlso, I am using Gradle 7.1 (according to the gradle-wrapper. Public static final Byte VALUE_AARAY = new Byte In the below-given code I get the compilation error Attribute value must be constant. Public static final Byte FIRST = 0, SECOND = 1, THIRD = 2, FOURTH = 3, FIFTH = 4 Reading from application.properties: Attribute value must be constant. ![]() If it helps here is the code to my EventPriority file: package me. Retryable (value Exception.class, maxAttempts 3, backoff Backoff (delay 100)) I have a java file using Configuration which is getting properties from a properties file. But i need to load value from properties file as on QA/Prod/SIT, the URL is different. I am using spring retry mechanism when calling rest API. ![]() The line byte value() default EventPriority.THIRD was the line giving me the error. Java: How to provide value to annotation attribute fetched from a properties file It always say that The value for annotation attribute dlLocation must be a constant expression. Import īyte value() default EventPriority.THIRD This error came from a file EventTarget whose code is: package me. The values of annotation members must be non- null compile-time constant expressions that are assignment-compatible with the declared type of the member. After finishing it I tried to run it and came across an error element value must be a constant expression. I was trying to make an event system for my Minecraft client. The value for annotation attribute GetMapping.produces must be a constant expression Reading properties from Application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |