Can not use biojava in a Maven Netbeans application


I have a problem getting BioJava to work in a Netbeans RCP application, built using Maven. I've created a Maven module as a wrapper, including org.biojava.* and org.forester.* packages as public in the POM. Then, from another module I set the wrapper as a dependency, and use some of the basic examples from the BioJava cookbook for testing.

Whenever I try to instantiate some object of a class from BioJava, the application freezes and I have to kill it using the Windows task manager.

Here's the wrapper's pom file:

    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

Here's some code I try to get to work. This is just a very coarse example, called from a button in a TopComponent. Input and output are just text fields.

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         

    Reader r = new Reader(new File("D:\\current\\fastafile.fasta"));
    for (ProteinSequence a : r.getSequences()) {
    Profile<ProteinSequence, AminoAcidCompound> profile = Alignments.getMultipleSequenceAlignment(r.sequences);
    output.setText(String.format("Clustalw:%n%s%n", profile));



Here's the reader class:

public class Reader {

    List<ProteinSequence> sequences = new ArrayList<>();

    public Reader(File fastaFile) {

        try {

            FileInputStream inStream = new FileInputStream(fastaFile);
            FastaReader<ProteinSequence, AminoAcidCompound> fastaReader
                    = new FastaReader<>(
                            new GenericFastaHeaderParser<ProteinSequence, AminoAcidCompound>(),
                            new ProteinSequenceCreator(AminoAcidCompoundSet.getAminoAcidCompoundSet()));
            LinkedHashMap<String, ProteinSequence> b = fastaReader.process();

        } catch (IOException ex) {
            Logger.getLogger(Reader.class.getName()).log(Level.SEVERE, null, ex);


    public List<ProteinSequence> getSequences() {
        return sequences;


In the (Netbeans) IDE, the classes are found and used in autocompletion, and the project builds successfully, in each case indicating that principally the dependencies are set up correctly.

First of all check the wrapper module's manifest to see if all entries are correctly generated, especially since you define useOSGiDependencies==true. It could be that the biojava jars contain osgi headers and then you are not wrapping the jars in module, but declare a dependency on osgi plugin.

However locking of the app is weird, if there was something wrong with the runtime dependencies I would have expected an early 'unsatisfied dependencies' error. You might want to create a thread dump and check what's going on. Maybe you have a deadlock. Or since your action (jButton1ActionPerformed) is called from AWT, maybe the whole reading thing just takes time and your UI thread is locked.