PersistenceUnitBuilder cannot find persistence.xml on inPlace deployments
-------------------------------------------------------------------------
Key: GERONIMO-5452
URL: https://issues.apache.org/jira/browse/GERONIMO-5452
Project: Geronimo
Issue Type: Bug
Security Level: public (Regular issues)
Components: persistence
Affects Versions: 2.2, 2.1.6, 2.1.5, 2.1.4
Environment: Linux. Tested on 2.1.4 and 2.1.5 release versions, but
I'm sure it's the same in 2.2 and versions prior to 2.1.4.
Reporter: Ryan Sumner
OpenJPA PersistenceUnitBuilder will fail to find persistence.xml files within
modules of the EAR when using the inPlace deployment option. The following
exception will be thrown during deployment:
org.apache.geronimo.common.DeploymentException: Could not resolve reference at
deploy time for query
?name=persistence/mydb#org.apache.geronimo.persistence.PersistenceUnitGBean. No
GBeans found.
Where mydb is the name of the persistence unit.
I've attached a patch for the fix:
--- PersistenceUnitBuilder.java.orig 2010-07-14 20:26:55.991703857 -0500
+++ PersistenceUnitBuilder.java 2010-07-17 16:22:22.786269319 -0500
@@ -105,9 +105,16 @@
// buildPersistenceUnits(persistence, module,
module.getTargetPath());
}
try {
- File rootBaseFile =
module.getRootEarContext().getConfiguration().getConfigurationDir();
+ File rootBaseFile;
+ URI moduleBaseURI;
+
if(module.getRootEarContext().getConfigurationData().getInPlaceConfigurationDir()
== null) {
+ rootBaseFile =
module.getRootEarContext().getConfigurationData().getConfigurationDir();
+ moduleBaseURI = moduleContext.getBaseDir().toURI();
+ } else {
+ rootBaseFile =
module.getRootEarContext().getConfigurationData().getInPlaceConfigurationDir();
+ moduleBaseURI =
moduleContext.getConfigurationData().getInPlaceConfigurationDir().toURI();
+ }
String rootBase = rootBaseFile.toURI().normalize().toString();
- URI moduleBaseURI = moduleContext.getBaseDir().toURI();
Map rootGeneralData = module.getRootEarContext().getGeneralData();
ClassPathList manifestcp = (ClassPathList)
module.getEarContext().getGeneralData().get(ClassPathList.class);
if (manifestcp == null) {
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.