title: Class loader error - unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader
body: <p>I am quite new to Spring and Java as a whole and I am currently working on an API. I've got this code which accesses MSSQL database, retrieves the results and IS SUPPOSED TO visualize it, but it doesn't work. I mean, if I would only call the procedure and visualize the result set, it would work normally. The problem is that I can't work with the "RatingProcedure" object. When I try get some object's value, it shows me following <strong>error</strong>: </p>
  
  <blockquote>
    <p>Hibernate: 
        {call dis_entity.spdcmpracovnici(?,?,?,?)}
    2019-09-02 01:56:01.355  WARN 8720 --- [nio-8050-exec-3] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [java.lang.ClassCastException: class [Ljava.lang.Object; cannot be cast to class com.pproi.dcm.ratingprocedure.RatingProcedure ([Ljava.lang.Object; is in module java.base of loader 'bootstrap'; >com.pproi.dcm.ratingprocedure.RatingProcedure is in unnamed module of loader >org.springframework.boot.devtools.restart.classloader.RestartClassLoader @7193df92)]</p>
  </blockquote>
  
  <p><strong>The code:</strong></p>
  
  <pre><code>@GetMapping("/replacements/{sourceId}/workers")
      public ResponseEntity&lt;List&lt;PossibleReplacementResponseModel&gt;&gt; getReplacements(@PathVariable Integer sourceId,
              @RequestParam(required = false) Integer targetWorkerId,
              @RequestParam(required = false) Integer targetLineId,
              @RequestParam(required = false) String targetWorkplaces) {
  
          List&lt;PossibleReplacementResponseModel&gt; response = new ArrayList&lt;&gt;();
  
          // 400 Bad Request
          if ((targetLineId != null &amp;&amp; targetWorkerId != null) || (targetWorkplaces != null &amp;&amp; targetLineId == null))
              return ResponseEntity.badRequest().build();
  
          StoredProcedureQuery ratingProcedure = entityManager.createNamedStoredProcedureQuery("dcmrating");
  
          StoredProcedureQuery storedProcedure = ratingProcedure.setParameter("pk_target_worker", targetWorkerId)
                  .setParameter("pk_target_sdl", targetLineId).setParameter("pk_target_workplaces", targetWorkplaces)
                  .setParameter("pk_source_sdl", sourceId);
  
          List&lt;RatingProcedure&gt; ratings = storedProcedure.getResultList();
  
          for(RatingProcedure rating : ratings) {
              PossibleReplacementResponseModel responseModel = new PossibleReplacementResponseModel();
              Optional&lt;Worker&gt; _worker = workerRepository.findById(rating.getPersonalId());
  
              if(_worker.isPresent()) {
                  Worker worker = _worker.get();
                  responseModel.setId(worker.getId());
                  responseModel.setName(worker.getFullName());
                  responseModel.setSkills(findWorkersSkills(worker));
                  responseModel.setPhysicalExamination(findWorkersMedicalExaminationEndDate(worker));
                  responseModel.setExams(findWorkersExams(worker));
                  responseModel.setRestrictions(findWorkersRestrictions(worker));
                  responseModel.setRating(rating.getRating());
              }
              response.add(responseModel);
          }
  
          return ResponseEntity.ok(response);
      }
  </code></pre>
  
  <p>I probably even have an idea about the solution! I probably should customize my Restart Classloader as seen in <a href="https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-devtools-customizing-classload" rel="noreferrer">here</a>, but there my skills end and I have no idea what I should specify in the file. </p>
  
  <p>Any ideas?</p>
  
  <p>Thank you a lot.</p>