How to configure WildFly version 27 to use EclipseLink? - java

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>

Related

Wildfly 26 Jakarta EE 9.1

Background
Transforming a Wildfly 17 Java EE project (EAR) to Wildfly 26 and Jakarta EE9.1
Updated all dependencies and changed imports. Also some code changes necessary.
Now i am stuck on resteasy-core-spi-6.0.0.Beta1
When deploying i get this error:
Caused by: java.lang.IncompatibleClassChangeError: Expected static method 'java.lang.Object org.jboss.resteasy.spi.ResteasyProviderFactory.getContextData(java.lang.Class)'
The Code that calls this method looks like this.
FooClass foo = ResteasyProviderFactory.getContextData(FooClass .class);
A look at the SPI Class reveals this.
public static <T> T getContextData(Class<T> type) {
return getContextDataMap().get(type);
}
That looks perfectly fine.
Examining the Wildfly system dir and looking in the module for same jar.(resteasy-core-spi-6.0.0.Beta1,jar)
reveals this
<resources>
<resource-root path="resteasy-core-spi-6.0.0.Beta1.jar"/>
</resources>
<dependencies>
<module name="java.desktop"/>
<module name="java.logging"/>
<module name="java.management"/>
<module name="java.naming"/>
<module name="java.xml"/>
<module name="javax.activation.api"/>
<module name="javax.annotation.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.servlet.api"/>
<module name="javax.validation.api"/>
<module name="javax.xml.bind.api"/>
<module name="javax.ws.rs.api"/>
<module name="org.jboss.logging"/>
<module name="org.reactivestreams"/>
</dependencies>
I tried to update that to jakarta namespace but no change.
I am at a loss here, do anyone have some ideas?

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.

JSF Mojarra is not initializing ManagedBeans in JBoss modules

My problem is (as I think) quite complicated..
I am using JBoss 7 and created a module for Liferay faces. Within my WAR file, I created a jboss-deployment-structure.xml, in which I load the JSF module with Mojarra and the Liferay Faces module. But on startup of my web application, the ManagedBeans of the Liferay Faces implementation are not initialized and because of this, my application crashes. If I include the Liferay Faces JAR in my WAR lib folder, everything works, so this something of a class loading issue..
Liferay Faces modules.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.liferay.faces">
<resources>
<resource-root path="liferay-faces-alloy.jar"/>
<resource-root path="liferay-faces-bridge-api.jar"/>
<resource-root path="liferay-faces-bridge-impl.jar"/>
<resource-root path="liferay-faces-portal.jar"/>
<resource-root path="liferay-faces-util.jar"/>
<resource-root path="util-bridges.jar"/>
<resource-root path="util-java.jar"/>
<resource-root path="util-taglib.jar"/>
<!-- Just for testing --->
<resource-root path="AlexBean.jar"/>
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.enterprise.api" />
<module name="javax.faces.api" />
<module name="javax.inject.api" />
<module name="com.liferay.portal" />
<module name="com.sun.jsf-impl" />
</dependencies>
</module>
jboss-deployment-structure.xml
[...]
<module name="com.liferay.faces" services="import" export="true" meta-inf="export"/>
<module name="com.sun.jsf-impl" />
[...]
Why do I know Mojarra is not scanning and loading the #ManagedBeans #ApplicationScoped as it should? The JAR file AlexBean.jar contains a single class which is annotated as #ManagedBean and #ApplicationScoped. If the JAR file is placed within the WAR file, it works. If I use the JBoss modules they aren't, so I assume that the Liferay Faces beans aren't loaded either, but they are needed..
Thx in advance!
Best regards - Nuker

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

Jboss 7 firebird connection

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

Categories

Resources