[JBoss JIRA] (DROOLS-1704) NPE when updating container with java class
by Edson Tirelli (JIRA)
[ https://issues.jboss.org/browse/DROOLS-1704?page=com.atlassian.jira.plugi... ]
Edson Tirelli reassigned DROOLS-1704:
-------------------------------------
Assignee: Mario Fusco (was: Edson Tirelli)
> NPE when updating container with java class
> -------------------------------------------
>
> Key: DROOLS-1704
> URL: https://issues.jboss.org/browse/DROOLS-1704
> Project: Drools
> Issue Type: Bug
> Components: kie server
> Affects Versions: 7.2.0.Final
> Reporter: Karel Suta
> Assignee: Mario Fusco
> Labels: reported-by-qe
> Attachments: stacktrace.txt
>
>
> User has Kie server with deployed container with java class.
> If user updates the container to new version with kjar without java class then it is updated correctly. However if user then tries to update the container again, this time to version which contains same java class then NullPointerException is thrown. See attachment.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 9 months
[JBoss JIRA] (WFCORE-3197) jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
by Darran Lofthouse (JIRA)
[ https://issues.jboss.org/browse/WFCORE-3197?page=com.atlassian.jira.plugi... ]
Darran Lofthouse moved WFLY-9241 to WFCORE-3197:
------------------------------------------------
Project: WildFly Core (was: WildFly)
Key: WFCORE-3197 (was: WFLY-9241)
Component/s: Domain Management
Scripts
(was: Scripts)
Affects Version/s: 3.0.0.Beta31
(was: 10.1.0.Final)
> jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
> ----------------------------------------------------------------------------------------------------------
>
> Key: WFCORE-3197
> URL: https://issues.jboss.org/browse/WFCORE-3197
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management, Scripts
> Affects Versions: 3.0.0.Beta31
> Environment: centOs
> Reporter: Nuno Godinho de Matos
> Assignee: Tomaz Cerar
> Priority: Trivial
>
> Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
> One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
> While on windows the script is natrually working.
> On linux centOs, the script immediately broke with the error:
> {panel}
> [johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
> **********************************************************
> SETUP CORE ENV VARIABLES
> **********************************************************
> SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
> CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
> WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
> WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
> WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
> WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
> **********************************************************
> INVOKE jboss-cli.bat with script file: "file99.sh"
> **********************************************************
> Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
> <----- this some additional informaiton I am printing to make the point
> RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
> {panel}
> What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
> This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
> call jboss-cli.bat -f someFilepath
> and not break.
> The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
> And only cares about the current location of the jboss-cli.bat script itself.
> {panel}
> if "%OS%" == "Windows_NT" (
> set "DIRNAME=%~dp0%" <-------- This here is a good approach
> ) else (
> set DIRNAME=.\
> )
> {panel}
> On linux, the same is not being done:
> {panel}
> # Setup JBOSS_HOME
> RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
> if [ "x$JBOSS_HOME" = "x" ]; then
> # get the full path (without any relative bits)
> JBOSS_HOME=$RESOLVED_JBOSS_HOME
> else
> SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
> if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
> echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
> echo ""
> fi
> fi
> export JBOSS_HOME
> {panel}
> I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
> {code}
> #DIRNAME=`dirname "$0"`
> DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
> {code}
> Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
> {panel}
> # source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> /bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> {panel}
> Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
> So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
> Kindest regards.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 9 months
[JBoss JIRA] (WFLY-9241) jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
by Darran Lofthouse (JIRA)
[ https://issues.jboss.org/browse/WFLY-9241?page=com.atlassian.jira.plugin.... ]
Darran Lofthouse updated WFLY-9241:
-----------------------------------
Fix Version/s: (was: 10.2.0.Final)
> jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
> ----------------------------------------------------------------------------------------------------------
>
> Key: WFLY-9241
> URL: https://issues.jboss.org/browse/WFLY-9241
> Project: WildFly
> Issue Type: Bug
> Components: Scripts
> Affects Versions: 10.1.0.Final
> Environment: centOs
> Reporter: Nuno Godinho de Matos
> Assignee: Tomaz Cerar
> Priority: Trivial
>
> Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
> One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
> While on windows the script is natrually working.
> On linux centOs, the script immediately broke with the error:
> {panel}
> [johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
> **********************************************************
> SETUP CORE ENV VARIABLES
> **********************************************************
> SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
> CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
> WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
> WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
> WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
> WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
> **********************************************************
> INVOKE jboss-cli.bat with script file: "file99.sh"
> **********************************************************
> Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
> <----- this some additional informaiton I am printing to make the point
> RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
> {panel}
> What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
> This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
> call jboss-cli.bat -f someFilepath
> and not break.
> The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
> And only cares about the current location of the jboss-cli.bat script itself.
> {panel}
> if "%OS%" == "Windows_NT" (
> set "DIRNAME=%~dp0%" <-------- This here is a good approach
> ) else (
> set DIRNAME=.\
> )
> {panel}
> On linux, the same is not being done:
> {panel}
> # Setup JBOSS_HOME
> RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
> if [ "x$JBOSS_HOME" = "x" ]; then
> # get the full path (without any relative bits)
> JBOSS_HOME=$RESOLVED_JBOSS_HOME
> else
> SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
> if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
> echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
> echo ""
> fi
> fi
> export JBOSS_HOME
> {panel}
> I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
> {code}
> #DIRNAME=`dirname "$0"`
> DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
> {code}
> Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
> {panel}
> # source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> /bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> {panel}
> Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
> So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
> Kindest regards.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 9 months
[JBoss JIRA] (WFLY-9241) jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
by Nuno Godinho de Matos (JIRA)
[ https://issues.jboss.org/browse/WFLY-9241?page=com.atlassian.jira.plugin.... ]
Nuno Godinho de Matos updated WFLY-9241:
----------------------------------------
Description:
Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
While on windows the script is natrually working.
On linux centOs, the script immediately broke with the error:
{panel}
[johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
**********************************************************
INVOKE jboss-cli.bat with script file: "file99.sh"
**********************************************************
Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
<----- this some additional informaiton I am printing to make the point
RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
{panel}
What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
call jboss-cli.bat -f someFilepath
and not break.
The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
And only cares about the current location of the jboss-cli.bat script itself.
{panel}
if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%" <-------- This here is a good approach
) else (
set DIRNAME=.\
)
{panel}
On linux, the same is not being done:
{panel}
# Setup JBOSS_HOME
RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
if [ "x$JBOSS_HOME" = "x" ]; then
# get the full path (without any relative bits)
JBOSS_HOME=$RESOLVED_JBOSS_HOME
else
SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
echo ""
fi
fi
export JBOSS_HOME
{panel}
I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
{code}
#DIRNAME=`dirname "$0"`
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
{code}
Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
{panel}
# source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
/bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
{panel}
Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
Kindest regards.
was:
Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
While on windows the script is natrually working.
On linux centOs, the script immediately broke with the error:
{panel}
[johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
**********************************************************
INVOKE jboss-cli.bat with script file: "file99.sh"
**********************************************************
Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
<----- this some additional informaiton I am printing to make the point
RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
{panel}
What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
call jboss-cli.bat -f someFilepath
and not break.
The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
And only cares about the current location of the jboss-cli.bat script itself.
{panel}
if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%" <-------- This here is a good approach
) else (
set DIRNAME=.\
)
{panel}
On linux, the same is not being done:
{panel}
# Setup JBOSS_HOME
RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
if [ "x$JBOSS_HOME" = "x" ]; then
# get the full path (without any relative bits)
JBOSS_HOME=$RESOLVED_JBOSS_HOME
else
SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
echo ""
fi
fi
export JBOSS_HOME
{panel}
I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
{code}
#DIRNAME=`dirname "$0"`
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
{code}
Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
{panel}
# source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
/bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
{panel}
Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
Kindest regards.
> jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
> ----------------------------------------------------------------------------------------------------------
>
> Key: WFLY-9241
> URL: https://issues.jboss.org/browse/WFLY-9241
> Project: WildFly
> Issue Type: Bug
> Components: Scripts
> Affects Versions: 10.1.0.Final
> Environment: centOs
> Reporter: Nuno Godinho de Matos
> Assignee: Tomaz Cerar
> Priority: Trivial
> Fix For: 10.2.0.Final
>
>
> Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
> One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
> While on windows the script is natrually working.
> On linux centOs, the script immediately broke with the error:
> {panel}
> [johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
> **********************************************************
> SETUP CORE ENV VARIABLES
> **********************************************************
> SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
> CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
> WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
> WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
> WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
> WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
> **********************************************************
> INVOKE jboss-cli.bat with script file: "file99.sh"
> **********************************************************
> Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
> <----- this some additional informaiton I am printing to make the point
> RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
> {panel}
> What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
> This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
> call jboss-cli.bat -f someFilepath
> and not break.
> The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
> And only cares about the current location of the jboss-cli.bat script itself.
> {panel}
> if "%OS%" == "Windows_NT" (
> set "DIRNAME=%~dp0%" <-------- This here is a good approach
> ) else (
> set DIRNAME=.\
> )
> {panel}
> On linux, the same is not being done:
> {panel}
> # Setup JBOSS_HOME
> RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
> if [ "x$JBOSS_HOME" = "x" ]; then
> # get the full path (without any relative bits)
> JBOSS_HOME=$RESOLVED_JBOSS_HOME
> else
> SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
> if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
> echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
> echo ""
> fi
> fi
> export JBOSS_HOME
> {panel}
> I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
> {code}
> #DIRNAME=`dirname "$0"`
> DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
> {code}
> Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
> {panel}
> # source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> /bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> {panel}
> Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
> So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
> Kindest regards.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 9 months
[JBoss JIRA] (WFLY-9241) jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
by Nuno Godinho de Matos (JIRA)
[ https://issues.jboss.org/browse/WFLY-9241?page=com.atlassian.jira.plugin.... ]
Nuno Godinho de Matos updated WFLY-9241:
----------------------------------------
Description:
Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
While on windows the script is natrually working.
On linux centOs, the script immediately broke with the error:
{panel}
[johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
**********************************************************
INVOKE jboss-cli.bat with script file: "file99.sh"
**********************************************************
Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
<----- this some additional informaiton I am printing to make the point
RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
{panel}
What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
call jboss-cli.bat -f someFilepath
and not break.
The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
And only cares about the current location of the jboss-cli.bat script itself.
{panel}
if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%" <-------- This here is a good approach
) else (
set DIRNAME=.\
)
{panel}
On linux, the same is not being done:
{panel}
# Setup JBOSS_HOME
RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
if [ "x$JBOSS_HOME" = "x" ]; then
# get the full path (without any relative bits)
JBOSS_HOME=$RESOLVED_JBOSS_HOME
else
SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
echo ""
fi
fi
export JBOSS_HOME
{panel}
I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
{code}
#DIRNAME=`dirname "$0"`
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
{code}
Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
{panel}
# source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
/bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
{panel}
Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
Kindest regards.
was:
Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
While on windows the script is natrually working.
On linux centOs, the script immediately broke with the error:
{panel}
[johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
**********************************************************
SETUP CORE ENV VARIABLES
**********************************************************
SET_CORE_ENV_VARS_SCRIPT_PATH=/home/b7godin/AppServer/wildfly-10.1.0.Final/user_projects/domains/craneboxTrunkPostgres/bin
CURRENT_WILDFLY_DOMAIN_DIR=/home/b7godin/AppServer/wildfly-10.1.0.Final/user_projects/domains/craneboxTrunkPostgres/bin/..
WILDFLY_DOMAINS_DIR=/home/b7godin/AppServer/wildfly-10.1.0.Final/user_projects/domains/craneboxTrunkPostgres/bin/../..
WILDFLY_USER_PROJECTS_DIR=/home/b7godin/AppServer/wildfly-10.1.0.Final/user_projects/domains/craneboxTrunkPostgres/bin/../../..
WILDFLY_BASE_DIRECTORY=/home/b7godin/AppServer/wildfly-10.1.0.Final/user_projects/domains/craneboxTrunkPostgres/bin/../../../..
WILDFLY_BIN_DIRECTORY=/home/b7godin/AppServer/wildfly-10.1.0.Final/user_projects/domains/craneboxTrunkPostgres/bin/../../../../bin
**********************************************************
INVOKE jboss-cli.bat with script file: "file99.sh"
**********************************************************
Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
<----- this some additional informaiton I am printing to make the point
RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
{panel}
What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
call jboss-cli.bat -f someFilepath
and not break.
The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
And only cares about the current location of the jboss-cli.bat script itself.
{panel}
if "%OS%" == "Windows_NT" (
set "DIRNAME=%~dp0%" <-------- This here is a good approach
) else (
set DIRNAME=.\
)
{panel}
On linux, the same is not being done:
{panel}
# Setup JBOSS_HOME
RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
if [ "x$JBOSS_HOME" = "x" ]; then
# get the full path (without any relative bits)
JBOSS_HOME=$RESOLVED_JBOSS_HOME
else
SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
echo ""
fi
fi
export JBOSS_HOME
{panel}
I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
{code}
#DIRNAME=`dirname "$0"`
DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
{code}
Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
{panel}
# source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
/bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
{panel}
Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
Kindest regards.
> jboss-cli.sh - The RESOLVED_JBOSS_HOME strategy is not robust - Unable to access jarfile jboss-modules.jar
> ----------------------------------------------------------------------------------------------------------
>
> Key: WFLY-9241
> URL: https://issues.jboss.org/browse/WFLY-9241
> Project: WildFly
> Issue Type: Bug
> Components: Scripts
> Affects Versions: 10.1.0.Final
> Environment: centOs
> Reporter: Nuno Godinho de Matos
> Assignee: Tomaz Cerar
> Priority: Trivial
> Fix For: 10.2.0.Final
>
>
> Hi, I am currently migrating some windows batch scripts associated to an automated create domain/stanadlone process.
> One of these scripts, consists on faclitating the user to invoke the jboss cli to run a cli file.
> While on windows the script is natrually working.
> On linux centOs, the script immediately broke with the error:
> {panel}
> [johnDoe@localhost bin]$ sh 01_invoke_cli_file_script.sh "file99.sh"
> **********************************************************
> SETUP CORE ENV VARIABLES
> **********************************************************
> **********************************************************
> SETUP CORE ENV VARIABLES
> **********************************************************
> SET_CORE_ENV_VARS_SCRIPT_PATH=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin
> CURRENT_WILDFLY_DOMAIN_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/..
> WILDFLY_DOMAINS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../..
> WILDFLY_USER_PROJECTS_DIR=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../..
> WILDFLY_BASE_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../..
> WILDFLY_BIN_DIRECTORY=/home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/bin/../../../../bin
> **********************************************************
> INVOKE jboss-cli.bat with script file: "file99.sh"
> **********************************************************
> Error: Unable to access jarfile /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain/jboss-modules.jar
> <----- this some additional informaiton I am printing to make the point
> RESOLVED_JBOSS_HOME: /home/johnDoe/AppServer/wildfly-10.1.0.Final/user_projects/domains/someStandAloneDomain
> {panel}
> What the above panel shows is that the RESOLVED_JBOSS_HOME is not being properly set.
> This clearly constrasts with the windows behavior, where my base script can correctly invoke a :
> call jboss-cli.bat -f someFilepath
> and not break.
> The reason for this seems that that while on windows, the script correctly makes no assumption on where the current working directory of the user is.
> And only cares about the current location of the jboss-cli.bat script itself.
> {panel}
> if "%OS%" == "Windows_NT" (
> set "DIRNAME=%~dp0%" <-------- This here is a good approach
> ) else (
> set DIRNAME=.\
> )
> {panel}
> On linux, the same is not being done:
> {panel}
> # Setup JBOSS_HOME
> RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd` <-------- This is not a good approach if dirname is calculated based on the command line DIRNAME=`dirname "$0"`
> if [ "x$JBOSS_HOME" = "x" ]; then
> # get the full path (without any relative bits)
> JBOSS_HOME=$RESOLVED_JBOSS_HOME
> else
> SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
> if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
> echo "WARNING JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
> echo ""
> fi
> fi
> export JBOSS_HOME
> {panel}
> I would suggest that linux scripts shouild cross cuttingly assume nothing about current working directory and do something like:
> {code}
> #DIRNAME=`dirname "$0"`
> DIRNAME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
> {code}
> Since I do not want to be corrupting my wildfly installation and I want to leave all scripts completely untouched, I will be changing my script invocation from:
> {panel}
> # source "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> /bin/bash "$WILDFLY_BIN_DIRECTORY/jboss-cli.sh" --file="$fileNameWithoutPrefixSuffixQuotes"
> {panel}
> Which is not Ideal, since in some scripts I may want to set in my run time environment variables like JAVA_OPTS to override the default ones used on start up of an app server.
> So for me, in the ideal case, I would like to be able to use the source command to run any arbitrary script in the /bin folder without my current directory location playing any relevant role.
> Kindest regards.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 9 months