Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

3.4K
Views
¿Qué significa este error? java.lang.reflect.InaccessibleObjectException: no se puede hacer que el campo sea privado final int java.time.LocalDate.year

Estoy tratando de crear un método que use los datos Json con la biblioteca jackson para tener una lista de objetos. Si ejecuto mi código, me sale el error:

java.lang.reflect.InaccessibleObjectException: no se puede hacer que el campo sea privado final int java.time.LocalDate.year accesible: el módulo java.base no "abre java.time" en un módulo sin nombre @ 5c90e579

¿Por qué me da un error sobre LocalDate aunque tengo JodaModul en mi código?

 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; }

Cómo se ve en mi archivo:

 [{"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}..

No está en el orden correcto como mi Objeto tiene en su constructor, ¿podría ser esa la razón?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Resolví este problema para cambiar jdk16 a jdk11.

over 4 years ago · Santiago Trujillo Report

0

Puede solucionar este problema por su cuenta.

agregue --add-opens java.base/java.time=ALL-UNNAMED como argumento de inicio y funcionará.

Aquí está la JEP correspondiente

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!