[
https://issues.redhat.com/browse/WFLY-14132?page=com.atlassian.jira.plugi...
]
Cheng Fang commented on WFLY-14132:
-----------------------------------
[~jgmeligmeyling] when deploying an exploded directory (copying to {{.../deployments}})
that does not end with valid extensions (.jar, .war, etc), do you see any other
errors/warnings, besides ejb-jar.xml and jboss-ejb3.xml being ignored? From my above
comment, other parts would also fail, for example,
{code}
2020-12-07 23:56:54,063 ERROR [org.jboss.as.server.deployment.scanner]
(DeploymentScanner-threads - 2) WFLYDS0011: The deployment scanner found a directory named
META-INF that was not inside a directory whose name ends with .ear, .jar, .rar, .sar or
.war. This is likely the result of unzipping an archive directly inside the
xxx/build/target/wildfly-22.0.0.Beta1-SNAPSHOT/standalone/deployments directory, which is
a user error. The META-INF directory will not be scanned for deployments, but it is
possible that the scanner may find other files from the unzipped archive and attempt to
deploy them, leading to errors.
{code}
jboss-ejb3.xml is ignored for exploded deployments
--------------------------------------------------
Key: WFLY-14132
URL:
https://issues.redhat.com/browse/WFLY-14132
Project: WildFly
Issue Type: Bug
Components: EJB
Affects Versions: 14.0.1.Final, JBoss AS7 7.1.1.Final, 21.0.1.Final
Reporter: Jan-Willem Gmelig Meyling
Assignee: Cheng Fang
Priority: Major
Labels: ejb-jar.xml, jboss-ejb3.xml
{{EjbJarParsingDeploymentUnitProcessor}} distinguishes between a WAR and JAR deployment
based on the file extension of the name of the deployment root. For exploded deployments
however, this deployment root may be a folder without any file extension. As a result the
logic fails to detect either a JAR or WAR file and the {{ejb-jar.xml}} and
{{jboss-ejb3.xml}} files are ignored. A better way could be to determine the extension
from the name of {{DeploymentUnit}} instead.
Code from:
[
https://github.com/wildfly/wildfly/blob/master/ejb3/src/main/java/org/jbo...]
{code:java}
private static VirtualFile getDescriptor(final VirtualFile deploymentRoot, final
String descriptorName) {
// Locate the descriptor
final VirtualFile descriptor;
// EJB 3.1 FR 20.4 Enterprise Beans Packaged in a .war
if (isWar(deploymentRoot)) {
// it's a .war file, so look for the ejb-jar.xml in WEB-INF
descriptor = deploymentRoot.getChild(WEB_INF + "/" +
descriptorName);
} else if
(deploymentRoot.getName().toLowerCase(Locale.ENGLISH).endsWith(JAR_FILE_EXTENSION)) {
descriptor = deploymentRoot.getChild(META_INF + "/" +
descriptorName);
} else {
// neither a .jar nor a .war. Return
return null;
}
if (descriptor == null || !descriptor.exists()) {
// no descriptor found, nothing to do!
return null;
}
return descriptor;
}
{code}
I encountered this issue on WildFly 14.0.1.Final, but the code is also present in the
current master and goes back to versions as early as 7.1.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)