-
1. Re: JBoss 6.0: ignore persistence.xml in jar file
alesj Jun 22, 2011 3:56 PM (in response to gonne)Hmm, looking at EARStructure
if (archive.getChild("META-INF/persistence.xml").exists()) { log.trace(archive.getName() + " in ear lib directory has persistence units"); if (structureContext.determineChildStructure(archive) == false) it means that .ear lib is considered a sub-deployment if it has persistence.xml.
This means you need to add META-INF/jboss-ignore.txt to the actual lib.
Which sort of defeats the purpose of ignore file ...
-
2. Re: JBoss 6.0: ignore persistence.xml in jar file
alesj Jun 22, 2011 4:00 PM (in response to alesj)This means you need to add META-INF/jboss-ignore.txt to the actual lib.
With proper relative path: META-INF/persistence.xml or just persistence.xml will also do.
Or simply delete the persistence.xml ... (grrr, need to see who put this code there)
-
3. Re: JBoss 6.0: ignore persistence.xml in jar file
gonne Jul 6, 2011 7:50 AM (in response to alesj)Hi Ales,
thank you for your response.
According to your advice I tried to add the META-INF/jboss-ignore.txt to the actual lib. It was properly parsed by the AbstractIgnoreFilesDeployer and the NameIgnoreMechanism was registered in the DeploymentUnit.
AbstractParsingDeployerWithOutput<T>: createMetaData()
...
unit.getTransientManagedObjects().addAttachment(key, result, getOutput());
...
But in the ignoreFile() method of AbstractVFSParsingDeployer<T> the DummyNameIgnoreMechanism is always used.
It seems that the nameIgnoreMechanism attribute is not set properly even though the correct one is registered in the DeploymentUnit as transientManagedObject "org.jboss.deployers.spi.deployer.matchers.NameIgnoreMechanism".
I overrided the nameIgnoreMechanism attribute in the debugger with the correct value and it worked as exprected.
setNameIgnoreMechanism((org.jboss.deployers.spi.deployer.matchers.NameIgnoreMechanism)unit.getTransientManagedObjects().getAttachment("org.jboss.deployers.spi.deployer.matchers.NameIgnoreMechanism"))
But I do not know where it should be fixed.
Kind regards,
Gonne
-
4. Re: JBoss 6.0: ignore persistence.xml in jar file
alesj Jul 8, 2011 5:52 PM (in response to gonne)Which deployer instance is this?
By default all parsing deployers get set with DummyNIM; see org.jboss.Main class.
It's then per parsing deployer to set the appropriate NIM instance.