Search in sources :

Example 1 with ExceptionManagerFacade

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);
    }
}
Also used : Options(org.apache.openejb.loader.Options) ExceptionManagerFacade(org.apache.tomee.catalina.facade.ExceptionManagerFacade) RemoteInitialContextFactory(org.apache.openejb.client.RemoteInitialContextFactory) OpenEJBTCKRuntimeException(org.apache.openejb.tck.OpenEJBTCKRuntimeException) Properties(java.util.Properties) InitialContext(javax.naming.InitialContext) OpenEJBTCKRuntimeException(org.apache.openejb.tck.OpenEJBTCKRuntimeException) IOException(java.io.IOException) DeploymentException(org.jboss.testharness.api.DeploymentException)

Aggregations

IOException (java.io.IOException)1 Properties (java.util.Properties)1 InitialContext (javax.naming.InitialContext)1 RemoteInitialContextFactory (org.apache.openejb.client.RemoteInitialContextFactory)1 Options (org.apache.openejb.loader.Options)1 OpenEJBTCKRuntimeException (org.apache.openejb.tck.OpenEJBTCKRuntimeException)1 ExceptionManagerFacade (org.apache.tomee.catalina.facade.ExceptionManagerFacade)1 DeploymentException (org.jboss.testharness.api.DeploymentException)1