Jboss 7 firebird connection - java

I'm having trouble connectiong to Firebird database (jaybird driver) from JBoss 7.1.0 CR1
This is the log:
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.firebirdsql (missing) dependents: [service jboss.data-source.java:/tiranDS]
This is standalone.xml
This is my standalone.xml [some parts are changed, like ...(some_path)...]
...
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:/tiranDS" pool-name="TiranPool" enabled="true" jta="true" use-java-context="true" use-ccm="true">
<connection-url>
jdbc:firebirdsql:serversp/3050:C:\Program Files\...(some_path)...\tiran.gdb
</connection-url>
<driver>
firebirdsql
</driver>
<pool>
<prefill>
false
</prefill>
<use-strict-min>
false
</use-strict-min>
<flush-strategy>
FailingConnectionOnly
</flush-strategy>
</pool>
<security>
<user-name>
username
</user-name>
<password>
pass
</password>
</security>
</datasource>
<drivers>
<driver name="firebirdsql" module="org.firebirdsql">
<xa-datasource-class>
org.firebirdsql.jdbc.FBDriver
</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
...
module.xml looks like this (all .jars mentioned in module.xml are in ...\jboss-as-7.1.0.CR1b\modules\org\firebirdsql\main folder)
<module xmlns="urn:jboss:module:1.0" name="org.firebirdsql">
<resources>
<resource-root path="jaybird-full-2.1.6.jar"/>
<resource-root path="jaybird-pool-2.1.6.jar"/>
<resource-root path="log4j-1.2.13.jar"/>
<resource-root path="jboss-javaee.jar"/>
<resource-root path="jmxri.jar"/>
<resource-root path="jmxtools.jar"/>
<resource-root path="sax2.jar"/>
<resource-root path="commons-logging-1.1.jar"/>
<resource-root path="junit-3.8.1.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.activation.api"/>
<module name="javax.xml.soap.api"/>
<module name="javax.servlet.api"/>
<module name="org.jboss.common-core"/>
<module name="org.jboss.logging"/>
<module name="javax.mail.api"/>
<module name="org.apache.log4j"/>
<module name="org.jboss.logmanager.log4j"/>
<module name="org.apache.james.mime4j"/>
<module name="org.apache.commons.codec"/>
<module name="org.apache.commons.collections"/>
<module name="org.apache.commons.io"/>
<module name="org.apache.commons.lang"/>
<module name="org.apache.commons.logging"/>
<module name="org.apache.httpcomponents"/>
<module name="org.apache.xalan"/>
<module name="org.apache.xerces"/>
<module name="org.w3c.css.sac"/>
<module name="net.sourceforge.cssparser"/>
<module name="net.sourceforge.nekohtml"/>
</dependencies>
</module>
Whati is wrong here?
Application with this driver class worked on JBoss 5, but I've tried both classes org.firebirdsql.jdbc.FBDriver and org.firebirdsql.pool.FBConnectionPoolDataSource still no change.
Also, I've tried putting jaybird-2.1.6.jar instead of jaybird-full-2.1.6.jar but still the error is the same.
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.firebirdsql (missing) dependents: [service jboss.data-source.java:/tiranDS]
Although I'm sure that all that you said Mark is true, it seems like the problem before all this mentioned above is that I'm missing some dependencies in module.xml but I do not know wich.

