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