User: mnf999
Date: 02/02/03 17:50:52
Modified: src/main/org/jboss/deployment DeploymentInfo.java
MainDeployer.java
Log:
Fix for faulty manifest references intra EAR, DON'T use manifest INTRA-EAR
Revision Changes Path
1.4 +7 -5 jboss/src/main/org/jboss/deployment/DeploymentInfo.java
Index: DeploymentInfo.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/DeploymentInfo.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DeploymentInfo.java 2002/02/02 22:14:17 1.3
+++ DeploymentInfo.java 2002/02/04 01:50:52 1.4
@@ -54,7 +54,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Schulze</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Christoph G. Jung</a>
-* @version $Revision: 1.3 $ <p>
+* @version $Revision: 1.4 $ <p>
*
* <b>20011211 marc fleury:</b>
* <ul>
@@ -140,6 +140,10 @@
// The key url the deployment comes from
this.url = url;
+ // Does it even exist?
+ try { url.openStream().close(); }
+ catch (Exception e) {throw new DeploymentException("url "+url+" could not
be opened, does it exist?");}
+
// this may be changed by deployers in case of directory and xml file
following
this.watch =url;
@@ -164,9 +168,7 @@
// Do we have an XML descriptor only deployment?
isXML = shortName.toLowerCase().endsWith("xml");
-
- // Does it even exist?
- try { url.openStream().close(); } catch (Exception e) {throw new
DeploymentException("url "+url+" could not be opened, does it exist?");}
+
}
public void createClassLoaders()
@@ -228,7 +230,7 @@
subDeployments.clear();
mbeans.clear();
-
+
}
1.7 +39 -19 jboss/src/main/org/jboss/deployment/MainDeployer.java
Index: MainDeployer.java
===================================================================
RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/MainDeployer.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- MainDeployer.java 2002/02/02 20:22:44 1.6
+++ MainDeployer.java 2002/02/04 01:50:52 1.7
@@ -42,7 +42,7 @@
* Takes a series of URL to watch, detects changes and calls the appropriate
Deployers
*
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.6 $
+* @version $Revision: 1.7 $
*
*
*/
@@ -75,8 +75,12 @@
/** period of scanning **/
int period = 5000;
+ /** an increment for tmp files **/
int id = 0;
+ /** Given a flat set of files, this is the order of deployment **/
+ String[] order = {"sar", "service.xml", "rar", "jar", "war", "ear", "zip"};
+
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -301,7 +305,12 @@
Iterator subs = di.subDeployments.iterator();
while (subs.hasNext())
{
- undeploy((DeploymentInfo) subs.next());
+ DeploymentInfo sub = (DeploymentInfo) subs.next();
+
+ // undeploy((DeploymentInfo) subs.next());
+ log.info("DEPLOYMENT OF SUB "+sub.url);
+ undeploy(sub);
+
}
// Them remove the deployment itself
@@ -313,7 +322,7 @@
// remove from local maps
deployments.remove(di.url);
if (deploymentsList.lastIndexOf(di) != -1)
deploymentsList.remove(deploymentsList.lastIndexOf(di));
-
+
// Nuke my stuff, this includes the class loader
di.cleanup(log);
@@ -546,6 +555,7 @@
JarFile jarFile =null;
// Then the packages inside the package being deployed
+ HashSet subDeployments = new HashSet();
// marcf FIXME FIXME FIXME add support for directories not just jar files
@@ -596,9 +606,8 @@
DeploymentInfo sub = new DeploymentInfo(subURL, di);
// And deploy it, this call is recursive
- deploy(sub);
+ subDeployments.add(sub);
}
- catch (DeploymentException e3) { throw e3;} //just throw
catch (Exception e2)
{
log.error("Error in subDeployment with name "+name, e2);
@@ -616,7 +625,20 @@
// works
// We should encapsulate "opening and closing of the jarFile" in the
DeploymentInfo
// Here we let it be open and cached
+
}
+
+ // Order the deployments
+ Iterator lt = sortDeployments(subDeployments).listIterator();
+
+ // Deploy them all
+ while (lt.hasNext())
+ {
+
+ try{ deploy((DeploymentInfo) lt.next());}
+
+ catch (DeploymentException de) { di.subDeployments.remove(di);}
+ }
}
@@ -733,26 +755,28 @@
{
URL lib = null;
- try
- {
- String tk = st.nextToken();
+ String tk = st.nextToken();
- lib = new URL(sdi.url, tk);
+ DeploymentInfo sub = null;
+
+ log.debug("new manifest entry for sdi at "+sdi.shortName+" entry is
"+tk);
- log.debug("new manifest entry for sdi at "+sdi.shortName+" entry is
"+tk);
+ try {
+
+ lib = new URL(sdi.url, tk);
if (!deployments.containsKey(lib))
{
- // Try having it as a full subdeployment
- DeploymentInfo sub = new DeploymentInfo(lib, sdi);
+ // Try having it as a full subdeployment
+ sub = new DeploymentInfo(lib, sdi);
+
deploy(sub);
-
- sdi.subDeployments.add(sub);
}
}
catch (Exception ignore) {
- log.error("The manifest entry in "+sdi.url+" references URL "+lib+ "
which could not be opened, entry ignored, please fix classpath in manifest.mf");
+ log.error("The manifest entry in "+sdi.url+" references URL "+lib+
+ " which could not be opened, entry ignored");
}
}
}
@@ -762,8 +786,6 @@
{
ArrayList list = new ArrayList(urls.size());
- String[] order = {"sar", "service.xml", "rar", "ear", "jar", "zip","war"};
-
for (int i = 0 ; i < order.length ; i++)
{
Iterator it = urls.iterator();
@@ -788,8 +810,6 @@
public ArrayList sortDeployments(Set urls)
{
ArrayList list = new ArrayList(urls.size());
-
- String[] order = {"sar", "service.xml", "rar", "ear", "war", "jar", "zip"};
for (int i = 0 ; i < order.length ; i++)
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development