Help to detect java classes in drop-seq (covid-19 relevant) needed

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Help to detect java classes in drop-seq (covid-19 relevant) needed

Andreas Tille-5
Hi,

I've started packaging of drop-seq[1] and replaced those JARs that are
replacable by Debian packaged versions.  I also have set CLASS_PATH in
d/rules, but it seems to be ignored.  I have dealt with similar cases by
patching it into build.xml but here I have not found the relevant place
to do so.  I'm aware that I did not yet added all needed classes to
CLASS_PATH, but currently I get


   dh_auto_build
        ant -Duser.name debian
Buildfile: /build/drop-seq-2.3.0+dfsg/build.xml
  [taskdef] Could not load definitions from resource testngtasks. It could not be found.

compile-src:
    [mkdir] Created dir: /build/drop-seq-2.3.0+dfsg/classes
    [javac] Compiling 201 source files to /build/drop-seq-2.3.0+dfsg/classes
    [javac] /build/drop-seq-2.3.0+dfsg/src/java/org/broadinstitute/dropseqrna/TranscriptomeException.java:28: error: package htsjdk.samtools does not exist
    [javac] import htsjdk.samtools.SAMException;
    [javac]                       ^
    [javac] /build/drop-seq-2.3.0+dfsg/src/java/org/broadinstitute/dropseqrna/TranscriptomeException.java:34: error: cannot find symbol
    [javac] public class TranscriptomeException extends SAMException
    [javac]                                             ^
    [javac]   symbol: class SAMException
...


but /usr/share/java/htsjdk.jar which is in CLASS_PATH contains this class.

Any hint how to take this hurdle would be welcome.

Kind regards

       Andreas.


[1] https://salsa.debian.org/med-team/drop-seq

--
http://fam-tille.de

Reply | Threaded
Open this post in threaded view
|

Re: Help to detect java classes in drop-seq (covid-19 relevant) needed

Andrius Merkys
Hi Andreas,

On 2020-05-20 14:20, Andreas Tille wrote:
> Any hint how to take this hurdle would be welcome.

Try setting the CLASSPATH in your d/rules like this:

export CLASSPATH :=
$(DEBJAR)/htsjdk.jar:$(DEBJAR)/picard.jar:$(DEBJAR)/commons-collections4.jar

I did this in one of packages and it seemed to work.

Hope this helps,
Andrius

Reply | Threaded
Open this post in threaded view
|

Re: Help to detect java classes in drop-seq (covid-19 relevant) needed

Felix Natter-2
In reply to this post by Andreas Tille-5
Andreas Tille <[hidden email]> writes:

> Hi,

hello Andreas,

> I've started packaging of drop-seq[1] and replaced those JARs that are
> replacable by Debian packaged versions.  I also have set CLASS_PATH in
> d/rules, but it seems to be ignored.  I have dealt with similar cases by
> patching it into build.xml but here I have not found the relevant place
> to do so.  I'm aware that I did not yet added all needed classes to
> CLASS_PATH, but currently I get
>
>
>    dh_auto_build
>         ant -Duser.name debian
> Buildfile: /build/drop-seq-2.3.0+dfsg/build.xml
>   [taskdef] Could not load definitions from resource testngtasks. It could not be found.
>
> compile-src:
>     [mkdir] Created dir: /build/drop-seq-2.3.0+dfsg/classes
>     [javac] Compiling 201 source files to /build/drop-seq-2.3.0+dfsg/classes
>     [javac] /build/drop-seq-2.3.0+dfsg/src/java/org/broadinstitute/dropseqrna/TranscriptomeException.java:28: error: package htsjdk.samtools does not exist
>     [javac] import htsjdk.samtools.SAMException;
>     [javac]                       ^
>     [javac] /build/drop-seq-2.3.0+dfsg/src/java/org/broadinstitute/dropseqrna/TranscriptomeException.java:34: error: cannot find symbol
>     [javac] public class TranscriptomeException extends SAMException
>     [javac]                                             ^
>     [javac]   symbol: class SAMException
> ...