The org.firebirdsql.jdbc.FBDriver is not an xa-datasource-class. This element requires the name of the javax.sql.XADataSource implementation in Jaybird, not the java.sql.Driver implementation.
In Jaybird 2.2 and higher, the XADataSource implementation is org.firebirdsql.ds.FBXADataSource.
The XADataSource implementation in Jaybird 2.1.6 and earlier is org.firebirdsql.pool.FBConnectionPoolDataSource (see also http://web.firebirdsql.org/devel/doc/jaybird/pdf/jaybird_manual.pdf ); this class was deprecated in Jaybird 2.2 and removed in Jaybird 3.
As far as I know JBoss actually includes an example to use Firebird. (but that might have been an earlier version).
BTW: When using from an application server you should not use the jaybird-full-2.1.6.jar file, but jaybird-2.1.6.jar (as the former includes some (older) JavaEE interfaces that are already included in JBoss)

Perhaps a little late, the point is simply that Firebird is not really JDBC 4 so you have to add the driver class yourself to the configuration like this:
<driver name="firebirdsql" module="org.firebirdsql">
<driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>
<xa-datasource-class>org.firebirdsql.pool.FBConnectionPoolDataSource</xa-datasource-class>
</driver>
That should solve your problem

Related

How to configure WildFly version 27 to use EclipseLink?

I am trying to deploy applications currently running on WildFly 26.1.2.Final to WildFly 27.0.0.Final. The deployment fails with the following error:
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."jee2ap102-ear.ear".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jee2ap102-ear.ear".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "jee2ap102-ear.ear"
at org.jboss.as.server#19.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
at org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc#1.4.13.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: jakarta.persistence.PersistenceException: WFLYJPA0057: PersistenceProvider 'org.eclipse.persistence.jpa.PersistenceProvider' not found
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:999)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.nextPhaseDependsOnPersistenceUnit(PersistenceUnitServiceHandler.java:1042)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:138)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server#19.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
... 8 more
I used the same configuration that I have been using for previous versions, that is:
Copy eclipselink-2.7.8.jar to C:\wildfly-27.0.0.Final\modules\system\layers\base\org\eclipse\persistence\main.
Modify the module.xml file in that directory to add the resource corresponding to eclipselink-2.7.8.jar. Now the file looks like this:
<properties>
<property name="jboss.api" value="public"/>
</properties>
<resources>
<resource-root path="jipijapa-eclipselink-27.0.0.Final.jar"/>
<resource-root path="eclipselink-2.7.8.jar">
<filter>
<exclude path="javax/**" />
</filter>
</resource-root>
</resources>
<dependencies>
<module name="java.logging"/>
<module name="java.management"/>
<module name="java.naming"/>
<module name="jakarta.annotation.api"/>
<module name="jakarta.enterprise.api"/>
<module name="jakarta.json.api" optional="true"/>
<module name="jakarta.persistence.api"/>
<module name="jakarta.transaction.api"/>
<module name="jakarta.validation.api"/>
<module name="jakarta.xml.bind.api"/>
<module name="org.antlr"/>
<module name="org.apache.commons.collections"/>
<module name="org.dom4j"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
</dependencies>
The persistence.xml file had no modifications; it looks like this:
<persistence
version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="jee2ap102-ejb-pu" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/jee2ap102</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-server" value="JBoss"/>
<property name="eclipselink.weaving" value="static"/>
</properties>
</persistence-unit>
</persistence>
I'm using the same eclipselink-2.7.8.jar for both WildFly 26 and 27. I'm sure class org.eclipse.persistence.jpa.PersistenceProvider is in that jar, but even so WildFly 27 can't find it.
EDIT 11/19/2022
I also tried using eclipselink 3.0.3. It also fails. This is the error message:
INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 18) WFLYJPA0003: Starting Persistence Unit Service 'jee2ap102-ear.ear/jee2ap102-ejb.jar#jee2ap102-ejb-pu'
ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 18) MSC000001: Failed to start service jboss.persistenceunit."jee2ap102-ear.ear/jee2ap102-ejb.jar#jee2ap102-ejb-pu": org.jboss.msc.service.StartException in service jboss.persistenceunit."jee2ap102-ear.ear/jee2ap102-ejb.jar#jee2ap102-ejb-pu": java.lang.NoClassDefFoundError: java/rmi/RemoteException
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:199)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:129)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.wildfly.security.elytron-base#2.0.0.Final//org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:664)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:214)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads#2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
Caused by: java.lang.NoClassDefFoundError: java/rmi/RemoteException
at org.eclipse.persistence//org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactoryImpl(PersistenceProvider.java:331)
at org.eclipse.persistence//org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:316)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:367)
at org.jboss.as.jpa#27.0.0.Final//org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:191)
... 10 more
Caused by: java.lang.ClassNotFoundException: java.rmi.RemoteException from [Module "org.eclipse.persistence" from local module loader #fb9c7aa (finder: local module finder #4c398c80 (roots: C:\wildfly-27.0.0.Final\modules,C:\wildfly-27.0.0.Final\modules\system\layers\base))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:200)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
... 14 more
At this point I tried adding java.management.rmi and java.rmi as module dependencies, but it didn't work with either of them.
I will be very grateful for any help in solving this problem.
Take a look into the changelog:
We don’t plan to support Jakarta EE 8 in standard WildFly. The WildFly 26.1 releases will be the last that support EE 8.
Use Eclipselink 3.0.0 because it supports Jakarta EE 9 in which all namespaces have been adapted to jakarta.* in comparison to the old one javax.*.
With Wildfly 27 and Eclipselink 4 the following updated module.xml works (see commented changes):
<module name="org.eclipse.persistence" xmlns="urn:jboss:module:1.9">
<properties>
<property name="jboss.api" value="public"/>
</properties>
<resources>
<resource-root path="jipijapa-eclipselink-27.0.1.Final.jar"/>
<!-- Added Eclipselink library -->
<resource-root path="eclipselink-4.0.0.jar"/>
</resources>
<dependencies>
<module name="java.logging"/>
<module name="java.management"/>
<module name="java.naming"/>
<!-- Added rmi dependency used by Eclipselink -->
<module name="java.rmi"/>
<!-- Added desktop dependency used by Eclipselink -->
<module name="java.desktop"/>
<module name="jakarta.annotation.api"/>
<module name="jakarta.enterprise.api"/>
<module name="jakarta.json.api" optional="true"/>
<module name="jakarta.persistence.api"/>
<module name="jakarta.transaction.api"/>
<module name="jakarta.validation.api"/>
<module name="jakarta.xml.bind.api"/>
<module name="org.antlr"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
</dependencies>
</module>
add <module name="javax.api"/> to your dependencies, i also did not add the filter attribute to my resource-root as that caused an exception loop. Also, if you get a Failed to define class org.eclipse.persistence.jpa.rs.exceptions.JPARSExceptionMapper, add <module name="javax.ws.rs.api"/> to the dependencies as well.
Your final configured module.xml file should look like this:
<module name="org.eclipse.persistence" xmlns="urn:jboss:module:1.9">
<properties>
<property name="jboss.api" value="public"/>
</properties>
<resources>
<resource-root path="jipijapa-eclipselink-27.0.0.Final.jar"/>
<resource-root path="eclipselink.jar"/>
</resources>
<dependencies>
<module name="java.logging"/>
<module name="java.management"/>
<module name="java.naming"/>
<module name="javax.api"/>
<module name="jakarta.annotation.api"/>
<module name="jakarta.enterprise.api"/>
<module name="jakarta.json.api" optional="true"/>
<module name="jakarta.persistence.api"/>
<module name="jakarta.transaction.api"/>
<module name="jakarta.validation.api"/>
<module name="jakarta.xml.bind.api"/>
<module name="javax.ws.rs.api"/>
<module name="org.antlr"/>
<module name="org.apache.commons.collections"/>
<module name="org.dom4j"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
</dependencies>
</module>

Adding a mysql datasource to jboss AS 7

I am trying to add a MySQL data source to JBoss AS 7.1.1.
Below is the module.xml file I added in com/mysql/main :
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<properties>
<resources>
<resource-root path="mysql-connector-java-5.1.34_1.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
And this is the datasource I added in standalone.xml and standalone-full.xml:
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool- name="ExampleDS"
enabled="${mysql.enabled}" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/myDb</connection-url>
<driver>com.mysql</driver>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
</datasource>
<drivers>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
I've also modified the persistence.xml in my app :
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
When I start the server, I get this error:
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.datasources.ExampleDS (missing) dependents: [service jboss.persistenceunit."MyApp.war#myAppservice"]
11:03:56,257 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"MyApp.war#myAppservice\"jboss.naming.context.java.jboss.datasources.ExampleDSMissing[jboss.persistenceunit.\"MyApp.war#myAppservice\"jboss.naming.context.java.jboss.datasources.ExampleDS]"]}}}
I tried the solution that was here JBoss 7 MySQL datasource issue
and here
https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7/
but nothing works.
Try to comment ot delete default-bindings context-service in configuration file.

