[ovirt-devel] How to debug NullPointerException for project restapi-def inition of version 3.6.4.1?

Juan Hernández jhernand at redhat.com
Thu Apr 7 09:23:06 UTC 2016


On 04/07/2016 10:50 AM, Kai Kang wrote:
> 
> 
> On Thu, Apr 7, 2016 at 3:55 PM, Juan Hernández <jhernand at redhat.com
> <mailto:jhernand at redhat.com>> wrote:
> 
>     On 04/07/2016 08:34 AM, Martin Mucha wrote:
>     >
>     >
>     > ----- Original Message -----
>     >>
>     >>
>     >> On Wed, Apr 6, 2016 at 6:03 PM, Juan Hernández <
>     jhernand at redhat.com <mailto:jhernand at redhat.com> > wrote:
>     >>
>     >>
>     >>
>     >> On 04/06/2016 11:51 AM, Kai Kang wrote:
>     >>> Hi,
>     >>>
>     >>> I am building ovirt-engine 3.6.4.1 and failed with
>     NullPointerException.
>     >>> I build for cross compile with commands:
>     >>>
>     >>>
>     >>>
>     >>>
>     tmp_repo=/buildarea3/kkang/builds/Mar31-ovrit-engine/bitbake_build/tmp/work/corei7-64-wrs-linux/ovirt-engine/3.6.4.1-r0/repo
>     >>> export MAVEN_OPTS="-Dmaven.repo.local=$tmp_repo"
>     >>>
>     >>> make EXTRA_BUILD_FLAGS="-s
>     >>>
>     /buildarea3/kkang/builds/Mar31-ovrit-engine/bitbake_build/tmp/work/corei7-64-wrs-linux/ovirt-engine/3.6.4.1-r0/settings.xml
>     >>> --debug --offline" -j1 BUILD_GWT=1 BUILD_LOCALES=0
>     >>> BUILD_UT=1 BUILD_VALIDATION=0
>     >>> JAVA_DIR=/usr/share/ovirt-engine/java LOCALSTATE_DIR=/var
>     >>> MAVENPOM_DIR=/usr/share/ovirt-engine/maven-poms PREFIX=/usr
>     >>> SYSCONF_DIR=/etc PKG_SYSCONF_DIR=/etc/ovirt-engine
>     >>> PKG_DOC_DIR=/usr/doc/ovirt-engine
>     >>> PKG_EAR_DIR=/usr/share/ovirt-engine/engine.ear
>     >>> PKG_PKI_DIR=/etc/pki/ovirt-engine
>     >>> PKG_JBOSS_MODULES=/usr/share/ovirt-engine/modules
>     >>> PKG_CACHE_DIR=/var/cache/ovirt-engine
>     >>> PKG_LOG_DIR=/var/log/ovirt-engine
>     >>> PKG_TMP_DIR=/var/tmp/ovirt-engine
>     >>> PKG_STATE_DIR=/var/lib/ovirt-engine PKG_USER=ovirt PKG_GROUP=ovirt
>     >>> all
>     >>>
>     >>>
>     >>> The error messages show:
>     >>>
>     >>> [INFO] oVirt Engine API Definition .......................
>     FAILURE [1.476s]
>     >>> ...
>     >>> [INFO]
>     >>>
>     ------------------------------------------------------------------------
>     >>> [ERROR] Failed to execute goal
>     >>> org.codehaus.mojo:exec-maven-plugin:1.2:java (default) on project
>     >>> restapi-definition: An exception occured while executing the
>     Java class.
>     >>> null: InvocationTargetException: NullPointerException -> [Help 1]
>     >>> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
>     >>> execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java
>     (default) on
>     >>> project restapi-definition: An exception occured while executing the
>     >>> Java class. null
>     >>> at
>     >>>
>     org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
>     >>> ...
>     >>> at javax.xml.bind.JAXB.marshal(JAXB.java:332)
>     >>> at
>     >>>
>     org.ovirt.engine.api.rsdl.RsdlManager.serializeRsdl(RsdlManager.java:134)
>     >>> at
>     >>>
>     org.ovirt.engine.api.rsdl.RsdlManager.generateRsdlFile(RsdlManager.java:84)
>     >>> at org.ovirt.engine.api.rsdl.RsdlManager.main(RsdlManager.java:58)
>     >>> ... 6 more
>     >>>
>     >>>
>     >>> My questions are:
>     >>>
>     >>> 1 I know the error occurs in
>     >>> file
>     >>>
>     backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/rsdl/RsdlManager.java,
>     >>> but how to debug it?
>     >>>
>     >>> 2 When I remove pom and jar files of javax.xml.bind.JAXB in mave
>     repo
>     >>> with offline mode, it still could find the class.
>     >>> Which javax.xml.bind.JAXB is used? I searched the ovirt engine
>     repo but
>     >>> didn't find it either.
>     >>>
>     >>
>     >> The version of JAXB used by that area of the code is the version
>     of JAXB
>     >> included in the JDK that you are using for the build. So the
>     question is
>     >> what version of the JDK are you using?
>     >>
>     >> Hi Juan,
>     >>
>     >> I am using icedtea7 to build openjdk-7. And I found the JAXB file.
>     >
>     > note: I saw same line using java-1.8.0-openjdk installed from repo.
>     >
> 
>     The build of the master branch (what will eventually be oVirt 4)
>     requires Java 8, but Kai Kang is trying to build 3.6.4.1, which should
>     build correctly with Java 7. I just tried that, with the version of
>     OpenJDK 7 included in CentOS 7:
> 
>       $ java -version
>       java version "1.7.0_85"
>       OpenJDK Runtime Environment (rhel-2.6.1.2.el7_1-x86_64 u85-b01)
>       OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode
> 
>     Kai Kang, from the "icedtea7" and "openjdk-7" names I assume that you
>     aren't using CentOS or Fedora, which are the typical distributions used
>     for oVirt. What distribution are you using exactly? And what version of
>     openjdk-7 exactly? If you share that information we may be able to
>     reproduce.
> 
> 
> I am working on cross-compile with Yocto project. So the java is built
> from openjdk source.
> 
> $ java -version
> java version "1.7.0"
> JamVM version 2.0.0
> Copyright (C) 2003-2014 Robert Lougher <rob at jamvm.org.uk
> <mailto:rob at jamvm.org.uk>>
> 
> ...
> 
> Build information:
> 
> Execution Engine: inline-threaded interpreter
> Compiled with: gcc 4.8.2
> 
> Boot Library Path:
> /buildarea3/kkang/builds/ovp-intel-Mar15/bitbake_build/tmp/sysroots/x86_64-linux/usr/lib/cl
> asspath
> Boot Class Path:
> /buildarea3/kkang/builds/ovp-intel-Mar15/bitbake_build/tmp/sysroots/x86_64-linux/usr/share/ja
> mvm/classes.zip:/buildarea3/kkang/builds/ovp-intel-Mar15/bitbake_build/tmp/sysroots/x86_64-linux/usr/share/cla
> sspath/glibj.zip
> 
> 
> ovirt-engine 3.5.x could be built successfully. But none of 3.6.x could
> be built from 3.6.0.
> 
>  
> 
> 
>     >>
>     >> Would you like to give some advice how to debug this issue? Does jdb could
>     >> debug such code?
>     >>
> 
>     The easiest way to debug this to have an IDE, like IntelliJ Idea, or
>     Eclipse, set a breakpoint in the relevant line and then debug the Maven
>     build.
> 
>     You may be able to debug the Maven build with "jdb" as well, but I can't
>     help you with that, I'm not familiar with it.
> 
>     I'd suggest to perform the build of the relevant component only, using
>     the Maven -X option. For example:
> 
>     1. Do a complete build of the engine, manually:
> 
>       $ mvn clean install -DskipTests
> 
>     This should fail in the same point where it failed previously, as you
>     will be using the same JDK.
> 
>     2. Change to the directory of the failing component, and repeat the
>     build, with the "-X" flag:
> 
>       $ cd backend/manager/modules/restapi/interface/definition
>       $ mvn clean install -X -DskipTests > build.log
> 
>     That should fail again, but there will be more information in the
>     "build.log" file. Inspect and maybe share it with us.
> 
> 
> The error occurs in 
> 
> ./backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/rsdl/RsdlManager.java
> 
> to deal with "/rsdl_metadata.yaml".
> 
> I tried to copy rsdl_metadata.yaml from 3.5.1.1 to cover the file in
> build directory, but it stills to fail.
> 
> The build log is pasted at:
> 
> https://gist.github.com/parr0tr1ver/11760d866e6f40990e59c772cd6bca6f
> 
> I'll try to debug it by eclipse.
> 

The problem looks like this JAXB bug:

  https://java.net/jira/browse/JAXB-860

Any chances that your JDK includes a version of JAXB that isn't fixed?
As you are building the JDK from source you may be able to update the
version of JAXB.

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Devel mailing list