Since the upstream jars were in ${lib}, you need to point ${lib} to /usr/share/java/:

diff --git a/debian/patches/debian_packaged_libs.patch b/debian/patches/debian_packaged_libs.patch
index 1d3790c..4fc1ed9 100644
--- a/debian/patches/debian_packaged_libs.patch
+++ b/debian/patches/debian_packaged_libs.patch
@@ -1,6 +1,6 @@
 --- a/build.xml
 +++ b/build.xml
-@@ -35,7 +35,7 @@
+@@ -35,13 +35,15 @@
      <property name="classes.test" location="testclasses"/>
      <property name="test.output" location="dist/test"/>
      <property name="javadoc" location="javadoc"/>
@@ -9,3 +9,13 @@
      <property name="public.dir" location="."/>

      <!-- INIT -->
+     <path id="classpath">
+-        <fileset dir="${lib}">
+-            <include name="*.jar"/>
++        <fileset dir="/usr/share/java">
++            <include name="htsjdk.jar"/>
++            <include name="picard.jar"/>
++            <include name="commons-collections4.jar"/>
+         </fileset>
+     </path>
+     <path id="test.classpath">

You have to add more libraries like these.

Cheers and Best Regards,
--
Felix Natter
debian/rules!

Reply | Threaded
Open this post in threaded view
|

Re: Help to detect java classes in drop-seq (covid-19 relevant) needed

Andreas Tille-6
HI Felix,

On Wed, May 20, 2020 at 06:12:54PM +0200, Felix Natter wrote:

>
> Since the upstream jars were in ${lib}, you need to point ${lib} to /usr/share/java/:
>
> diff --git a/debian/patches/debian_packaged_libs.patch b/debian/patches/debian_packaged_libs.patch
> index 1d3790c..4fc1ed9 100644
> --- a/debian/patches/debian_packaged_libs.patch
> +++ b/debian/patches/debian_packaged_libs.patch
> @@ -1,6 +1,6 @@
>  --- a/build.xml
>  +++ b/build.xml
> -@@ -35,7 +35,7 @@
> +@@ -35,13 +35,15 @@
>       <property name="classes.test" location="testclasses"/>
>       <property name="test.output" location="dist/test"/>
>       <property name="javadoc" location="javadoc"/>
> @@ -9,3 +9,13 @@
>       <property name="public.dir" location="."/>
>
>       <!-- INIT -->
> +     <path id="classpath">
> +-        <fileset dir="${lib}">
> +-            <include name="*.jar"/>
> ++        <fileset dir="/usr/share/java">
> ++            <include name="htsjdk.jar"/>
> ++            <include name="picard.jar"/>
> ++            <include name="commons-collections4.jar"/>
> +         </fileset>
> +     </path>
> +     <path id="test.classpath">
>
> You have to add more libraries like these.

Thanks.  This was pretty helpful.  Now I need to package the
remaining JAR which is not yet packaged from

   http://la4j.org/

...

Kind regards

      Andreas.

--
http://fam-tille.de

Reply | Threaded
Open this post in threaded view
|

Re: Help to detect java classes in drop-seq (covid-19 relevant) needed

Andreas Tille-5
Hi,

On Wed, May 20, 2020 at 10:07:48PM +0200, Andreas Tille wrote:
>
> Thanks.  This was pretty helpful.  Now I need to package the
> remaining JAR which is not yet packaged from
>
>    http://la4j.org/

I made some progress and also uploaded libla4j-java[1] to new.  With
this I tried to build drop-seq[2] and stumbled upon two issues:

At first a lintian issue:

