[Biojava-l] The Java sandbox and BioJava

Andrew Walsh walsh at andrew.cmu.edu
Wed Jun 21 17:38:42 UTC 2006


Thanks to Richard and Mark for the replies and suggestions.  As it turns 
out, the BioJava code accesses AlphabetManager.xml in a perfectly safe, 
"in the sandbox" way, which is why I couldn't see a problem there.  The 
problem was actually that I had a copy of biojava.jar in the "ext" 
folder of my local Java run time environment.  This location apparently 
supersedes any libraries provided remotely by the application in the Web 
Start framework, so Java was loading the classes from there.  Then when 
the ClassLoader tried to get the resource, it went looking in the jar 
file in the local filesystem, which is not allowed from inside the 
sandbox.  After removing the unnecessary biojava.jar from the "ext" 
folder, everything worked just fine.

Thanks again for the help, and thanks for the developers for writing the 
code correctly in the first place!
-Andy

mark.schreiber at novartis.com wrote:
> I think I remember something similar happening with Applets a long time 
> ago. I don't recall the solution. Christophe Gille uses biojava and 
> webstart for the STRAP project. He may be able to offer advice 
> (www.charite.de/bioinf/strap)
>
> - Mark
>
>
>
>
>
> Andrew Walsh <walsh at andrew.cmu.edu>
> Sent by: biojava-l-bounces at lists.open-bio.org
> 06/20/2006 10:29 PM
>
>  
>         To:     biojava-l at lists.open-bio.org
>         cc:     (bcc: Mark Schreiber/GP/Novartis)
>         Subject:        [Biojava-l] The Java sandbox and BioJava
>
>
> I am working on an application that I want to deliver via Java Web 
> Start.  This application uses BioJava 1.4 to do some basic processing of 
> protein sequence files.  Applications run via Java Web Start have the 
> option of staying in the Java sandbox or requesting to have full 
> access.  I would like to provide both options to the user, but I am 
> having trouble with the in-sandbox version.  When the application tries 
> to open a sequence file, it fails with the following error:
>
> java.lang.reflect.InvocationTargetException
> <snipped list of Sun classes involved in running an application>
> Caused by: org.biojava.bio.BioError: Couldn't locate 
> AlphabetManager.xml.  This probably means that your biojava.jar file is 
> corrupt or incorrectly built.
>     at 
> org.biojava.bio.symbol.AlphabetManager.<clinit>(AlphabetManager.java:1012)
>     at org.biojava.bio.seq.ProteinTools.<clinit>(ProteinTools.java:75)
>     at 
> org.biojava.bio.seq.io.MSFAlignmentFormat.read(MSFAlignmentFormat.java:187)
>     at org.biojava.bio.seq.io.SeqIOTools.fileToAlign(SeqIOTools.java:1138)
>     at 
> org.biojava.bio.seq.io.SeqIOTools.fileToBiojava(SeqIOTools.java:940)
>     at 
> org.biojava.bio.seq.io.SeqIOTools.fileToBiojava(SeqIOTools.java:908)
>     at org.msaviewer.tools.SequenceFileReader.readAlignmentFile(Unknown 
> Source)
>     at org.msaviewer.MSAViewer.openSafeSession(MSAViewer.java:295)
>     at org.msaviewer.MSAViewer.main(MSAViewer.java:1334)
>     ... 11 more
>
> It would appear that the way in which the AlphabetManager reads 
> AlphabetManager.xml from the BioJava jar file is not compatible with the 
> Java Web Start sandbox restrictions.  I skimmed the relevant sections of 
> the AlphabetManager code and didn't see an obvious solution.  Does 
> anyone have any experience with getting BioJava to work inside the 
> sandbox that might be able to suggest a fix to this problem?
>
> Thanks,
> Andy Walsh
> Postdoctoral Fellow
> Language Technologies Institute
> Carnegie Mellon University
>
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biojava-l
>
>
>
>
>   




More information about the Biojava-l mailing list