Exception When Browsing to OpenMRS 2 From Another Site

Has anyone run into a problem when attempting to browse to OpenMRS 2 from another site?

When I attempt to browse to our OpenHMIS demo site via a link on our OpenHMIS web site I get an StringIndexOutOfBoundsException when the login page is attempted to be rendered. I have already created an issue for this that includes more detail:

You can reproduce this by:

  1. Go to http://openhmisafrica.org/
  2. Hover over the Technical menu
  3. Click on the OpenHMIS Demo Site menu item Instead of being directed to the login page, a StringIndexOutOfBoundsException will be thrown.

I have tested this with our OpenMRS 2 demo site (http://demo2.openhmisafrica.org) as well as the main OpenMRS demo site (http://demo.openmrs.org) with the same results.

So far I’m unable to reproduce this. I tried:

  1. Going to http://openhmisafrica.org/ (the link you had originally posted was a different domain name)
  2. Under “Technical” menu, I click on “OpenHMIS Demo Site”.
  3. The link goes to http://demo2.openhmis.org/ but that is an invalid hostname.

Oops… thanks for letting me know about the bad link! I’ve updated it to the correct one (demo2.openhmisafrica.org) and the exception still appears.

1 Like

Thanks. I was able to reproduce your error now, using the same steps as above. I’m wondering if it’s somehow related to the HTTP referrer used…

Now the link goes to https://anon.click/demo2.openhmisafrica.org and then redirects to http://build.openhmisafrica.org/openmrs2/login.htm

But no exception is thrown.

@lluismf Yes, I had to change that to get the link to work. However, this does seem to indicate that there is some issue with the referrer parsing in the UI framework (or OpenMRS?) that needs to be resolved.

I couldn’t reproduce this, is it because you are excluding the referer header? Another work around is to add a redirectUrl to the home page as request parameter in the link on the OpenHMIS site

This should really not be complicated or require discussion.

Wes has described a bug and provided a stack trace with a StringIndexOutOfBoundsException. No value of the referrer header should be allowed to cause this.

Someone should just pick it up and fix it. :slight_smile:

Since this is a Reference Application bug, not a UI Framework bug, I moved the JIRA issue to the RA project. It is now:

The work arounds are just for the period when the new version is not released but yes it needs to be addressed. Thanks @ibewes for reporting this and actually filing a well described ticket.