HPE Anywhere Developer Forum
Showing results for 
Search instead for 
Do you mean 

UserInfoService getUserName almost always returns null

SOLVED
Go to Solution
Advisor

UserInfoService getUserName almost always returns null

Hi,

I have done following steps

1. Installed HPA IDE from HPAnywhere-CreateSetup-10.00.331-331-win64 on my machine
2. Generated "My Report Project" using HP wizard.
3. Added few changes to get user name and user id from UserInfoService. Also added HTML button to refresh data from server. Diff file is attached (small_changes.txt)
4. In admin console uploaded ZIP package
5. After pressing Refresh button in 3-4 times from 5 I am getting screenshot EmptyUserNameMostOfTheTime.png
6. In one case from 5 I am getting screenshot AdminUserNameOneFromFiveTimes.png
7. It seems that UserInfoService sometimes is returning current user admin and in rest cases returns null.

 

I have also attached full source code and ZIP package.

How can I get current username in the backend side everytime?

Thanks in advance

 

10 REPLIES
Honored Contributor

Re: UserInfoService getUserName almost always returns null

Hi Andy

Please provide the server logs ZIP

--------------------------------------------------------------------------------------
If some answer solves your problem, please mark it as a solution.
Advisor

Re: UserInfoService getUserName almost always returns null

Yossi,

 

Please find logs attached.

 

Thanks

 

Honored Contributor

Re: UserInfoService getUserName almost always returns null

[ Edited ]

Andy,

I see errors in the btoa_app.log. It could be not connected to your App, but please check whether following XMLs are well formed:

events-user-settings.xml

FindARoom-user-settings.xml

roomer-user-settings.xml

 

Spoiler
[2013-05-17 16:19:35,202] ERROR [localhost-startStop-2] (UserSettingsXMLCacher.java:119) Exception when parsing settings XML file: events-user-settings.xml
org.xml.sax.SAXParseException; systemId: file:/C:/HP/HPAnywhere/conf/userSettings/events-user-settings.xml; lineNumber: 2; columnNumber: 44; Document root element "category", must match DOCTYPE root "null".

 

Yossi

--------------------------------------------------------------------------------------
If some answer solves your problem, please mark it as a solution.
Highlighted
Advisor

Re: UserInfoService getUserName almost always returns null

Yossi,

 

It seems that those files are well formed.

I was able to open them in Internet Explorer and it doesn't show any error.

Also I have tried to change something in structure of files and Internet Explorer was not able to load such XML. 

So it seems that those XML are well-formed.

 

Thanks

 

Honored Contributor

Re: UserInfoService getUserName almost always returns null

Andy, please provide tomcat/logs as well. Specifically, make sure that the tomcat access log is populated.

--------------------------------------------------------------------------------------
If some answer solves your problem, please mark it as a solution.
Advisor

Re: UserInfoService getUserName almost always returns null

Yossi,

 

Please find tomcat log attached.

 

Thanks

Honored Contributor

Re: UserInfoService getUserName almost always returns null

Hi
Does this log include problematic issue, when UserInfoService.getUserName returned null?
--------------------------------------------------------------------------------------
If some answer solves your problem, please mark it as a solution.
Advisor

Re: UserInfoService getUserName almost always returns null

Yes, of course.

I clicked about 30 times.

Most of them return null result (aproximatelly 25 times)

 

Thanks

Frequent Visitor

Re: UserInfoService getUserName almost always returns null

Hi Andy,

 

I see a problem in your web.xml file of your app. The problem relate to the order of the defined filters:

The order of the filters must be: DiamondTenantFilter, springSecurityFilterChain, DiamondSecurityFilter,

 

This is example which you can use. Please carefully replace it in your web.xml under WEB-INF folder:

 

    <filter>

        <filter-name>DiamondTenantFilter</filter-name>

        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

    </filter>

    <filter-mapping>

        <filter-name>DiamondTenantFilter</filter-name>

        <url-pattern>/rest/*</url-pattern>

        <url-pattern>/services/*</url-pattern>

    </filter-mapping>

 

    <filter>

        <filter-name>springSecurityFilterChain</filter-name>

        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

    </filter>

    <filter-mapping>

        <filter-name>springSecurityFilterChain</filter-name>

        <url-pattern>/*</url-pattern>

    </filter-mapping>

 

    <filter>

        <filter-name>DiamondSecurityFilter</filter-name>

        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

    </filter>

    <filter-mapping>

        <filter-name>DiamondSecurityFilter</filter-name>

        <url-pattern>/rest/*</url-pattern>

        <url-pattern>/services/*</url-pattern>

    </filter-mapping>

 

 

Please let us know which IDE template you used to develop your App.

 

Thanks,

Avi

Advisor

Re: UserInfoService getUserName almost always returns null

Avi,

 

I have done following steps

1. Installed HPA IDE from HPAnywhere-CreateSetup-10.00.331-331-win64 on my machine
2. Generated "My Report Project" using HP wizard.

 

Thanks for your reply