Travelling, and not Arriving

          ... a good traveler has no fixed plans and is not intent upon arriving... (Lao Tzu)

Posted
22 February 2007 @ 7am

Tagged
Java, Open Source, TechArticles

Glassfish in the trenches: How to fix MacOsX startup problems

I don’t really know if this is a new problem (caused by the recent update of the JDK 1.5 for MacOsX) or if it’s an old one, but last night, while writing the domain cheatsheet, I discovered that the asadmin command line has some problems with MacOsX 10.4.x.
Reproducing this bug is simple: just try to create a new domain typing:

asadmin create-domain –adminuser admin –adminport 4848 my-domain-name

Then you’ll be asked to choose the password, but after typing it you’ll obtain an exception:

./bin/asadmin create-domain --adminuser admin --adminport 4848 mydomain
Please enter the admin password>
FATAL ERROR in native method: Bad global or local ref passed to JNI
        at com.sun.enterprise.cli.framework.CliUtil.getPassword(Native Method)
        at com.sun.enterprise.cli.commands.S1ASCommand.getInteractiveOption(S1ASCommand.java:777)
        at com.sun.enterprise.cli.commands.S1ASCommand.getInteractiveOptionWithConfirmation(S1ASCommand.java:742)
        at com.sun.enterprise.cli.commands.S1ASCommand.getPassword(S1ASCommand.java:704)
        at com.sun.enterprise.cli.commands.CreateDomainCommand.getAdminPassword(CreateDomainCommand.java:136)
        at com.sun.enterprise.cli.commands.CreateDomainCommand.runCommand(CreateDomainCommand.java:171)
        at com.sun.enterprise.cli.framework.CLIMain.invokeCommand(CLIMain.java:155)
        at com.sun.enterprise.cli.framework.CLIMain.main(CLIMain.java:63)

Apparently there isn’t a bugfix yet for this problem, but the Glassfish forum has promptly suggested me a workaround.
So, if you encounter this problem, simply create a glassfish.password file somewhere (i.e. /tmp/glassfish.password) containing two parameters:

AS_ADMIN_ADMINPASSWORD=adminadmin
AS_ADMIN_MASTERPASSWORD=adminadmin

Then create the domain using the command:

asadmin create-domain –-adminport 4848 –passwordfile /tmp/glassfish.password my-domain-name

Similarly, you have to start this new domain with the command line:

asadmin start-domain –passwordfile /tmp/glassfish.password my-domain-name


No Comments Yet


There are no comments yet. You could be the first!

Leave a Comment

Glassfish in the trenches: Domains cheatsheet TDD of mail services