Re: UserInfoService getUserName almost always returns null (680 Views)
Reply
Advisor
Andywzzz
Posts: 18
Registered: ‎07-11-2012
Message 1 of 11 (841 Views)
Accepted Solution

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

 

Honored Contributor
Yossi_Gutin
Posts: 209
Registered: ‎04-04-2013
Message 2 of 11 (797 Views)

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
Andywzzz
Posts: 18
Registered: ‎07-11-2012
Message 3 of 11 (789 Views)

Re: UserInfoService getUserName almost always returns null

Yossi,

 

Please find logs attached.

 

Thanks

 

Honored Contributor
Yossi_Gutin
Posts: 209
Registered: ‎04-04-2013
Message 4 of 11 (776 Views)

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.
Advisor
Andywzzz
Posts: 18
Registered: ‎07-11-2012
Message 5 of 11 (767 Views)

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
Yossi_Gutin
Posts: 209
Registered: ‎04-04-2013
Message 6 of 11 (751 Views)

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
Andywzzz
Posts: 18
Registered: ‎07-11-2012
Message 7 of 11 (733 Views)

Re: UserInfoService getUserName almost always returns null

Yossi,

 

Please find tomcat log attached.

 

Thanks

Honored Contributor
Yossi_Gutin
Posts: 209
Registered: ‎04-04-2013
Message 8 of 11 (729 Views)

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
Andywzzz
Posts: 18
Registered: ‎07-11-2012
Message 9 of 11 (728 Views)

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
Avi Genshaft
Posts: 1
Registered: ‎04-18-2010
Message 10 of 11 (700 Views)

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
Andywzzz
Posts: 18
Registered: ‎07-11-2012
Message 11 of 11 (680 Views)

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

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.