eclipse 错误: glassfish\domains\domain1 不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5635483/
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-09-10 20:07:31  来源:igfitidea点击:

eclipse error: glassfish\domains\domain1 does not exist

eclipsejakarta-eeglassfish-3

提问by enterprize

I have java ee6 web profile sdk & I am using eclipse ee. I installed Glassfish plugin for eclipse using Download additional server adaptersin the New Serverwizard. Now during building a test app, eclipse raise this error glassfish\domains\domain1 does not exist. Whats the reason & how can I remove it?

我有 java ee6 web profile sdk & 我正在使用 eclipse ee。我使用“新建服务器”向导中的下载其他服务器适配器”为 Eclipse 安装了 Glassfish 插件。现在在构建测试应用程序期间,eclipse 会引发此错误 glassfish\domains\domain1 does not exist。是什么原因以及如何删除它?

回答by Matt Handy

Either your eclipse glassfish plugin points to the wrong domain or your server has no domain although there should be at least a default domain which is usually named domain1.

您的 eclipse glassfish 插件指向错误的域,或者您的服务器没有域,尽管至少应该有一个通常名为domain1的默认域。

Check what's the name of your domain in glassfish-install-dir\glassfish\domainsdirectory. If there is no subdir, you can create a domain with the asadmin tool:

检查glassfish-install-dir\glassfish\domains目录中的域名称。如果没有子目录,可以使用asadmin工具创建域:

glassfish-install-dir\bin\asadmin create-domain your-domain-name

See this description of the create-domain command.

请参阅create-domain 命令的此说明

If you already have a domain with a different name than domain1, you have to reconfigure your eclipse glassfish plugin. (Since I don't use eclipse, I can't take you any further. But I remember a BalusC tutorial on this topic).

如果您已经有一个名称与domain1不同的域,则必须重新配置 eclipse glassfish 插件。(因为我不使用 eclipse,所以我不能带你进一步。但我记得关于这个主题BalusC 教程)。

回答by suniti

Go to <Glassfish-install-directory>/glassfish/configdirectory.

进入<Glassfish-install-directory>/glassfish/config目录。

Edit asenvand point to your JDK installation for set AS_JAVA=C:\Java\jdk.

编辑asenv并指向您的 JDK 安装set AS_JAVA=C:\Java\jdk

Now you should be able to run asadmin.

现在您应该可以运行asadmin.

Create a new domain using asadmin create-domain domain1(inside bin directory).

使用asadmin create-domain domain1(在 bin 目录中)创建一个新域。

Server setup in eclipse will now find your newly created domain.

eclipse 中的服务器设置现在将找到您新创建的域。

回答by Pakman

I ran into this same problem and fixed it with the following:

我遇到了同样的问题并使用以下方法修复了它:

  1. Open a command prompt and browse to C:\glassfish3\glassfish\bin(or whatever your glassfish directory is)
  2. Execute asadmin
  3. Type in create-domain--adminport 4848 domain1(your debug port can probably be whatever)
  4. Go back into Eclipse and continue
  1. 打开命令提示符并浏览到C:\glassfish3\glassfish\bin(或任何您的 glassfish 目录)
  2. 执行 asadmin
  3. 输入create-domain--adminport 4848 domain1(您的调试端口可能是任何)
  4. 返回 Eclipse 并继续

回答by vinsinraw

Although late reply, but may be useful to someone facing similar issues.

虽然回复晚了,但可能对面临类似问题的人有用。

If no domain exists in your glassfish path i.e say C:\glassfish4\glassfish\domains\then you can create a new domain in the same path as follows:

如果您的 glassfish 路径中不存在域,即说,C:\glassfish4\glassfish\domains\那么您可以在相同的路径中创建一个新域,如下所示:

  1. Navigate to C:\glassfish4\bin\directory and double click on asadmin.bat. It will open a command prompt as asadmin >

  2. Type the following command asadmin > create-domain --adminport 4848 domain1

  3. Click Enterrepeatedly to keep the default settings viz. username (admin) password and other things.

  1. 导航到C:\glassfish4\bin\目录并双击asadmin.bat。它将打开一个命令提示符asadmin >

  2. 输入以下命令 asadmin > create-domain --adminport 4848 domain1

  3. Enter重复单击以保留默认设置即。用户名(管理员)密码和其他东西。

That's it. You will find the domain1created under C:\glassfish4\glassfish\domains\directory with all default configurations.

就是这样。您将domain1C:\glassfish4\glassfish\domains\所有默认配置的目录下找到created 。

If want to create domain in another directory or want some more info then can refer Oracle Glassfish Reference Manual:

如果想在另一个目录中创建域或需要更多信息,可以参考 Oracle Glassfish 参考手册:

http://docs.oracle.com/cd/E19798-01/821-1758/create-domain-1/index.html

http://docs.oracle.com/cd/E19798-01/821-1758/create-domain-1/index.html

回答by HITURAJ

Eclipse doesn't have domain path setting for glassfish server. This error comes when domain path is not correct. Make sure when you run your application on eclipse give glassfish credentials user/password

Eclipse 没有为 glassfish 服务器设置域路径。当域路径不正确时会出现此错误。确保在 Eclipse 上运行应用程序时提供 glassfish 凭据用户/密码

回答by FiruzzZ

In my case, the C:\glassfish4\glassfish\domains\domain1\config\ domain.xmlwas renamed to something like domain568912323464576456.xml, so I edited the file, leaving it as it supposed to be named and done, server started up again.

在我的例子中,C:\glassfish4\glassfish\domains\domain1\config\ domain.xml被重命名为类似 domain 568912323464576456.xml 的东西,所以我编辑了这个文件,让它按原样命名并完成,服务器启动再起来。

回答by codeGeass

create a new domain with

创建一个新域

asadmin create-domain myDomain

add the path of this new domain, if there is a message "domain is not valid", make the folder domains/myDomain/conf permission to not only the root. If there is the message "is not writtable" then open Eclipse as root and try again. This should be work in these cases.

添加这个新域的路径,如果有提示“域无效”,将文件夹domains/myDomain/conf权限设置为不仅是root。如果有消息“不可写”,则以 root 用户身份打开 Eclipse 并重试。这应该在这些情况下工作。

回答by TomasRG

You must to add a password to your admin user. Eclipse mistake. Eclipse doesn't recognise the domain without admin password.

您必须为管理员用户添加密码。日食错误。Eclipse 无法识别没有管理员密码的域。

When you create the domain, add a admin user and a password and Eclipse doesn't complain any more.

当您创建域时,添加一个管理员用户和一个密码,Eclipse 就不再抱怨了。