0

So I am trying to restart glassfish server but it fails to start. What could be the error?

asadmin> start-domain java.io.FileNotFoundException: /home/ubuntu/glassfish-3.1.1/glassfish/domains/domain1/logs/server.log (Permission denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:221) at java.io.FileOutputStream.<init>(FileOutputStream.java:142) at java.util.logging.FileHandler.open(FileHandler.java:173) at java.util.logging.FileHandler.openFiles(FileHandler.java:441) at java.util.logging.FileHandler.<init>(FileHandler.java:287) at com.sun.enterprise.admin.launcher.GFLauncherLogger.addLogFileHandler(GFLauncherLogger.java:100) at com.sun.enterprise.admin.launcher.GFLauncher.setup(GFLauncher.java:178) at com.sun.enterprise.admin.cli.StartDomainCommand.createLauncher(StartDomainCommand.java:205) at com.sun.enterprise.admin.cli.StartDomainCommand.executeCommand(StartDomainCommand.java:105) at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:264) at com.sun.enterprise.admin.cli.MultimodeCommand.executeCommands(MultimodeCommand.java:226) at com.sun.enterprise.admin.cli.MultimodeCommand.executeCommand(MultimodeCommand.java:144) at com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:264) at com.sun.enterprise.admin.cli.AsadminMain.executeCommand(AsadminMain.java:306) at com.sun.enterprise.admin.cli.AsadminMain.main(AsadminMain.java:238) Waiting for domain1 to start ..............................................................................................................................................................................................................................

Anyone kindly advice?

Lorem Ipsum
  • 41
  • 11

2 Answers2

1

It obviously fails to create or open the log file:

/home/ubuntu/glassfish-3.1.1/glassfish/domains/domain1/logs/server.log

You should ensure that the folder structure exists and is accessible by the process (and it's user).

Mario
  • 35,726
  • 5
  • 62
  • 78
0

Judging by "Permission denied" error you got, try one of the following:

1) Give write permissions on the directory with Glassfish to your Linux user

2) Start asadmin with sudo command

Miljen Mikic
  • 14,765
  • 8
  • 58
  • 66
  • Please think twice before running a process as root to get around a permission problem. – Dan Armstrong Dec 10 '16 at 08:22
  • @DanArmstrong I am very aware of risks of using `sudo` command. Note however that if admin didn't give permissions on certain directory to the user, the only way for user to access it is by using `sudo`. More important, admin is responsible for taking care about the list of sudoers. – Miljen Mikic Dec 10 '16 at 11:26