且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Web应用程序在端口8080上启动,该在哪里更改?

更新时间:2023-01-17 21:50:47

有点晚了,但这应该可以...

A bit late, but this should work...

我已经没有6.8了,但是以下情况适用于6.9和6.10m1-在目录< home dir>/.netbeans/< version>/config中,有一个名为.nbattrs的文件-编辑它,然后寻找类似的东西:

I don't have 6.8 anymore, but the following is true for 6.9 and 6.10m1 - in the directory <home dir>/.netbeans/<version>/config, there is a file called .nbattrs - edit it, and look for something like:

<attr name="GlassFishEE6\Instances\glassfish_autoregistered_instance\httpportnumber" stringvalue="8082"/>

将值更改为您在适当的Glassfish域中设置的任何值.如果像我一样,如果您安装了多个版本的Glassfish,或者可能安装了多个域,则只需注意.... displayName键并跟随您的鼻子-显然您要更改哪个版本.

Change the value to whatever you've set in the appropriate Glassfish domain. If, like me, you have more than one version of Glassfish installed, or perhaps multiple domains, just look out for the ....displayName keys and follow your nose - it should be obvious which one you're altering.

HTH,

约翰

NB:您当然可以删除服务器,然后使用向导选择正确的端口再次将其添加到服务器中-但是我认为编辑.nbattrs要容易得多

NB: you can, of course, delete the server and add it in again using the wizard to select the right ports - but I think editing .nbattrs is far easier

NB2:目录链中还有另一个.nbattrs文件,该文件中还包含glassfish配置(无法记住确切的位置-抱歉!),这看起来像是更改端口的正确位置-但会出现编辑此文件的情况.对我来说没有任何作用,因为每次启动Netbeans时,它都会被config/.nbattrs文件中的内容覆盖

NB2: there is another .nbattrs file further down the directory chain that also contains glassfish config (can't remember the exact location - sorry!) and this looks like the right place to change the port - but editing this file appears to have no effect as, for me, it gets overridden with whatever is in config/.nbattrs file whenever I start up Netbeans