When I am trying to call a WSDL-based web service from inside a Resource Adapter, I get the following exception:
SEVERE [org.apache.cxf.BusFactory] (JmsMessageDispatcher#2) Failed to determine BusFactory implementation class name.: java.lang.ClassCastException: class org.apache.cxf.bus.spring.SpringBusFactory
at java.lang.Class.asSubclass(Class.java:3126) [rt.jar:1.7.0_45]
at org.apache.cxf.BusFactory.getBusFactoryClass(BusFactory.java:333) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:260) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.newInstance(BusFactory.java:247) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:99) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.createThreadBus(BusFactory.java:193) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:182) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:166) [cxf-api-2.5.9.jar:2.5.9]
at org.apache.cxf.frontend.ClientProxyFactoryBean.configureObject(ClientProxyFactoryBean.java:99) [cxf-rt-frontend-simple-2.5.9.jar:2.5.9]
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:131) [cxf-rt-frontend-simple-2.5.9.jar:2.5.9]
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:155) [cxf-rt-frontend-jaxws-2.5.9.jar:2.5.9]
During deployment of said Resource Adapter, I get this warning:
WARN [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015893: Encountered invalid class name 'org.springframework.context.ApplicationContext,org.springframework.beans.BeansException' for service type 'org.apache.cxf.bus.factory'
I guess it is like they say: A warning DOES become an error sooner or later ;)
The answer to this question didn't help, since I added the following dependency to my pom.xml already like so:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-api</artifactId>
<version>2.5.9</version>
</dependency>
The Resource Adapter is deployed as a JCA Connector (.rar).
Thanks for any help!
Don't deliver Spring and CXF with your resource adapters. Include them as module dependency.
In your RA project:
pom.xml: use provided scope for CXF libraries
add META-INF/jboss-deployment-structure.xml to RAR archive
META-INF/jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="org.jboss.ws.cxf.jbossws-cxf-client" services="import" />
<module name="org.apache.cxf"> <!-- .impl removed -->
<imports>
<include path="META-INF" />
<include path="META-INF/cxf" />
</imports>
</module>
<module name="org.springframework.spring">
<imports>
<include path="META-INF" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
As spring is not part of JBoss you have to deploy it as new module.
Create module directory $JBOSS_HOME/modules/org/springframework/spring/main/
add module.xml
add the JAR files listed in module.xml to the directory
module.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.spring">
<resources>
<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="spring-web-3.2.4.RELEASE.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.servlet.api" />
<module name="javax.transaction.api" />
<module name="org.apache.commons.logging" />
</dependencies>
</module>
I'm not sure if this is a class-loading bug deep down in JBoss or not.
Related
ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-22) Forwarding to error page from request [/api/method] due to exception [com.fasterxml.jackson.annotation.JsonFormat$Value.hasLenient()Z]: java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.hasLenient()Z
at com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase.createContextual(JSR310DateTimeDeserializerBase.java:104)
at com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:685)
at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:446)
- Create file named jboss-deployment-structure.xml
- Add the below block
- Copy file in location WEB-INF/jboss-deployment-structure.xml
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<exclusions>
<module name="com.fasterxml.jackson.core.jackson-annotations" />
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.slf4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>
IMG - Preview project Maven
I was trying to add jsf2.2 into JBoss 7.0 server following this article's 2nd option. I created folder with name 2.2 within /modules/javax/faces/api/ and modules\com\sun\jsf-impl and added jsf-api-2.2.14.jar and jsf-impl-2.2.14.jar respectively.
The module.xml file within /modules/javax/faces/api/2.2 looks like
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="2.2">
<dependencies>
<module name="javax.el.api" export="true"/>
<module name="javax.servlet.api" export="true"/>
<module name="javax.servlet.jsp.api" export="true"/>
<module name="javax.servlet.jstl.api" export="true"/>
<module name="javax.validation.api" export="true"/>
<module name="com.sun.jsf-impl" slot="2.2"/>
</dependencies>
<resources>
<resource-root path="jsf-api-2.2.14.jar"/>
</resources>
</module>
and module.xml file within /modules/com/sunjsf-impl/2.2 looks like
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.sun.jsf-impl" slot="2.2">
<properties>
<property name="jboss.api" value="private"/>
</properties>
<dependencies>
<module name="javax.faces.api" slot="2.2"/>
<module name="javaee.api"/>
<module name="javax.servlet.jstl.api"/>
<module name="org.apache.xerces" services="import"/>
<module name="org.apache.xalan" services="import"/>
</dependencies>
<resources>
<resource-root path="jsf-impl-2.2.14.jar"/>
</resources>
</module>
and jboss-deployment-structure.xml looks like below in both Project and and JBoss Server
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.log4j" />
<module name="javax.faces.api" />
<module name="com.sun.jsf-impl" />
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="2.2"/>
<module name="com.sun.jsf-impl" slot="2.2"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
After all these set up done, when I run the project, I get below error in modules\javax\faces\api\2.2\module.xml
Unexpected content of type 'element start' named
'{urn:jboss:module:1.1}module'
But I don't know what's wrong with that line in file mentioned above. Everything seems valid there. Here is the complete StackTrace
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:67) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [:1.7.0_79]
at java.lang.Thread.run(Unknown Source) [:1.7.0_79]
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from D:\Eclipse\jboss-as-web-7.0.2.Final\jboss-as-web-7.0.2.Final\modules\javax\faces\api\2.2\module.xml
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:249)
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:200)
at org.jboss.modules.LocalModuleLoader.parseModuleInfoFile(LocalModuleLoader.java:147)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:124)
at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:245)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:194)
at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:97)
at org.jboss.modules.ModuleLoader.preloadExportedModule(ModuleLoader.java:205)
at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:218)
at org.jboss.as.server.moduleservice.ServiceModuleLoader.preloadModule(ServiceModuleLoader.java:161) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:176)
at org.jboss.modules.Module.linkImports(Module.java:1041)
at org.jboss.modules.Module.relink(Module.java:1153)
at org.jboss.modules.ModuleLoader.relink(ModuleLoader.java:400)
at org.jboss.as.server.moduleservice.ServiceModuleLoader.relinkModule(ServiceModuleLoader.java:204) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:64) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[25,72]
Message: Unexpected content of type 'element start' named '{urn:jboss:module:1.1}module'
at org.jboss.modules.ModuleXmlParser.unexpectedContent(ModuleXmlParser.java:312)
at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:503)
at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:244)
... 20 more
Could someone help me out through this?
According to this link
https://developer.jboss.org/thread/171833
a similar problem (but that time caused by the file jboss-deployment-structure.xml ) was solved by removing the namespace attribute from the element.
Now that your error message is actually the same, why don't you experiment by changing the namespace of (one of) your elements from
<module xmlns="urn:jboss:module:1.1"
maybe to
<module xmlns="urn:jboss:module:1.0"
Or just try to completely remove the namespace attribute from the element?
I've been searching and fighting this all day and nothing I have found has been able to resolve this issue. I am in the progress of attempting to migrate a spring-based application to WildFly 10 (from a legacy JBoss application server) and am having issues when deploying.
For this application, I have my application (MyApplication.war) and 2 modules, Spring 3.1.2 and MyCustomJar.jar. The custom JAR contains spring XML configuration files (and is what appears to be blowing up on WildFly).
The WAR file deploys, and the spring container gets initialized. However once it starts to try and process bean definitions from mycustomjar.jar!myspring-app.xml it errors out because it cannot find the spring context schema. The stack trace from wildfly and my module + jboss-deployment-structure are included. Any ideas to try would be appreciated. I have done about every variation of import/export from the spring module that I could find online today with absolutely no effect.
2017-03-02 14:58:08,282 INFO [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 62) Refreshing Root WebApplicationContext: startup date [Thu Mar 02 14:58:08 EST 2017]; root of context hierarchy
2017-03-02 14:58:08,317 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from URL [jar:file:/c:/data/apps/wildfly-10.1.0.Final/modules/mycustomjar/mycustomjar.jar!/myspring-context.xml]
2017-03-02 14:58:08,518 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from class path resource [myspring-app.xml]
2017-03-02 14:58:08,575 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 62) Loading XML bean definitions from class path resource [myspring-services.xml]
2017-03-02 14:58:08,676 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 62) Context initialization failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:myspring-services.xml]
Offending resource: URL [jar:file:/c:/data/apps/wildfly-10.1.0.Final/modules/mycustomjar/mycustomjar.jar!/myspring-context.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [myspring-services.xml]
org.springframework.spring
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.springframework.spring" slot="3.1.2">
<resources>
<resource-root path="org.springframework.aop-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.asm-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.aspects-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.beans-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.context-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.context.support-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.core-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.expression-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.instrument-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.instrument.tomcat-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.jdbc-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.jms-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.orm-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.oxm-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.test-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.transaction-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web.portlet-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web.servlet-3.1.2.RELEASE.jar" />
<resource-root path="org.springframework.web.struts-3.1.2.RELEASE.jar" />
</resources>
<dependencies>
<module name="javax.api" export="true" />
<module name="javax.servlet.api" />
<module name="org.apache.commons.logging" />
<module name="org.jboss.vfs" />
<module name="org.jboss.msc" />
</dependencies>
</module>
MyCustomJar.jar
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="mycustomjar">
<resources>
<resource-root path="mycustomjar.jar" />
</resources>
<dependencies>
</dependencies>
</module>
MyApplication.war jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="javax.servlet.api" />
<module name="org.springframework.spring" meta-inf="export" export="true" />
<module name="mycustomjar" />
</dependencies>
</deployment>
</jboss-deployment-structure>
EDIT
I started testing around with different spring versions, and upgrading to 3.2.14 I was able to get it running without any issues using the above configuration. Are the schema files located in a different spot in 3.1.2? It has to be something with those specific versions because a simple upgrade fixed everything
I have .war using Jersey REST, and it works in tomCat. But I need to run my .war in JBoss 6.4.0 which causes an exception
java.lang.RuntimeException: java.lang.NoSuchMethodError:
javax.validation.spi.ConfigurationState.getParameterNameProvider()
because JBoss uses old version javax.validation, and I need to exclude javax.validation from deployment of JBoss.
I create jboss-deployment-structure.xml in WEB-INF of .war:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclude-subsystems>
<subsystem name="resteasy" />
<subsystem name="jpa"/>
<subsystem name="org.hibernate" />
<subsystem name="org.hibernate.validator" />
</exclude-subsystems>
<exclusions>
<module name="javaee.api" />
<module name="javax.ws.rs.api"/>
<module name="org.jboss.resteasy.resteasy-jaxrs"/>
<module name="javax.validation.api"/>
<module name="org.hibernate"/>
<module name="org.hibernate.validator"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
This helped me to exclude javax.ws.rs, but How can to exclude javax.validation? Help me, please
Ok, so You need to exclude not only
<module name="javax.validation.api"/>
itself, but also modules that are dependent on javax.validation.api module. The easiest way to see which modules are dependent on javax.validation.api and force it to be included, even though it was excluded, is to search your .xml files in
JBOSS_DIRECTORY/modules for javax.validation.api, the modules that are dependent have something like that in module.xml:
<dependencies>>
<module name="javax.validation.api"/>
...
And those modules need to be excluded as well. For me - I also needed to exclude:
<module name="javax.faces.api"/>
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider"/>
And then, javax validation eclusion was working :)
So, it is something! May be help to someone:
Library javax.validation.api in JBoss - belongs to Implicit module, documentation about implicit module: implicit module dependencies
So implicit modules are Automatic Dependencies, and their can exclusion, about this: class lading and automatic dependencies - part about Automatic Dependencies:
Automatic dependencies can be excluded through the use of jboss-deployment-structure.xml. But this is not work! :(, and JBoss has bug with similar library javax.persistence, and it bug open in tasks.
So - what can to do?
Update JBoss to 7.0.0 version, but now just Alpha and Beta versions :(
Replace old javax.validation.api .jar on new version .jar
(in EAP-6.4.0/modules/system/layers/base/javax/faces/api/main)
Add custom version, and it tangled:
change default config in EAP-6.4.0/modules/system/layers/base/javax/faces/api/main module.xml file, in line <module name="javax.validation.api" export="true"/> remove option export="true", result: <module name="javax.validation.api"/> This changed to allow you add a new custom library javax.validation.
And create custom folder with name 1.1 in EAP-6.4.0/modules/system/layers/base/javax/validation/api, put in 1.1 folder new javax.validation .jar and model.xml.
model.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="javax.validation.api" slot="1.1">
<resources>
<resource-root path="validation-api-1.1.0.Final.jar"/>
</resources>
<dependencies>
<module name="org.jboss.logging"/>
</dependencies>
</module>
params:
slot - name custom folder (1.1),
path - path to .jar library
Last: add module to jboss-deployment-structure.xml in project:
<dependencies>
<module name="javax.validation.api" slot="1.1" export="true"/>
</dependencies>
i have installed wildfly 8.1 and because i have already a project configured to use EclipseLink, i have tried to configure wildfly to use it.
However, it always gives the same error :
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
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:1145) [rt.jar:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider '
org.eclipse.persistence.jpa.PersistenceProvider
' not found
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:990)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:258)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleWarDeployment(PersistenceUnitServiceHandler.java:191)
at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:126)
at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.1.0.Final.jar:8.1.0.Final]
... 5 more
I have followed the instructions of the official documentation, but nothing changed. I have added the eclipseLink's jar to "modules\system\layers\base\org\eclipse\persistence\main"
and the module.xml :
<module xmlns="urn:jboss:module:1.3" name="org.eclipse.persistence">
<resources>
<resource-root path="jipijapa-eclipselink-1.0.1.Final.jar"/>
<resource-root path="eclipselink.jar"/>
</resources>
<dependencies>
<module name="asm.asm"/>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="javax.xml.bind.api"/>
<module name="org.antlr"/>
<module name="org.apache.commons.collections"/>
<module name="org.dom4j"/>
<module name="org.javassist"/>
<module name="org.jboss.as.jpa.spi"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.vfs"/>
</dependencies>
</module>
Do you know what is the problem ?
Tks
Edit :
My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<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="AppPu">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/H2Ds</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
</persistence-unit>
</persistence>
New lines in provider section of persistence.xml won't work (how could it help?).
Wildfly hasn't got provided eclipseLink implementation in libs. To fix this follow this steps:
Download eclipselink.jar (or copy from your maven repo)
Copy it to
destination :
...Wildfly\modules\system\layers\base\org\eclipse\persistence\main
Edit module.xml (same path). Add section
<resource-root path="eclipselink.jar"><filter><exclude path="javax/**" /></filter></resource-root>
After server restart everything should work.
Finally I solved the problem!
in fact, I have a composite unit, all persistence.xml are correct, but the persistence.xml which declared the composite unit was a bad statement of the provider:
<provider>
org.eclipse.persistence.jpa.PersistenceProvider
</provider>
replaced by :
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
and now work fine.
You need to add provider to persistence-unit in your persistence.xml:
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
The official documentaiton on how to configure the eclipselin module, and the required system property to active the vfs acrhieve factory impl are both given here:
https://docs.jboss.org/author/display/WFLY10/JPA+Reference+Guide#JPAReferenceGuide-UsingEclipseLink
For the module do something as:
<module xmlns="urn:jboss:module:1.1" name="org.eclipse.persistence">
<resources>
<resource-root path="jipijapa-eclipselink-10.0.0.Final.jar"/>
<resource-root path="eclipselink.jar">
<filter>
<exclude path="javax/**" />
</filter>
</resource-root>
</resources>
<dependencies>
<module name="asm.asm"/>
<module name="javax.api"/>
<module name="javax.annotation.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="javax.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>
For the system property do something as:
<system-properties>
...
<property name="eclipselink.archive.factory" value="org.jipijapa.eclipselink.JBossArchiveFactoryImpl"/>
</system-properties>
Finally, do not start adding to your persistence.xml any container sepcific properties like:
<property name="eclipselink.target-server" value="JBoss" />
This is completely wrong.
Wildfly is already taking care of puting the proper target server platform in its:
org.jipijapa.eclipselink.EclipseLinkPersistenceProviderAdaptor
Here is a sample of code from their class:
#SuppressWarnings({ "rawtypes", "unchecked" })
#Override
public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) {
if (!pu.getProperties().containsKey(ECLIPSELINK_TARGET_SERVER)) {
properties.put(ECLIPSELINK_TARGET_SERVER, WildFlyServerPlatform.class.getName());
properties.put(ECLIPSELINK_ARCHIVE_FACTORY, JBossArchiveFactoryImpl.class.getName());
properties.put(ECLIPSELINK_LOGGING_LOGGER, JBossLogger.class.getName());
}
}
YOu might want to make sure you debug this class, to make sure it gets invoked and makes your dynamic persistence unit properties all proper.
But do not mess around with persistence.xml properties that are specific to the container. Wildfly is doing this properly and they add them themselves.
So just follow their documentation, that is the best advice.
in EAP with a servicepack there is the trap that the org.eclipse.persistence module might actually be in the .overlays/ tree (modules/system/layers/base/.overlays/).