Netbeans 7.1.2 - Unable to add glassfish server 3.

2019-05-05 14:13发布

问题:

I downloaded glassfish server from http://glassfish.java.net/downloads/3.1.2.2-final.html and installed in separately.

Now I am trying to add this in Netbeans. But it does not work. I did the below steps

  1. Open Netbeans as administrator
  2. Open Tools -> Servers
  3. Click "Add Server" button
  4. Choose GlassFish Server 3+
  5. Specify a name as "GlassFish"
  6. Choose the installation folder location - C:\glassfish3

Now it displays the error "Not a valid Glassfish server Installation".

I am new to Netbeans & Glassfish & now don't know how to continue. My glassfish server is running successfully at localhost:8181

Can someone please help?

回答1:

I had this same issue and was able to fix it by following what was done in the video found here: http://happilyblogging.wordpress.com/2012/10/04/not-a-valid-glassfish-server-installation-netbeans/

Essentially, you must stop the gf3 server and rename the console-core-X.X.X.jar located in \glassfish3\glassfish\lib\install\applications__admingui\WEB-INF\lib to console-core-3.1.2.jar



回答2:

There is one simpler workaround. Just change the name of the jar in glassfish installation (c:\glassfish3\glassfish\lib\install\applications__admingui\WEB-INF\lib\console-core-3.1.2.jar) Then our server 3.1.2.x will be recognized by the netbeans as version 3.1.2 ;-) Works fine.



回答3:

  1. I uninstalled Netbeans & Glassfish current installations.
  2. Opened http://netbeans.org/downloads/index.html, Clicked "Download" button under "All" column (240MB). Downloaded the exe file & installed it
  3. This installed Netbeans & Glassfish as a bundle
  4. Now creating a web application project displayed Glassfish 3.1.2 in the list automatically.

Problem solved.

Please note that separate installation still doesn't work. I am still unable to register a separate glassfish3 installation. I think bundled installation has some fix in it.



回答4:

For windows 7 I searched for the GlassFish path (it was installed with NetBeans). I found it in

C:\Program Files\glassfish-3.1.2.2\glassfish\lib\install\applications__admingui\WEB-INF\lib

the rename in the posts above did not help.

So I removed the folders from the path until I got to this shortened path C:\Program Files\glassfish-3.1.2.2\glassfish where the next button became active and I could install GlassFish.



回答5:

Reason for Not a valid Glassfish server Installation could be you may not give correct Server(Glassfish/Tomcat) installation folder. Adding server to your project is as follows

Go to Services tab , Select Servers then right click on it. Select Add Server. Select your server(Glassfish) and name it then click next.

In Server Location give correct installation location (in my pc, c:\Program Files\glassfish-3.1) the click next. Give Domain name as you like it. Do not use default port. Leave Target name, username, password then click Finish. It will show Domain creation successful.

For Ref: Creating server in netbeans