Giter Site home page Giter Site logo

NoClassDefFoundError about nginx-gui HOT 19 CLOSED

onlyguo avatar onlyguo commented on September 3, 2024
NoClassDefFoundError

from nginx-gui.

Comments (19)

climba03003 avatar climba03003 commented on September 3, 2024 2

問題成因:

必要運行庫中缺少 rt.jar 令JVM起動失敗
只複製 rt.jar 會出現其他問題

暫時解決:

把 JRE 整個取代

yum install java-1.8.0-openjdk
rm -rf <nginxgui directory>/lib
cp -R /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*/jre <nginxgui directory>/lib
cp <nginxgui directory>/lib/bin/java <nginxgui directory>/lib/bin/java_vms_nginx_gui

ZIP: https://mega.nz/#!8Z9nQIiZ!8AEgmZ0fxfBxXSuFKHGHaT63YcoNYld0yUgkvQiLvSc

永久解決:

打包時把所有必要/原生 Jar 也一起打包

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

Centos 7.4 64位运行startup.sh报
nginxgui
nginxgui/startup.sh: line 4: cd: nginxgui: No such file or directory
Nginx GUI Service Running ...
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Nginx GUI Service Shutdown !

编辑startup.sh, 去掉第三行cd 'dirname $0'试一下呢?

from nginx-gui.

cbrjay avatar cbrjay commented on September 3, 2024

Centos 7.4 64位运行startup.sh报
nginxgui
nginxgui/startup.sh: line 4: cd: nginxgui: No such file or directory
Nginx GUI Service Running ...
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Nginx GUI Service Shutdown !

编辑startup.sh, 去掉第三行cd 'dirname $0'试一下呢?

遇到同样的问题,多台centos服务器都是一样的报错,去掉这个也一样

from nginx-gui.

Zzih avatar Zzih commented on September 3, 2024

Centos 7.4 64位运行startup.sh报
nginxgui
nginxgui / startup.sh:第4行:cd​​:nginxgui:没有这样的文件或目录
Nginx GUI服务运行...
在初始化VM
java / lang / NoClassDefFoundError 期间发生错误:java / lang / Object
Nginx GUI服务关闭!

编辑startup.sh,去掉第三行cd 'dirname $0'试一下呢?

遇到同样的问题,多台的centos服务器都是一样的报错,去掉这个也一样

我也遇到了你是怎么解决的?

from nginx-gui.

cbrjay avatar cbrjay commented on September 3, 2024

Centos 7.4 64位运行startup.sh报
nginxgui
nginxgui / startup.sh:第4行:cd​​:nginxgui:没有这样的文件或目录
Nginx GUI服务运行...
在初始化VM
java / lang / NoClassDefFoundError 期间发生错误:java / lang / Object
Nginx GUI服务关闭!

编辑startup.sh,去掉第三行cd 'dirname $0'试一下呢?

遇到同样的问题,多台的centos服务器都是一样的报错,去掉这个也一样

我也遇到了你是怎么解决的?

没解决,等 @onlyGuo 来解答吧

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

Centos 7.4 64位运行startup.sh报
nginxgui
nginxgui / startup.sh:第4行:cd​​:nginxgui:没有这样的文件或目录
Nginx GUI服务运行...
在初始化VM
java / lang / NoClassDefFoundError 期间发生错误:java / lang / Object
Nginx GUI服务关闭!

编辑startup.sh,去掉第三行cd 'dirname $0'试一下呢?

遇到同样的问题,多台的centos服务器都是一样的报错,去掉这个也一样

我也遇到了你是怎么解决的?

没解决,等 @onlyGuo 来解答吧

主演是, 我这里没有重现问题, 试着编辑startup.sh把

lib/bin/java_vms_nginx_gui -classpath $PTFENCE_CLASSPATH com.aiyi.server.manager.nginx.NginxManagerApplication conf.dir=$BASEPATH/conf/

改为

$BASEPATH/lib/bin/java_vms_nginx_gui -classpath $PTFENCE_CLASSPATH com.aiyi.server.manager.nginx.NginxManagerApplication conf.dir=$BASEPATH/conf/

