0

I have several web apps (.war files) deployed to JBoss 7. All of these webapps are part of a larger application that has one entry (authentication) point. These webapps make use of functionality in each other through HTTP services (cross-domain calls).

Say I 5 users on the system. But then I reboot the server (JBoss) for whatever reason. The users do not exit the system either before or after the reboot. After the server has been restarted, the cross-domain server-side services result in a "Connection Refused" error.

At this point the services can be invoked via the browser by pasting the URL into the address. This works every time without error.

If 1 (just 1) of the 5 users reauthenticates then the server-side service calls will start working again for all 5 users. All 5 do not have to reauthenticate. Our app is SSO, so there isn't much authentication code. We just invoke some NTLM calls to authenticate.

We do not pass any credentials to the services. Anyone who is authenticated is authorized to invoke the services.

It should be noted that all other features of the system work without any user reauthenticating (client-side AJAX; DB queries/updates). It is only the invocation of server-side service calls via HTTP that do not work.

According to other posts and documentation I have found, "Connection refused" happens because either 1) the service is not running or 2) there is a firewall issue.

Neither of these are true in my case. As stated, the services can be invoked from the browser. And I can recreate this by running a local JBoss on my Windows computer. I just have to restart it and the error happens. There is no firewall involved.

I thought this might be a CORS issue, but it seems that CORS is related to requests that originate from the browser (e.g. Javascript/AJAX) and that is not the case here. All the service requests in question originate on the server.

I don't have much experience with network or security, so I'm at a loss as to what is happening here. Authentication seems related to or is causing the problem, but I don't understand why or how to fix it.

Any suggestions will be welcome.

  • JBoss 7
  • Java 6
  • Spring MVC 4.0.6
  • Windows 7

Thanks.

TJ Grant
  • 59
  • 1
  • 9

1 Answers1

0

It sounds like your application isn't getting loaded until it is accessed. Try adding an entry in your web.xml

    <servlet>
      <servlet-name>YourApp</servlet-name>
      <servlet-class>com.company.YourApplication</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

The load-on-startup is key. Here is a question that goes into a little more detail What does the servlet <load-on-startup> value signify

Community
  • 1
  • 1
  • thanks for this suggestion. however, the problem turned out to be something very esoteric to our application that we fixed by correcting some code. – TJ Grant Aug 21 '16 at 14:11