Skip to content

Commit

Permalink
com.opensymphony.module.sitemesh.Factory no longer works with Java 11
Browse files Browse the repository at this point in the history
resolves sitemesh#36
  • Loading branch information
hazendaz committed May 13, 2023
1 parent d62d826 commit 27f56ea
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/opensymphony/module/sitemesh/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.lang.reflect.InvocationTargetException;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

/**
* Factory responsible for creating appropriate instances of implementations. This is specific to a web context and is
Expand Down Expand Up @@ -114,9 +113,8 @@ private static String getEnvEntry(String envEntry, String defaultValue) {
if (Container.get() != Container.JRUN) {
// TODO: JRun really isn't happy with this
InitialContext ctx = new InitialContext();
Object o = ctx.lookup("java:comp/env/" + envEntry);
result = (String) ctx.lookup("java:comp/env/" + envEntry);
ctx.close();
result = (String) PortableRemoteObject.narrow(o, String.class); // rmi-iiop friendly.
}
} catch (Exception | NoClassDefFoundError e) {
// failed - don't moan, just return default.
Expand Down

0 comments on commit 27f56ea

Please sign in to comment.