File tree 1 file changed +10
-5
lines changed
modules/core/src/main/java/org/apache/synapse/deployers
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 30
30
import org .apache .synapse .libraries .LibClassLoader ;
31
31
32
32
import java .io .File ;
33
+ import java .net .MalformedURLException ;
33
34
34
35
public class ClassMediatorDeployer extends AbstractDeployer {
35
36
@@ -65,13 +66,17 @@ public void deploy(DeploymentFileData deploymentFileData) throws DeploymentExcep
65
66
String mediatorPath = FilenameUtils .normalize (deploymentFileData .getAbsolutePath ());
66
67
67
68
log .info ("Deploying library from file : " + mediatorPath );
68
- ClassLoader classLoader = deploymentFileData .getClassLoader ();
69
- if (classLoader instanceof LibClassLoader ) {
70
- classLoader = Utils .getClassLoader (classLoader , mediatorPath , false );
69
+ if (deploymentFileData .getClassLoader () != null ) {
70
+ try {
71
+ ((LibClassLoader ) deploymentFileData .getClassLoader ()).addURL (new File (mediatorPath ).toURI ().toURL ());
72
+ } catch (MalformedURLException e ) {
73
+ throw new DeploymentException ("Error adding URL to lib class loader" , e );
74
+ }
71
75
} else {
72
- classLoader = Utils .getClassLoader (ClassMediatorDeployer .class .getClassLoader (), mediatorPath , false );
76
+ ClassLoader mediatorLoader = Utils .getClassLoader (ClassMediatorDeployer .class .getClassLoader (),
77
+ mediatorPath , false );
78
+ getDeploymentStore ().addClassMediatorClassLoader (mediatorPath , mediatorLoader );
73
79
}
74
- getDeploymentStore ().addClassMediatorClassLoader (mediatorPath , classLoader );
75
80
}
76
81
77
82
/**
You can’t perform that action at this time.
0 commit comments