[jboss-cvs] JBossAS SVN: r106441 - trunk/ejb3/src/main/java/org/jboss/ejb3/deployers.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 6 02:50:10 EDT 2010
Author: wolfc
Date: 2010-07-06 02:50:10 -0400 (Tue, 06 Jul 2010)
New Revision: 106441
Modified:
trunk/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java
Log:
JBAS-8153: correctly determine client class path
Modified: trunk/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java
===================================================================
--- trunk/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java 2010-07-06 06:11:43 UTC (rev 106440)
+++ trunk/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java 2010-07-06 06:50:10 UTC (rev 106441)
@@ -128,19 +128,27 @@
VFSDeploymentUnit earUnit = unit.getParent();
if(earUnit != null)
{
- List<VirtualFile> earClassPath = earUnit.getClassPath();
JBossAppMetaData earMD = earUnit.getAttachment(JBossAppMetaData.class);
if(earMD != null)
{
+ // find the lib dir of the ear
String libDir = earMD.getLibraryDirectory();
- if(libDir == null)
+ // if not explicitly specified, then set the default as "lib" folder in .ear
+ if (libDir == null || libDir.length() == 0)
+ {
libDir = "lib";
- String libDirPrefix = libDir + "/";
- for(VirtualFile vf : earClassPath)
+ }
+ // get the root of the ear
+ VirtualFile earRoot = earUnit.getRoot();
+ // get the VirtualFile corresponding to .ear/libdirectory (if any)
+ VirtualFile earLib = earRoot.getChild(libDir);
+ // ear library dir was found, so add all it's children to the classpath
+ if (earLib != null)
{
- if(vf.getPathName().startsWith(libDirPrefix))
+ List<VirtualFile> earLibContents = earLib.getChildren();
+ for (VirtualFile fileInEarLib : earLibContents)
{
- String uri = vf.toURI().toString();
+ String uri = fileInEarLib.toURI().toString();
cpURIs.add(uri);
}
}
More information about the jboss-cvs-commits
mailing list