use of org.apache.tomee.catalina.facade.ExceptionManagerFacade in project tomee by apache.
the class FullRestartContainer method lookup.
private ExceptionManagerFacade lookup() {
final Options options = new Options(System.getProperties());
final Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
final int port = ServerLocal.getPort(-1);
if (port > 0) {
System.out.println("provider url = " + "http://localhost:" + port + "/tomee/ejb");
props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb"));
} else {
throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'");
}
try {
final InitialContext context = new InitialContext(props);
return (ExceptionManagerFacade) context.lookup("openejb/ExceptionManagerFacadeBusinessRemote");
} catch (final Exception e) {
throw new OpenEJBTCKRuntimeException(e);
}
}
Aggregations