Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-2855 - Payara4 #2842

Merged
merged 2 commits into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import com.sun.enterprise.container.common.spi.util.ComponentEnvManager;
import com.sun.enterprise.container.common.spi.util.InjectionException;
import com.sun.enterprise.container.common.spi.util.InjectionManager;
import java.util.logging.Logger;

import javax.annotation.Resource;
import javax.ejb.EJB;
Expand All @@ -67,6 +68,8 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import org.glassfish.api.invocation.ComponentInvocation;
import org.glassfish.api.invocation.InvocationManager;

/**
* Class to provide actual injection of an annotation and related services
Expand Down Expand Up @@ -111,7 +114,13 @@ public <T> void aroundInject(InjectionContext<T> injectionContext) {
EjbContainerServices containerServices = serviceLocator.getService(EjbContainerServices.class);

JndiNameEnvironment componentEnv = compEnvManager.getCurrentJndiNameEnvironment();

if(componentEnv == null) {
InvocationManager invMgr = serviceLocator.getService(InvocationManager.class);
if (invMgr.getCurrentInvocation() != null) {
componentEnv = (JndiNameEnvironment)invMgr.<ComponentInvocation>getCurrentInvocation().getJNDIEnvironment();
}
}

ManagedBeanDescriptor mbDesc = null;

JndiNameEnvironment injectionEnv = (JndiNameEnvironment) bundleContext;
Expand All @@ -131,7 +140,7 @@ public <T> void aroundInject(InjectionContext<T> injectionContext) {
} else {
if( componentEnv == null ) {
//throw new IllegalStateException("No valid EE environment for injection of " + targetClassName);
System.err.println("No valid EE environment for injection of " + targetClassName);
Logger.getLogger(this.getClass().getCanonicalName()).info("No valid EE environment for injection of " + targetClassName);
injectionContext.proceed();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.jboss.weld.injection.spi.InjectionServices;

import javax.enterprise.inject.spi.*;
import java.util.logging.Logger;

/**
* The InjectionServices for a non-module bda (library or rar). A non-module bda has no associated bundle so we
Expand Down Expand Up @@ -81,7 +82,7 @@ public <T> void aroundInject(InjectionContext<T> injectionContext) {

if( componentEnv == null ) {
//throw new IllegalStateException("No valid EE environment for injection of " + targetClass);
System.err.println("No valid EE environment for injection of " + targetClass);
Logger.getLogger(this.getClass().getCanonicalName()).info("No valid EE environment for injection of " + targetClass);
injectionContext.proceed();
return;
}
Expand Down