Wildfly - "Connector 'netty' not found on the main configuration file" - java

I've added a connection factory at the standalone-full file of Wildfly:
<jms-connection-factories>
<connection-factory name="K19Factory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="K19Factory"/>
<entry name="java:jboss/exported/jms/K19Factory"/>
</entries>
</connection-factory>
...
</jms-connection-factories>
And I have the following code to use it:
Properties props = new Properties();
props.setProperty("java.naming.factory.initial","org.jboss.naming.remote.client.InitialContextFactory");
props.setProperty("java.naming.provider.url", "http-remoting://127.0.0.1:8080/");
/*props.setProperty("java.naming.provider.url","remote://localhost:8080");*/
props.setProperty("java.naming.security.principal","k19");
props.setProperty("java.naming.security.credentials","1234");
InitialContext ic = new InitialContext(props);
// factory of JMS connections
ConnectionFactory factory = (ConnectionFactory)ic.lookup("jms/K19Factory");
But I'm facing problems. Widfly is saying it can't find the Netty connector, so it can't create the connection factory.
...
17:07:02,316 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 62) JBAS011601: Bound messaging object to jndi name queue/pedidos
17:07:02,331 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 57) HQ221003: trying to deploy queue jms.topic.noticias
17:07:02,347 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 57) JBAS011601: Bound messaging object to jndi name topic/noticias
17:07:02,331 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 61) MSC000001: Failed to start service jboss.messaging.default.jms.connection-factory.K19Factory: org.jboss.msc.service.StartException in service jboss.messaging.default.jms.connection-factory.K19Factory: JBAS011639: Failed to create connection-factory
at org.jboss.as.messaging.jms.ConnectionFactoryService$1.run(ConnectionFactoryService.java:69) [wildfly-messaging-8.2.0.Final.jar:8.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_31]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_31]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.1.Final.jar:2.1.1.Final]
Caused by: HornetQIllegalStateException[errorType=ILLEGAL_STATE message=HQ129005: Connector 'netty' not found on the main configuration file]
at org.hornetq.jms.server.impl.JMSServerManagerImpl.internalCreateCFPOJO(JMSServerManagerImpl.java:1421) [hornetq-jms-server-2.4.5.Final.jar:]
at org.hornetq.jms.server.impl.JMSServerManagerImpl.internalCreateCF(JMSServerManagerImpl.java:1368) [hornetq-jms-server-2.4.5.Final.jar:]
at org.hornetq.jms.server.impl.JMSServerManagerImpl.access$1300(JMSServerManagerImpl.java:107) [hornetq-jms-server-2.4.5.Final.jar:]
at org.hornetq.jms.server.impl.JMSServerManagerImpl$5.runException(JMSServerManagerImpl.java:1215) [hornetq-jms-server-2.4.5.Final.jar:]
at org.hornetq.jms.server.impl.JMSServerManagerImpl.runAfterActive(JMSServerManagerImpl.java:1906) [hornetq-jms-server-2.4.5.Final.jar:]
at org.hornetq.jms.server.impl.JMSServerManagerImpl.createConnectionFactory(JMSServerManagerImpl.java:1201) [hornetq-jms-server-2.4.5.Final.jar:]
at org.jboss.as.messaging.jms.ConnectionFactoryService$1.run(ConnectionFactoryService.java:66) [wildfly-messaging-8.2.0.Final.jar:8.2.0.Final]
... 4 more
17:07:02,347 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 57) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/topic/noticias
17:07:02,347 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 59) HQ221003: trying to deploy queue jms.queue.DLQ
17:07:02,347 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 59) JBAS011601: Bound messaging object to jndi name java:/jms/queue/DLQ
17:07:02,347 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 60) HQ221003: trying to deploy queue jms.queue.ExpiryQueue
17:07:02,347 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 60) JBAS011601: Bound messaging object to jndi name java:/jms/queue/ExpiryQueue
17:07:02,347 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 58) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
17:07:02,472 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-8) JBAS010406: Registered connection factory java:/JmsXA
17:07:02,488 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
17:07:02,545 INFO [org.hornetq.ra] (MSC service thread 1-8) HornetQ resource adaptor started
17:07:02,545 INFO [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-8) IJ020002: Deployed: file://RaActivatorhornetq-ra
17:07:02,545 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-3) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
17:07:02,545 INFO [org.jboss.as.messaging] (MSC service thread 1-5) JBAS011601: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
17:07:02,545 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "messaging"),
("hornetq-server" => "default"),
("connection-factory" => "K19Factory")
]) - failure description: {"JBAS014671: Failed services" => {"jboss.messaging.default.jms.connection-factory.K19Factory" => "org.jboss.msc.service.StartException in service jboss.messaging.default.jms.connection-factory.K19Factory: JBAS011639: Failed to create connection-factory
Caused by: HornetQIllegalStateException[errorType=ILLEGAL_STATE message=HQ129005: Connector 'netty' not found on the main configuration file]"}}
17:07:02,623 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.messaging.default.jms.connection-factory.K19Factory: org.jboss.msc.service.StartException in service jboss.messaging.default.jms.connection-factory.K19Factory: JBAS011639: Failed to create connection-factory
Can someone give me a hand on it?

This error is due the fact that you are referencing a non-existent connector. By default does not exist a netty-connector, but other such as http-connector.
'Cause you're using standalone-full, I'll consider that org.jboss.as.messaging module is enabled.
First, we have to include an acceptor, responsible by accepting connections that will be made to the server. For this, in the messaging subsystem (XML namespace urn:jboss:domain:messaging:2.0) find acceptorstag and add this:
<netty-acceptor name="netty" socket-binding="messaging" />
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
After this, we have to include a connector, responsible by transport configurations (how to connect) on the server. For this, in the messaging subsystem (XML namespace urn:jboss:domain:messaging:2.0) find connectorstag and add this:
<netty-connector name="netty" socket-binding="messaging" />
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
Finally you have to configure the socket binding. Find socket-binding-group tag and include this:
<socket-binding name="messaging" port="5445"/>
<socket-binding name="messaging-throughput" port="5455"/>
See also the documentation of JBoss EAP (Obs.: there are differences in the EAP settings for Wildfly/AS Community, especially directories, but overall it is a good reference) and of Wildfly for more detailed configuration of messaging system.
Given this setting and your connection-factory, this code should works:
final Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
props.setProperty(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
props.setProperty(Context.SECURITY_PRINCIPAL, "user"); // add an application user before
props.setProperty(Context.SECURITY_CREDENTIALS, "user1234");
final InitialContext ic = new InitialContext(props);
final ConnectionFactory factory = (ConnectionFactory) ic.lookup("jms/K19Factory");
System.out.println(factory != null ? "Factory is not null" : "Factory is null");
This is the log of lookup (source above):
Jun 02, 2015 7:18:13 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.0.Final
Jun 02, 2015 7:18:13 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.1.Final
Jun 02, 2015 7:18:13 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.0.Final
Factory is not null
And this is the log in WildFly:
19:18:13,731 INFO [org.jboss.as.naming] (default task-35) JBAS011806: Channel end notification received, closing channel Channel ID 24a74dfb (inbound) of Remoting connection 29a8f328 to /127.0.0.1:63595
To run this example you may need these dependencies in yout classpath:
jboss-remote-naming
hornetq-jms-client
a XNIO provider, like xnio-nio

WildFly leverages Servlet's protocol upgrade feature to drive all traffic over http/https. You should see by default some connectors in your xml like this
<connectors>
<http-connector name="http-connector" socket-binding="http">
<param key="http-upgrade-endpoint" value="http-acceptor"/>
</http-connector>
<http-connector name="http-connector-throughput" socket-binding="http">
<param key="http-upgrade-endpoint" value="http-acceptor-throughput"/>
<param key="batch-delay" value="50"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
With these, you get a http connector and in-vm connector. Based on the contents here I don't see a netty connector available. You should ideally stick with the http and in-vm connectors, for performance reasons.

Related

Unable to add SQL Server DataSource in JBoss EAP 7.2

I am trying to add an SQL Server datasource in JBoss EAP 7.2 through the management console. However, the Test Connection operation is failing. Below are the version details:
JBoss EAP - 7.2
MSSQL Driver Jar - mssql-jdbc-6.1.0.jre8.jar
Module.xml:
<module name="com.microsoft.sqlserver" xmlns="urn:jboss:module:1.3">
<resources>
<resource-root path="mssql-jdbc-6.1.0.jre8.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
Module Directory Structure:
jboss-eap-7.2\modules\system\layers\base\com\microsoft\sqlserver\main
Standalone.xml Datasource and Driver Configuration:
<datasource jndi-name="java:/MSSQLDS" pool-name="MSSQLDS">
<connection-url>jdbc:sqlserver://192.168.XX.XX;DatabaseName=MYTESTDB1</connection-url>
<datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>
<driver>sqlserver</driver>
<security>
<user-name>mydb_xxxx</user-name>
<password>xxxxxxxx</password>
</security>
</datasource>
<driver name="sqlserver" module="com.microsoft.sqlserver">
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
<datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>
</driver>
Server Logs:
13:21:52,267 WARN [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) IJ020020: Connection Properties for DataSource: 'java:/MSSQLDS' is empty, try to use driver-class: 'com.microsoft.sqlserver.jdbc.SQLServerDriver' and connection-url: 'jdbc:sqlserver://192.168.XX.XX;DatabaseName=MYTESTDB1' to connect database
13:21:52,279 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
13:21:52,279 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:/MSSQLDS]
13:21:52,640 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
13:21:52,803 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 5.2.4.Final-redhat-00001 (Apache CXF 3.2.5.redhat-00001)
13:21:54,308 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-7) ISPN000128: Infinispan version: Infinispan 'Estrella Galicia' 9.3.3.Final-redhat-00001
13:21:54,598 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 72) WFLYCLINF0002: Started client-mappings cache from ejb container
13:21:54,792 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
13:21:54,924 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
13:21:54,929 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.2.0.GA (WildFly Core 6.0.11.Final-redhat-00001) started in 8695ms - Started 477 of 663 services (333 services are lazy, passive or on-demand)
13:22:21,345 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External Management Request Threads -- 1) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1326)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:499)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:1067)
at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:93)
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:240)
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:97)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1411)
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:423)
at org.jboss.as.controller.ModelControllerImpl.lambda$execute$1(ModelControllerImpl.java:243)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:265)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:231)
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:243)
at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:212)
at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:93)
at org.jboss.as.domain.http.server.security.ElytronIdentityHandler.lambda$handleRequest$0(ElytronIdentityHandler.java:62)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:289)
at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:246)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
at org.jboss.as.domain.http.server.security.ElytronIdentityHandler.handleRequest(ElytronIdentityHandler.java:61)
at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:206)
at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:257)
at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2385)
at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:567)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1955)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1616)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1447)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:788)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(SQLServerDataSource.java:719)
at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(SQLServerDataSource.java:79)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:314)
... 35 more
13:22:21,350 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "MSSQLDS")
]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid"
Update -
Even though i have specified the IP address of my database, JBoss is trying to connect to localhost instead of that IP.
I have verified and ruled out any network / firewall related problems. Through a sample Java/SpringBoot project, i am able to open a JDBC connection to the database. However, the datasource creation from JBoss is failing.
Found the solution finally. It’s a problem with Wildfly when the datasource-class is used while adding the driver module.
With the datasource class, explicit connection properties are required and the connection-url tag is “effectively” ignored. By “effectively” ignored, I mean JBoss erroneously expects connection-url tag to be present and just ignores it.
This issue has been called out in issues - WFLY-6157 and WFLY-6200.
This is a little bit late but the solution can be found in redhat solutions. The issue is when defining non-XA datasource, datasource-class has been define in the datasource setup.
So what I did is goto admin console > configuration > subsystems > Datasource & drivers > Datasources > < datasource name > > click view.
on the attributes tab > click edit > delete the value in Datasource Class > save and reload server.
Test your connection now and it should be successful.
Solution for me, edit file standalone.xml:
<datasource jndi-name="java:jboss/datasources/SqlServerdb" pool-name="SqlServerdb" statistics-enabled="true">
<datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>
<connection-property name="databaseName">
DATABASENAME
</connection-property>
<connection-property name="ServerName">
IP(WITHOUT PORT)
</connection-property>
<driver>sqlserver</driver>
<security>
<user-name>USER</user-name>
<password>PASSWORD</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>
<background-validation>true</background-validation>
</validation>
</datasource>
and:
<driver name="sqlserver" module="com.microsoft.sqlserver">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
</driver>
Taking into account Vaibhav1988's comments about "the datasource class needs explicit connection properties", in my case the solution was adding the following 2 properties under the datasource configuration:
databaseName=
ServerName=
In the Management Console go to "Subsystems" -> "Datasources & Drivers" -> "Datasources" then click on "View" in your datasource, go to "Connection" tab, click on "Edit" and add the properties in the field that says "Connection Properties".

