Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-26687

(8.0.z) JakartaEE application client: module "org.hibernate" is not added to classpath

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.0 Update 2
    • None
    • JPA/Hibernate
    • None
    • False
    • None
    • False
    • +
    • Hide

      Deploy attached ear [^KuchenZutatInheritance.ear] file to the server, then start the JakartaEE application client:

      %WILDFLY_HOME%\bin\appclient.bat x:\PfadZurEarDatei\KuchenZutatInheritance.ear#KuchenZutatInheritanceClient.jar
      

      (when using Java 17, you need to set this first):

      set JAVA_OPTS=--add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED
      

      Click the top left button "New", enter something in the textfield and press "OK". Now this error should report:

      2024-02-07 19:24:38,650 ERROR [stderr] (AWT-EventQueue-0) jakarta.ejb.EJBException: Failed to read response
      2024-02-07 19:24:38,651 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.ejb-client@5.0.5.Final//org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation$MethodCallResultProducer.apply(EJBClientChannel.java:1367)
      ...
      2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.ejb-client@5.0.5.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:116)
      2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) 	at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceEJB.jar/jdk.proxy6/jdk.proxy6.$Proxy13.getKuchen(Unknown Source)
      2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) 	at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar//de.hsrm.jakartaee.knauf.kuchenzutatinheritance.FrameKuchenZutatInheritance.fillKuchen(FrameKuchenZutatInheritance.java:483)
      2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) 	at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar//de.hsrm.jakartaee.knauf.kuchenzutatinheritance.FrameKuchenZutatInheritance.jButtonKuchenNeuActionPerformed(FrameKuchenZutatInheritance.java:395)
      2024-02-07 19:24:38,657 ERROR [stderr] (AWT-EventQueue-0) 	at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar//de.hsrm.jakartaee.knauf.kuchenzutatinheritance.FrameKuchenZutatInheritance.actionPerformed(FrameKuchenZutatInheritance.java:169)
      2024-02-07 19:24:38,657 ERROR [stderr] (AWT-EventQueue-0) 	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
      ...
      2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) 	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
      2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) Caused by: java.lang.ClassNotFoundException: org.hibernate.collection.spi.PersistentBag from [Module "deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar" from Service Module Loader]
      2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
      2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at java.base/java.lang.Class.forName0(Native Method)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at java.base/java.lang.Class.forName(Class.java:467)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling@2.1.3.SP1//org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:129)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling@2.1.3.SP1//org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:110)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:1227)
      2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1560)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:441)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:388)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:2107)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:2020)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1601)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:441)
      2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:388)
      2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadCollectionObject(RiverUnmarshaller.java:344)
      2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.readCollectionData(RiverUnmarshaller.java:1055)
      2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:908)
      2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:373)
      2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.marshalling@2.1.3.SP1//org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
      2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) 	at org.jboss.ejb-client@5.0.5.Final//org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation$MethodCallResultProducer.apply(EJBClientChannel.java:1341)
      2024-02-07 19:24:38,666 ERROR [stderr] (AWT-EventQueue-0) 	... 67 more
      
      Show
      Deploy attached ear [^KuchenZutatInheritance.ear] file to the server, then start the JakartaEE application client: %WILDFLY_HOME%\bin\appclient.bat x:\PfadZurEarDatei\KuchenZutatInheritance.ear#KuchenZutatInheritanceClient.jar (when using Java 17, you need to set this first): set JAVA_OPTS=--add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED Click the top left button "New", enter something in the textfield and press "OK". Now this error should report: 2024-02-07 19:24:38,650 ERROR [stderr] (AWT-EventQueue-0) jakarta.ejb.EJBException: Failed to read response 2024-02-07 19:24:38,651 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.ejb-client@5.0.5.Final//org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation$MethodCallResultProducer.apply(EJBClientChannel.java:1367) ... 2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.ejb-client@5.0.5.Final//org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:116) 2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceEJB.jar/jdk.proxy6/jdk.proxy6.$Proxy13.getKuchen(Unknown Source) 2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar//de.hsrm.jakartaee.knauf.kuchenzutatinheritance.FrameKuchenZutatInheritance.fillKuchen(FrameKuchenZutatInheritance.java:483) 2024-02-07 19:24:38,656 ERROR [stderr] (AWT-EventQueue-0) at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar//de.hsrm.jakartaee.knauf.kuchenzutatinheritance.FrameKuchenZutatInheritance.jButtonKuchenNeuActionPerformed(FrameKuchenZutatInheritance.java:395) 2024-02-07 19:24:38,657 ERROR [stderr] (AWT-EventQueue-0) at deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar//de.hsrm.jakartaee.knauf.kuchenzutatinheritance.FrameKuchenZutatInheritance.actionPerformed(FrameKuchenZutatInheritance.java:169) 2024-02-07 19:24:38,657 ERROR [stderr] (AWT-EventQueue-0) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) ... 2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) 2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) Caused by: java.lang.ClassNotFoundException: org.hibernate.collection.spi.PersistentBag from [Module "deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar" from Service Module Loader] 2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200) 2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410) 2024-02-07 19:24:38,662 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at java.base/java.lang.Class.forName0(Native Method) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at java.base/java.lang.Class.forName(Class.java:467) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling@2.1.3.SP1//org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:129) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling@2.1.3.SP1//org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:110) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:1227) 2024-02-07 19:24:38,663 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1560) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:441) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:388) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:2107) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:2020) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1601) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:441) 2024-02-07 19:24:38,664 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:388) 2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadCollectionObject(RiverUnmarshaller.java:344) 2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.readCollectionData(RiverUnmarshaller.java:1055) 2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:908) 2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling.river@2.1.3.SP1//org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:373) 2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.marshalling@2.1.3.SP1//org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41) 2024-02-07 19:24:38,665 ERROR [stderr] (AWT-EventQueue-0) at org.jboss.ejb-client@5.0.5.Final//org.jboss.ejb.protocol.remote.EJBClientChannel$MethodInvocation$MethodCallResultProducer.apply(EJBClientChannel.java:1341) 2024-02-07 19:24:38,666 ERROR [stderr] (AWT-EventQueue-0) ... 67 more

      I have a JakartaEE application client sample that fails to run on WildFly 30 with this error:

      java.lang.ClassNotFoundException: org.hibernate.collection.spi.PersistentBag from [Module "deployment.KuchenZutatInheritance.ear.KuchenZutatInheritanceClient.jar" from Service Module Loader]

      It works if I add a "jboss-deployment-structure.xml" to "EarContent":

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.3"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:jboss:deployment-structure:1.3 http://www.jboss.org/schema/jbossas/jboss-deployment-structure-1_3.xsd">
          <deployment>
              <dependencies>
                  <module name="org.hibernate" export="true">
                  </module>
              </dependencies>
          </deployment>
      </jboss-deployment-structure>

      Probably, the application client framework should add hibernate to the classpath, as it seems reasonable to use JPA entity beans on the client side.

      The issue seems to be caused by the fact that I use a "OneToMany" annotation.

            thofman Tomas Hofman
            rhn-support-bmaxwell Brad Maxwell
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: