You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2018/12/11 15:07:46 UTC
[2/3] tomee git commit: Add some debugging information on the APIs
not found
Add some debugging information on the APIs not found
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/36e426e7
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/36e426e7
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/36e426e7
Branch: refs/heads/master
Commit: 36e426e7e8cdfb947cf315a1130a5a43aad3b7f2
Parents: c17b93c
Author: Jean-Louis Monteiro <je...@gmail.com>
Authored: Tue Dec 11 16:06:43 2018 +0100
Committer: Jean-Louis Monteiro <je...@gmail.com>
Committed: Tue Dec 11 16:06:43 2018 +0100
----------------------------------------------------------------------
.../openejb/cdi/ManagedSecurityService.java | 24 +++++++++++++-------
1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/36e426e7/container/openejb-core/src/main/java/org/apache/openejb/cdi/ManagedSecurityService.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/ManagedSecurityService.java b/container/openejb-core/src/main/java/org/apache/openejb/cdi/ManagedSecurityService.java
index 1532f71..c5aba9d 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/ManagedSecurityService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/ManagedSecurityService.java
@@ -19,23 +19,25 @@ package org.apache.openejb.cdi;
import org.apache.openejb.loader.SystemInstance;
import org.apache.openejb.spi.SecurityService;
+import org.apache.openejb.util.Join;
+import org.apache.openejb.util.LogCategory;
+import org.apache.openejb.util.Logger;
import org.apache.webbeans.config.WebBeansContext;
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
+import java.lang.reflect.*;
import java.security.Principal;
import java.security.PrivilegedActionException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Properties;
public class ManagedSecurityService implements org.apache.webbeans.spi.SecurityService {
+
private final org.apache.webbeans.corespi.security.ManagedSecurityService delegate = new org.apache.webbeans.corespi.security.ManagedSecurityService();
+ private final Logger logger = Logger.getInstance(LogCategory.OPENEJB_CDI, ManagedSecurityService.class.getName());
+
private final boolean useWrapper;
private Principal proxy = null;
@@ -51,6 +53,7 @@ public class ManagedSecurityService implements org.apache.webbeans.spi.SecurityS
.getProperty("org.apache.webbeans.component.PrincipalBean.proxyApis", "org.eclipse.microprofile.jwt.JsonWebToken").split(",");
List<Class> interfaceList = new ArrayList<>();
+ List<String> notFoundInterfaceList = new ArrayList<>();
for (final String apiInterface : apiInterfaces) {
try {
@@ -58,11 +61,16 @@ public class ManagedSecurityService implements org.apache.webbeans.spi.SecurityS
interfaceList.add(clazz);
} catch (NoClassDefFoundError | ClassNotFoundException e) {
-
- // TODO: log severe error here with guidance
+ notFoundInterfaceList.add(apiInterface);
}
}
+ if (!notFoundInterfaceList.isEmpty()) {
+ logger.info("Some Principal APIs could not be loaded: {0} out of {1} not found",
+ Join.join(",", notFoundInterfaceList),
+ Join.join(",", Arrays.asList(apiInterfaces)));
+ }
+
// not sure if we should do that, or simply check if we can't load the classes before
// and then skip the proxy creation and set the useWrapper to false.
if (interfaceList.isEmpty()) {