2015-09-17 3 views
1

Миграция этого портлета в Liferay 6.2 GA4. Код работал на Websphere в WSRP Producer, но я не думаю, что он был создан с использованием какой-либо фабрики. В принципе, я думаю, что проблема вращается вокруг PortletRequest объекта здесь:Перенос портлета WSRP из Websphere в Liferay - PortletRequest.getAttribute (USER_INFO) возвращает null

RenderRequest portletRequest = (RenderRequest) request 
        .getAttribute("javax.portlet.request"); 
      logger.info("RenderRequest request value: " + request.toString()); 
      logger.info("portletRequest value: " + portletRequest.toString()); 
      logger.info("getAttribute: " + portletRequest.getAttributeNames().toString()); 
      if (portletRequest != null) { 
       props = (Map) portletRequest 
         .getAttribute(PortletRequest.USER_INFO); 
       logger.info("These are the props: " + props); 
       String userFirstName = (String) props 
         .get("user.name.given"); 
       logger.info("First name: " + userFirstName); 

Выход заявления журнала:

2015-09-17 14:58:20,423 WARN portlet.controller.Controller - Portlet Controller Initialized 
2015-09-17 14:59:47,274 INFO portlet.controller.Controller - New unique id: gAnsN6rBt6g-zgvmjw-8utKX 
2015-09-17 14:59:47,276 INFO portlet.controller.Controller - Set userProfileBean with gAnsN6rBt6g-zgvmjw-8utKX 
2015-09-17 14:59:47,277 INFO portlet.controller.Controller - RenderRequest request value: [email protected] 
2015-09-17 14:59:47,277 INFO portlet.controller.Controller - portletRequest value: [email protected] 
2015-09-17 14:59:47,278 INFO portlet.controller.Controller - getAttribute: [email protected] 
2015-09-17 14:59:47,278 INFO portlet.controller.Controller - These are the props: null 
2015-09-17 14:59:47,280 ERROR portlet.controller.Controller - NullPointerException in Controller 
java.lang.NullPointerException 
    at portlet.controller.Controller.getUserProfileForView(Controller.java:338) 

Я это определено в моей portlet.xml:

<user-attribute> <description>FirstName</description> <name>user.name.given</name> </user-attribute> <user-attribute> <description>LastName</description> <name>user.name.family</name> </user-attribute>

Где в атрибуте USER_INFO ничего нет?

ОБНОВЛЕНИЕ: Я только что проверил, что пользовательский портлет локально (то есть на том же сервере, где он создается), и аутентификация пользователя распространяется нормально, как я ожидал. Таким образом, где-то отключается портлет из удаленной (Liferay) среды.

UPDATE: liferay.log Показывает следующее при доступе к портлету от удаленного пользователя.

09:09:40,369 ERROR [server info][AutoLoginFilter:261] Current URL /en_US/widget/c/portal/layout?p_auth_secret=K%2BiMpCQsduglOsYkdIUQZQMtaDM%3D&p_l_id=21504&p_p_id=MyApp_WAR_MyApp_INSTANCE_X6Sw&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_isolated=1&wsrp=1 generates exception: com.liferay.portal.NoSuchUserException: No User exists with the key {companyId=20155, screenName=adminscreen} 
09:17:21,318 ERROR [server info][AutoLoginFilter:261] Current URL /en_US/widget/c/portal/layout?p_auth_secret=K%2BiMpCQsduglOsYkdIUQZQMtaDM%3D&p_l_id=21504&p_p_id=MyApp_WAR_MyApp_INSTANCE_X6Sw&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_isolated=1&_MyApp_WAR_MyApp_INSTANCE_X6Sw_action=aboutMyApp.do&&wsrp=1 generates exception: com.liferay.portal.NoSuchUserException: No User exists with the key {companyId=20155, screenName=adminscreen} 
09:17:21,323 WARN [server info][SecurityPortletContainerWrapper:630] Reject process action for /c/portal/layout on MyApp_WAR_MyApp_INSTANCE_X6Sw 

UPDATE: Стек трассировки для моего приложения, где генерируется NullPointer:

2015-09-18 12:15:10,965 ERROR portlet.controller.Controller - NullPointerException in Controller 
java.lang.NullPointerException 
    at portlet.controller.Controller.getUserProfileForView(Controller.java:338) 
    at portlet.controller.Controller.doView(Controller.java:64) 
    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328) 
    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233) 
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103) 
    at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55) 
    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100) 
    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64) 
    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) 
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718) 
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655) 
    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:583) 
    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656) 
    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362) 
    at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1213) 
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365) 
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309) 
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) 
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718) 
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655) 
    at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:55) 
    at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78) 
    at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53) 
    at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:655) 
    at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:138) 
    at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141) 
    at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126) 
    at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156) 
    at com.liferay.portal.layoutconfiguration.util.velocity.TemplateProcessor.processMax(TemplateProcessor.java:171) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:606) 
    at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389) 
    at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378) 
    at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270) 
    at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) 
    at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342) 
    at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) 
    at org.apache.velocity.Template.merge(Template.java:328) 
    at org.apache.velocity.Template.merge(Template.java:235) 
    at com.liferay.portal.velocity.VelocityTemplate.processTemplate(VelocityTemplate.java:112) 
    at com.liferay.portal.template.AbstractTemplate.processTemplate(AbstractTemplate.java:108) 
    at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:375) 
    at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:284) 
    at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.processTemplate(RuntimePageImpl.java:113) 
    at com.liferay.portal.layoutconfiguration.util.RuntimePageUtil.processTemplate(RuntimePageUtil.java:61) 
    at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:506) 
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:69) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:365) 
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:309) 
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:242) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) 
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718) 
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655) 
    at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:302) 
    at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:405) 
    at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:200) 
    at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:95) 
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) 
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) 
    at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:179) 
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) 
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) 
    at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:549) 
    at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:526) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:360) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:293) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) 
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:620) 
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:553) 
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:482) 
    at com.liferay.portal.servlet.WidgetServlet.service(WidgetServlet.java:62) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:267) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832) 
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:620) 
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:553) 
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:482) 
    at com.liferay.portal.servlet.I18nServlet.service(I18nServlet.java:114) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169) 
    at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96) 
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738) 
    at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:57) 
    at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96) 
    at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:420) 
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) 
    at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) 
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344) 
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854) 
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) 
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) 
    at java.lang.Thread.run(Thread.java:745) 
