Services with missing/unavailable dependencies error in JBoss EAP 6.2.0.GA - datasource

I am trying to migrate my project war from Tomcat 6 to JBoss EAP 6.2.0. When trying to deploy the war I am getting the following exception:
16:58:58,493 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011001: Could not resolve resource-env-ref java:/mwdb
16:58:58,568 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) JBAS010403: Deploying JDBC-compliant driver class com.microsoft.sqlserver.jdbc.SQLServerDriver (version 4.0)
16:58:58,787 ERROR [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS015870: Deploy of deployment "csc.war" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.csc.csc.env.jdbc.mwdb is missing [jboss.naming.context.java.jboss.resources.jdbc.mwdb]"]}
I am using MSSQL server as database and following is the configuration in my standalone.xml file.
<datasources>
<datasource jta="true" jndi-name="java:/mwdb" pool-name="jdbc/mwdb" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:sqlserver://<ServerIP>\\<Instance>:<port>;Database=MWDB</connection-url>
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
<driver>sqlserver</driver>
<pool>
<min-pool-size>2</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<use-fast-fail>false</use-fast-fail>
</validation>
</datasource>
<drivers>
<driver name="sqlserver" module="com.microsoft.sqlserver.jdbc">
<datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>
</driver>
</drivers>
</datasources>
I have placed sqljdbc4.jar and module.xml at jboss-as\modules\com\microsoft\sqlserver\jdbc\main.
My module.xml reads as follows:
<module xmlns="urn:jboss:module:1.1" name="com.microsoft.sqlserver.jdbc">
<resources>
<resource-root path="sqljdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
I have searched a lot about this issue in last two days and tried many things but nothing seems to work.

Related

JBoss EAP 7.1.0.GA + picketlink 2.7.1.Final causes org.jboss.modules.ModuleLoadError

I'm using an Red Hat JBoss Enterprise Application Platform - Version 7.1.0.GA and trying to use picketlink 2.7.1.Final causes org.jboss.modules.ModuleLoadError.
So, I added in standalone.xml
<extension module="org.wildfly.extension.picketlink"/>
Then ran the picketlink-installer-2.7.1.Final with the ant that gave me: BUILD SUCCESSFUL, and when I try to launch my app with jboss, I get an:
WARN [org.jboss.modules] (ServerService Thread Pool -- 31) Failed to define class org.picketlink.identity.federation.web.handlers.saml2.SAML2IssuerTrustHandler in Module "org.picketlink.federation" from local module loader #58134517 (finder: local module finder #4450d156 (roots: D:\Jboss\bin\..\modules,D:\Jboss\bin\..\modules\system\layers\base)): org.jboss.modules.ModuleLoadError: org.jboss.common-core
I added the picketlink.xml file with the Handlers:
<Handlers xmlns="urn:picketlink:identity-federation:handler:config:2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:picketlink:identity-federation:handler:config:2.1 ">
<Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2IssuerTrustHandler" />
<Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2LogOutHandler"/>
<Handler class="org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler"/>
<Handler class="org.picketlink.identity.federation.web.handlers.saml2.RolesGenerationHandler"/>
</Handlers>
I added in \Jboss\modules\system\layers\base\org\jboss\common-core\main\jboss-common-4.2.2.GA.jar and an module.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.5" name="org.jboss.common-core">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<dependencies>
<module name="javax.api"/>
</dependencies>
<resources>
<resource-root path="jboss-common-4.2.2.GA.jar"/>
</resources>
</module>
And that error is gone, I have other errors now...

JCache with Infinispan in Wildfly 14 generate Unsatisfied dependencies for type InfinispanExtensionEmbedded with qualifiers #Default

I'm following some guide to set JCache in Wildfly 14 enviroment using as provider Infinispan.
I followed these steps :
- I downloaded the wildfly module version 9.4.14 from Infinispan website
- I copied the content of the zip in the module dir of Wildfly
- I added to my application the file jboss-deployment-structure.xml
- I added the interceptors to the beans.xml file on my application
- I add the annotation #CacheResult to a function
- I start Wildfly and I get the following error
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type InfinispanExtensionEmbedded with qualifiers #Default
at injection point [BackedAnnotatedField] #Inject private org.infinispan.cdi.embedded.AdvancedCacheProducer.infinispanExtension
I add information that can be useful. The application that I'm deploying on wildfly is an ear ant this is the structure that I'm using :
ear file
lib
META-INF
JAR library file
META-INF
beans.xml file
jboss-deployment-structure.xml
WAR file
jboss-deployment-structure.xml :
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="org.infinispan" slot="ispn-9.4" services="export"/>
<module name="org.infinispan.cdi.embedded" slot="ispn-9.4" services="export"/>
<module name="org.infinispan.jcache" slot="ispn-9.4" services="export"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
beans.xml :
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
<interceptors>
<class>org.infinispan.jcache.annotation.InjectedCacheResultInterceptor</class>
<class>org.infinispan.jcache.annotation.InjectedCachePutInterceptor</class>
<class>org.infinispan.jcache.annotation.InjectedCacheRemoveEntryInterceptor</class>
<class>org.infinispan.jcache.annotation.InjectedCacheRemoveAllInterceptor</class>
<class>org.infinispan.jcache.annotation.CacheResultInterceptor</class>
<class>org.infinispan.jcache.annotation.CachePutInterceptor</class>
<class>org.infinispan.jcache.annotation.CacheRemoveEntryInterceptor</class>
<class>org.infinispan.jcache.annotation.CacheRemoveAllInterceptor</class>
</interceptors>
</beans>
With this standard configuration, I expect the interceptor start to defined in the beans.xml start to function, so I can use a default cache container in the application
org.infinispan.cdi.embedded and org.infinispan.jcache modules have SPI extensions inside them (jar/META-INF/services folder). Just add services="export" in module dependencies in jboss-deployment-structure.xml to enable them.
Here is mine jboss-deployment-structure.xml:
<jboss-deployment-structure>
<deployment>
<module-alias name="deployment.magic-blog" />
<dependencies>
<module name="org.infinispan.cdi.embedded" slot="ispn-9.4" export="true" services="export" />
<module name="org.infinispan.jcache" slot="ispn-9.4" export="true" services="export" />
<module name="javax.cache.api" slot="ispn-9.4" export="true"/>
</dependencies>
</deployment>

Splunk log4j2 plugin not working in mule application

I have a requirement to send all mule logs to splunk, so for this i am using splunks Http Event collector mentioned here http://dev.splunk.com/view/event-collector/SP-CAAAE6M
for this i have configured appender in log4j2 xml file as
<Http name="SPLUNK"
url="https://localhost:8088"
token="4B916A8F-C41E-4DD3-80AC-778D3E24F45C" batch_size_bytes="0"
batch_size_count="0" batch_interval="0" disableCertificateValidation="true">
<PatternLayout pattern="%m" />
</Http>
<Logger name="splunk.log4j" level="INFO">
<AppenderRef ref="SPLUNK" />
</Logger>
i have added following libraries in pom file
<dependency>
<groupId>com.splunk.logging</groupId>
<artifactId>splunk-library-javalogging</artifactId>
<version>1.5.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
i know for this to work i need to add splunk jar in /lib/boot so i have copied following jars in /lib/boot
/lib/boot/splunk-1.5.0.0.jar
/lib/boot/splunk-library-javalogging-1.5.2.jar
but even after that when i deploy to standalone server i get following error but surprisingly it works fine in Studio and not in standalone server.
2017-12-11 14:26:12,771 WrapperListener_start_runner ERROR Unable to invoke factory method in class class com.splunk.logging.HttpEventCollectorLog4jAppender for element Http.
2017-12-11 14:26:12,771 WrapperListener_start_runner ERROR Null object returned for Http in Appenders.
2017-12-11 14:26:12,775 WrapperListener_start_runner ERROR Unable to locate appender "SPLUNK" for logger config "splunk.log4j"
does any one know why is this happening?
ERROR Unable to locate appender "SPLUNK" for logger config "splunk.log4j"
This means there is no Appender named "SPLUNK" configured. Make sure your log4j2.xml contains such configuration, for example to output log to console:
<Appenders>
<Console name="SPLUNK" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %c{1} - %msg%n"/>
</Console>
</Appenders>
See the Configuring Appenders and Appenders doc for details.

Missing jboss.jdbc-driver.org_postgresql_Driver

I'm trying to configure a Postgres datasource in standalone.xml. I've put the driver jar in the right place "jboss-as-7.2.0.Final\modules\org\postgresql\main" and this is my "standalone.xml":
<datasource jta="true" jndi-name="java:jboss/datasources/ProcessEngine" pool-name="ProcessEngine" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:postgresql://localhost:5432/camunda_process_engine</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql</driver>
<security>
<user-name>postgres</user-name>
<password>postgres</password>
</security>
</datasource>
<drivers>
</driver>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
...
"jboss-as-7.2.0.Final\modules\org\postgresql\main\module.xml"
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.3-1102.jdbc41.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
I'm trying to start server but it shows errors.
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.org_postgresql_Driver (missing) dependents: [service jboss.driver-demander.java:jboss/datasources/ProcessEngine, service jboss.data-source.java:jboss/datasources/ProcessEngine]
You also have to add a dependency on your new module to your application. The easiest way to do this is to add a jboss-deployment-structure.xml to the META-INF of your Ear, or if you just have a war, put it in WEB-INF.
<?xml version="1.0"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<deployment>
<dependencies>
<module name="org.postgresql" />
</dependencies>
</deployment>
</jboss-deployment-structure>
When you redeploy, JBoss will know to put your new custom module in the classpath. Decent guide to classloading in AS7 here.

issues interating jboss eap6 with ActiveMQ 5.9

I have the activeMQ server running in the jvm at tcp://localhost:61616
then i place the activemq-rar-5.9.0.redhat-610379 unzipped
adaptor
in the
\runtimes\jboss-eap\modules\system\layers\base\org\apache\activemq\main
in the adaptor i have the Meta-INF
in the jboss EAP6 , standalone.xml i have specified the
But when i start the server ... i get the below error
**
12:05:39,910 ERROR [org.jboss.as.controller.management-operation]
(ServerService Thread Pool -- 40) JBAS014612: Operation ("add") failed
- address: ([
("subsystem" => "resource-adapters"),
("resource-adapter" => "activemq-rar.rar") ]) - failure description: "JBAS010473: Failed to load module for RA
[org.apache.activemq]"
**
Your question is missing some information, but in reviewing what you have typed it sounds like you are missing the module.xml that needs to go in your module directory (\runtimes\jboss-eap\modules\system\layers\base\org\apache\activemq\main)
For ActiveMQ RAR version 5.9 a module.xml would look like the following
<module xmlns="urn:jboss:module:1.1" name="org.apache.activemq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<resources>
<resource-root path="."/>
<resource-root path="activemq-broker-5.9.0.jar"/>
<resource-root path="activemq-client-5.9.0.jar"/>
<resource-root path="activemq-jms-pool-5.9.0.jar"/>
<resource-root path="activemq-kahadb-store-5.9.0.jar"/>
<resource-root path="activemq-openwire-legacy-5.9.0.jar"/>
<resource-root path="activemq-pool-5.9.0.jar"/>
<resource-root path="activemq-protobuf-1.1.jar"/>
<resource-root path="activemq-ra-5.9.0.jar"/>
<resource-root path="activemq-spring-5.9.0.jar"/>
<resource-root path="aopalliance-1.0.jar"/>
<resource-root path="commons-pool-1.6.jar"/>
<resource-root path="commons-logging-1.1.3.jar"/>
<resource-root path="hawtbuf-1.9.jar"/>
<resource-root path="spring-aop-3.2.4.RELEASE.jar"/>
<resource-root path="spring-beans-3.2.4.RELEASE.jar"/>
<resource-root path="spring-context-3.2.4.RELEASE.jar"/>
<resource-root path="spring-core-3.2.4.RELEASE.jar"/>
<resource-root path="spring-expression-3.2.4.RELEASE.jar"/>
<resource-root path="xbean-spring-3.14.jar"/>
</resources>
<exports>
<exclude path="org/springframework/**"/>
<exclude path="org/apache/xbean/**"/>
<exclude path="org/apache/commons/**"/>
<exclude path="org/aopalliance/**"/>
<exclude path="org/fusesource/**"/>
</exports>
<dependencies>
<module name="javax.api"/>
<module name="org.slf4j"/>
<module name="javax.resource.api"/>
<module name="javax.jms.api"/>
<module name="javax.management.j2ee.api"/>
</dependencies>
</module>
Also, you should really not create custom modules under \modules\system\layers\base\ as this is used by JBoss and could be modified during patches and new releases. You are best to either create your own layer or simply create you module directly under the /modules folder.
As previous answer has noted, especially in a standalone setup it might be easier to just directly deploy the RAR instead.
I am having trouble reading your question. In general, I would recommend deploying the A-MQ JCA rar file via either the command line CLI or via the web UI and not as a module. Just go to the web UI, find the "Deployments" page and deploy the A-MQ JCA.
I had the same problem when I followed the tutorial http://www.mastertheboss.com/jboss-frameworks/ironjacamar/configuring-a-resource-adapter-for-activemq-on-jbosswildfly.
I'm using a JBoss EAP 6.3.x and in my case the problem was in reference to the META-INF/ra.xml file. If I comment out the config-property below the note
<!-- NOTE disable the following property if you do not wish to deploy an embedded broker -->
I got the same error like you. If I removed the config-property the problem was solved and it's working as expected.