diff --git a/core/src/main/java/lucee/runtime/exp/PageExceptionImpl.java b/core/src/main/java/lucee/runtime/exp/PageExceptionImpl.java index 02df8cb2b5..11eede8e74 100755 --- a/core/src/main/java/lucee/runtime/exp/PageExceptionImpl.java +++ b/core/src/main/java/lucee/runtime/exp/PageExceptionImpl.java @@ -594,27 +594,38 @@ public static String toString(PageContext pc, StackTraceElement trace) { if (trace.getFileName() == null || trace.getFileName().endsWith(".java")) return trace.toString(); Config config = ThreadLocalPageContext.getConfig(pc); if (config != null) { - Resource res = pc.getConfig().getResource(trace.getFileName()); - if (res.exists()) path = trace.getFileName(); - - // get path from source - if (path == null) { - SourceInfo si = MappingUtil.getMatch(pc, trace); - if (si != null) { - if (si.absolutePath(pc) != null) { - res = pc.getConfig().getResource(si.absolutePath(pc)); - if (res.exists()) path = si.absolutePath(pc); - } - if (path == null && si.relativePath != null) path = si.relativePath; - } - if (path == null) path = trace.getFileName(); - } + path = abs((PageContextImpl) pc, config, trace.getFileName()); + /* + * Resource res = pc.getConfig().getResource(trace.getFileName()); if (res.exists()) path = + * trace.getFileName(); + * + * // get path from source if (path == null) { SourceInfo si = MappingUtil.getMatch(pc, trace); if + * (si != null) { if (si.absolutePath(pc) != null) { res = + * pc.getConfig().getResource(si.absolutePath(pc)); if (res.exists()) path = si.absolutePath(pc); } + * if (path == null && si.relativePath != null) path = si.relativePath; } if (path == null) path = + * trace.getFileName(); } + */ } return trace.getClassName() + "." + trace.getMethodName() + (trace.isNativeMethod() ? "(Native Method)" : (path != null && trace.getLineNumber() >= 0 ? "(" + path + ":" + trace.getLineNumber() + ")" : (path != null ? "(" + path + ")" : "(Unknown Source)"))); } + private static String abs(PageContextImpl pci, Config config, String template) { + + Resource res = config.getResource(template); + if (res.exists()) return template; + + PageSource ps = pci == null ? null : pci.getPageSource(template); + res = ps == null ? null : ps.getPhyscalFile(); + if (res == null || !res.exists()) { + res = config.getResource(ps.getDisplayPath()); + if (res != null && res.exists()) return res.getAbsolutePath(); + } + else return res.getAbsolutePath(); + return template; + } + private static StackTraceElement[] getStackTraceElements(Throwable t) { StackTraceElement[] st = getStackTraceElements(t, true); if (st == null) st = getStackTraceElements(t, false); diff --git a/loader/build.xml b/loader/build.xml index d454b47a11..ed050c00f6 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index ffa42b15fe..d7481ef727 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.1.0.29-BETA + 6.1.0.30-BETA jar Lucee Loader Build