试一下呢?

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

Centos 7.4 64位运行startup.sh报
nginxgui
nginxgui / startup.sh:第4行:cd​​:nginxgui:没有这样的文件或目录
Nginx GUI服务运行...
在初始化VM
java / lang / NoClassDefFoundError 期间发生错误:java / lang / Object
Nginx GUI服务关闭!

编辑startup.sh,去掉第三行cd 'dirname $0'试一下呢?

遇到同样的问题,多台的centos服务器都是一样的报错,去掉这个也一样

我也遇到了你是怎么解决的?

没解决,等 @onlyGuo 来解答吧

如果还是不行的话, 可以提供一下当前项目目录的结构和完整的截图之类的信息, 最好带上linux版本。

from nginx-gui.

climba03003 avatar climba03003 commented on September 3, 2024

我是有試到有同樣問題
你可以裝個全新 Centos 來試試重現問題

我本身不太熟悉Java 建置後的事
幫不了解決

還有一個思路的 Centos 環境參數對比
你看一下你測試系統和重新系統有什麼差距?

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

如果还是不能解决, 试着BASEPATH=$(cd `dirname $0`; pwd) 这行换成BASEPATH=$(cd `dirname $0`&& pwd) 或者BASEPATH=$(cd `dirname $0`& pwd)这是我能想到的最后的可能了, 具体我重装了linux在尝试重现这个问题。

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

找到原因了, 相对目录的问题。
尝试编辑startup.sh, 将以下行:

BASEPATH=$(cd `dirname $0`; pwd)

修改为如下:

BASEPATH=$(cd `dirname $0` && pwd -P)

@zhoulexuan @cbrjay @Zzih @climba03003

from nginx-gui.

liketoochao avatar liketoochao commented on September 3, 2024

不行啊 刚才那个 -P

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

不行啊 刚才那个 -P

要死了要死了, 回头我再找找原因@_@~

from nginx-gui.

climba03003 avatar climba03003 commented on September 3, 2024

Distro Information : Centos 7.6.1810 Minimal

CentOS Linux release 7.6.1810 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.6.1810 (Core)
CentOS Linux release 7.6.1810 (Core)

Folder Structure
image

Error Message
image

System PATH
image

from nginx-gui.

onlyGuo avatar onlyGuo commented on September 3, 2024

問題成因:

必要運行庫中缺少 rt.jar 令JVM起動失敗
只複製 rt.jar 會出現其他問題

暫時解決:

把 JRE 整個取代

yum install java-1.8.0-openjdk
rm -rf <nginxgui directory>/lib
cp -R /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*/jre <nginxgui directory>/lib
cp <nginxgui directory>/lib/bin/java <nginxgui directory>/lib/bin/java_vms_nginx_gui

ZIP: https://mega.nz/#!8Z9nQIiZ!8AEgmZ0fxfBxXSuFKHGHaT63YcoNYld0yUgkvQiLvSc

永久解決:

打包時把所有必要/原生 Jar 也一起打包

感谢!

from nginx-gui.

cbrjay avatar cbrjay commented on September 3, 2024

問題成因:

必要運行庫中缺少 rt.jar 令JVM起動失敗
只複製 rt.jar 會出現其他問題

暫時解決:

把 JRE 整個取代

yum install java-1.8.0-openjdk
rm -rf <nginxgui directory>/lib
cp -R /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*/jre <nginxgui directory>/lib
cp <nginxgui directory>/lib/bin/java <nginxgui directory>/lib/bin/java_vms_nginx_gui

ZIP: https://mega.nz/#!8Z9nQIiZ!8AEgmZ0fxfBxXSuFKHGHaT63YcoNYld0yUgkvQiLvSc

永久解決:

打包時把所有必要/原生 Jar 也一起打包

