[Fixed] Angular 7 Unable to resolve spring boot rest API hostname


I have bundled an Angular7 app as static content within a spring boot REST API into a .war archive and deployed it on JBoss EAP 7.3. The application deploys successfully and I am able to see the login page. However, when I try to login, I get a net::err_name_not_resolved error in my browser console and when I check the network tab, I see that the hostname is omitted whilst angular is trying to call the REST API for authentication, hence the error reported in the console. In my angular configs, I have defined apiHost='/' and expect that this would be resolved to the machine’s host or IP at runtime, but this is not working. I have also created a jboss-web.xml where I defined the context root as /.

I would greatly appreciate any help in this regard.


I need this to work because I am deploying the .war file in a JBoss cluster, hence, the application should be reachable from any of the cluster members.


I finally resolved the issue by using apiHost='.'

I can now call up my application using any of the hosts participating in the JBoss cluster.

Leave a Reply

(*) Required, Your email will not be published