Use WildFly module both datasource and connectionFactory

I have a module in Wildfly to use as my datasource to Firebird. It works great
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.firebirdsql">
<resources>
<resource-root path="jaybird-2.2.13.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.resource.api"/>
<module name="javax.xml.bind.api"/> <!-- Jaybird 3.0 onwards doesn't need this -->
<module name="org.antlr4"/>
</dependencies>
</module>
and the jar is put inside the directory of module.xml.
But I want to use the driver both with data source and also to create a pure JDBC connection in connectionfactory like Class.forName("org.firebirdsql.jdbc.FBDriver");, not using data source provided by the server.
If I put jaybird in pom.xml I got errors. I think because this is duplicating the libs. How can I solve this?
I just added the below code under <subsystem xmlns="urn:jboss:domain:ee:4.0">
<global-modules>
<module name="org.firebirdsql" slot="main"/>
</global-modules>
Thanks, Mark Rotteveel for answer on the Jaybird bug tracker.

Unable to query Infinispan on JBoss 7 due to SearchFactoryIntegrator not being in the registry

TL:DR I'm getting the following error and I can see no reason for it, indexing is enabled, and the SearchFactoryIntegrator is on the classpath for everything that needs to see it.
Indexing was not enabled on this cache. interface
org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
Long Version:
JBoss version: 7.1.1 FINAL
Infinispan version: 5.16 (upgraded from 5.1.2 JBoss ships with in attempts to solve issue)
Java Version: 1.7
I am attempting to build a simple test application to run queries against an Infinispan cache.
I am successfully adding objects to the cache. The cache is defined as private org.infinispan.Cache<String, Agent> cache; with Agent being my own object.
When attempting to query the cache I get the following error from the line
SearchManager searchManager = Search.getSearchManager(cache);
17:35:43,873 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/SearchableCacheTest].[Faces Servlet]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalArgumentException: Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:40) [infinispan-query-5.1.6.FINAL.jar:5.1.6.FINAL]
at org.infinispan.query.SearchManagerImpl.<init>(SearchManagerImpl.java:56) [infinispan-query-5.1.6.FINAL.jar:5.1.6.FINAL]
at org.infinispan.query.Search.getSearchManager(Search.java:39) [infinispan-query-5.1.6.FINAL.jar:5.1.6.FINAL]
The important part being
Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
Prior to this error cache.getCacheConfiguration().indexing().enabled() resolves to true
The cache is a modified version of the default "cluster" cache already configured in the standalone-ha.xml of JBoss.
<cache-container name="cluster" aliases="ha-partition" default-cache="default" start="EAGER">
<transport lock-timeout="60000"/>
<replicated-cache name="default" mode="SYNC" batching="true" indexing="LOCAL">
<locking isolation="REPEATABLE_READ"/>
<store class="org.infinispan.loaders.file.FileCacheStore" preload="true" passivation="false" fetch-state="true" purge="false">
<property name="location">
/tempCacheIndex
</property>
</store>
</replicated-cache>
</cache-container>
I see the index being created in the configured file location so it seems that enabled boolean resolving to true is a factual representation of the current state.
I have created an org.infinispan.query module in JBoss and it contains the following
avro-1.5.1.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-search-engine-4.1.1.Final.jar
infinispan-query-5.1.6.FINAL.jar
jackson-core-asl-1.9.2.jar
jackson-mapper-asl-1.9.2.jar
lucene-core-3.5.0.jar
paranamer-2.3.jar
slf4j-api-1.6.1.jar
snappy-java-1.0.4.1.jar
All of the above are defined in as resource-roots in the module.xml for that module.
I have modified the module.xml for the module org.infinispan to have a dependency on the module org.infinispan.query
I have declared dependencies on both those modules in my jboss-deployment-structure.xml
Does anyone have any ideas why this might be happening and perhaps have a solution?
Note: There is a very similar question here but he was ultimately unsuccessful and chose a different route.
NOTE: I started with a clean JBoss 7.1.1 instance and hence reverted from Infinispan 5.1.6 to 5.1.2
For my needs I modified the existing cluster cache so it looks like this
<cache-container name="cluster" aliases="ha-partition"
default-cache="default" start="EAGER">
<transport lock-timeout="60000" />
<replicated-cache name="default" mode="SYNC" batching="true"
indexing="LOCAL">
<locking isolation="REPEATABLE_READ" />
<store class="org.infinispan.loaders.file.FileCacheStore"
preload="true" passivation="false" fetch-state="true" purge="false">
<property name="location">
/tempCacheIndex
</property>
</store>
</replicated-cache>
Then to actually be able to query the cache create the org.infinispan.query module containing the jars mentioned in the following module.xml
<module xmlns="urn:jboss:module:1.1" name="org.infinispan.query">
<resources>
<resource-root path="avro-1.5.1.jar"/>
<resource-root path="hibernate-commons-annotations-4.0.1.Final.jar"/>
<resource-root path="hibernate-search-4.1.0.Beta1.jar"/>
<resource-root path="hibernate-search-analyzers-4.1.0.Beta1.jar"/>
<resource-root path="hibernate-search-engine-4.1.0.Beta1.jar"/>
<resource-root path="hibernate-search-orm-4.1.0.Beta1.jar"/>
<resource-root path="infinispan-query.jar"/>
<resource-root path="jackson-core-asl-1.9.2.jar"/>
<resource-root path="jackson-mapper-asl-1.9.2.jar"/>
<resource-root path="lucene-analyzers-3.5.0.jar"/>
<resource-root path="lucene-core-3.5.0.jar"/>
<resource-root path="lucene-grouping-3.5.0.jar"/>
<resource-root path="lucene-highlighter-3.5.0.jar"/>
<resource-root path="lucene-memory-3.5.0.jar"/>
<resource-root path="lucene-misc-3.5.0.jar"/>
<resource-root path="lucene-smartcn-3.5.0.jar"/>
<resource-root path="lucene-spatial-3.5.0.jar"/>
<resource-root path="lucene-spellchecker-3.5.0.jar"/>
<resource-root path="lucene-stempel-3.5.0.jar"/>
<resource-root path="paranamer-2.3.jar"/>
<resource-root path="slf4j-api-1.6.1.jar"/>
<resource-root path="snappy-java-1.0.4.1.jar"/>
<resource-root path="solr-analysis-extras-3.5.0.jar"/>
<resource-root path="solr-commons-csv-3.5.0.jar"/>
<resource-root path="solr-core-3.5.0.jar"/>
<resource-root path="solr-solrj-3.5.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="org.hibernate"/>
<module name="org.infinispan" services="import" export="true"/>
<module name="org.apache.commons.codec"/>
<module name="org.apache.commons.io"/>
<module name="org.apache.commons.lang"/>
<module name="com.google.guava"/>
<module name="org.slf4j" export="true"/>
<module name="org.jboss.logging"/>
</dependencies>
Modify the org.jboss.as.clustering.infinspan module xml to include a dependency on the new query module but also the org.hibernate module that already exists. So add the following to that file.
<module name="org.hibernate" services="import"/>
<module name="org.infinispan.query" services="import"/>
The jboss-deployment-structure.xml of your app needs to have the following dependencies added to it
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module export="true" name="org.hibernate" services="import"/>
<module export="true" name="org.infinispan" services="import"/>
<module export="true" name="org.infinispan.query" services="import"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
For annotating your objects so they can be indexed and searched I suggest you look at the samples here
EDIT:
FURTHER NOTE:
To get indexed objects to actually share over the cache I now had to
Create a jar containing all the classes that you plan to put in the cache.
Make sure these entities do not contain anything too complex it terms of imports or you'll run into class loader issues.
Create a module from this jar, and give it a dependency on the Infinispan.query module.
Expose this module as a global module (is this actually needed?) in the standalone.xml or domain.xml whichever is appropriate.
Find the file modules/org/jboss/as/clustering/infinispan/main/module.xml
Add your new module containing your cachable entities to the list of dependencies

