Skip to content

Commit 17c17d7

Browse files
committed
print more info about NginxBridgeHandler related classpath, e.g. jersey
1 parent a07ac97 commit 17c17d7

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/java/nginx/clojure/bridge/NginxBridgeStarter.java

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public NginxBridge start(Map<String, String> properties) {
2828

2929
String libDirs = properties.get(BRIDGE_LIB_DIRS);
3030
String cpDirs = properties.get(BRIDGE_LIB_CP);
31-
String loaderKey = libDirs+"\n" + cpDirs;
3231
ClassLoader bootstrapLoader = null;
3332

3433
for (Entry<String, String> en : properties.entrySet()) {
@@ -39,11 +38,27 @@ public NginxBridge start(Map<String, String> properties) {
3938
}
4039

4140
String bridgeImp = properties.get(BRIDGE_IMP);
41+
42+
NginxClojureRT.getLog().info("%s.boot() with bridge.lib.dirs : [%s]", bridgeImp, libDirs);
43+
NginxClojureRT.getLog().info("%s.boot() with bridge.lib.cp : [%s]", bridgeImp, cpDirs);
4244

4345
List<URL> urlList = new ArrayList<URL>();
4446
if (libDirs != null) {
4547
for (String dir : libDirs.split(File.pathSeparator)) {
46-
for (File f : new File(dir).listFiles()) {
48+
File[] fileList = new File(dir).listFiles();
49+
50+
if (fileList == null) {
51+
NginxClojureRT.getLog().warn("%s.boot() no jar/dir in path : [%s]", bridgeImp, dir);
52+
continue;
53+
}
54+
55+
for (File f : fileList) {
56+
57+
if (!f.canRead()) {
58+
NginxClojureRT.getLog().warn("%s.boot() [%s] is not readable or we have no read permission", bridgeImp, f.getAbsolutePath());
59+
continue;
60+
}
61+
4762
try {
4863
if (f.isFile() && f.getName().endsWith(".jar")) {
4964
urlList.add(f.toURI().toURL());
@@ -59,6 +74,12 @@ public NginxBridge start(Map<String, String> properties) {
5974
if (cpDirs != null) {
6075
for (String dir : cpDirs.split(File.pathSeparator)) {
6176
File f = new File(dir);
77+
78+
if (!f.canRead()) {
79+
NginxClojureRT.getLog().warn("%s.boot() [%s] is not readable or we have no read permission", bridgeImp, f.getAbsolutePath());
80+
continue;
81+
}
82+
6283
try {
6384
if (f.isFile() && f.getName().endsWith(".jar")) {
6485
urlList.add(f.toURI().toURL());

0 commit comments

Comments
 (0)