在类路径中找不到为持久单元“oozie mariadb”指定的xml资源“persistence.xml”

jtoj6r0c  于 2021-07-13  发布在  Hadoop
关注(0)|答案(0)|浏览(299)

我在用mariadb教程学习apachehadoopoozie时出错了。我是这样运行的:

ooziedb.sh create -sqlfile ooziedb_init_schema.sql -run

但我知道了:

ai@spkm:~/oozie$ ooziedb.sh create -sqlfile ooziedb_init_schema.sql -run
Validate DB Connection
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/ai/oozie/lib/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/ai/oozie/libext/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
DONE
DB schema does not exist
Check OOZIE_SYS table does not exist
DONE
Create SQL schema

"~/.bashrc"

Error: org.apache.openjpa.persistence.PersistenceProductDerivation:java.util.MissingResourceException: The specified XML resource "persistence.xml" for persistence unit "oozie-mariadb" can't be found in your class path.

Stack trace for the error was (for debug purposes):
--------------------------------------
java.util.MissingResourceException: org.apache.openjpa.persistence.PersistenceProductDerivation:java.util.MissingResourceException: The specified XML resource "persistence.xml" for persistence unit "oozie-mariadb" can't be found in your class path.
        at org.apache.openjpa.lib.conf.ProductDerivations.reportErrors(ProductDerivations.java:380)
        at org.apache.openjpa.lib.conf.ProductDerivations.load(ProductDerivations.java:283)
        at org.apache.openjpa.lib.conf.Configurations.populateConfiguration(Configurations.java:356)
        at org.apache.openjpa.jdbc.meta.MappingTool.run(MappingTool.java:1003)
        at org.apache.openjpa.jdbc.meta.MappingTool$1.run(MappingTool.java:949)
        at org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:764)
        at org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:754)
        at org.apache.openjpa.jdbc.meta.MappingTool.main(MappingTool.java:944)
        at org.apache.oozie.tools.OozieDBCLI.createUpgradeDB(OozieDBCLI.java:1153)
        at org.apache.oozie.tools.OozieDBCLI.createDB(OozieDBCLI.java:198)
        at org.apache.oozie.tools.OozieDBCLI.run(OozieDBCLI.java:135)
        at org.apache.oozie.tools.OozieDBCLI.main(OozieDBCLI.java:83)
Caused by: java.util.MissingResourceException: The specified XML resource "persistence.xml" for persistence unit "oozie-mariadb" can't be found in your class path.
        at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:532)
        at org.apache.openjpa.persistence.PersistenceProductDerivation.load(PersistenceProductDerivation.java:363)
        at org.apache.openjpa.lib.conf.ProductDerivations.load(ProductDerivations.java:274)
        ... 10 more
-------------------------------------

core-site.xml文件

<configuration>
        <property>
                <name>fs.defaultFS</name>
                <value>hdfs://spkm:9000</value>
        </property>
          <property>
    <name>hadoop.proxyuser.ai.groups</name>
    <value>*</value>
  </property>
  <property>
    <name>hadoop.proxyuser.ai.hosts</name>
    <value>*</value>
  </property>
          <property>
   <name>hadoop.http.authentication.cookie.persistent</name>
   <value>true</value>
</property>
</configuration>

hdfs-site.xml文件

<configuration>
        <property>
                <name>dfs.replication</name>
                <value>1</value> 
        </property>
        <property>
                <name>dfs.namenode.name.dir</name>
                <value>/home/ai/data/dfs/namenode</value>
        </property>
        <property>
                <name>dfs.namenode.checkpoint.dir</name>
                <value>/home/ai/data/dfs/namesecondary</value>
        </property>
        <property>
                <name>dfs.datanode.data.dir</name>
                <value>/home/ai/data/dfs/datanode</value>
        </property>
        <property>
                <name>dfs.webhdfs.enabled</name>
                <value>true</value>
        </property>
        <property>
                <name>dfs.http.address</name>
                <value>spkm:9080</value>
        </property>
</configuration>

mapred-site.xml文件

<configuration>
        <property>
                <name>mapreduce.framework.name</name>
                <value>yarn</value>
        </property>
</configuration>

工人

spkw

我的oozie-site.xml

<configuration>
    <property>
        <name>oozie.service.JPAService.jdbc.driver</name>
        <value>com.mysql.cj.jdbc.Driver</value>
    </property>

    <property>
        <name>oozie.service.JPAService.jdbc.url</name>
        <value>jdbc:mariadb://spkm:3306/oozie</value>
    </property>

    <property>
        <name>oozie.service.JPAService.create.db.schema</name>
        <value>true</value>
    </property>

    <property>
        <name>oozie.service.JPAService.jdbc.username</name>
        <value>oozie</value>
    </property>

    <property>
        <name>oozie.service.JPAService.jdbc.password</name>
        <value>oozie</value>
    </property>
</configuration>

我的/etc/profile

export JAVA_HOME=/usr/lib/jvm/java
export HADOOP_HOME=/home/ai/hadoop
export CLASS_PATH=$JAVA_HOME/lib:$CLASS_PATH
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export SCRIPT_HOME=/home/ai/scripts

export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export SPARK_HOME=/home/ai/spark
export PATH=$PATH:$SPARK_HOME/bin:$PSARK_HOME/sbin

export MAVEN_HOME=/usr/bin/maven
export PATH=$PATH:$MAVEN_HOME/bin

export OOZIE_HOME=/home/ai/oozie
export PATH=$PATH:$OOZIE_HOME/bin

**附加hadoop版本3.2.2 spark版本3.0.2 oozie版本5.2.1 maven 3.6.3 java openjdk 1.8

我在google上搜索这个问题,但是没有任何可用的解决方案。
我不知道为什么它一直不起作用。
为什么oozie需要一个“presistence.xml”文件来运行sql?为什么我的代码不起作用?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题