Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hubble): encode/decode Chinese error after building package #627

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add export xxx for system encoding env?

Also need test the docker version

Copy link
Member

@imbajin imbajin Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could refer:
image

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
Loading