jboss error: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V

I'm trying to create a simple hello world java web application that is using JPA through hibernate and using JBoss 6.4.0 as application Server. The application has been created through maven. Furthermore I'm using Intellij as an IDE. However when I run the application Server I receive the following error:
16:09:04,772 INFO [org.hibernate.Version] (ServerService Thread Pool -- 25) HHH000412: Hibernate Core {5.3.7.Final}
16:09:04,774 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 25) HHH000206: hibernate.properties not found
16:09:04,970 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 25) HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
16:09:05,141 WARN [org.hibernate.orm.connections.pooling] (ServerService Thread Pool -- 25) HHH10001002: Using Hibernate built-in connection pool (not for production use!)
16:09:05,145 INFO [org.hibernate.orm.connections.pooling] (ServerService Thread Pool -- 25) HHH10001005: using driver [com.mysql.cj.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/testdb]
16:09:05,146 INFO [org.hibernate.orm.connections.pooling] (ServerService Thread Pool -- 25) HHH10001001: Connection properties: {user=smattes, password=****}
16:09:05,147 INFO [org.hibernate.orm.connections.pooling] (ServerService Thread Pool -- 25) HHH10001003: Autocommit mode: false
16:09:05,150 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 25) MSC000001: Failed to start service jboss.persistenceunit.javahelloworld#NewPersistenceUnit: org.jboss.msc.service.StartException in service jboss.persistenceunit.javahelloworld#NewPersistenceUnit: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_191]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_191]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_191]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.2.Final-redhat-1.jar:2.1.2.Final-redhat-1]
Caused by: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections.<init>(DriverManagerConnectionProviderImpl.java:276)
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections.<init>(DriverManagerConnectionProviderImpl.java:260)
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl$PooledConnections$Builder.build(DriverManagerConnectionProviderImpl.java:401)
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.buildPool(DriverManagerConnectionProviderImpl.java:112)
at org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:75)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:100)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:246)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66)
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:94)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:179)
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:119)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:904)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:935)
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
... 4 more
16:09:05,164 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014612: Operation ("deploy") failed - address: ([("deployment" => "javahelloworld")]) - failure description: {"JBAS014671: Failed services" => {"jboss.persistenceunit.javahelloworld#NewPersistenceUnit" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.javahelloworld#NewPersistenceUnit: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V
Caused by: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V"}}
16:09:05,179 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "javahelloworld.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.persistenceunit.javahelloworld#NewPersistenceUnit" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.javahelloworld#NewPersistenceUnit: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V
Caused by: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;I)V"}}
16:09:05,211 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015877: Stopped deployment javahelloworld (runtime-name: javahelloworld.war) in 42ms
16:09:05,213 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
The persistence.xml file is the following:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" version="2.1">
<persistence-unit name="NewPersistenceUnit">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>jpa.AuthorsEntity</class>
<class>jpa.UserEntity</class>
<properties>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/testdb"/>
<property name="hibernate.connection.driver_class" value="com.mysql.cj.jdbc.Driver"/>
<property name="hibernate.connection.username" value="myusername"/>
<property name="hibernate.connection.password" value="mypassword"/>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hbm2ddl.auto" value="update"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2400Dialect"/>
</properties>
</persistence-unit>
</persistence>
and the jpa.AuthorsEntity and jpa.UserEntity are two java Entity classes that correspond to the tables authors and user correspondingly.
Any help would be appreciated.
Such errors are typically caused by having different versions of a library on the compile time and runtime classpath.
Application servers - such as JBoss - typically provide their own versions of the Hibernate libraries at runtime. This version is then most likely incompatible with the compile time version specified in your POM.
JBoss AS 6.4 only supports JPA spec 2. You can then either roll-back the compile time Hibernate version in your POM to be compatible with the runtime dependency supplied by JBoss or, if you really need JPA 2.1 features, tell JBoss you are bundling the Hibernate libraries with your app.
For the former approach, this document indicates EAP 6.4 supports Hibarnate 4.2.18.Final
https://access.redhat.com/articles/112673#EAP_6
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.2.18.Final</version>
<!-- Don't bundle in the WAR as provided by the server -->
<scope>provided</scope>
</dependency>
Check there are no hibernate libs in the deployed war (as a result of transitive dependencies for example).
For the latter approach see here:
https://issues.jboss.org/browse/WFCORE-209?_sscc=t
for future readers, recently i had this issues, i had in the project the hibernate version 5.1 with glassfish 4.1 and it is generated this issues, for resolved i agregated in the WEB-INF folder the file glassfish-web.xml
as i showing to continuation
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<class-loader delegate="false"/>
</glassfish-web-app>

JDBC_PING on infinispan server not working

I'm in phase of experimentation with infinispan server and I have a problem in set-up a infinispan cluster on my local machine.
Configuration files:
I change configuration file cluster.xml by changing part of jgroup stack with udp stack and jdbc_ping discovery.
<subsystem xmlns="urn:infinispan:server:jgroups:7.0" default-stack="${jboss.default.jgroups.stack:udp-jdbc}">
<stack name="udp-jdbc">
<transport type="UDP" socket-binding="jgroups-udp">
<property name="ip_mcast">false</property>
</transport>
<protocol type="JDBC_PING">
<property name="connection_url">jdbc:mysql://localhost/jgroups</property>
<property name="connection_username">root</property>
<property name="connection_password">root</property>
<property name="connection_driver">com.mysql.jdbc.Driver</property>
</protocol>
<protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="UFC"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
<protocol type="RSVP"/>
</stack>
I put mysql driver in folder standalone/deployments, run the server and here is what I have as output
20:13:15,389 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "mysql-connector-java-5.1.34-bin.jar" (runtime-name: "mysql-connector-java-5.1.34-bin.jar")
20:13:15,461 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.jgroups.channel.clustered: org.jboss.msc.service.StartException in service jboss.jgroups.channel.clustered: java.lang.IllegalArgumentException: JDBC Driver required for JDBC_PING protocol could not be loaded: 'com.mysql.jdbc.Driver'
at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:74)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_25]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_25]
Caused by: java.lang.IllegalArgumentException: JDBC Driver required for JDBC_PING protocol could not be loaded: 'com.mysql.jdbc.Driver'
at org.jgroups.protocols.JDBC_PING.loadDriver(JDBC_PING.java:267)
at org.jgroups.protocols.JDBC_PING.init(JDBC_PING.java:93)
at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:860)
at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:481)
at org.jgroups.JChannel.init(JChannel.java:848)
at org.jgroups.JChannel.<init>(JChannel.java:159)
at org.jboss.as.clustering.jgroups.JChannelFactory.createChannel(JChannelFactory.java:87)
at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:69)
... 5 more
20:13:15,559 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
20:13:15,561 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
20:13:15,563 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) JBAS010417: Started Driver service with driver-name = mysql-connector-java-5.1.34-bin.jar_com.mysql.jdbc.Driver_5_1
20:13:15,564 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010417: Started Driver service with driver-name = mysql-connector-java-5.1.34-bin.jar_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
20:13:15,597 INFO [org.jboss.as.server] (ServerService Thread Pool -- 18) JBAS018559: Deployed "mysql-connector-java-5.1.34-bin.jar" (runtime-name : "mysql-connector-java-5.1.34-bin.jar")
20:13:15,599 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.jgroups.channel.clustered: org.jboss.msc.service.StartException in service jboss.jgroups.channel.clustered: java.lang.IllegalArgumentException: JDBC Driver required for JDBC_PING protocol could not be loaded: 'com.mysql.jdbc.Driver'
As you can see from the jboss log, the subsystem infinispan:server:jgroups failed to start because the JDBC driver isn't loaded (required by JDBC_PING), but after that step infinispan server successfully deployed mysql jdbc driver. This same error occupy in conditions where I work with datasource.
Is there any way to tell the infinispan:server:jgroups subsystem to be started before driver loading or before jndi naming creation ?
Or any workaround that will help
Thanks in advance
For direct JDBC use, you need to allow JGroups module to load your JDBC driver module. To do that, install JDBC driver jar as a module, then open modules/system/layers/base/org/jgroups/main/module.xml, add your JDBC driver module under the dependencies section.
For datasource lookup with EAGER caches, I think it's currently not possible to ensure that the datasource is available before JGroups tries to use it. The services boot order is controlled by programmatic dependencies but there is no way to declare the dependencies through config files so JGroups doesn't wait for the datasource.

