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