Skip to content

Commit

Permalink
EjbExceptionMapper not registered properly.
Browse files Browse the repository at this point in the history
Change-Id: Ib74bf2fa84e7cb51ef974747d233085b12dcd5d3
  • Loading branch information
pavelbucek committed Mar 14, 2017
1 parent 67222a2 commit d22d0c9
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,18 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.ws.rs.ext.ExceptionMapper;

import javax.annotation.Priority;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.inject.Singleton;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import org.glassfish.jersey.internal.inject.AbstractBinder;
import org.glassfish.jersey.internal.inject.Binding;
import org.glassfish.jersey.internal.inject.Bindings;
import org.glassfish.jersey.internal.inject.ClassBinding;
import org.glassfish.jersey.internal.inject.InjectionManager;
import org.glassfish.jersey.internal.inject.InstanceBinding;
import org.glassfish.jersey.server.ApplicationHandler;
Expand Down Expand Up @@ -300,11 +302,12 @@ public void done() {
}

private void registerEjbExceptionMapper() {
ClassBinding<EjbExceptionMapper> descriptor =
Bindings.serviceAsContract(EjbExceptionMapper.class)
.in(Singleton.class);

injectionManager.register(descriptor);
injectionManager.register(new AbstractBinder() {
@Override
protected void configure() {
bind(EjbExceptionMapper.class).to(ExceptionMapper.class).in(Singleton.class);
}
});
}

private boolean isEjbComponent(Class<?> component) {
Expand Down

0 comments on commit d22d0c9

Please sign in to comment.