Search in sources :

Example 11 with InjectionException

use of javax.enterprise.inject.InjectionException in project minijax by minijax.

the class EntityProvider method get.

@Override
public T get() {
    final MinijaxRequestContext context = MinijaxRequestContext.getThreadLocal();
    final InputStream entityStream = context.getEntityStream();
    try {
        return getImpl(context, entityStream);
    } catch (final IOException ex) {
        throw new InjectionException(ex.getMessage(), ex);
    }
}
Also used : InjectionException(javax.enterprise.inject.InjectionException) MinijaxRequestContext(org.minijax.MinijaxRequestContext) InputStream(java.io.InputStream) IOException(java.io.IOException)

Example 12 with InjectionException

use of javax.enterprise.inject.InjectionException in project minijax by minijax.

the class ConstructorProvider method get.

@Override
public T get() {
    try {
        final T result = ctor.newInstance(getParams(paramProviders));
        initImpl(result);
        return result;
    } catch (final InvocationTargetException ex) {
        final Throwable inner = ex.getCause();
        throw new InjectionException(inner.getMessage(), inner);
    } catch (final Exception e) {
        throw new InjectionException(String.format("Can't instantiate %s", ctor), e);
    }
}
Also used : InjectionException(javax.enterprise.inject.InjectionException) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvocationTargetException(java.lang.reflect.InvocationTargetException) InjectionException(javax.enterprise.inject.InjectionException)

Aggregations

InjectionException (javax.enterprise.inject.InjectionException)12 UnsatisfiedResolutionException (javax.enterprise.inject.UnsatisfiedResolutionException)3 ArrayList (java.util.ArrayList)2 Bean (javax.enterprise.inject.spi.Bean)2 CamelContext (org.apache.camel.CamelContext)2 Endpoint (org.apache.camel.Endpoint)2 FluentProducerTemplate (org.apache.camel.FluentProducerTemplate)2 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)2 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)2 DefaultCamelContextNameStrategy (org.apache.camel.impl.DefaultCamelContextNameStrategy)2 BeanManagerImpl (org.apache.webbeans.container.BeanManagerImpl)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Annotation (java.lang.annotation.Annotation)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 Level (java.util.logging.Level)1 CreationException (javax.enterprise.inject.CreationException)1 WebApplicationException (javax.ws.rs.WebApplicationException)1 MediaType (javax.ws.rs.core.MediaType)1