axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r306513 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/engine/ integration/test/org/apache/axis2/integration/
Date Thu, 06 Oct 2005 03:27:00 GMT
Author: deepal
Date: Wed Oct  5 20:26:46 2005
New Revision: 306513

URL: http://svn.apache.org/viewcvs?rev=306513&view=rev
Log:
fixing problems in deploying module using resources.

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java?rev=306513&r1=306512&r2=306513&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentClassLoader.java
Wed Oct  5 20:26:46 2005
@@ -72,7 +72,7 @@
         try {
             ZipInputStream zin = new ZipInputStream(new FileInputStream(file));
             ZipEntry entry;
-            String entryName = "";
+            String entryName;
             while ((entry = zin.getNextEntry()) != null) {
                 entryName = entry.getName();
                 /**
@@ -108,27 +108,31 @@
      */
     protected Class findClass(final String name)
             throws ClassNotFoundException {
-        Class cla = null;
+        Class cla ;
         try {
             cla = (Class)loadedclass.get(name);
             if(cla != null){
                 return cla;
             }
-            boolean foundClass = false;
+            boolean foundClass ;
             try {
                 cla = super.findClass(name);
-                foundClass = true;
                 loadedclass.put(name, cla);
                 return cla;
             } catch (ClassNotFoundException e) {
                 foundClass = false;
             }
             if (!foundClass) {
-                byte raw[] = getBytes(name);
-                cla = defineClass(name, raw, 0, raw.length);
-                loadedclass.put(name, cla);
-                foundClass = true;
-                return cla;
+                try {
+                    byte raw[] = getBytes(name);
+                    cla = defineClass(name, raw, 0, raw.length);
+                    loadedclass.put(name, cla);
+                    return cla;
+                } catch (Exception e) {
+                    foundClass = false;
+                } catch (ClassFormatError classFormatError) {
+                    foundClass = false;
+                }
             }
             if (!foundClass) {
                 throw new ClassNotFoundException(Messages.getMessage(
@@ -136,7 +140,8 @@
             }
 
         } catch (Exception e) {
-
+             throw new ClassNotFoundException(Messages.getMessage(
+                        DeploymentErrorMsgs.CLASS_NOT_FOUND, name));
         }
         return null;
     }
@@ -158,14 +163,14 @@
          * Replacing org.apache. -> org/apache/...
          */
         completeFileName = completeFileName.replace('.', '/').concat(".class");
-        byte raw[] = null;
+        byte raw[] ;
         for (int i = 0; i < lib_jars_list.size(); i++) {
             String libjar_name = (String) lib_jars_list.get(i);
             InputStream in = this.getResourceAsStream(libjar_name);
             try {
                 ZipInputStream zin = new ZipInputStream(in);
                 ZipEntry entry;
-                String entryName = "";
+                String entryName ;
                 while ((entry = zin.getNextEntry()) != null) {
                     entryName = entry.getName();
                     if (entryName != null &&

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=306513&r1=306512&r2=306513&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
Wed Oct  5 20:26:46 2005
@@ -787,9 +787,10 @@
      * @throws DeploymentException
      */
 
-    public ModuleDescription buildModule(File modulearchive) throws DeploymentException {
+    public ModuleDescription buildModule(File modulearchive, AxisConfiguration config) throws
DeploymentException {
         ModuleDescription axismodule;
         try {
+            this.setPhasesinfo(((AxisConfigurationImpl)config).getPhasesinfo());
             currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
             axismodule = new ModuleDescription();
             ArchiveReader archiveReader = new ArchiveReader();

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java?rev=306513&r1=306512&r2=306513&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/AxisConfigurationImpl.java
Wed Oct  5 20:26:46 2005
@@ -436,7 +436,7 @@
         if (module == null) {
             File file = new ArchiveReader().creatModuleArchivefromResource(
                     moduleref.getLocalPart(), getRepository());
-            module = new DeploymentEngine().buildModule(file);
+            module = new DeploymentEngine().buildModule(file,this);
             isNewmodule = true;
         }
         if (module != null) {

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java?rev=306513&r1=306512&r2=306513&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
Wed Oct  5 20:26:46 2005
@@ -125,12 +125,11 @@
                 org.apache.axis2.Constants.TESTING_REPOSITORY +
                         "/modules/addressing.mar");
         TestCase.assertTrue(file.exists());
-        ModuleDescription moduleDesc = deploymentEngine.buildModule(file);
 
         ConfigurationContextFactory efac = new ConfigurationContextFactory();
         ConfigurationContext sysContext =
                 efac.buildClientConfigurationContext("target/test-resources/intregrationRepo");
-
+         ModuleDescription moduleDesc = deploymentEngine.buildModule(file,sysContext.getAxisConfiguration());
         sysContext.getAxisConfiguration().addModule(moduleDesc);
         //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
 
@@ -148,11 +147,11 @@
                 org.apache.axis2.Constants.TESTING_REPOSITORY +
                         "/modules/addressing.mar");
         TestCase.assertTrue(file.exists());
-        ModuleDescription moduleDesc = deploymentEngine.buildModule(file);
 
         ConfigurationContextFactory efac = new ConfigurationContextFactory();
         ConfigurationContext sysContext =
                 efac.buildClientConfigurationContext(clientHome);
+        ModuleDescription moduleDesc = deploymentEngine.buildModule(file,sysContext.getAxisConfiguration());
 
         sysContext.getAxisConfiguration().addModule(moduleDesc);
         //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());



Mime
View raw message