User: fleury
Date: 00/05/19 18:36:16
Modified: src/java/org/ejboss/deployment EjbJar.java
Log:
EjbJar works from the jarURL connection as well.
We change the read to get the entry fron the open connection
Revision Changes Path
1.8 +11 -26 ejboss/src/java/org/ejboss/deployment/EjbJar.java
Index: EjbJar.java
===================================================================
RCS file: /products/cvs/ejboss/ejboss/src/java/org/ejboss/deployment/EjbJar.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- EjbJar.java 2000/05/20 01:26:46 1.7
+++ EjbJar.java 2000/05/20 01:36:15 1.8
@@ -36,7 +36,7 @@
*/
-public class EjbJar extends com.dreambean.ejx.ejb.EjbJar {
+public class EjbJar extends com.dreambean.ejx.ejb.EjbJar {
/*
* The file
@@ -228,40 +228,25 @@
try {
//Create a input stream from the distant URL
- java.io.InputStream urlInput;
- System.out.println(url);
- try{
- URL jarUrl = new
URL("jar:"+url.toString()+"!/META-INF/ejb-jar.xml");
- JarURLConnection conn = (JarURLConnection)jarUrl.openConnection();
- urlInput = conn.getInputStream();
- }catch(Throwable e)
- {
- e.printStackTrace();
- System.out.println("666666666666666666");
- throw new IOException(e.getMessage());
- }
- JarInputStream jarInputStream = new JarInputStream(urlInput);
- JarEntry jarEntry = jarInputStream.getNextJarEntry();
+ // We create the new URL as a "jar URL"
- // Cycle until we find the right entry
+ URL jarUrl = new URL("jar:"+url.toString()+"!/META-INF/ejb-jar.xml");
- while (!jarEntry.getName().equals("META-INF/ejb-jar.xml")) {
+ // Open the connection
+ JarURLConnection conn = (JarURLConnection)jarUrl.openConnection();
- jarEntry = jarInputStream.getNextJarEntry();
- }
-
// The input stream is at the right entry to read it
- document = xmlManager.load(new InputStreamReader(jarInputStream));
+ document = xmlManager.load(new
InputStreamReader(conn.getInputStream()));
}
catch (IOException ioe) {
Tracer.trace(TracerConstants.LOG_ERR,
- "ejbJarFile",
+ "EjbJar",
"could not load document in jar"+
- jarFile.toString());
+ url.toString());
Tracer.trace(ioe);
@@ -281,9 +266,9 @@
catch (Exception e) {
Tracer.trace(TracerConstants.LOG_ERR,
- "ejbJarFile",
+ "EjbJar",
"could not import document in jar"+
- jarFile.toString());
+ url.toString());
Tracer.trace(e);
@@ -301,7 +286,7 @@
beans++;
}
- StringBuffer message = new StringBuffer("parsed "+ jarFile.getName()+
+ StringBuffer message = new StringBuffer("parsed "+url.toString()+
" ("+beans+" ");
if (beans == 1) {