Porting Oracle’s “First Cup” Tutorial to Wildfly / JBoss

  JBoss, Tutorial, Wildfly

Troubles ? Sese Checklist

23:30:17,027 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment firstcup-war.war
23:30:17,028 INFO [org.hibernate.orm.deprecation] (ServerService Thread Pool — 146) HHH90000001: Found usage of deprecated setting for specifying Scanner [hibernate.ejb.resource_scanner]; use [hibernate.archive.scanner] instead
23:30:17,031 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-1) WFLYEJB0473: JNDI bindings for session bean named ‘DukesBirthdayBean’ in deployment unit ‘deployment “firstcup-war.war”‘ are as follows:

java:global/firstcup-war/DukesBirthdayBean!org.firstcup.war.ejb.DukesBirthdayBean
java:app/firstcup-war/DukesBirthdayBean!org.firstcup.war.ejb.DukesBirthdayBean
java:module/DukesBirthdayBean!org.firstcup.war.ejb.DukesBirthdayBean
java:global/firstcup-war/DukesBirthdayBean
java:app/firstcup-war/DukesBirthdayBean
java:module/DukesBirthdayBean

23:30:17,052 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool — 146) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
23:30:17,053 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool — 146) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
23:30:17,053 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool — 146) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
23:30:17,053 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool — 146) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
23:30:17,055 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
23:30:17,055 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0006: Starting Services for CDI deployment: firstcup-war.war
23:30:17,056 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = firstcup-war.war_org.h2.Driver_1_4
23:30:17,056 INFO [org.jboss.weld.deployer] (MSC service thread 1-7) WFLYWELD0009: Starting weld service for deployment firstcup-war.war

23:30:17,063 INFO [org.jboss.as.jpa] (ServerService Thread Pool — 148) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service ‘firstcup-war.war#PUnit’
23:30:17,066 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool — 148) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
23:30:17,071 INFO [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool — 148) Envers integration enabled? : true
23:30:17,073 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool — 146) WFLYCLINF0002: Started client-mappings cache from ejb container
23:30:17,091 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool — 148) HHH000227: Running hbm2ddl schema export
23:30:17,094 INFO [stdout] (ServerService Thread Pool — 148) Hibernate: drop table FirstcupUser if exists

23:30:17,097 INFO [stdout] (ServerService Thread Pool — 148) Hibernate: drop sequence if exists hibernate_sequence

23:30:17,098 INFO [stdout] (ServerService Thread Pool — 148) Hibernate: create sequence hibernate_sequence start with 1 increment by 1

23:30:17,098 INFO [stdout] (ServerService Thread Pool — 148) Hibernate: create table FirstcupUser (id bigint not null, ageDifference integer not null, birthday date, primary key (id))

23:30:17,099 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool — 148) HHH000230: Schema export complete
23:30:17,099 INFO [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool — 148) HHH000397: Using ASTQueryTranslatorFactory
23:30:17,189 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool — 148) Mojarra 2.2.12-jbossorg-2 20150729-1131 für Kontext ‘/firstcup-war’ wird initialisiert.
23:30:17,526 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool — 148) WFLYUT0021: Registered web context: /firstcup-war
23:30:17,534 INFO [org.jboss.as.server] (management-handler-thread – 40) WFLYSRV0010: Deployed “firstcup-war.war” (runtime-name : “firstcup-war.war”)
23:30:47,932 INFO [org.firstcup.war.ejb.DukesBirthdayBean] (default task-19) Raw ageDifference is: 35
23:30:47,982 INFO [stdout] (default task-19) Hibernate: call next value for hibernate_sequence

23:30:48,005 INFO [org.firstcup.war.ejb.DukesBirthdayBean] (default task-19) Final ageDifference is: 35
23:30:48,013 INFO [stdout] (default task-19) Hibernate: insert into FirstcupUser (ageDifference, birthday, id) values (?, ?, ?)

23:30:48,019 INFO [org.firstcup.war.web.DukesBDay] (default task-19) age diff from dukesbday 35
23:30:48,020 INFO [org.firstcup.war.web.DukesBDay] (default task-19) absAgeDiff 35
23:30:48,028 INFO [stdout] (default task-19) Hibernate: select avg(cast(firstcupus0_.ageDifference as double)) as col_0_0_ from FirstcupUser firstcupus0_

23:30:48,033 INFO [org.firstcup.war.ejb.DukesBirthdayBean] (default task-19) Average age difference is: 35
23:30:48,033 INFO [org.firstcup.war.web.DukesBDay] (default task-19) averageAgeDifference 35

The dom4j Exception was caused by having an incorrect port number in the element in standalone.xml. When I corrected the port number I could deploy and enable the entity .jar file.

I tried to reproduce this problem by undeploying the entity .jar file, stopping JBoss, and putting the incorrect port number in the element. This time I got a meaningful
Exception showing that JBoss could not obtain a managed connection for the .

The meaningless dom4j Exception only occurs before the archive gets deployed for the first time with the correct datasource. On subsequent deployments if the wrong datasource port is specified JBoss gives a meaningful exception. The meaningless exception goes away after the archive is deployed the first time with the correct datasource.

LEAVE A COMMENT