PredictionIO启动服务器在centos 6

时间:2015-07-01 13:19:41

标签: java centos6 unsupported-class-version predictionio

我在RHEL 6.6中安装了forecastIO。但是当我用pio-start启动pio时,我得到的错误如下

$ pio-start-all 
Starting Elasticsearch...
Starting HBase...
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/util/HBaseConfTool : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.apache.hadoop.hbase.util.HBaseConfTool. Program will exit.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/zookeeper/ZKServerTool : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: org.apache.hadoop.hbase.zookeeper.ZKServerTool. Program will exit.
starting master, logging to /home/itdevel/PredictionIO/vendors/hbase-1.0.0/bin/../logs/hbase-itdevel-master-Puget-129416.out
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/master/HMaster : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
starting regionserver, logging to /home/itdevel/PredictionIO/vendors/hbase-1.0.0/bin/../logs/hbase-itdevel-1-regionserver-Puget-129416.out
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hbase/regionserver/HRegionServer : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
Waiting 10 seconds for HBase to fully initialize...
Starting PredictionIO Event Server...

毕竟pio服务器没有启动。我已经为该用户创建了一个新用户并安装了java,因为系统范围的java安装是1.6。我已成功为新用户安装了Java 1.8

$java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

我已经在pio-start-all中编辑了路径,指向我的java安装,因为pio-start-all找不到jdp。我检查了我的java路径。

 $echo $JAVA_HOME
/home/me/jdk1.8.0_45/bin

将pio-start-all中的路径从/home/me/jdk1.8.0_45/bin/bin更改为/home/me/jdk1.8.0_45/bin后,jdp错误已修复,但我对当前错误感到震惊。我已经在几台ubuntu机器和服务器中安装了pio,定制了pio以满足我的自定义引擎模板要求,并且它运行没有问题。 predictIO支持Redhat吗?希望这是您需要的所有错误跟踪。提前谢谢:)

2 个答案:

答案 0 :(得分:2)

我已经解决了这个问题。在我的情况下,hbase指向错误的java安装。在JAVA_HOME更新/home/me/PredictionIO/vendors/hbase-1.0.0/bin/hbase后,hbase启动并运行,我的问题已修复。感谢您的支持:)

答案 1 :(得分:0)

java.lang.UnsupportedClassVersionError或其运行的其他脚本仍然使用早期版本的Java时,pio-start-all肯定会抛出predictionIO,而不是root所要求的。您必须彻底检查使用的Java版本。

其中一种方法是尝试alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1062      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1062      manual mode

Press enter to keep the current choice[*], or type selection number:

你会有这样的东西

JAVA_HOME

选择最新的Java版本。

您也可以配置- (void)methodThatNeedsAClassOfSpecialTypeAsInput:(Class)inClass; 。请check the instructions for RedHat