Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

3.4K
Vistas
What does this error mean? java.lang.reflect.InaccessibleObjectException: Unable to make field private final int java.time.LocalDate.year

I'm trying to make a method, which uses the Json data with jackson library to have a list of objects. If I run my code, I get the error:

java.lang.reflect.InaccessibleObjectException: Unable to make field private final int java.time.LocalDate.year accessible: module java.base does not "opens java.time" to unnamed module @5c90e579

Why is it giving me an error about LocalDate even though I have JodaModul in my Code?

public static List<Tweet> getTweetsFile() throws Exception{

            ObjectMapper mapper = new ObjectMapper().
                    registerModule(new JodaModule()).
                    configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
            
            File path = new File ("C:/Users/PC/eclipse-workspace/hw4/tw.json");

            List<Tweet> myObjects3 =  Arrays.asList(mapper.readValue(path, Tweet.class));
    
            return myObjects3;
    }

How it looks in my File:

[{"date":"2001-12-28","tweetNumber":1,"country":"England","comments":11,"message":"I like to watch anime and reading books","retweets":3,"username":"Isabelle","likes":55},{"date":"2003-05-11","tweetNumber":2,"country":"France","comments":25,"message":"I'm Viatnamese, but I live in France","retweets":30,"username":"Vin","likes":110}..

It's not in the right order like my Object has in their constructor, could that be the reaseon?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

I solved this problem to change jdk16 to jdk11.

over 4 years ago · Santiago Trujillo Denunciar

0

You can fix this issue on your own.

add --add-opens java.base/java.time=ALL-UNNAMED as start-argument and it'll work.

Here is the corresponding JEP

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda