Skip to content

Commit

Permalink
fix(hubble): encode/decode Chinese error after building package (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrostyHec authored and imbajin committed Dec 9, 2024
1 parent 26d5f14 commit c2dcd71
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

@SpringBootApplication
@EnableScheduling
@MapperScan("org.apache.hugegraph.mapper")
Expand All @@ -38,6 +41,8 @@ public static void main(String[] args) {
}

public static void initEnv() {
Ex.check(Charset.defaultCharset().equals(StandardCharsets.UTF_8),
"Charset must be UTF-8, current:" + Charset.defaultCharset());
String hubbleHomePath = System.getProperty("hubble.home.path");
Ex.check(StringUtils.isNotEmpty(hubbleHomePath),
"The system property 'hubble.home.path' must be set");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ for jar in "${LIB_PATH}"/*.jar; do
class_path=${class_path}:${jar}
done

JAVA_OPTS="-Xms512m"
JAVA_OPTS="-Xms512m -Dfile.encoding=UTF-8"
JAVA_DEBUG_OPTS=""
FOREGROUND="false"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
export LANG=zh_CN.UTF-8
set -ev

if [[ $# -ne 1 ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
export LANG=zh_CN.UTF-8
set -ev

TRAVIS_DIR=$(dirname "$0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
export LANG=zh_CN.UTF-8
set -ev

COMMIT_ID=$1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
export LANG=zh_CN.UTF-8
set -ev

TRAVIS_DIR="hubble-dist/assembly/travis"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ args=${CONF_PATH}/hugegraph-hubble.properties
log=${LOG_PATH}/hugegraph-hubble.log

echo -n "starting HugeGraphHubble "
nohup nice -n 0 java -server "${java_opts}" "${agent_opts}" -Dhubble.home.path="${HOME_PATH}" -cp "${class_path}" ${main_class} "${args}" > "${log}" 2>&1 < /dev/null &
nohup nice -n 0 java -server -Dfile.encoding=UTF-8 "${java_opts}" "${agent_opts}" -Dhubble.home.path="${HOME_PATH}" -cp "${class_path}" ${main_class} "${args}" > "${log}" 2>&1 < /dev/null &
pid=$!
echo ${pid} > "${PID_FILE}"

Expand Down

0 comments on commit c2dcd71

Please sign in to comment.