Java 我不知道在 netbeans 中启动 glassfish

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2037726/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 02:52:27  来源:igfitidea点击:

I can't figure out to start glassfish within netbeans

javanetbeansglassfish

提问by ajsie

When I click on Run it displays the following error message:

当我单击“运行”时,它显示以下错误消息:

Starting GlassFish v3 Domain
GlassFish v3 Domain start failed.
/Volumes/Private/noname/Sites/projects/java/MyFirstServlet/nbproject/build-impl.xml:602: Deployment error:
GlassFish v3 Domain start failed.
See the server log for details.
BUILD FAILED (total time: 2 minutes 0 seconds)

But then I fire up Terminal in mac and use asadmin start-domain and it starts.

但随后我在 mac 中启动终端并使用 asadmin start-domain 并启动。

And in netbeans I then Run the project and it fires up Safari and displays the content.

然后在 netbeans 中运行该项目,它会启动 Safari 并显示内容。

But why can't glassfish start in netbeans? Any idea?

但是为什么 glassfish 不能在 netbeans 中启动?任何的想法?

采纳答案by Csharp_Prefered

I've met the same problem as I was learning java web programming, but in windows env. I've spent much time guessing what that error could mean because the log file wasn't clearly saying that. Finally I found out that glassfish v3 was trying to run on 8080 port, which was already occupied by reportingservicesservice.exe which is sql server service. I didn't get to know how to switch the port used by glassfish, but I found that in netbeans 6.8 (which I use) in tools->servers I can add a new glassfish server instance which runs on a different, free port - that solved the problem :)

我在学习 java web 编程时遇到了同样的问题,但在 windows env 中。我花了很多时间猜测这个错误可能意味着什么,因为日志文件没有清楚地说明这一点。最后我发现glassfish v3试图在8080端口上运行,该端口已经被sql server服务的reportingservicesservice.exe占用。我不知道如何切换 glassfish 使用的端口,但我发现在 netbeans 6.8(我使用的)工具->服务器中,我可以添加一个新的 glassfish 服务器实例,该实例在不同的免费端口上运行-解决了这个问题:)

回答by Alfabravo

Only thing that comes to my mind is to check if the JAVA_HOME is properly set. Guess GFv3 requires it to be set to the bin folder in the JDK installation. Just guessing...

我唯一想到的是检查 JAVA_HOME 是否正确设置。Guess GFv3 要求将其设置为 JDK 安装中的 bin 文件夹。只是猜测...

回答by Jitesh

Go to following link there i've wrote solution for it...

转到以下链接,我已经为它编写了解决方案...

http://forums.netbeans.org/post-65058.html

http://forums.netbeans.org/post-65058.html

回答by Aaron

I just ran into this same problem with both glassfish and tomcat in netbeans 6.9. My problem and solution were both simple. The problem: tomcat was already running on my machine on port 8080 and therefore netbeans could not create a new instance of either. The solution: shutdown the running instance of tomcat and let netbeans start it up for you. Hope this helps.

我刚刚在 netbeans 6.9 中用 glassfish 和 tomcat 遇到了同样的问题。我的问题和解决方案都很简单。问题:tomcat 已经在我的机器上的 8080 端口上运行,因此 netbeans 无法创建任何一个的新实例。解决办法:关闭正在运行的tomcat实例,让netbeans为你启动。希望这可以帮助。

回答by Yusuf

My problem was with the port 8080, when I type http://localhost:8080, I found that oracle 10g was using it first before I install netbeans 6.8 with glassfish, I deleted oracle database 10g and, wich made the 8080 port free, and now everything is fine, it works.

我的问题是端口 8080,当我输入时http://localhost:8080,我发现 oracle 10g 在我用 glassfish 安装 netbeans 6.8 之前首先使用了它,我删除了 oracle 数据库 10g,然后释放了 8080 端口,现在一切正常,它作品。

回答by Ryan M

Netbeans IDE X.X --> Tools --> Servers

Add Server --> Choose Server --> GlassFish 3.X

添加 Server --> Choose Server --> GlassFish 3.X

then click (next) browse installation location click (next)

然后点击(下一步)浏览安装位置点击(下一步)

select (register local domain) domain name : domain 2

click on finish button

点击完成按钮

回答by emy

You must change the port of glassfish. To do this: join C:\Program Files\SEMS-v3\glassfish\domains\domain1\configopen the file domain.xml and change the text in 8080 by 9999.

您必须更改 glassfish 的端口。为此:加入C:\Program Files\SEMS-v3\glassfish\domains\domain1\config打开文件 domain.xml 并将 8080 中的文本更改为 9999。

After you do this, enter the remove server netbeans glassfish glassfish addServer then add it so that it can recognize the port changed. Then Started On glassfish server, then run your project.

执行此操作后,输入 remove server netbeans glassfish glassfish addServer 然后添加它,以便它可以识别更改的端口。然后在 glassfish 服务器上启动,然后运行您的项目。

Here is the link: http://www.srikanthtechnologies.com/blog/java/changeglassfishport.asp

这是链接:http: //www.srikanthtechnologies.com/blog/java/changeglassfishport.asp

回答by user2072492

Got the same problem, here are the steps I followed to solve it:

遇到了同样的问题,以下是我解决它的步骤:

  • remove the glassfish server under "Services > Servers"
  • close projet and Netbeans
  • locate the install directory of Glassfish and go to domains (GlassFish_Server\glassfish\domains).
  • delete the "domain1" directory
  • start Netbeans
  • recreate a Glassfish server
  • Don't forget to recreate your data sources and connection pools
  • 删除“服务 > 服务器”下的 glassfish 服务器
  • 关闭项目和 Netbeans
  • 找到 Glassfish 的安装目录并转到域 (GlassFish_Server\glassfish\domains)。
  • 删除“domain1”目录
  • 启动 Netbeans
  • 重新创建一个 Glassfish 服务器
  • 不要忘记重新创建数据源和连接池

回答by Skyartz

i have start to learn java recently,i have encountered the same problem too but i found out that when the first time the guidebook ask me to add a server, i put in user and password. so i give another try to remove the server and add it again without the password. and it is working.

我最近开始学习java,我也遇到了同样的问题,但我发现当指南第一次要求我添加服务器时,我输入了用户名和密码。所以我再次尝试删除服务器并在没有密码的情况下再次添加它。它正在工作。

回答by Filipe P Goes

I just had the same problem, and it happened because of a version mismatch between the local server (Glassfish 4.1) and the remote (Glassfish 4.0).

我刚刚遇到了同样的问题,这是由于本地服务器(Glassfish 4. 1)和远程服务器(Glassfish 4. 0)之间的版本不匹配而发生的。