W: drop-seq-tools: classpath-contains-relative-path usr/share/java/dropseq-2.3.0.jar: lib/FastInfoset-1.2.12.jar, lib/FastInfoset.jar, lib/FastInf
N:
N:    The classpath listed in the jar file refers to a potential missing jar
N:    file. This could be the remnants of a build-time classpath that are not
N:    relevant for a JAR bundled in a Debian package.
N:    
N:    Alternatively, the classpath may be correct, but the package is lacking
N:    a jar file or a symlink to it.
N:    
N:    Note, Lintian assumes that all (relative) classpaths pointing to
N:    /usr/share/java/ (but not subdirs thereof) are satisfied by dependencies
N:    as long as there is at least one strong libX-java dependency.
N:    
N:    Severity: warning
N:    
N:    Check: languages/java

I have no idea what this means.  A `grep -Ri fastinfoset` inside the source
tree remains empty.

The other one is a runtime error of the wrapper script:

$ drop-seq
Error: Could not find or load main class org.broadinstitute.dropseqrna.cmdline.DropSeqMain
Caused by: java.lang.NoClassDefFoundError: picard/cmdline/PicardCommandLine

Any idea what might be wrong here?

Thanks a lot for any help

      Andreas.


[1] https://salsa.debian.org/med-team/libla4j-java
[2] https://salsa.debian.org/med-team/drop-seq

--
http://fam-tille.de

Reply | Threaded
Open this post in threaded view
|

Re: Help to detect java classes in drop-seq (covid-19 relevant) needed

Felix Natter-2
Andreas Tille <[hidden email]> writes:

> Hi,

hello Andreas,

> On Wed, May 20, 2020 at 10:07:48PM +0200, Andreas Tille wrote:
>>
>> Thanks.  This was pretty helpful.  Now I need to package the
>> remaining JAR which is not yet packaged from
>>
>>    http://la4j.org/
>
> I made some progress and also uploaded libla4j-java[1] to new.  With
> this I tried to build drop-seq[2] and stumbled upon two issues:
>
> At first a lintian issue:
>
> W: drop-seq-tools: classpath-contains-relative-path usr/share/java/dropseq-2.3.0.jar: lib/FastInfoset-1.2.12.jar, lib/FastInfoset.jar, lib/FastInf
> N:
> N:    The classpath listed in the jar file refers to a potential missing jar
> N:    file. This could be the remnants of a build-time classpath that are not
> N:    relevant for a JAR bundled in a Debian package.
> N:
> N:    Alternatively, the classpath may be correct, but the package is lacking
> N:    a jar file or a symlink to it.
> N:
> N:    Note, Lintian assumes that all (relative) classpaths pointing to
> N:    /usr/share/java/ (but not subdirs thereof) are satisfied by dependencies
> N:    as long as there is at least one strong libX-java dependency.
> N:
> N:    Severity: warning
> N:
> N:    Check: languages/java
>
> I have no idea what this means.  A `grep -Ri fastinfoset` inside the source
> tree remains empty.
>

The (current) problem is this in the jar-executable target:

        <pathconvert property="classpath.manifest" refid="classpath" pathsep=" ">
            <chainedmapper>
                <flattenmapper/>
                <globmapper from="*.jar" to="lib/*.jar"/>
            </chainedmapper>
        </pathconvert>

This causes the classpath for the runnable jar to be prefixed with lib/,
but /usr/share/java/lib/... (or lib/...) does not exist. Please try to change it to:

        <pathconvert property="classpath.manifest" refid="classpath" pathsep=" ">
           <flattenmapper/>
        </pathconvert>

> The other one is a runtime error of the wrapper script:
>
> $ drop-seq
> Error: Could not find or load main class org.broadinstitute.dropseqrna.cmdline.DropSeqMain
> Caused by: java.lang.NoClassDefFoundError:
> picard/cmdline/PicardCommandLine

This is a likely consequence of the lintian above: the dropseq jar does
not refer to the correct classpath entry for picard.jar.

If it still does not work, please post the META-INF/MANIFEST.MF contents
of the usr/share/java/dropseq-2.3.0.jar (you can rename it to .zip, then
open it with an archiver).

Cheers and Best Regards,
--
Felix Natter
debian/rules!