We're updating the issue view to help you get more done. 

can't deploy on Glassfish when empty password set

Description

I develop on Glassfish with a blank admin password.

1 2 3 4 5 6 7 8 9 10 org.codehaus.cargo.util.CargoException: password needs to be 8 characters or longer at org.codehaus.cargo.container.glassfish.GlassFishStandaloneLocalConfiguration.getPasswordFile(GlassFishStandaloneLocalConfiguration.java:93) at org.codehaus.cargo.container.glassfish.GlassFishInstalledLocalDeployer.addConnectOptions(GlassFishInstalledLocalDeployer.java:198) at org.codehaus.cargo.container.glassfish.GlassFishInstalledLocalDeployer.doDeploy(GlassFishInstalledLocalDeployer.java:118) at org.codehaus.cargo.container.glassfish.GlassFishInstalledLocalDeployer.redeploy(GlassFishInstalledLocalDeployer.java:95) at org.codehaus.cargo.maven2.DeployerRedeployMojo.performDeployerActionOnSingleDeployable(DeployerRedeployMojo.java:40) at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables(AbstractDeployerMojo.java:112) at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:55) at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:255) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)

On http://svn.plexus.codehaus.org/browse/~raw,r=43/cargo-contrib/glassfish/src/main/java/org/codehaus/cargo/container/glassfish/GlassFishStandaloneLocalConfiguration.java I found:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // ... String password = getPropertyValue(RemotePropertySet.PASSWORD); if(password.length()<8) throw new CargoException("password needs to be 8 characters or longer"); try { File f = new File(getHome(), "password.properties"); if(!f.exists()) { getFileHandler().mkdirs(getHome()); FileWriter w = new FileWriter(f); // somehow glassfish uses both. Brain-dead. w.write("AS_ADMIN_PASSWORD="+password+"\n"); w.write("AS_ADMIN_ADMINPASSWORD="+password+"\n"); w.close(); } return f; // ...

Oh yes, when system property with password is set, then it's validated (ekhm...) against length. When properties come from /tmp/cargo/conf/password.properties - not. This weird validation should be removed.
A workaround for now is to keep the blank password in /tmp/cargo/conf/password.properties...

Status

Assignee

Savas Ali Tokmen

Reporter

Damian Nowak

Components

Fix versions

Affects versions

1.0.2

Priority

Critical