New missing/unsatisfied dependencies: service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:jboss/MyDB]

I am using JBoss 7.1.1. When I try to start the server, I get an exception. I have tried many solutions but nothing seems to work.
The following line appears in the logs -
New missing/unsatisfied dependencies:
service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:jboss/MyDB]
Here is my standalone.xml:
</datasource>
<datasource jta="true" jndi-name="java:jboss/MyDB" pool-name="MyDB_Pool" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/test</connection-url>
<driver>com.mysql</driver>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
<timeout>
<idle-timeout-minutes>0</idle-timeout-minutes>
<query-timeout>600</query-timeout>
</timeout>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="com.mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
This is my module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.24-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
<module name="javax.validation.api"/>
</dependencies>
</module>
But i still got this exception
Here is my web.xml(a part of it):
<resource-ref id="ResourceRef_1">
<res-ref-name>MyDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
<lookup-name>java:jboss/datasources/MyDB</lookup-name>
</resource-ref>
Can anyone help?
Your module.xml should be like this:
<module xmlns="urn:jboss:module:1.0" name="com.mysql" slot="main">
<resources>
<resource-root path="mysql-connector-java-5.1.24-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
And make sure you have mysql-connector-java-5.1.24-bin.jar and mysql-connector-java-5.1.24-bin.jar.index in same folder where you have module.xml.
Solved: New missing/unsatisfied dependencies: service jboss.jdbc-driver.com_ for Jboss / WildFly 10
Hi,
first stop the WildFly server.
then update standalone.xml file to add MS-SQL JTDS driver details and Datasource details like below:
<subsystem xmlns="urn:jboss:domain:datasources:4.0">
<datasources>
<datasource jta="true" jndi-name="java:/jdbc/speedtest-datasource" pool-name="MSSQLDSspeedTestDEV" enabled="true" use-ccm="true">
<connection-url>jdbc:jtds:sqlserver://serverName:1433;DatabaseName=dbName</connection-url>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<driver>JTDS</driver>
<security>
<user-name>username</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>
<drivers>
<driver name="JTDS" module="net.sourceforge">
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
</driver>
</drivers>
</datasources>
</subsystem>
Module.xml for MS SQL JTDS: path : E:\Softwares\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules\system\layers\base\net\sourceforge\main ( need to create directory structure as highlighted and add module.xml and jtds-1.3.0.jar files).
(note in this example i have used module name as "net.sourceforge" and created the folder structure path as "net\sourceforge\main"). Please note this is more important to match the directory path and module name in module,xml file.
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="net.sourceforge">
<resources>
<resource-root path="jtds-1.3.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Note: Please note that the path highlighted in green above at 2 places should match (ie directory structure and module name in module.xml),
For example. If you have created directory structure as E:\Softwares\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules\system\layers\base\net\sourceforge\jtds\main then module name in module.xml file should be “net.sourceforge.jtds” as shown below in module.xml file
Module.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds">
<resources>
<resource-root path="jtds-1.3.0.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
now save these two files and restart the wildFLY server.
Regards,
Rasool Javeed Mohammad
javeed.mca#gmail.com
try upgrading your mysql-connector. i was trying to deploy 5.1.5 (i was migrating from jboss 5.1 to 7.1.1 so i was just moving an already working environment over to the newer container). after banging my head against this for two days, i upgraded to 5.1.27 and the datasource deployed like a champ.
Try to delete META-INF/services/java.sql.Driver from the mysql connector lib.
One thing to check with this error is to make sure you are storing the data in the correct folder. For JBoss EAP 7.1, it is the modules\system\layers\base\com folder. Inside of the com folder, create an additional folder called mysql and a main folder inside of the mysql folder. The main folder will hold the jar file and the module.xml file.
Try below steps. i solve the same problem with you in wildfly8.0.0-final. if there occurs that duplicate mysql dependencies, remove configuration firstly, after restart your computer, try the steps again.
1. Create mysql folder
under: ${WILDFLY_HOME}/modules/system/layers/base
create the directories com/mysql/driver/main
copy the driver library jar Into the folder main
add module.xml
// urn:jboss:module:X.X should be same with the version of wildfly, you can reference other modules.
<module xmlns="urn:jboss:module:1.1" name="com.mysql.driver">
<resources>
<resource-root path="mysql-connector-java-5.1.16.jar" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
2. Register the module as driver with CLI.
${WILDFLY_HOME}/bin/standalone.sh (only if wildfly is not running)
./jboss-cli.sh
connect
/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql.driver,driver-class-name=com.mysql.jdbc.Driver)
If the operation is successful then the message below will be showed {"outcome" => "success"}
and into the file of the standalone profile the code below is produced
...
<driver name="mysql" module="com.mysql.driver">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
3. Create database in mysql
login as root: mysql root -p
Create database
create tables
4. Create connection to database from console
http://localhost:9990/console
add datasources with configuration like
name: mysql
JNDI name: java:jboss/mysql
url: jdbc:mysql://localhost:3306/your_database
done.

Categories

Resources