红帽6.8安装kettle9.4,运行carte.sh报错Caused by: java.lang.reflect.InvocationTargetException

运行carte.sh报错Caused by: java.lang.reflect.InvocationTargetException

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.pentaho.commons.launcher.Launcher.main(Launcher.java:92)
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
        at jdk.internal.platform.Metrics.systemMetrics(Metrics.java:67)
        at jdk.internal.platform.Container.metrics(Container.java:42)
        at sun.management.OperatingSystemImpl.<init>(OperatingSystemImpl.java:181)
        at sun.management.ManagementFactoryHelper.getOperatingSystemMXBean(ManagementFactoryHelper.java:106)
        at java.lang.management.PlatformComponent$7.getMXBeans(PlatformComponent.java:157)
        at java.lang.management.PlatformComponent.getMXBeans(PlatformComponent.java:377)
        at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:472)
        at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
        at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:637)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
        at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
        at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
        at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
        at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
        at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
        at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
        at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:284)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:304)
        at org.pentaho.di.i18n.GlobalMessageUtil.<clinit>(GlobalMessageUtil.java:50)
        at org.pentaho.di.i18n.LAFMessageHandler.calculateString(LAFMessageHandler.java:94)
        at org.pentaho.di.i18n.GlobalMessages.getString(GlobalMessages.java:177)
        at org.pentaho.di.i18n.BaseMessages.getString(BaseMessages.java:86)
        at org.pentaho.di.core.logging.LogLevel.<clinit>(LogLevel.java:36)
        at org.pentaho.di.core.logging.DefaultLogLevel.<init>(DefaultLogLevel.java:36)
        at org.pentaho.di.core.logging.DefaultLogLevel.getInstance(DefaultLogLevel.java:41)
        at org.pentaho.di.core.logging.DefaultLogLevel.getLogLevel(DefaultLogLevel.java:50)
        at org.pentaho.di.core.logging.LogChannel.<init>(LogChannel.java:80)
        at org.pentaho.di.core.logging.LogChannel.<clinit>(LogChannel.java:41)
        at org.pentaho.di.i18n.GlobalMessages.<clinit>(GlobalMessages.java:46)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at org.pentaho.di.laf.LAFDelegate.loadHandler(LAFDelegate.java:83)
        at org.pentaho.di.laf.LAFDelegate.init(LAFDelegate.java:59)
        at org.pentaho.di.laf.LAFDelegate.<init>(LAFDelegate.java:51)
        at org.pentaho.di.laf.LAFFactory.getDelegate(LAFFactory.java:60)
        at org.pentaho.di.laf.LAFFactory.getHandler(LAFFactory.java:75)
        at org.pentaho.di.i18n.BaseMessages.init(BaseMessages.java:51)
        at org.pentaho.di.i18n.BaseMessages.<init>(BaseMessages.java:46)
        at org.pentaho.di.i18n.BaseMessages.getInstance(BaseMessages.java:56)
        at org.pentaho.di.i18n.BaseMessages.<clinit>(BaseMessages.java:42)
        at org.pentaho.di.www.Carte.parseAndRunCommand(Carte.java:173)
        at org.pentaho.di.www.Carte.main(Carte.java:164)
        ... 5 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at jdk.internal.platform.Metrics.systemMetrics(Metrics.java:63)
        ... 52 more
Caused by: java.lang.ExceptionInInitializerError
        at jdk.internal.platform.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:95)
        at jdk.internal.platform.CgroupMetrics.getInstance(CgroupMetrics.java:169)
        ... 57 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4
        at jdk.internal.platform.cgroupv2.CgroupV2Subsystem.initSubsystem(CgroupV2Subsystem.java:73)
        at jdk.internal.platform.cgroupv2.CgroupV2Subsystem.<clinit>(CgroupV2Subsystem.java:44)
        ... 59 more

这个错误是由于 Java 反射机制在尝试获取系统指标(metrics)时出现了问题,具体原因是 ArrayIndexOutOfBoundsException 导致的 ExceptionInInitializerError。问题出现在 Java 运行时环境尝试初始化 cgroup v2 子系统时。

从堆栈跟踪信息中可以看到,问题根源在于 Java 运行时无法正确解析 cgroup v2 子系统的信息,可能是因为运行的环境(如容器化环境或者虚拟机)不完全支持这些特性,或者这些特性在当前配置下出现了问题。

禁用 cgroup 相关的功能
在 OPT 变量中添加 -XX:-UseContainerSupport 参数
修改脚本
#!/bin/sh

# *****************************************************************************
#
# Pentaho Data Integration
#
# Copyright (C) 2006 - 2022 by Hitachi Vantara : http://www.hitachivantara.com
#
# *****************************************************************************
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# *****************************************************************************

# OS specific support.
darwin=false;
case "$(uname -s)" in
  Darwin*)
    darwin=true
    ;;
esac

BASEDIR="`dirname $0`"
cd "$BASEDIR"
DIR="`pwd`"
cd - > /dev/null
OPT="$OPT -Dorg.mortbay.util.URI.charset=UTF-8 -XX:-UseContainerSupport"
if [ ! "x$JAAS_LOGIN_MODULE_CONFIG" = "x" -a ! "x$JAAS_LOGIN_MODULE_NAME" = "x" ]; then
        OPT=$OPT" -Djava.security.auth.login.config=$JAAS_LOGIN_MODULE_CONFIG"
        OPT=$OPT" -Dloginmodulename=$JAAS_LOGIN_MODULE_NAME"
fi
if [ "${darwin}" = "true" ]; then
  OPT="$OPT -Djava.awt.headless=true"
fi
export OPT
"$DIR/spoon.sh" -main org.pentaho.di.www.Carte "$@"

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值