Подскажите пожалуйста какие нюансы есть при вызове stateless ejb bean из самодельного Authentication Provider для Weblogic ? Может дадите ссылку на доку ?
Собственно вот кусок кода из Authentication Adapter
public String[] authenticate(Callback[] callbacks) throws LoginException {
userName = getUserName(callbacks);
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
UserManagerBeanRemote session = createSession();
Collection<String> privileges;
try {
long userId = session.authonitacateUser(userName);
privileges = session.getUserPrivileges(userId);
} catch (RemoteException e) {
throw new LoginException("Failed to perform call [" + e.getMessage() + "]");
}
Collection<String> principals = new HashSet<String>(privileges.size());
for (String privilege : privileges) {
principals.add(privilege);
}
return principals.toArray(new String[principals.size()]);
}
private static UserManagerBeanRemote createSession() throws LoginException {
UserManagerBeanRemote result;
javax.naming.InitialContext initialContext = null;
try {
initialContext = new javax.naming.InitialContext(null);
Object objRef = initialContext.lookup(userManagerBeanJNDIName);
Object homeObj = javax.rmi.PortableRemoteObject.narrow(objRef, UserManagerBeanRemoteHome.class);
UserManagerBeanRemoteHome home = (UserManagerBeanRemoteHome)homeObj;
result = home.create();
} catch (CreateException ce){
throw new LoginException("Failed to create login ejb.");
}
catch (NamingException e) {
throw new LoginException("Failed to locate login ejb.");
}
catch (RemoteException e) {
throw new LoginException("Failed to create login ejb.");
}
finally {
try {
if ( initialContext != null )
initialContext.close();
}
catch (Exception e) {
// ignore
}
}
return result;
}
получаю странный Exception
java.lang.NullPointerException
at weblogic.logging.commons.LogImpl.doLog(LogImpl.java:95)
at weblogic.logging.commons.LogImpl.warn(LogImpl.java:75)
at weblogic.logging.commons.LogImpl.warn(LogImpl.java:71)
at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processException(PageFlowRequestProcessor.java:987)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:95)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2042)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:90)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2114)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:554)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:851)
at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:630)
at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:157)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3242)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Подскажите пожалуйста кто чем может...
Маленькое уточнение, проблеса происходит в этой строчке
result = home.create();
Не может создать Remoute интерфейс.
Проблема, разрешилась. Оказывается один из методов Session bean возращал Value Object который у меня не был положен в ClassPath моего Custom Authentication Provider