+0

Если пользователь не прошел проверку подлинности в запросе, то нет информации о пользователе объект не доступен. Вы можете проверить это с помощью 'request.getUserPrincipal()'. –

+0

Ну, пользователь аутентифицирован (зарегистрировался) в Лифере. Я смущен тем, как еще нужно аутентифицировать пользователя. Я протестировал 'request.getUserPrincipal()', и он также возвратил null. – JohnQuincyKerbal

+0

Не могли бы вы добавить полную трассировку стека - я хотел бы проверить, кто создает 'PortletRequest'. –

ответ

1

вопрос был свойство, что мне нужно в portal-ext.properties (который идет в $ LIFERAY_HOME кстати).

auto.login.hooks=com.liferay.portal.security.auth.RequestHeaderAutoLogin

+0

К сожалению, это показало еще одну проблему. Когда это свойство включено, Liferay принимает свойства пользователя из HTTP-заголовка, но затем пытается аутентифицироваться в своей собственной таблице базы данных пользователей. Есть ли способ использовать Liferay WSRP-производителя и иметь портлет, созданный на потребительском конце, используя строго пользовательскую информацию, первоначально переданную производителю? Мне не нужна аутентификация в Liferay. – JohnQuincyKerbal

 Смежные вопросы

  • Нет связанных вопросов^_^