I do not understand but the main page works.
When the code is executing in EJB:
[code]
try {
// String className = "org.gjt.mm.mysql.Driver";
String className = "com.mysql.jdbc.Driver";
Class driverObject = Class.forName(className);
System.out.println("driverObject=" + driverObject);
System.out.println("your installation of JDBC Driver OK.");
} catch (Exception e) {
System.out.println("Failed: JDBC Driver Error: " + e.getMessage());
}
[\code]
I see in console :
22:07:26,027 INFO [stdout] (default task-4) Failed: JDBC Driver Error: com.mysql.jdbc.Driver from [Module "deployment.jsf-managedBean-and-ejb.war:main" from Service Module Loader]
When the server is started:
[code]
$ Pobrane/wildfly-8.2.0.Final/bin/standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/pioflor/Pobrane/wildfly-8.2.0.Final
JAVA: java
JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
=========================================================================
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
22:39:32,464 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
22:39:32,871 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
22:39:32,992 INFO [org.jboss.as] (MSC service thread 1-2) JBAS015899: WildFly 8.2.0.Final "Tweek" starting
22:39:34,975 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found jsf-managedBean-and-ejb.war in deployment directory. To trigger deployment create a file called jsf-managedBean-and-ejb.war.dodeploy
22:39:35,006 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
22:39:35,046 INFO [org.xnio] (MSC service thread 1-2) XNIO version 3.3.0.Final
22:39:35,085 INFO [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.3.0.Final
22:39:35,193 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 4 core threads with 32 task threads based on your 2 available processors
22:39:35,198 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
22:39:35,273 INFO [org.jboss.as.connector.logging] (MSC service thread 1-4) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
22:39:35,275 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
22:39:35,309 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
22:39:35,323 INFO [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
22:39:35,347 WARN [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
22:39:35,356 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
22:39:35,411 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010417: Started Driver service with driver-name = h2
22:39:35,424 INFO [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 4.0.6.Final
22:39:35,426 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
22:39:35,471 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 27) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "mysql")
]) - failure description: "JBAS010441: Failed to load module for driver [com.mysql.jdbc]"
22:39:35,487 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.1.0.Final starting
22:39:35,501 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017502: Undertow 1.1.0.Final starting
22:39:35,507 INFO [org.jboss.as.security] (MSC service thread 1-3) JBAS013170: Current PicketBox version=4.0.21.Final
22:39:35,642 INFO [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
22:39:35,643 INFO [org.jboss.as.mail.extension] (MSC service thread 1-3) JBAS015400: Bound mail session [java:jboss/mail/Default]
22:39:36,092 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path /home/pioflor/Pobrane/wildfly-8.2.0.Final/welcome-content
22:39:36,232 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS017525: Started server default-server.
22:39:36,308 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017531: Host default-host starting
22:39:36,504 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017519: Undertow HTTP listener default listening on /127.0.0.1:8080
22:39:36,804 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory /home/pioflor/Pobrane/wildfly-8.2.0.Final/standalone/deployments
22:39:36,834 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "jsf-managedBean-and-ejb.war" (runtime-name: "jsf-managedBean-and-ejb.war")
22:39:37,194 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
22:39:37,567 INFO [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
22:39:38,060 INFO [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011401: Read persistence.xml for jsf-managedBean-and-ejb
22:39:38,247 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 50) JBAS011409: Starting Persistence Unit (phase 1 of 2) Service 'jsf-managedBean-and-ejb.war#jsf-managedBean-and-ejb'
22:39:38,260 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 50) HHH000204: Processing PersistenceUnitInfo [
name: jsf-managedBean-and-ejb
...]
22:39:38,346 INFO [org.hibernate.Version] (ServerService Thread Pool -- 50) HHH000412: Hibernate Core {4.3.7.Final}
22:39:38,348 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 50) HHH000206: hibernate.properties not found
22:39:38,351 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 50) HHH000021: Bytecode provider name : javassist
22:39:38,790 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment jsf-managedBean-and-ejb.war
22:39:38,890 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-2) HV000001: Hibernate Validator 5.1.3.Final
22:39:39,009 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named CalculatorImpl in deployment unit deployment "jsf-managedBean-and-ejb.war" are as follows:
java:global/jsf-managedBean-and-ejb/CalculatorImpl!org.superbiz.jsf.Calculator
java:app/jsf-managedBean-and-ejb/CalculatorImpl!org.superbiz.jsf.Calculator
java:module/CalculatorImpl!org.superbiz.jsf.Calculator
java:jboss/exported/jsf-managedBean-and-ejb/CalculatorImpl!org.superbiz.jsf.Calculator
java:global/jsf-managedBean-and-ejb/CalculatorImpl
java:app/jsf-managedBean-and-ejb/CalculatorImpl
java:module/CalculatorImpl
22:39:39,569 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: jsf-managedBean-and-ejb.war
22:39:39,619 INFO [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900: 2.2.6 (Final)
22:39:39,682 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment jsf-managedBean-and-ejb.war
22:39:39,995 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 50) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'jsf-managedBean-and-ejb.war#jsf-managedBean-and-ejb'
22:39:40,126 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 50) HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
22:39:40,801 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 50) HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
22:39:40,813 WARN [org.hibernate.dialect.H2Dialect] (ServerService Thread Pool -- 50) HHH000431: Unable to determine H2 database version, certain features may not work
22:39:40,911 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 50) HHH000397: Using ASTQueryTranslatorFactory
22:39:43,444 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initializing Mojarra 2.2.8-jbossorg-1 20140822-1131 for context '/jsf-managedBean-and-ejb'
22:39:44,975 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017534: Registered web context: /jsf-managedBean-and-ejb
22:39:44,993 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "newdatabase")
]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:/newdatabase is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/newdatabase is missing [jboss.jdbc-driver.mysql]"
]}
22:39:45,001 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "newdatabase")
]) - failure description: {
"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:/newdatabase is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/newdatabase is missing [jboss.jdbc-driver.mysql]"
],
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.data-source.reference-factory.newdatabase",
"jboss.naming.context.java.newdatabase"
],
"Services that may be the cause:" => ["jboss.jdbc-driver.mysql"]
}
}
22:39:45,118 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "jsf-managedBean-and-ejb.war" (runtime-name : "jsf-managedBean-and-ejb.war")
22:39:45,123 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.driver-demander.java:/newdatabase, service jboss.data-source.java:/newdatabase]
22:39:45,229 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
22:39:45,229 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
22:39:45,230 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: WildFly 8.2.0.Final "Tweek" started (with errors) in 13269ms - Started 739 of 796 services (4 services failed or missing dependencies, 92 services are lazy, passive or on-demand)
[\code]
It seems that JBoss is still not connected to MySQL?
I found this website https://issues.jboss.org/browse/WFLY-3646
Does this mean that this is a bug in this version?