简体   繁体   中英

Glassfish not running web application independently of Netbeans

Please see the steps I have followed below:

1) Start the Glassfish server in Netbeans:

在此处输入图片说明

2) Run the Netbeans project, which successfully browses to: http://localhost:8080/CRUDWebAppSQL/StudentServlet I am able to use the application. 3) Close Netbeans, which stops Glassfish (in preparation for the next step)

Then I try this:

1) Run the following DOS commands:

cd C:\Program Files\glassfish-4.0\bin
sadmin start-domain domain1  

2) Message received saying server has started. Browse to: http://localhost:4848/ and login. Make sure that CRUDWebAppSQL is listed as an app. 3) Browse to: http://localhost:8080/CRUDWebAppSQL/StudentServlet which display a Glassfish 404 error

Why does step three produce a Glassfish 404 error? Does it have something to do with this: Where does glassfish save your class/project after deployment on Windows?

NetBeans is using a different mechanism to deploy your application to support hot deployment in comparison to a manual deployment.

To run the application without NetBeans first build the web application with eg with Maven mvn clean install to get the *.war file.

Start the Glassfish application server and either deploy the war file through the web interface or with command line asadmin deploy war-name

By the way I would suggest to update NetBeans to the current 8.2 release and have a look at Payara, which is a patched drop-in replacement for Glassfish: http://www.payara.fish/downloads

Netbeans glassfirsh server combine with Felix platform.

Download GlassFish Server Open Source Edition. Unzip it and goto bin folder in the unzipped folder. double click asadmin.bat type start-domain

in this command you can start glassfirsh server (you can find more command in google)

open browser and type http://localhost:8080/

click link as

go to the Administration Console.

it view "GlassFish Console".

in here you can deploy your web app.(Extension ".war" file)

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