Access HornetQ Connection Factory (Locally) via JNDI in JBoss EAP 6.2.0

I'v deployed a web application (jms-api.war) in JBoss, and I want to get a JMS connection factory via JNDI from it, Is it possible without any configuration (like this)? I tried to use JNDI without any configuration:
my connection factory in standalone.xml:
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
</connection-factory>
</jms-connection-factories>
And in my application i have this spring bean to access connection factory (It's working in my tests with embedded hornetq):
<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="/ConnectionFactory" />
<property name="resourceRef" value="true"/>
</bean>
In jboss startup i get this error, how can i solve it?:
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.resources.jms.ConnectionFactory (missing) dependents: [service jboss.naming.context.java.module.jms-api.jms-api.env.jms.ConnectionFactory]
Jboss log (hornetq start part):
11:00:32,689 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221000: live server is starting with configuration HornetQ Configuration (clustered=false,backup=false,sharedStore=true,journalDirectory=C:\Users\Mojtaba\workspace-hornetq\build\appserver\jboss\standalone\data\../../../hornetqdata/journal,bindingsDirectory=C:\Users\Mojtaba\workspace-hornetq\build\appserver\jboss\standalone\data\../../../hornetqdata/bindings,largeMessagesDirectory=C:\Users\Mojtaba\workspace-hornetq\build\appserver\jboss\standalone\data\../../../hornetqdata/large-message,pagingDirectory=C:\Users\Mojtaba\workspace-hornetq\build\appserver\jboss\standalone\data\../../../hornetqdata/paging)
11:00:32,691 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221006: Waiting to obtain live lock
11:00:32,723 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221013: Using NIO Journal
11:00:32,840 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221034: Waiting to obtain live lock
11:00:32,841 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221035: Live Server Obtained live lock
11:00:33,041 INFO [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on 127.0.0.1:9999
11:00:33,777 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221020: Started Netty Acceptor version 3.6.6.Final-redhat-1-fd3c6b7 0.0.0.0:5445 for CORE protocol
11:00:33,779 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221007: Server is now live
11:00:33,780 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 50) HQ221001: HornetQ Server version 2.3.12.Final (2.3.12, 123) [c0d4ec44-d8d5-11e3-afd6-5372513ac770]
11:00:33,786 INFO [org.hornetq.jms.server] (ServerService Thread Pool -- 50) HQ121005: Invalid "host" value "0.0.0.0" detected for "netty" connector. Switching to "Mojtaba-PC". If this new address is incorrect please manually configure the connector to use the proper one.
11:00:33,811 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 50) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
11:00:33,812 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 50) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory
11:00:33,815 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 52) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
11:00:33,816 INFO [org.hornetq.core.server] (ServerService Thread Pool -- 51) HQ221003: trying to deploy queue jms.queue.testQueue
11:00:34,115 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 51) JBAS011601: Bound messaging object to jndi name java:/queue/testQueue
11:00:34,116 INFO [org.jboss.as.messaging] (ServerService Thread Pool -- 51) JBAS011601: Bound messaging object to jndi name java:jboss/exported/queues/testQueue
11:00:34,195 INFO [org.jboss.as.server] (ServerService Thread Pool -- 27) JBAS018559: Deployed "jms-api.war" (runtime-name : "jms-api.war")
11:00:34,199 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.resources.jms.ConnectionFactory (missing) dependents: [service jboss.naming.context.java.module.jms-api.jms-api.env.jms.ConnectionFactory]
(jboss eap 6.2.0, hornetq 2.3.12.Final)
Though I have not yet worked with v6.2 but you can try this. The error was unable to find your connection factory via JNDI tree. So, add below in your already listed entry:
<entries>
<entry name="java:/ConnectionFactory"/>
<!-- Add this -->
<entry name="java:jboss/exported/ConnectionFactory"/>
</entries>
And change connector ref from in-vm to netty
The easiest solution is to change your bean configuration:
<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/ConnectionFactory" />
<property name="resourceRef" value="false"/>
</bean>
If resourceRef is true, then Spring will attempt to look up "java:comp/env/ConnectionFactory", (or perhaps even "java:comp/env//ConnectionFactory"), because that is what correct resource references look like to all JavaEE containers (not just JBoss).
If you want to use resource references, you must declare them in your web.xml file and map them in a jboss-web.xml file.
You would typically do this when you're trying to write code that must be portable between different JavaEE server implementations. They all have their own variation of jboss-web.xml to map between the constant resource reference name and the physical resource name in the server.
I defined this connection-factory on my messaging subsystem:
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="java:jboss/exported/jms/ConnectionFactory"/>
</entries>
</connection-factory>
and in my webapp spring bean configuration (the jndiName should be started with java:/):
<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/jboss/exported/jms/ConnectionFactory" />
<property name="lookupOnStartup" value="false"/>
<property name="proxyInterface" value="javax.jms.ConnectionFactory"/>
</bean>
And no changes or configs in web.xml (e.g. no need for resource-ref in web.xml)!

