title: java.lang.ClassCastException: class ... is in unnamed module of loader 'app' - spring-boot-dev-tools
body: <p>We have a larger Spring boot application which causes the following exeception:</p>
  <pre><code>    java.lang.ClassCastException: class jpa.XVersion cannot be cast to class jpa.XVersion (jpa.XVersion is in unnamed module of loader 'app'; jpa.XVersion is in unnamed module of loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader @671ef14f)
      at y.package.abc(XService.java:70)
      at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
  </code></pre>
  <p>while starting from within IDEA IntelliJ in relationship with JPA classes.</p>
  <p>The application works fine while starting from plain command line.</p>
  <p>After we have removed the dependency</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
    &lt;optional&gt;true&lt;/optional&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>The execution from within the IDE works fine without any issues.</p>
  <p>We are using:</p>
  <ul>
  <li>Idea IntelliJ 2020.1.2</li>
  <li>Spring Boot Version 2.3.1,</li>
  <li>JDK 11.0.7 (Adopt Open JDK),</li>
  <li>Apache Maven 3.6.3</li>
  </ul>
  <p>Does someone has already observed that kind of issue?
  Does exist a different solution then removing the dependency?</p>