谢谢大神,使用你提供的zip报了另外一个错误:
.
Nginx GUI Service Running ...
lib/bin/java_vms_nginx_gui: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/nginx-gui-centos-7-x64-v1.1/lib/bin/../lib/amd64/jli/libjli.so)
Nginx GUI Service Shutdown !

是必须使用openjdk?我的centos上已经有安装了jdk1.8了

from nginx-gui.

climba03003 avatar climba03003 commented on September 3, 2024

問題成因:
必要運行庫中缺少 rt.jar 令JVM起動失敗
只複製 rt.jar 會出現其他問題
暫時解決:
把 JRE 整個取代

yum install java-1.8.0-openjdk
rm -rf <nginxgui directory>/lib
cp -R /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*/jre <nginxgui directory>/lib
cp <nginxgui directory>/lib/bin/java <nginxgui directory>/lib/bin/java_vms_nginx_gui

ZIP: https://mega.nz/#!8Z9nQIiZ!8AEgmZ0fxfBxXSuFKHGHaT63YcoNYld0yUgkvQiLvSc
永久解決:
打包時把所有必要/原生 Jar 也一起打包

谢谢大神,使用你提供的zip报了另外一个错误:
.
Nginx GUI Service Running ...
lib/bin/java_vms_nginx_gui: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/nginx-gui-centos-7-x64-v1.1/lib/bin/../lib/amd64/jli/libjli.so)
Nginx GUI Service Shutdown !

是必须使用openjdk?我的centos上已经有安装了jdk1.8了

你應該是 CentOS 6.X 版本吧
連 GLIBC 2.14 也沒有……

如果自己安裝了了JDK 1.8 的話
JRE 應該是在 /usr/java 內的
找一找再複製取代nginx-gui 的 lib即可

另外你可以先試一試新發佈的版本吧
不行我再裝CentOS 6.X 弄一弄好了

from nginx-gui.

cbrjay avatar cbrjay commented on September 3, 2024

問題成因:
必要運行庫中缺少 rt.jar 令JVM起動失敗
只複製 rt.jar 會出現其他問題
暫時解決:
把 JRE 整個取代

yum install java-1.8.0-openjdk
rm -rf <nginxgui directory>/lib
cp -R /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*/jre <nginxgui directory>/lib
cp <nginxgui directory>/lib/bin/java <nginxgui directory>/lib/bin/java_vms_nginx_gui

ZIP: https://mega.nz/#!8Z9nQIiZ!8AEgmZ0fxfBxXSuFKHGHaT63YcoNYld0yUgkvQiLvSc
永久解決:
打包時把所有必要/原生 Jar 也一起打包

谢谢大神,使用你提供的zip报了另外一个错误:
.
Nginx GUI Service Running ...
lib/bin/java_vms_nginx_gui: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /opt/nginx-gui-centos-7-x64-v1.1/lib/bin/../lib/amd64/jli/libjli.so)
Nginx GUI Service Shutdown !
是必须使用openjdk?我的centos上已经有安装了jdk1.8了

你應該是 CentOS 6.X 版本吧
連 GLIBC 2.14 也沒有……

如果自己安裝了了JDK 1.8 的話
JRE 應該是在 /usr/java 內的
找一找再複製取代nginx-gui 的 lib即可

另外你可以先試一試新發佈的版本吧
不行我再裝CentOS 6.X 弄一弄好了

新版本运行成功,非常感谢!

from nginx-gui.

bobzhanggmail avatar bobzhanggmail commented on September 3, 2024

碰到同样的问题,我是用的oracle官网上的jdk 1.8。
修改了startup.sh脚本,增加下
export JAVA_HOME=JDK解压位置
另外执行命令那里,把lib/bin/java_vms_nginx_gui,直接改成java,即直接用官方的java命令去执行。
java -classpath $PTFENCE_CLASSPATH com.aiyi.server.manager.nginx.NginxManagerApplication conf.dir=$BASEPATH/conf/
这样修改后,成功运行!!

from nginx-gui.

climba03003 avatar climba03003 commented on September 3, 2024

更新至最新版本可解決問題
Issue 可以關閉了 @onlyGuo

from nginx-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.