Closed glassfishrobot closed 10 years ago
@glassfishrobot Commented jeremy_lv said: Chris: I have looked into the code and found it is because the default node directory in creating the instance is different from the default value defined in the asenv.bat(asenv.conf). I want to know whether it is the special syntax as you have designed for the command of "create-instance"?
[My suggestion] Why not unify the default value of the node in the create-instance and create-local-instance into the same one, which are both defined in the asenv.bat(asenv.conf), Here's some of suggestions:
**CreateIntsnaceCommand.java** private File defaultLocalNodeDirFile() {
+ final Map<String,String> systemProps =
+ Collections.unmodifiableMap(new ASenvPropertyReader().getProps());
/*
- * The "nodes" directory we want to use is a child of
- * the install directory.
- *
- * The installDir field contains the installation directory which the
- * administrator specified, if s/he specified one, when the target node
- * was first created. It is null if the administrator did not specify
- * an installation directory for the node. In that case we should
- * use the DAS's install directory (because this method applies in the
- * local instance case).
- */
- final File nodeParentDir = (installDir == null
-? serverContext.getInstallRoot()
-: new File(installDir, "glassfish"));
- return new File(nodeParentDir, "nodes");
+ * The default "nodes" directory we want to use
+ * has been set in asenv.conf named as
+ * AS_DEF_NODES_PATH
+ */
+ String nodeDirDefault = systemProps.get(
+SystemPropertyConstants.AGENT_ROOT_PROPERTY);
+ return new File(nodeDirDefault);
}
@glassfishrobot Commented zhouronghui said: The patch for #20705
@glassfishrobot Commented zhouronghui said: Hi Chris,
I think that this is because of the CreateIntsnaceCommand class in nucleus\cluster\admin. and we have maken a patch for that.
Would you please check it? If the patch is OK, I will commit it.
Thank you.
@glassfishrobot Commented kasso said: The developer who wrote the original code looked at the fix and said it is OK. You are clear to integrate the change.
@glassfishrobot Commented zhouronghui said: Hi Chris,
Thank you for reviewed the patch. I have committed the fix to trunk at r63166.
@glassfishrobot Commented zhouronghui said: The patch have been reviewed by chris, committed at r63166.
@glassfishrobot Commented File: CreateInstanceCommand.patch Attached By: zhouronghui
@glassfishrobot Commented Was assigned to zhouronghui
@glassfishrobot Commented This issue was imported from java.net JIRA GLASSFISH-20705
@glassfishrobot Commented Reported by jeremy_lv
@glassfishrobot Commented Marked as fixed on Wednesday, March 19th 2014, 7:14:29 pm
[Phenomenon] Here's my steps to reproduce the Exception:
1). Reset the value of AS_DEF_NODES_PATH in asenv.bat(In my platform, the asenv.bat is under the directory of E:\glassfish4\glassfish\config\asenv.bat) as AS_DEF_NODES_PATH=..\my_nodes
2). asadmin start-domain Command start-domain executed successfully.
3). asadmin create-instance --node localhost-domain1 ins1 Successfully created instance ins1 in the DAS configuration, but failed to retri eve configuration files during bootstrap. Command create-instance completed with warnings.
4). Check the server.log and you'll find the following Exception will be thrown out:
[My suggestion] In my option, I think it will be successed without any Exception under my reproduced steps, what means it should be success to create the instance after step 3):
Environment
Win 7
Affected Versions
[4.0_dev]