javaeekickoff / java-ee-kickoff-app

javaee-kickoff-app
Other
179 stars 54 forks source link

Unable to deploy on Wildfly 11.0.0 #21

Closed Logicko closed 6 years ago

Logicko commented 6 years ago

I'm trying to deploy the kickoff app on Wildfly 11.0.0 but I'm getting error : javax.persistence.PersistenceException: [PersistenceUnit: kickoff] Unable to build Hibernate SessionFactory Caused by: javax.persistence.PersistenceException: [PersistenceUnit: kickoff] Unable to build Hibernate SessionFactory Caused by: org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/app/kickoff/DataSource Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/app/kickoff/DataSource Caused by: javax.resource.ResourceException: IJ031084: Unable to create connection Caused by: java.lang.NullPointerException

However I deployed Mysql driver and tested connection by adding XA data source (different than the one defined in web.xml) via wildfly admin console. Is there any deployment guide to follow ?

This is my config :

<entry key="className">com.mysql.jdbc.Driver</entry>
    <!-- <entry key="className">com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</entry> -->
    <entry key="url">jdbc:mysql://localhost:3306/Logidb</entry>
    <entry key="user">logiuser</entry>
    <entry key="password">****</entry>

_

Complete stacktrace :
2018-02-25 22:40:59,028 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 18) MSC000001: Failed to start service jboss.persistenceunit."java-ee-kickoff-app.war#kickoff": org.jboss.msc.service.StartException in service jboss.persistenceunit."java-ee-kickoff-app.war#kickoff": javax.persistence.PersistenceException: [PersistenceUnit: kickoff] Unable to build Hibernate SessionFactory at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:195) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:125) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:640) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:209) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: javax.persistence.PersistenceException: [PersistenceUnit: kickoff] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:953) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:883) at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:357) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1300(PersistenceUnitServiceImpl.java:70) at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:187) ... 7 more Caused by: org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97) at org.hibernate.resource.transaction.backend.jta.internal.DdlTransactionIsolatorJtaImpl.<init>(DdlTransactionIsolatorJtaImpl.java:44) at org.hibernate.tool.schema.internal.Helper.buildDefaultDdlTransactionIsolator(Helper.java:145) at org.hibernate.tool.schema.internal.HibernateSchemaManagementTool.getDdlTransactionIsolator(HibernateSchemaManagementTool.java:180) at org.hibernate.tool.schema.internal.HibernateSchemaManagementTool.buildGenerationTargets(HibernateSchemaManagementTool.java:140) at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:109) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:137) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:65) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:476) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:422) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:880) ... 11 more **Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/app/kickoff/DataSource** at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:146) at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180) at org.hibernate.resource.transaction.backend.jta.internal.DdlTransactionIsolatorJtaImpl.<init>(DdlTransactionIsolatorJtaImpl.java:41) ... 20 more **Caused by: javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/app/kickoff/DataSource** at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:690) ... **Caused by: java.lang.NullPointerException** at org.omnifaces.persistence.datasource.SwitchableXADataSource.getXAConnection(SwitchableXADataSource.java:19)

Thanks a lot for your help !

Logicko commented 6 years ago

After resolving the first error, I'm now getting this one...I read the issue #17 but I'm trying to deploy to Wildfly 11.0.0.Final (JSF 2.3).

``

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."java-ee-kickoff-app.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."java-ee-kickoff-app.war".WeldStartService: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1978)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.reflect.MalformedParameterizedTypeException
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:58)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:51)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(ParameterizedTypeImpl.java:92)
    at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(CoreReflectionFactory.java:105)
    at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:140)
    at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
    at sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(ClassRepository.java:108)
    at java.lang.Class.getGenericInterfaces(Class.java:913)
    at org.jboss.weld.util.reflection.HierarchyDiscovery.discoverInterfaces(HierarchyDiscovery.java:143)
    at org.jboss.weld.util.reflection.HierarchyDiscovery.discoverFromClass(HierarchyDiscovery.java:139)
    at org.jboss.weld.util.reflection.HierarchyDiscovery.discoverTypes(HierarchyDiscovery.java:111)
    at org.jboss.weld.util.reflection.HierarchyDiscovery.<init>(HierarchyDiscovery.java:93)
    at org.jboss.weld.util.reflection.HierarchyDiscovery.<init>(HierarchyDiscovery.java:86)
    at org.jboss.weld.annotated.enhanced.TypeClosureLazyValueHolder.computeValue(TypeClosureLazyValueHolder.java:43)
    at org.jboss.weld.annotated.enhanced.TypeClosureLazyValueHolder.computeValue(TypeClosureLazyValueHolder.java:33)
    at org.jboss.weld.util.LazyValueHolder.get(LazyValueHolder.java:49)
    at org.jboss.weld.annotated.slim.backed.BackedAnnotated.getTypeClosure(BackedAnnotated.java:27)
    at org.jboss.weld.annotated.enhanced.jlr.AbstractEnhancedAnnotated.getTypeClosure(AbstractEnhancedAnnotated.java:203)
    at org.jboss.weld.util.Beans.getTypes(Beans.java:437)
    at org.jboss.weld.bean.attributes.BeanAttributesFactory$BeanAttributesBuilder.<init>(BeanAttributesFactory.java:113)
    at org.jboss.weld.bean.attributes.BeanAttributesFactory$BeanAttributesBuilder.<init>(BeanAttributesFactory.java:93)
    at org.jboss.weld.bean.attributes.BeanAttributesFactory.forBean(BeanAttributesFactory.java:70)
    at org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:260)
    at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:226)
    at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:74)
    at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:71)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)

2018-02-27 01:47:05,090 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 6) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "java-ee-kickoff-app.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"java-ee-kickoff-app.war\".WeldStartService" => "Failed to start service
    Caused by: java.lang.reflect.MalformedParameterizedTypeException"}}
2018-02-27 01:47:05,092 ERROR [org.jboss.as.server] (External Management Request Threads -- 6) WFLYSRV0021: Deploy of deployment "java-ee-kickoff-app.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"java-ee-kickoff-app.war\".WeldStartService" => "Failed to start service
    Caused by: java.lang.reflect.MalformedParameterizedTypeException"}}

``

Logicko commented 6 years ago

I tried with JSF 2.2 and Wildfly 10.1.0.Final without success! Has anyone here deployed this app on wildfly with mysql ??

I want to know if this skeleton can be used in production environnement

Thanks

BalusC commented 6 years ago

Duplicates #17 and #20.

Logicko commented 6 years ago

It's not a duplicate : there is a problem with data source defined in web.xml ! I deployed the app on wildfly 10.1.0 without problem but when I disabled the data source in web.xml...(I defined data source on server side)

So there is an issue needs a solution. You can not close an issue without providing a solution.

BalusC commented 6 years ago

You're describing the first error. Your second comment on this issue confirms that you've "resolved" it.