Showing missing dependencies while deploying an application in JBoss AS 7

Getting following exception while deploying the ear file whose structure as follow :
Ear comprise of ejb module(EJB + JPA) and war module
//stack trace
11:47:09,207 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2)
JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version
9.0)
11:47:09,290 INFO [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering
web context: /saleshout
11:47:09,964 INFO [org.jboss.as.server] (HttpManagementService-threads - 6)
JBAS015870: Deploy of deployment "SaleShoutEar-0.0.1-SNAPSHOT.ear" was rolled back
with failure message {"JBAS014771: Services with missing/unavailable dependencies"
=> ["jboss.persistenceunit.\"SaleShoutEar-0.0.1-SNAPSHOT.ear/nsqejb-0.0.1-
SNAPSHOT.jar#persistence\"jboss.naming.context.java.jboss.
SMSCampaignDataSourceMissing[jboss.persistenceunit.\"SaleShoutEar-0.0.1-
SNAPSHOT.ear/nsqejb-0.0.1-
SNAPSHOT.jar#persistence\"jboss.naming.context.java.jboss.SMSCampaignDataSource]"]}
11:47:10,010 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1)
JBAS015877: Stopped deployment nsqejb-0.0.1-SNAPSHOT.jar in 45ms
11:47:10,039 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3)
JBAS015877: Stopped deployment saleshout-0.0.1-SNAPSHOT.war in 74ms
11:47:10,091 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3)
JBAS015877: Stopped deployment SaleShoutEar-0.0.1-SNAPSHOT.ear in 126ms
11:47:10,102 INFO [org.jboss.as.controller] (HttpManagementService-threads - 6)
JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.SMSCampaignDataSource (missing) dependents:
[service jboss.persistenceunit."SaleShoutEar-0.0.1-SNAPSHOT.ear/nsqejb-0.0.1-
SNAPSHOT.jar#persistence"]
To integrate ejb with JPA i follow this link http://theopentutorials.com/examples/java-ee/ejb3/how-to-create-ejb3-jpa-project-in-eclipse-jboss-as-7-1/
I have configured the datasource but still getting persistence.xml related exception.
I am new to JBoss.can anyone tell me why i am getting this exception.
//Persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
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_0.xsd" version="2.0">
<persistence-unit name="persistence" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/SMSCampaignDataSource</jta-data-source>
<class>...</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQLDialect"></property>
<property name="show_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>
Thanks.
You have to define the datasource in the standalone.xml and if you have already defined then please see whether your added datasource is saved or not.The stack trace clearly indicate that the problem is with datasource as persistence.xml is fine.I have face the same situation but in my case the changes that i have made in the standalone.xml was not getting saved as the JBoss directory was having the root privilege.So i edited and added the datasource in the standalone.xml with root privilege and the problem resolved of missing dependencies.
If your's is the different case then this link might help you : Services with missing/unavailable dependencies

Categories