[Biojava-l] A newbie question

Thomas Down td2@sanger.ac.uk
Sat, 27 Jan 2001 16:05:26 +0000

On Fri, Jan 26, 2001 at 02:52:19PM -0500, madavh00 wrote:
> I am trying to use the biojava packages within a servlet. And when I try
> from code from EmblToGffFasta.java from within the servlet  I get the
> following error
> java.lang.ClassCastException
> rethrown as org.biojava.bio.BioError: Unable to initialize AlphabetManager
> at org.biojava.bio.symbol.AlphabetManager
> The lines of code follow
>       Alphabet alpha = DNATools.getDNA();
>       SymbolParser rParser = alpha.getParser("token");
> Can you help me resolve this. I am using Biojava 1.01 Java SDK v 1.2.2

It's hard to be sure what's going wrong without a little more
implementation.  What platform were you running on?  What servlet
container?  Did you get a full stack trace when the exception

My best guess (without a bit more information it has to be a guess),
is that you've hit an issue with the AlphabetManager initialization
code which makes it rather fussy about the exact behaviour of the XML
parser and DOM implementation in use.  My suspicion is that your servrlet
container is supplying a DOM implmentation which differs from the `xml.jar'
file supplied with BioJava, and this is triggering your problems.

I fixed a problem of this kind early on in the BioJava 1.1 development
cycle.  As an experiment, I've backported this fix to the 1.0
branch.  Could you try downloading:


This should work as a drop-in replacement for biojava-1.01.
Let me know if this helps...