eclipse error: glassfish\domains\domain1 does not exist

26,055

Solution 1

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.

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

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

See this description of the create-domain command.

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).

Solution 2

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

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

Now you should be able to run asadmin.

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

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

Solution 3

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

Solution 4

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:

  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 Enter repeatedly to keep the default settings viz. username (admin) password and other things.

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

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

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

Share:
26,055
enterprize
Author by

enterprize

Updated on July 09, 2022

Comments

  • enterprize
    enterprize almost 2 years

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

  • enterprize
    enterprize about 13 years
    I do not create any domain. Just installed Java EE 6 web profile. Then installed glassfish plugin & now encounter this problem. I tried to run the command glassfish\bin\asadmin create-domain doamin1, but cmd gives error,'system cannot find path specified.'
  • Matt Handy
    Matt Handy about 13 years
    @user701854 : updated my answer and clarified directories. Note that there is a glassfish dir inside your glassfish-install-dir. And there should be your domains.
  • enterprize
    enterprize about 13 years
    yes & I used path pf same. It precisely is 'D:\Java6EE\glassfish\bin\asadmin'. I used this path but strangely cmd gives path error. I followed all steps given in BalusC tutorial except just not creating any admin acc when installing Java EE web profile & leaving both fields admin/pass blank.
  • Matt Handy
    Matt Handy about 13 years
    What is inside your glassfish\domains directory?
  • Ruwanka Madhushan
    Ruwanka Madhushan about 10 years
    doesn't work..still saying domain cannot be created.