简体   繁体   中英

Eclipse not opening browser when running application on glassfish server

I am running eclipse Luna with glassfish 4.1 .

Everything seems to be running fine except when I use the option "Run As/Run on Server" the IDE does not open a browser to the context root of the application, like I would expect. Glassfish is started and the application deployed successfully but no browser is opened.

If I do the same to a TomCat server a browser is opened to the context root of the application. I can open a browser manually and type the URL and it works as expected but I would really like the time savings of this happening automatically.

Inside your Eclipse, click in "Window" -> Web Browser -> Choose your browser .

Then right-click your project and run it.

Tested it with Eclipse Kepler, everything working correctly.

Put file glassfish-web.xml in WEB-INF folder.

glassfish-web.xml content:

  <?xml version="1.0" encoding="UTF-8"?>

   <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1    Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
  <glassfish-web-app>
  <context-root>/yourapp</context-root>
 </glassfish-web-app>

Well I even reinstalled eclipse and the glassfish pluggin, to no avail. But it did discover I can open the browser to the root context from the Servers pain, by right clicking on the deployed application and selecting "Open in Browser". That works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM