0 Replies Latest reply on Feb 13, 2020 11:45 AM by Thales Batista de Melo

    Cannot start simple application using JPA + Hibernate 4 provided by wildfly 18

    Thales Batista de Melo Newbie

      I would like to run a simple web service application  using the module provided by wildfly hibernate 4.3 or 4.1 and jpa 2.

      Even following all the instructions of the tutorial and wildfly guide, it still does not work.

      jboss-deployment-structure.xml  is in a war file under WEB-INF

      What is missing?

       

       

      ivy.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <ivy-module version="2.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
      <info organisation="com.company" module="wildfly-jpa-webservice"
      status="integration">
      <extends extendType="configurations" organisation="com.exerp"
      module="common-base" revision="latest.integration"
      location="../common-base/ivy.xml" />
      </info>
      <publications>
      <artifact name="wildfly-jpa-webservice" type="war"
      conf="master" />
      </publications>
      <dependencies
      defaultconfmapping="compile->default;lib->master">
      
      
      <!-- Provided by wildfly in runtime -->
      <dependency org="javax" name="javaee-api" rev="7.0" conf="compile->master" />
      
      
      </dependencies>
      </ivy-module>
      

       

      jboss-deployment-structure.xml

      <jboss-deployment-structure
      xmlns="urn:jboss:deployment-structure:1.2">
      
      
      
      
      
      
      
      
      
      
      
      
      
      

       

       

      persistence.xml

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_2.xsd"
      version="2.2">
      transaction-type="JTA">
      
      
      java:/DefaultDS
      com.exerp.DbVersion
      
       
      
      
      
      
      
      
      
      
      
      

       

       

      Stacktrace

      17:33:48,143 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "wildfly-jpa-webservice.war" (runtime-name: "wildfly-jpa-webservice.war")
      17:33:48,408 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) WFLYJPA0002: Read persistence.xml for persistence_ctx
      17:33:48,701 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.16.Final
      17:33:48,977 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 85) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'wildfly-jpa-webservice.war#persistence_ctx'
      17:33:48,995 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 85) HHH000204: Processing PersistenceUnitInfo [
      name: persistence_ctx
      ...]
      17:33:49,064 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 85) HHH000412: Hibernate Core {5.3.13.Final}
      17:33:49,066 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 85) HHH000206: hibernate.properties not found
      17:33:49,152 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 11) WFLYCLINF0002: Started client-mappings cache from ejb container
      17:33:49,179 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 85) HCANN000001: Hibernate Commons Annotations {5.0.5.Final}
      17:33:49,253 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 85) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'wildfly-jpa-webservice.war#persistence_ctx'
      17:33:49,279 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 85) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
      17:33:49,510 INFO  [org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl] (ServerService Thread Pool -- 85) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
      17:33:49,515 INFO  [org.hibernate.type.BasicTypeRegistry] (ServerService Thread Pool -- 85) HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@5157043b
      17:33:49,519 INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 85) Envers integration enabled? : true
      17:33:49,663 INFO  [org.hibernate.orm.beans] (ServerService Thread Pool -- 85) HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
      17:33:49,715 INFO  [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 85) HV000001: Hibernate Validator 6.0.18.Final
      17:33:49,941 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 85) MSC000001: Failed to start service jboss.persistenceunit."wildfly-jpa-webservice.war#persistence_ctx": org.jboss.msc.service.StartException in service jboss.persistenceunit."wildfly-jpa-webservice.war#persistence_ctx": javax.persistence.PersistenceException: [PersistenceUnit: persistence_ctx] Unable to build Hibernate SessionFactory
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:198)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:128)
      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:658)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:212)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      at java.lang.Thread.run(Thread.java:748)
      at org.jboss.threads.JBossThread.run(JBossThread.java:485)
      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: persistence_ctx] Unable to build Hibernate SessionFactory
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1016)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:942)
      at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:170)
      ... 9 more
      Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
      at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:123)
      at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)
      at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:154)
      at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:295)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:939)
      ... 11 more
      Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:91)
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116)
      at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:413)
      at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:557)
      at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:124)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96)
      ... 16 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:88)
      ... 25 more
      Caused by: java.lang.IllegalArgumentException: Could not create type
      at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:154)
      at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:365)
      at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:174)
      at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:376)
      at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.load(ByteBuddyState.java:183)
      at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.loadProxy(ByteBuddyState.java:107)
      at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.buildProxy(ByteBuddyProxyHelper.java:54)
      at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyFactory.postInstantiate(ByteBuddyProxyFactory.java:62)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:163)
      at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:155)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:59)
      ... 30 more
      Caused by: java.lang.IllegalStateException: Error invoking Unsafe::defineClass
      at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$Enabled.defineClass(ClassInjector.java:1997)
      at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe.injectRaw(ClassInjector.java:1774)
      at net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:112)
      at net.bytebuddy.dynamic.loading.ClassLoadingStrategy$ForUnsafeInjection.load(ClassLoadingStrategy.java:546)
      at net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:100)
      at net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:5662)
      at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.lambda$load$0(ByteBuddyState.java:187)
      at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:152)
      ... 40 more
      Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
      at sun.misc.Unsafe.defineClass(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$Enabled.defineClass(ClassInjector.java:1987)
      ... 47 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.proxy.HibernateProxy from [Module "deployment.wildfly-jpa-webservice.war" from Service Module Loader]
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      ... 53 more
      
      
      17:33:49,945 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ({"deployment" => "wildfly-jpa-webservice.war"}) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"wildfly-jpa-webservice.war#persistence_ctx\"" => "javax.persistence.PersistenceException: [PersistenceUnit: persistence_ctx] Unable to build Hibernate SessionFactory
          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: persistence_ctx] Unable to build Hibernate SessionFactory
          Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
          Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
          Caused by: java.lang.reflect.InvocationTargetException
          Caused by: java.lang.IllegalArgumentException: Could not create type
          Caused by: java.lang.IllegalStateException: Error invoking Unsafe::defineClass
          Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
          Caused by: java.lang.ClassNotFoundException: org.hibernate.proxy.HibernateProxy from [Module \"deployment.wildfly-jpa-webservice.war\" from Service Module Loader]"}}
      17:33:49,946 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "wildfly-jpa-webservice.war" was rolled back with the following failure message: 
      {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"wildfly-jpa-webservice.war#persistence_ctx\"" => "javax.persistence.PersistenceException: [PersistenceUnit: persistence_ctx] Unable to build Hibernate SessionFactory
          Caused by: javax.persistence.PersistenceException: [PersistenceUnit: persistence_ctx] Unable to build Hibernate SessionFactory
          Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
          Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
          Caused by: java.lang.reflect.InvocationTargetException
          Caused by: java.lang.IllegalArgumentException: Could not create type
          Caused by: java.lang.IllegalStateException: Error invoking Unsafe::defineClass
          Caused by: java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy
          Caused by: java.lang.ClassNotFoundException: org.hibernate.proxy.HibernateProxy from [Module \"deployment.wildfly-jpa-webservice.war\" from Service Module Loader]"}}