From zbhuang2005 at hotmail.com Tue Jan 2 08:16:16 2007 From: zbhuang2005 at hotmail.com (Huang Zhibin) Date: Tue, 02 Jan 2007 13:16:16 +0000 Subject: [Biojava-dev] how to run unittest in eclipse Message-ID: Dear all, First all,thanks for the contribution of BioJava. I downloaded the BioJava and compile apps, demos, tests and runtests using ant. It is ok. But when importing this project into eclipse, I do not know hot to runtests. For example, when clicking file of /tests/org.biojava.bio.alignment/FlexibleAlignmentTest.java, choose Run As | JUnit Test, it fails. Info in Console will be listed below. I know maybe it failed in the step of initialization, but I do now know how to solve it. Can someone who run junittest in JAVA IDE share the experience or give me some suggestions? I will appreciate it. Best regards, Zhibin ------------------------------ Info printed in Console: org.biojava.bio.BioError: Unable to initialize DNATools at org.biojava.bio.seq.DNATools.(DNATools.java:117) at org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:74) at org.biojava.bio.alignment.FlexibleAlignmentTest.(FlexibleAlignmentTest.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at junit.framework.TestSuite.createTest(TestSuite.java:135) at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at junit.framework.TestSuite.(TestSuite.java:75) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 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.(AlphabetManager.java:148) at org.biojava.bio.seq.DNATools.(DNATools.java:80) ... 15 more java.lang.NoClassDefFoundError at org.biojava.bio.seq.ProteinTools.(ProteinTools.java:76) at org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:76) _________________________________________________________________ ???????????????????????????? MSN Messenger: http://messenger.msn.com/cn From bugzilla-daemon at portal.open-bio.org Wed Jan 3 11:55:12 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 3 Jan 2007 11:55:12 -0500 Subject: [Biojava-dev] [Bug 2175] New: IndexOutOfBoundsException still occurring on SCF.create(File file) Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2175 Summary: IndexOutOfBoundsException still occurring on SCF.create(File file) Product: BioJava Version: live (CVS source) Platform: PC OS/Version: Windows XP Status: NEW Severity: blocker Priority: P1 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: cristyn at broad.mit.edu SCF.create(File file) is still broken. I'm using the 1.5-beta2 download. Here is the stacktrace: ava.lang.IndexOutOfBoundsException at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:199) at java.io.DataInputStream.read(DataInputStream.java:132) at org.biojava.bio.program.scf.SCF$Parser.parsePrivate(SCF.java:391) at org.biojava.bio.program.scf.SCF$Parser.parse(SCF.java:349) at org.biojava.bio.program.scf.SCF$ParserFactory.parse(SCF.java:202) at org.biojava.bio.program.scf.SCF.load(SCF.java:145) at org.biojava.bio.program.scf.SCF.load(SCF.java:140) at org.biojava.bio.program.scf.SCF.create(SCF.java:126) -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 3 11:56:15 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 3 Jan 2007 11:56:15 -0500 Subject: [Biojava-dev] [Bug 2175] IndexOutOfBoundsException still occurring on SCF.create(File file) In-Reply-To: Message-ID: <200701031656.l03GuFcn015619@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2175 cristyn at broad.mit.edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cristyn at broad.mit.edu ------- Comment #1 from cristyn at broad.mit.edu 2007-01-03 11:56 ------- java.lang.IndexOutOfBoundsException at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:199) at java.io.DataInputStream.read(DataInputStream.java:132) at org.biojava.bio.program.scf.SCF$Parser.parsePrivate(SCF.java:391) at org.biojava.bio.program.scf.SCF$Parser.parse(SCF.java:349) at org.biojava.bio.program.scf.SCF$ParserFactory.parse(SCF.java:202) at org.biojava.bio.program.scf.SCF.load(SCF.java:145) at org.biojava.bio.program.scf.SCF.load(SCF.java:140) at org.biojava.bio.program.scf.SCF.create(SCF.java:126) 1.5-beta2 version of SCF class. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 3 12:13:54 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 3 Jan 2007 12:13:54 -0500 Subject: [Biojava-dev] [Bug 2175] IndexOutOfBoundsException still occurring on SCF.create(File file) In-Reply-To: Message-ID: <200701031713.l03HDsoN016548@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2175 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Comment #2 from holland at ebi.ac.uk 2007-01-03 12:13 ------- 1) please check that your SCF file is version 2 or version 3. More recent versions are not yet supported. 2) the exception occurs whilst parsing a PRIVATE block in your SCF file. The block is supposed to specify its size in the header and its offset from the start, then the parser uses this size to read exactly the right amount of data from the right location. In your case it sounds like the header contains an incorrect (too large) size or an incorrect (too late) offset, and so the parser is attempting to read more data than is actually present at the given offset. This would be a bug in the SCF file not the parser. Please could you check the above and get back to me - the file itself would be useful too. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From mark.schreiber at novartis.com Wed Jan 3 22:14:36 2007 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 4 Jan 2007 11:14:36 +0800 Subject: [Biojava-dev] nio for io? Message-ID: Hello - I have been reading about the NIO api recently (very remiss of me to leave it this long). There seems to be potential for this to greatly speed up our parsers such as memory mapping etc, however .... Our current Format objects want to see something like a BufferedReader. We would probably need to make an extension to the Format interface to use a FileChannel of some sort as input. If I do something so naive as use the Channels utility to wrap a Channel into a BufferedReader I get no advantage (it's even a bit slower). There has been some talk of Sun reprogramming normal java.io objects to use NIO internally, does anyone know if this has happened (if it has there is probably not much point in us looking into it much)? Are there people more experienced with this API that can see some potential for it to improve parsing speed (probably the biggest bioinformatics bottleneck)? Comments greatly appreciated. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 From heuermh at acm.org Thu Jan 4 01:02:55 2007 From: heuermh at acm.org (Michael Heuer) Date: Thu, 4 Jan 2007 01:02:55 -0500 (EST) Subject: [Biojava-dev] nio for io? In-Reply-To: Message-ID: Mark Schreiber wrote: > There has been some talk of Sun reprogramming normal java.io objects to > use NIO internally, does anyone know if this has happened (if it has there > is probably not much point in us looking into it much)? I seem to remember the jdk release notes around 1.5 saying this was the case. Very unscientifically, $ grep nio jdk1.6.0/src/java/io/*.java ByteArrayOutputStream.java: * default character set. The {@linkplain java.nio.charset.CharsetDecoder} ByteArrayOutputStream.java: * the specified {@link java.nio.charset.Charset charsetName}. The length of ByteArrayOutputStream.java: * java.nio.charset.CharsetDecoder} class should be used when more control ByteArrayOutputStream.java: * {@linkplain java.nio.charset.Charset charset} Console.java:import java.nio.charset.Charset; Console.java:import sun.nio.cs.StreamDecoder; Console.java:import sun.nio.cs.StreamEncoder; Console.java: * {@link java.io.Reader#read(java.nio.CharBuffer) read(java.nio.CharBuffer)} File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * The {@linkplain java.nio.charset.CharsetEncoder} class should be used when more OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset() default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { $ grep nio jdk1.5.0_08/src/java/io/*.java File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { :) michael From mark.schreiber at novartis.com Thu Jan 4 01:26:51 2007 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 4 Jan 2007 14:26:51 +0800 Subject: [Biojava-dev] nio for io? Message-ID: OK , probably no gains to be made here then. Another good reason for people to upgrade to 1.5 or 1.6 if they have not already done so. It may also explain why things slowed down when I used the converter in Channels. I was wrapping a Channel into something that already used one. - Mark Michael Heuer Sent by: biojava-dev-bounces at lists.open-bio.org 01/04/2007 02:02 PM To: mark.schreiber at novartis.com cc: biojava-dev at biojava.org Subject: Re: [Biojava-dev] nio for io? Mark Schreiber wrote: > There has been some talk of Sun reprogramming normal java.io objects to > use NIO internally, does anyone know if this has happened (if it has there > is probably not much point in us looking into it much)? I seem to remember the jdk release notes around 1.5 saying this was the case. Very unscientifically, $ grep nio jdk1.6.0/src/java/io/*.java ByteArrayOutputStream.java: * default character set. The {@linkplain java.nio.charset.CharsetDecoder} ByteArrayOutputStream.java: * the specified {@link java.nio.charset.Charset charsetName}. The length of ByteArrayOutputStream.java: * java.nio.charset.CharsetDecoder} class should be used when more control ByteArrayOutputStream.java: * {@linkplain java.nio.charset.Charset charset} Console.java:import java.nio.charset.Charset; Console.java:import sun.nio.cs.StreamDecoder; Console.java:import sun.nio.cs.StreamEncoder; Console.java: * {@link java.io.Reader#read(java.nio.CharBuffer) read(java.nio.CharBuffer)} File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * The {@linkplain java.nio.charset.CharsetEncoder} class should be used when more OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset() default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { $ grep nio jdk1.5.0_08/src/java/io/*.java File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { :) michael _______________________________________________ biojava-dev mailing list biojava-dev at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-dev From bugzilla-daemon at portal.open-bio.org Thu Jan 4 11:54:06 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Thu, 4 Jan 2007 11:54:06 -0500 Subject: [Biojava-dev] [Bug 2175] IndexOutOfBoundsException still occurring on SCF.create(File file) In-Reply-To: Message-ID: <200701041654.l04Gs6NG014233@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2175 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #3 from holland at ebi.ac.uk 2007-01-04 11:54 ------- I've added a workaround to this in the head of CVS, but not in the beta branches etc. Basically I was right - the file given as an example has incorrect values in its header data declaring that the private block is much bigger (835) than it actually is (698). The workaround causes the parser to notice this and not attempt to read the excess data. As the private block is not used anywhere inside the parser class and is not visible to outside users, this should not affect anyone's code. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 05:16:02 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 05:16:02 -0500 Subject: [Biojava-dev] [Bug 2177] New: Unclosed streams in org.biojava.bio.program.scf.SCF Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2177 Summary: Unclosed streams in org.biojava.bio.program.scf.SCF Product: BioJava Version: 1.4 Platform: All OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi, There are problems in the following methods where the input streams have not been closed. This can cause a 'too many open files' os error when working rapidly over large data sets. org.biojava.bio.program.scf.SCF.load(File f) - FileInputStream fin; org.biojava.bio.program.scf.SCF.ParserFactory.parse(InputStream in, SCF out, long initOffset) - DataInputStream din -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 05:42:45 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 05:42:45 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051042.l05Agj4l030583@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #1 from andyyatz at gmail.com 2007-01-05 05:42 ------- (In reply to comment #0) > Hi, > > There are problems in the following methods where the input streams have not > been closed. This can cause a 'too many open files' os error when working > rapidly over large data sets. > > org.biojava.bio.program.scf.SCF.load(File f) > - FileInputStream fin; > > org.biojava.bio.program.scf.SCF.ParserFactory.parse(InputStream in, SCF out, > long initOffset) > - DataInputStream din > After a quick look at the source: 1). Yes SCF.load(File f) needs to be changed to: protected void load(File f) throws IOException, UnsupportedChromatogramFormatException { FileInputStream fin = new FileInputStream(f); try { load(fin, 0); } finally { fin.close(); } } Since this method opens the InputStream to the SCF file it has to be responsible for closing the stream. 2). I don't think that parse(InputStream in, SCF out, long initOffset) should be closing streams since it does not create them. It should be creating method's responsibility to close these streams. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 05:55:32 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 05:55:32 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051055.l05AtWi4031158@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #2 from andyyatz at gmail.com 2007-01-05 05:55 ------- Created an attachment (id=535) --> (http://bugzilla.open-bio.org/attachment.cgi?id=535&action=view) Patch for SCF class First patch file I've created so sorry if it is wrong but I've tested the patching process on my machine and it seems to work. Can someone please do a quick compile with patch for me please? -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 06:07:01 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:07:01 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051107.l05B71LE031749@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #3 from holland at ebi.ac.uk 2007-01-05 06:07 ------- I've tested and applied Andy's patch in CVS head. All seems to work nicely now. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 06:07:21 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:07:21 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051107.l05B7L8f031793@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #4 from holland at ebi.ac.uk 2007-01-05 06:07 ------- I've tested and applied Andy's patch in CVS head. All seems to work nicely now. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 06:10:07 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:10:07 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051110.l05BA7tM031932@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 keiranmraine at gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | ------- Comment #5 from keiranmraine at gmail.com 2007-01-05 06:10 ------- I don't mean the input stream in the second method. It's the DataInputStream that should be closed here, see below. public static void parse(InputStream in, SCF out, long initOffset) throws IOException, UnsupportedChromatogramFormatException { DataInputStream din; try { din = new DataInputStream(in); SCF.Parser parser = createParser(din, out, initOffset); parser.parse(); } finally { din.close(); } } -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 06:21:14 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:21:14 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051121.l05BLEXp032535@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED ------- Comment #6 from holland at ebi.ac.uk 2007-01-05 06:21 ------- Publicly visible methods that accept InputStreams should never ever close them - that is the responsibility of the caller. If the DataInputStream wrapping the InputStream were closed, it would also close the InputStream, thus breaking this contract. The DataInputStream will be implicitly closed when the caller closes the original InputStream after calling the method in question. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 06:27:30 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:27:30 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051127.l05BRUUa000422@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #7 from keiranmraine at gmail.com 2007-01-05 06:27 ------- (In reply to comment #6) > Publicly visible methods that accept InputStreams should never ever close them > - that is the responsibility of the caller. If the DataInputStream wrapping the > InputStream were closed, it would also close the InputStream, thus breaking > this contract. The DataInputStream will be implicitly closed when the caller > closes the original InputStream after calling the method in question. > Ahhh, sorry sbout that, I did not realise that closing the DataInputStream would close the InputStream. Thanks -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Tue Jan 16 12:35:53 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Tue, 16 Jan 2007 12:35:53 -0500 Subject: [Biojava-dev] [Bug 2186] New: ABIFparser never releases file resouce when generated with a File Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2186 Summary: ABIFparser never releases file resouce when generated with a File Product: BioJava Version: 1.4 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi all, I've detected a resource problem in the use of the following object constructor org.biojava.bio.program.abi.ABIFParser(File f) If you generate the parser in this manner the generated RandomAccessFile is never closed and causes a resource leak. The way the code is written I cannot see an obvious place to close this, but there appears to be a simple fix in that you can use the alternative method: org.biojava.bio.program.abi.ABIFParser(InputStream in) and control the closing outside of Biojava. As I say I'm not sure at which point it's safe to close the stream in ABIFParser but the File method could be removed?? Keiran -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 04:45:10 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 04:45:10 -0500 Subject: [Biojava-dev] [Bug 2186] ABIFparser never releases file resouce when generated with a File In-Reply-To: Message-ID: <200701170945.l0H9jAcx003234@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2186 ------- Comment #1 from andyyatz at gmail.com 2007-01-17 04:45 ------- (In reply to comment #0) > Hi all, > > I've detected a resource problem in the use of the following object constructor > > org.biojava.bio.program.abi.ABIFParser(File f) > > If you generate the parser in this manner the generated RandomAccessFile is > never closed and causes a resource leak. The way the code is written I cannot > see an obvious place to close this, but there appears to be a simple fix in > that you can use the alternative method: > > org.biojava.bio.program.abi.ABIFParser(InputStream in) > > and control the closing outside of Biojava. > > As I say I'm not sure at which point it's safe to close the stream in > ABIFParser but the File method could be removed?? > > Keiran > It would seem that way without a close method introduced into the parser which then causes more problems. I would prefer a deprecation of the constructor to warn future users that this is not the preferred way of creating an ABIFParser. Maybe an extension to this class should be a static builder method which takes in a file, creates the required stream, passes out the finished object and makes sure to clean up after itself. I don't know it this is possible as I've only every gone into the guts of the ABI parser once. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 05:41:45 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 05:41:45 -0500 Subject: [Biojava-dev] [Bug 2186] ABIFparser never releases file resouce when generated with a File In-Reply-To: Message-ID: <200701171041.l0HAfjR9005812@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2186 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from holland at ebi.ac.uk 2007-01-17 05:41 ------- I found a way of changing it but it involved adding a method to the ABIFParser.DataAccess interface. This does not affect anything internally to BioJava but may affect user code - but I very much doubt anyone is using it. Changes have been committed to the HEAD of biojava-live. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 10:47:36 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 10:47:36 -0500 Subject: [Biojava-dev] [Bug 2187] New: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2187 Summary: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Product: BioJava Version: 1.4 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi, Just a nicety for anyone using the class in programs for use by non-programmers. When catching the IllegalSymbolException the stack trace is printed in org.biojava.bio.program.scf.SCF$V3Parser.parseBases. I suggest that the UnsupportedChromatogramFormatException be extended to take the Throwable and the 'ise.printStackTrace(System.err);' removed. e.g. catch (IllegalSymbolException ise) { ise.printStackTrace(System.err); throw new UnsupportedChromatogramFormatException("Base call decoding failure"); } BECOMES catch (IllegalSymbolException ise) { throw new UnsupportedChromatogramFormatException("Base call decoding failure", ise); } -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 10:47:46 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 10:47:46 -0500 Subject: [Biojava-dev] [Bug 2188] New: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2188 Summary: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Product: BioJava Version: 1.4 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi, Just a nicety for anyone using the class in programs for use by non-programmers. When catching the IllegalSymbolException the stack trace is printed in org.biojava.bio.program.scf.SCF$V3Parser.parseBases. I suggest that the UnsupportedChromatogramFormatException be extended to take the Throwable and the 'ise.printStackTrace(System.err);' removed. e.g. catch (IllegalSymbolException ise) { ise.printStackTrace(System.err); throw new UnsupportedChromatogramFormatException("Base call decoding failure"); } BECOMES catch (IllegalSymbolException ise) { throw new UnsupportedChromatogramFormatException("Base call decoding failure", ise); } -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 11:00:28 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 11:00:28 -0500 Subject: [Biojava-dev] [Bug 2188] Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases In-Reply-To: Message-ID: <200701171600.l0HG0S0X030332@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2188 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #1 from holland at ebi.ac.uk 2007-01-17 11:00 ------- *** This bug has been marked as a duplicate of 2187 *** -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 11:00:32 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 11:00:32 -0500 Subject: [Biojava-dev] [Bug 2187] Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases In-Reply-To: Message-ID: <200701171600.l0HG0WRv030352@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2187 ------- Comment #1 from holland at ebi.ac.uk 2007-01-17 11:00 ------- *** Bug 2188 has been marked as a duplicate of this bug. *** -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 11:03:22 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 11:03:22 -0500 Subject: [Biojava-dev] [Bug 2187] Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases In-Reply-To: Message-ID: <200701171603.l0HG3MZU030882@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2187 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from holland at ebi.ac.uk 2007-01-17 11:03 ------- I've made the change as suggested. Committed to CVS biojava-live HEAD. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From holland at ebi.ac.uk Fri Jan 19 10:54:45 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Fri, 19 Jan 2007 15:54:45 -0000 Subject: [Biojava-dev] SimpleGFFRecord In-Reply-To: <200612201658.02312.tamir@imp.univie.ac.at> References: <200612201658.02312.tamir@imp.univie.ac.at> Message-ID: <458963F3.9020706@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks for pointing this out. I have fixed it on the HEAD branch of CVS. cheers, Richard Ido M. Tamir wrote: > Hi, > SimpleGFFRecord puts out one additional semicolon > at the end of the attributes. Shifting sBuff.append(";") > to the test changes that. > > old: > > public static String stringifyAttributes(Map attMap) { > StringBuffer sBuff = new StringBuffer(); > Iterator ki = attMap.keySet().iterator(); > while (ki.hasNext()) { > String key = (String) ki.next(); > sBuff.append(key); > List values = (List) attMap.get(key); > for (Iterator vi = values.iterator(); vi.hasNext();) { > String value = (String) vi.next(); > if (isText(value)) { > sBuff.append(" \"" + value + "\""); > } else { > sBuff.append(" " + value); > } > } > sBuff.append(";"); <---!! > if (ki.hasNext()) { > sBuff.append(" "); > } > } > return sBuff.substring(0); > } > > > public static String stringifyAttributes(Map attMap) { > StringBuffer sBuff = new StringBuffer(); > Iterator ki = attMap.keySet().iterator(); > while (ki.hasNext()) { > String key = (String) ki.next(); > sBuff.append(key); > List values = (List) attMap.get(key); > for (Iterator vi = values.iterator(); vi.hasNext();) { > String value = (String) vi.next(); > if (isText(value)) { > sBuff.append(" \"" + value + "\""); > } else { > sBuff.append(" " + value); > } > } > if (ki.hasNext()) { > sBuff.append(";"); <---!! > sBuff.append(" "); > } > } > return sBuff.substring(0); > } > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFiWPy4C5LeMEKA/QRAmJWAJ9jmAvPhQYF0YlJEYye7/XdPa7NhgCbBI5t lImvTgNuqgd6/RukpFd4Pik= =y7hf -----END PGP SIGNATURE----- From ayates at ebi.ac.uk Fri Jan 19 11:18:05 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Fri, 19 Jan 2007 16:18:05 -0000 Subject: [Biojava-dev] how to run unittest in eclipse In-Reply-To: References: Message-ID: <459A68DE.4020506@ebi.ac.uk> Hi, This sounds like a problem more with bad project setup where Eclipse has not been told where the resources directory is located. In eclipse right click on the project and go to: Build Path -> Configure Build Path... Click on the source tab and then click on the button Add Folder. Select the resources directory from the root of the BioJava project and then click ok. If everything has gone okay when you now run the test the Eclipse JUnit runner should pick up on the resources classpath and you should have a bit more luck with them. Andy Yates Huang Zhibin wrote: > Dear all, > First all,thanks for the contribution of BioJava. > I downloaded the BioJava and compile apps, demos, tests and runtests > using ant. It is ok. But when importing this project into eclipse, I do > not know hot to runtests. For example, when clicking file of > /tests/org.biojava.bio.alignment/FlexibleAlignmentTest.java, choose Run > As | JUnit Test, it fails. Info in Console will be listed below. > I know maybe it failed in the step of initialization, but I do now know > how to solve it. > Can someone who run junittest in JAVA IDE share the experience or give > me some suggestions? I will appreciate it. > Best regards, > Zhibin > > ------------------------------ > Info printed in Console: > > org.biojava.bio.BioError: Unable to initialize DNATools > at org.biojava.bio.seq.DNATools.(DNATools.java:117) > at > org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:74) > > > at > org.biojava.bio.alignment.FlexibleAlignmentTest.(FlexibleAlignmentTest.java:46) > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown > Source) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown > Source) > at java.lang.reflect.Constructor.newInstance(Unknown Source) > at junit.framework.TestSuite.createTest(TestSuite.java:135) > at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) > at junit.framework.TestSuite.(TestSuite.java:75) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) > > > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > > > 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.(AlphabetManager.java:148) > at org.biojava.bio.seq.DNATools.(DNATools.java:80) > ... 15 more > java.lang.NoClassDefFoundError > at org.biojava.bio.seq.ProteinTools.(ProteinTools.java:76) > at > org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:76) > > > > _________________________________________________________________ > ??????????,??? MSN Messenger: http://messenger.msn.com/cn > > > ------------------------------------------------------------------------ > > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev From td2 at sanger.ac.uk Wed Jan 31 04:53:21 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 09:53:21 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression Message-ID: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> Hi, A few weeks ago, this patch removed a couple of apparently-redundant lines from JDBCPooledDataSource: http://code.open-bio.org/cgi/viewcvs.cgi/biojava-live/ src/org/biojava/utils/JDBCPooledDataSource.java.diff? r1=1.2&r2=1.3&cvsroot=biojava This change causes at least some DataSource objects created using this class to fail with a NullPointerException the first time a connection is actually requested. Using biojava-ensembl to access an Ensembl MySQL database demonstrates this problem consistently. Reverting to revision 1.2 of JDBCPooledDataSource.java solves the problem. It looks like the PoolableConnectionFactory constructor has a side effect of registering the factory with the specified ObjectPool. This side effect doesn't seem to be documented particularly clearly, but the example code towards the bottom of: http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/ commons/dbcp/package-summary.html#package_description seems to rely on this behavior. Would it be possible to roll this source file back to revision 1.2? Or, alternatively, is there someone who can set me up with commit access on the new CVS server (I think I still have an account there, but my password doesn't work since the server move). Thanks, Thomas. From holland at ebi.ac.uk Wed Jan 31 06:04:05 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Wed, 31 Jan 2007 11:04:05 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> Message-ID: <45C077A5.4070706@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Thomas. I have made the change on Head as you have requested. cheers, Richard. Thomas Down wrote: > Hi, > > A few weeks ago, this patch removed a couple of apparently-redundant > lines from JDBCPooledDataSource: > > http://code.open-bio.org/cgi/viewcvs.cgi/biojava-live/ > src/org/biojava/utils/JDBCPooledDataSource.java.diff? > r1=1.2&r2=1.3&cvsroot=biojava > > This change causes at least some DataSource objects created using > this class to fail with a NullPointerException the first time a > connection is actually requested. Using biojava-ensembl to access an > Ensembl MySQL database demonstrates this problem consistently. > Reverting to revision 1.2 of JDBCPooledDataSource.java solves the > problem. > > It looks like the PoolableConnectionFactory constructor has a side > effect of registering the factory with the specified ObjectPool. > This side effect doesn't seem to be documented particularly clearly, > but the example code towards the bottom of: > > http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/ > commons/dbcp/package-summary.html#package_description > > seems to rely on this behavior. > > > Would it be possible to roll this source file back to revision 1.2? > Or, alternatively, is there someone who can set me up with commit > access on the new CVS server (I think I still have an account there, > but my password doesn't work since the server move). > > Thanks, > > Thomas. > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwHel4C5LeMEKA/QRAkZbAJ4s+fGGxsKDUhgYuWiTgw5JRk4XxQCdEFmq Lt0ZjTmBS2K+JGc3TF4R9Qg= =kaAs -----END PGP SIGNATURE----- From ayates at ebi.ac.uk Wed Jan 31 06:06:03 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 11:06:03 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> Message-ID: <45C0781B.7030304@ebi.ac.uk> Hi, I would say that this class' method is trying to do too much. We have a method which is creating a BasicDataSource then not bothering to return it in favour of a custom one which implements a hashcode & equals method. Can you try your test case when it returns the BasicDataSource & not the custom one and see if that works please? Thanks, Andy Yates Thomas Down wrote: > Hi, > > A few weeks ago, this patch removed a couple of apparently-redundant > lines from JDBCPooledDataSource: > > http://code.open-bio.org/cgi/viewcvs.cgi/biojava-live/ > src/org/biojava/utils/JDBCPooledDataSource.java.diff? > r1=1.2&r2=1.3&cvsroot=biojava > > This change causes at least some DataSource objects created using > this class to fail with a NullPointerException the first time a > connection is actually requested. Using biojava-ensembl to access an > Ensembl MySQL database demonstrates this problem consistently. > Reverting to revision 1.2 of JDBCPooledDataSource.java solves the > problem. > > It looks like the PoolableConnectionFactory constructor has a side > effect of registering the factory with the specified ObjectPool. > This side effect doesn't seem to be documented particularly clearly, > but the example code towards the bottom of: > > http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/ > commons/dbcp/package-summary.html#package_description > > seems to rely on this behavior. > > > Would it be possible to roll this source file back to revision 1.2? > Or, alternatively, is there someone who can set me up with commit > access on the new CVS server (I think I still have an account there, > but my password doesn't work since the server move). > > Thanks, > > Thomas. > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev From td2 at sanger.ac.uk Wed Jan 31 06:59:31 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 11:59:31 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C0781B.7030304@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> Message-ID: <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> On 31 Jan 2007, at 11:06, Andy Yates wrote: > Hi, > > I would say that this class' method is trying to do too much. We > have a > method which is creating a BasicDataSource then not bothering to > return > it in favour of a custom one which implements a hashcode & equals > method. Can you try your test case when it returns the > BasicDataSource & > not the custom one and see if that works please? Patching the current revision to return a PoolingDataSource (I assume that's what you meant) rather than a MyPoolingDataSource works fine. However, patching revision 1.3 the same way does not work. The problem I reported is definitely orthogonal to the question of exactly which type of PoolingDataSource gets returned. I'm not sure what the original rationale was for returning the custom PoolingDataSource subclass -- but I can't really see how it's going to do any harm. Thomas. From ayates at ebi.ac.uk Wed Jan 31 07:06:17 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:06:17 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> Message-ID: <45C08639.7080600@ebi.ac.uk> Hi, Sorry I was meaning if that if that method just becomes: public static DataSource getDataSource(final String driver, final String url, final String user, final String pass) throws Exception { BasicDataSource ds = new BasicDataSource(); ds.setUrl(url); ds.setDriverClassName(driver); ds.setUsername(user); ds.setPassword(pass); // Set BasicDataSource properties such as maxActive and maxIdle, as described in // http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html ds.setMaxActive(10); ds.setMaxIdle(5); ds.setMaxWait(10000); return ds; } Does that still work? I think the original rationale was to ensure that any two datasources do actually point to the same resource. However this seems a bit too much defensive programming & I don't know why anyone would program themselves into a situation where this is required. Andy Thomas Down wrote: > > On 31 Jan 2007, at 11:06, Andy Yates wrote: > >> Hi, >> >> I would say that this class' method is trying to do too much. We have a >> method which is creating a BasicDataSource then not bothering to return >> it in favour of a custom one which implements a hashcode & equals >> method. Can you try your test case when it returns the BasicDataSource & >> not the custom one and see if that works please? > > Patching the current revision to return a PoolingDataSource (I assume > that's what you meant) rather than a MyPoolingDataSource works fine. > However, patching revision 1.3 the same way does not work. The problem > I reported is definitely orthogonal to the question of exactly which > type of PoolingDataSource gets returned. > > I'm not sure what the original rationale was for returning the custom > PoolingDataSource subclass -- but I can't really see how it's going to > do any harm. > > Thomas. From td2 at sanger.ac.uk Wed Jan 31 07:21:10 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 12:21:10 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08639.7080600@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> Message-ID: <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> On 31 Jan 2007, at 12:06, Andy Yates wrote: > Hi, > > Sorry I was meaning if that if that method just becomes: > > public static DataSource getDataSource(final String driver, > final String url, > final String user, > final String pass) > throws Exception { > > BasicDataSource ds = new BasicDataSource(); > ds.setUrl(url); > ds.setDriverClassName(driver); > ds.setUsername(user); > ds.setPassword(pass); > // Set BasicDataSource properties such as maxActive and > maxIdle, as described in > // http://jakarta.apache.org/commons/dbcp/api/org/apache/ > commons/dbcp/BasicDataSource.html > ds.setMaxActive(10); > ds.setMaxIdle(5); > ds.setMaxWait(10000); > > return ds; > } > > Does that still work? Hmmm, I was assuming that BasicDataSource didn't actually do any pooling itself, and that you needed another layer on top to manage a connection pool -- that seems to be how all previous revisions of JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. But yes, BasicDataSource does seem to do pooling itself (confirmed by reading the source), so maybe your simpler version is a better idea. It certainly works okay for me. Thomas. From ayates at ebi.ac.uk Wed Jan 31 07:28:42 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:28:42 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> Message-ID: <45C08B7A.3060102@ebi.ac.uk> Thomas Down wrote: > > On 31 Jan 2007, at 12:06, Andy Yates wrote: > >> Hi, >> >> Sorry I was meaning if that if that method just becomes: >> >> public static DataSource getDataSource(final String driver, >> final String url, >> final String user, >> final String pass) >> throws Exception { >> >> BasicDataSource ds = new BasicDataSource(); >> ds.setUrl(url); >> ds.setDriverClassName(driver); >> ds.setUsername(user); >> ds.setPassword(pass); >> // Set BasicDataSource properties such as maxActive and maxIdle, >> as described in >> // >> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >> >> ds.setMaxActive(10); >> ds.setMaxIdle(5); >> ds.setMaxWait(10000); >> >> return ds; >> } >> >> Does that still work? > > Hmmm, I was assuming that BasicDataSource didn't actually do any pooling > itself, and that you needed another layer on top to manage a connection > pool -- that seems to be how all previous revisions of > JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. > But yes, BasicDataSource does seem to do pooling itself (confirmed by > reading the source), so maybe your simpler version is a better idea. It > certainly works okay for me. > > Thomas. That's what I thought should have happened :). Can I suggest that this revised version goes into CVS? Anyone got any objections? Andy From holland at ebi.ac.uk Wed Jan 31 07:40:46 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Wed, 31 Jan 2007 12:40:46 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08B7A.3060102@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> Message-ID: <45C08E4E.2050308@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andy could you make the change to your local copy of the source file and email the file to me, that way I can make sure I don't get it wrong when I commit it. Richard. PS. You should probably have your own CVS account - email the OBF helpdesk and ask for one, saying I told you to. :) Andy Yates wrote: > > Thomas Down wrote: >> On 31 Jan 2007, at 12:06, Andy Yates wrote: >> >>> Hi, >>> >>> Sorry I was meaning if that if that method just becomes: >>> >>> public static DataSource getDataSource(final String driver, >>> final String url, >>> final String user, >>> final String pass) >>> throws Exception { >>> >>> BasicDataSource ds = new BasicDataSource(); >>> ds.setUrl(url); >>> ds.setDriverClassName(driver); >>> ds.setUsername(user); >>> ds.setPassword(pass); >>> // Set BasicDataSource properties such as maxActive and maxIdle, >>> as described in >>> // >>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>> >>> ds.setMaxActive(10); >>> ds.setMaxIdle(5); >>> ds.setMaxWait(10000); >>> >>> return ds; >>> } >>> >>> Does that still work? >> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling >> itself, and that you needed another layer on top to manage a connection >> pool -- that seems to be how all previous revisions of >> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. >> But yes, BasicDataSource does seem to do pooling itself (confirmed by >> reading the source), so maybe your simpler version is a better idea. It >> certainly works okay for me. >> >> Thomas. > > That's what I thought should have happened :). Can I suggest that this > revised version goes into CVS? Anyone got any objections? > > Andy > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwI5O4C5LeMEKA/QRApbHAJ4pfXb4YqqBdCynKNK2Z3xzgGqcvQCfbl2K 6llWxdpbPek1cSCTAakt/5Q= =0Zam -----END PGP SIGNATURE----- From td2 at sanger.ac.uk Wed Jan 31 07:50:23 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 12:50:23 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08B7A.3060102@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> Message-ID: On 31 Jan 2007, at 12:28, Andy Yates wrote: >> >> Hmmm, I was assuming that BasicDataSource didn't actually do any >> pooling >> itself, and that you needed another layer on top to manage a >> connection >> pool -- that seems to be how all previous revisions of >> JDBCConnectionPool worked, so I guess I wasn't alone in thinking >> this. >> But yes, BasicDataSource does seem to do pooling itself (confirmed by >> reading the source), so maybe your simpler version is a better >> idea. It >> certainly works okay for me. >> >> Thomas. > > That's what I thought should have happened :). Can I suggest that this > revised version goes into CVS? Anyone got any objections? The one problem I can think of is that this might break any code which relies on DataSource objects having reliable hashCode/equals. I've found one place where this might be a problem, in OntologySQL.getOntologySQL. That's a deprecated class, so maybe it's not a big issue -- but it might be worth asking around. Thomas. From ayates at ebi.ac.uk Wed Jan 31 07:56:29 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:56:29 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> Message-ID: <45C091FD.3020501@ebi.ac.uk> Thomas Down wrote: > > On 31 Jan 2007, at 12:28, Andy Yates wrote: >>> >>> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling >>> itself, and that you needed another layer on top to manage a connection >>> pool -- that seems to be how all previous revisions of >>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. >>> But yes, BasicDataSource does seem to do pooling itself (confirmed by >>> reading the source), so maybe your simpler version is a better idea. It >>> certainly works okay for me. >>> >>> Thomas. >> >> That's what I thought should have happened :). Can I suggest that this >> revised version goes into CVS? Anyone got any objections? > > The one problem I can think of is that this might break any code which > relies on DataSource objects having reliable hashCode/equals. I've > found one place where this might be a problem, in > OntologySQL.getOntologySQL. That's a deprecated class, so maybe it's > not a big issue -- but it might be worth asking around. > > Thomas. If this is a problem then there is nothing wrong I guess with subclassing BasicDataSource & implementing the hashcode & equals methods from there. BasicDataSource gives access to URI/password/username so it should be a very simple matter of generating the correct methods. I can do that as the submitted version if required Andy From holland at ebi.ac.uk Wed Jan 31 08:07:58 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Wed, 31 Jan 2007 13:07:58 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C090A6.10909@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> <45C08E4E.2050308@ebi.ac.uk> <45C090A6.10909@ebi.ac.uk> Message-ID: <45C094AE.1030101@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've committed your changes Andy. Thomas, I wouldn't worry about OntologySQL. It's highly deprecated and not supported - the whole biojavax/Hibernate thing made that code redundant. Richard. Andy Yates wrote: > Okay I've attached the fix here. > > I just did this in a text editor but I believe that the imports are > okay. If you can just do a quick scan as well to make sure I haven't > deleted anything that was very important. > > I'll get on to the helpdesk now as well :) > > Andy > > Richard Holland wrote: > Andy could you make the change to your local copy of the source file and > email the file to me, that way I can make sure I don't get it wrong when > I commit it. > > Richard. > > PS. You should probably have your own CVS account - email the OBF > helpdesk and ask for one, saying I told you to. :) > > > Andy Yates wrote: >>>> Thomas Down wrote: >>>>> On 31 Jan 2007, at 12:06, Andy Yates wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Sorry I was meaning if that if that method just becomes: >>>>>> >>>>>> public static DataSource getDataSource(final String driver, >>>>>> final String url, >>>>>> final String user, >>>>>> final String pass) >>>>>> throws Exception { >>>>>> >>>>>> BasicDataSource ds = new BasicDataSource(); >>>>>> ds.setUrl(url); >>>>>> ds.setDriverClassName(driver); >>>>>> ds.setUsername(user); >>>>>> ds.setPassword(pass); >>>>>> // Set BasicDataSource properties such as maxActive and >>>>>> maxIdle, as described in >>>>>> // >>>>>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>>>>> >>>>>> ds.setMaxActive(10); >>>>>> ds.setMaxIdle(5); >>>>>> ds.setMaxWait(10000); >>>>>> >>>>>> return ds; >>>>>> } >>>>>> >>>>>> Does that still work? >>>>> Hmmm, I was assuming that BasicDataSource didn't actually do any >>>>> pooling itself, and that you needed another layer on top to manage a >>>>> connection pool -- that seems to be how all previous revisions of >>>>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking >>>>> this. But yes, BasicDataSource does seem to do pooling itself >>>>> (confirmed by reading the source), so maybe your simpler version is >>>>> a better idea. It certainly works okay for me. >>>>> >>>>> Thomas. >>>> That's what I thought should have happened :). Can I suggest that >>>> this revised version goes into CVS? Anyone got any objections? >>>> >>>> Andy >>>> _______________________________________________ >>>> biojava-dev mailing list >>>> biojava-dev at lists.open-bio.org >>>> http://lists.open-bio.org/mailman/listinfo/biojava-dev >>>> > ------------------------------------------------------------------------ > /* > * BioJava development code > * > * This code may be freely distributed and modified under the > * terms of the GNU Lesser General Public Licence. This should > * be distributed with the code. If you do not have a copy, > * see: > * > * http://www.gnu.org/copyleft/lesser.html > * > * Copyright for this code is held jointly by the individual > * authors. These should be listed in @author doc comments. > * > * For more information on the BioJava project and its aims, > * or to join the biojava-l mailing list, visit the home page > * at: > * > * http://www.biojava.org/ > * > */ > package org.biojava.utils; > import javax.sql.DataSource; > import org.apache.commons.dbcp.BasicDataSource; > import org.apache.commons.dbcp.PoolingDataSource; > import org.apache.commons.pool.ObjectPool; > /** > * Returns a DataSource that implements connection pooling > * > * Uses Jakarta Commons DBCP and Pool packages. > * See the description of the dbcp package at > * http://jakarta.apache.org/commons/dbcp/api/overview-summary.html#overview_description > * > * @author Simon Foote > * @author Len Trigg > */ > public class JDBCPooledDataSource { > public static DataSource getDataSource(final String driver, > final String url, > final String user, > final String pass) > throws Exception { > BasicDataSource ds = new BasicDataSource(); > ds.setUrl(url); > ds.setDriverClassName(driver); > ds.setUsername(user); > ds.setPassword(pass); > // Set BasicDataSource properties such as maxActive and maxIdle, as described in > // http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html > ds.setMaxActive(10); > ds.setMaxIdle(5); > ds.setMaxWait(10000); > return dataSource; > } > // Adds simple equals and hashcode methods so that we can compare if > // two connections are to the same database. This will fail if the > // DataSource is redirected to another database etc (I doubt this is > // ever likely to be used). > /** > * @depercated This is no longer used in favor of {@link BasicDataSource} > * from DBCP > */ > static class MyPoolingDataSource extends PoolingDataSource { > final String source; > public MyPoolingDataSource(ObjectPool connectionPool, String source) { > super(connectionPool); > this.source = source; > } > public boolean equals(Object o2) { > if ((o2 == null) || !(o2 instanceof MyPoolingDataSource)) { > return false; > } > MyPoolingDataSource b2 = (MyPoolingDataSource) o2; > return source.equals(b2.source); > } > public int hashCode() { > return source.hashCode(); > } > } > public static void main(String[] args) { > try { > DataSource ds1 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); > DataSource ds2 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); > System.err.println(ds1); > System.err.println(ds2); > System.err.println(ds1.equals(ds2)); > } catch (Exception e) { > e.printStackTrace(); > } > } > } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwJSu4C5LeMEKA/QRAgt1AJ9dtk3SBbDwtah469igyc9DYWGzMwCgqAad X1KXpdlqqhBfuL1MisMj/yo= =nlGe -----END PGP SIGNATURE----- From ayates at ebi.ac.uk Wed Jan 31 08:25:12 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 13:25:12 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C094AE.1030101@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> <45C08E4E.2050308@ebi.ac.uk> <45C090A6.10909@ebi.ac.uk> <45C094AE.1030101@ebi.ac.uk> Message-ID: <45C098B8.7030107@ebi.ac.uk> Cheers mate. If this hash/equals is a problem then this can be solved later on. Richard Holland wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I've committed your changes Andy. > > Thomas, I wouldn't worry about OntologySQL. It's highly deprecated and > not supported - the whole biojavax/Hibernate thing made that code redundant. > > Richard. > > Andy Yates wrote: >> Okay I've attached the fix here. >> >> I just did this in a text editor but I believe that the imports are >> okay. If you can just do a quick scan as well to make sure I haven't >> deleted anything that was very important. >> >> I'll get on to the helpdesk now as well :) >> >> Andy >> >> Richard Holland wrote: >> Andy could you make the change to your local copy of the source file and >> email the file to me, that way I can make sure I don't get it wrong when >> I commit it. >> >> Richard. >> >> PS. You should probably have your own CVS account - email the OBF >> helpdesk and ask for one, saying I told you to. :) >> >> >> Andy Yates wrote: >>>>> Thomas Down wrote: >>>>>> On 31 Jan 2007, at 12:06, Andy Yates wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Sorry I was meaning if that if that method just becomes: >>>>>>> >>>>>>> public static DataSource getDataSource(final String driver, >>>>>>> final String url, >>>>>>> final String user, >>>>>>> final String pass) >>>>>>> throws Exception { >>>>>>> >>>>>>> BasicDataSource ds = new BasicDataSource(); >>>>>>> ds.setUrl(url); >>>>>>> ds.setDriverClassName(driver); >>>>>>> ds.setUsername(user); >>>>>>> ds.setPassword(pass); >>>>>>> // Set BasicDataSource properties such as maxActive and >>>>>>> maxIdle, as described in >>>>>>> // >>>>>>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>>>>>> >>>>>>> ds.setMaxActive(10); >>>>>>> ds.setMaxIdle(5); >>>>>>> ds.setMaxWait(10000); >>>>>>> >>>>>>> return ds; >>>>>>> } >>>>>>> >>>>>>> Does that still work? >>>>>> Hmmm, I was assuming that BasicDataSource didn't actually do any >>>>>> pooling itself, and that you needed another layer on top to manage a >>>>>> connection pool -- that seems to be how all previous revisions of >>>>>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking >>>>>> this. But yes, BasicDataSource does seem to do pooling itself >>>>>> (confirmed by reading the source), so maybe your simpler version is >>>>>> a better idea. It certainly works okay for me. >>>>>> >>>>>> Thomas. >>>>> That's what I thought should have happened :). Can I suggest that >>>>> this revised version goes into CVS? Anyone got any objections? >>>>> >>>>> Andy >>>>> _______________________________________________ >>>>> biojava-dev mailing list >>>>> biojava-dev at lists.open-bio.org >>>>> http://lists.open-bio.org/mailman/listinfo/biojava-dev >>>>> > >> ------------------------------------------------------------------------ > >> /* >> * BioJava development code >> * >> * This code may be freely distributed and modified under the >> * terms of the GNU Lesser General Public Licence. This should >> * be distributed with the code. If you do not have a copy, >> * see: >> * >> * http://www.gnu.org/copyleft/lesser.html >> * >> * Copyright for this code is held jointly by the individual >> * authors. These should be listed in @author doc comments. >> * >> * For more information on the BioJava project and its aims, >> * or to join the biojava-l mailing list, visit the home page >> * at: >> * >> * http://www.biojava.org/ >> * >> */ >> package org.biojava.utils; > >> import javax.sql.DataSource; > >> import org.apache.commons.dbcp.BasicDataSource; >> import org.apache.commons.dbcp.PoolingDataSource; >> import org.apache.commons.pool.ObjectPool; > >> /** >> * Returns a DataSource that implements connection pooling >> * >> * Uses Jakarta Commons DBCP and Pool packages. >> * See the description of the dbcp package at >> * http://jakarta.apache.org/commons/dbcp/api/overview-summary.html#overview_description >> * >> * @author Simon Foote >> * @author Len Trigg >> */ > >> public class JDBCPooledDataSource { > >> public static DataSource getDataSource(final String driver, >> final String url, >> final String user, >> final String pass) >> throws Exception { > >> BasicDataSource ds = new BasicDataSource(); >> ds.setUrl(url); >> ds.setDriverClassName(driver); >> ds.setUsername(user); >> ds.setPassword(pass); >> // Set BasicDataSource properties such as maxActive and maxIdle, as described in >> // http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >> ds.setMaxActive(10); >> ds.setMaxIdle(5); >> ds.setMaxWait(10000); > >> return dataSource; >> } > > >> // Adds simple equals and hashcode methods so that we can compare if >> // two connections are to the same database. This will fail if the >> // DataSource is redirected to another database etc (I doubt this is >> // ever likely to be used). >> /** >> * @depercated This is no longer used in favor of {@link BasicDataSource} >> * from DBCP >> */ >> static class MyPoolingDataSource extends PoolingDataSource { >> final String source; >> public MyPoolingDataSource(ObjectPool connectionPool, String source) { >> super(connectionPool); >> this.source = source; >> } >> public boolean equals(Object o2) { >> if ((o2 == null) || !(o2 instanceof MyPoolingDataSource)) { >> return false; >> } >> MyPoolingDataSource b2 = (MyPoolingDataSource) o2; >> return source.equals(b2.source); >> } >> public int hashCode() { >> return source.hashCode(); >> } >> } > > >> public static void main(String[] args) { >> try { >> DataSource ds1 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); >> DataSource ds2 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); >> System.err.println(ds1); >> System.err.println(ds2); >> System.err.println(ds1.equals(ds2)); >> } catch (Exception e) { >> e.printStackTrace(); >> } >> } >> } > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFwJSu4C5LeMEKA/QRAgt1AJ9dtk3SBbDwtah469igyc9DYWGzMwCgqAad > X1KXpdlqqhBfuL1MisMj/yo= > =nlGe > -----END PGP SIGNATURE----- From jburdick at keyfitz.org Mon Jan 22 11:46:44 2007 From: jburdick at keyfitz.org (Josh Burdick) Date: Mon, 22 Jan 2007 16:46:44 -0000 Subject: [Biojava-dev] reading a subsequence from a .nib file Message-ID: <1169483375.5340.39.camel@localhost.localdomain> I wrote some code to read a chunk of DNA sequence from a file in Jim Kent's blat ".nib" file format. This is a simple format using four bits/base. I didn't attach the code, to avoid spamming the whole list; but it, and a (very crude!) JUnit test, are at http://www.keyfitz.org/jburdick/read_nib_file_java/NibFile.java http://www.keyfitz.org/jburdick/read_nib_file_java/NibFileTest.java You could use 2 bits/base, but then you can't have ambiguous bases. 4 bits/base seems like a reasonable compromise; plus sites that have "blat" installed will need to have the .nib files on a server somewhere anyway, and this way repeat-masking can be included, which may be convenient. Also, it doesn't support writing a .nib file; again, presumably people will be using Jim Kent's faToNib program to do that. It would need some tweaking to be included in BioJava, because it returns a plain String of ACGT, instead of a PackedSequence object. (Probably this would just involve rewriting the setupBuffer() and addToBuffer() methods in the code.) Also, the coordinate information could come from a Range object. If similar code is already somewhere in BioJava, please ignore this; but I couldn't find it with thirty seconds of Googling, so I figured it hadn't been written... Josh Burdick programmer, Vivian Cheung's lab, Children's Hospital of Philadelphia jburdick at keyfitz.org From ayates at ebi.ac.uk Wed Jan 31 07:50:53 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:50:53 -0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08E4E.2050308@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> <45C08E4E.2050308@ebi.ac.uk> Message-ID: <45C090A6.10909@ebi.ac.uk> Okay I've attached the fix here. I just did this in a text editor but I believe that the imports are okay. If you can just do a quick scan as well to make sure I haven't deleted anything that was very important. I'll get on to the helpdesk now as well :) Andy Richard Holland wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Andy could you make the change to your local copy of the source file and > email the file to me, that way I can make sure I don't get it wrong when > I commit it. > > Richard. > > PS. You should probably have your own CVS account - email the OBF > helpdesk and ask for one, saying I told you to. :) > > > Andy Yates wrote: >> Thomas Down wrote: >>> On 31 Jan 2007, at 12:06, Andy Yates wrote: >>> >>>> Hi, >>>> >>>> Sorry I was meaning if that if that method just becomes: >>>> >>>> public static DataSource getDataSource(final String driver, >>>> final String url, >>>> final String user, >>>> final String pass) >>>> throws Exception { >>>> >>>> BasicDataSource ds = new BasicDataSource(); >>>> ds.setUrl(url); >>>> ds.setDriverClassName(driver); >>>> ds.setUsername(user); >>>> ds.setPassword(pass); >>>> // Set BasicDataSource properties such as maxActive and maxIdle, >>>> as described in >>>> // >>>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>>> >>>> ds.setMaxActive(10); >>>> ds.setMaxIdle(5); >>>> ds.setMaxWait(10000); >>>> >>>> return ds; >>>> } >>>> >>>> Does that still work? >>> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling >>> itself, and that you needed another layer on top to manage a connection >>> pool -- that seems to be how all previous revisions of >>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. >>> But yes, BasicDataSource does seem to do pooling itself (confirmed by >>> reading the source), so maybe your simpler version is a better idea. It >>> certainly works okay for me. >>> >>> Thomas. >> That's what I thought should have happened :). Can I suggest that this >> revised version goes into CVS? Anyone got any objections? >> >> Andy >> _______________________________________________ >> biojava-dev mailing list >> biojava-dev at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/biojava-dev >> > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFwI5O4C5LeMEKA/QRApbHAJ4pfXb4YqqBdCynKNK2Z3xzgGqcvQCfbl2K > 6llWxdpbPek1cSCTAakt/5Q= > =0Zam > -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: JDBCPooledDataSource.java Type: text/x-java Size: 3155 bytes Desc: not available Url : http://lists.open-bio.org/pipermail/biojava-dev/attachments/20070131/92151f3e/attachment-0001.bin From zbhuang2005 at hotmail.com Tue Jan 2 13:16:16 2007 From: zbhuang2005 at hotmail.com (Huang Zhibin) Date: Tue, 02 Jan 2007 13:16:16 +0000 Subject: [Biojava-dev] how to run unittest in eclipse Message-ID: Dear all, First all,thanks for the contribution of BioJava. I downloaded the BioJava and compile apps, demos, tests and runtests using ant. It is ok. But when importing this project into eclipse, I do not know hot to runtests. For example, when clicking file of /tests/org.biojava.bio.alignment/FlexibleAlignmentTest.java, choose Run As | JUnit Test, it fails. Info in Console will be listed below. I know maybe it failed in the step of initialization, but I do now know how to solve it. Can someone who run junittest in JAVA IDE share the experience or give me some suggestions? I will appreciate it. Best regards, Zhibin ------------------------------ Info printed in Console: org.biojava.bio.BioError: Unable to initialize DNATools at org.biojava.bio.seq.DNATools.(DNATools.java:117) at org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:74) at org.biojava.bio.alignment.FlexibleAlignmentTest.(FlexibleAlignmentTest.java:46) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at junit.framework.TestSuite.createTest(TestSuite.java:135) at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at junit.framework.TestSuite.(TestSuite.java:75) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 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.(AlphabetManager.java:148) at org.biojava.bio.seq.DNATools.(DNATools.java:80) ... 15 more java.lang.NoClassDefFoundError at org.biojava.bio.seq.ProteinTools.(ProteinTools.java:76) at org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:76) _________________________________________________________________ ?????????????? MSN Messenger: http://messenger.msn.com/cn From bugzilla-daemon at portal.open-bio.org Wed Jan 3 16:55:12 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 3 Jan 2007 11:55:12 -0500 Subject: [Biojava-dev] [Bug 2175] New: IndexOutOfBoundsException still occurring on SCF.create(File file) Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2175 Summary: IndexOutOfBoundsException still occurring on SCF.create(File file) Product: BioJava Version: live (CVS source) Platform: PC OS/Version: Windows XP Status: NEW Severity: blocker Priority: P1 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: cristyn at broad.mit.edu SCF.create(File file) is still broken. I'm using the 1.5-beta2 download. Here is the stacktrace: ava.lang.IndexOutOfBoundsException at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:199) at java.io.DataInputStream.read(DataInputStream.java:132) at org.biojava.bio.program.scf.SCF$Parser.parsePrivate(SCF.java:391) at org.biojava.bio.program.scf.SCF$Parser.parse(SCF.java:349) at org.biojava.bio.program.scf.SCF$ParserFactory.parse(SCF.java:202) at org.biojava.bio.program.scf.SCF.load(SCF.java:145) at org.biojava.bio.program.scf.SCF.load(SCF.java:140) at org.biojava.bio.program.scf.SCF.create(SCF.java:126) -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 3 16:56:15 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 3 Jan 2007 11:56:15 -0500 Subject: [Biojava-dev] [Bug 2175] IndexOutOfBoundsException still occurring on SCF.create(File file) In-Reply-To: Message-ID: <200701031656.l03GuFcn015619@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2175 cristyn at broad.mit.edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cristyn at broad.mit.edu ------- Comment #1 from cristyn at broad.mit.edu 2007-01-03 11:56 ------- java.lang.IndexOutOfBoundsException at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:199) at java.io.DataInputStream.read(DataInputStream.java:132) at org.biojava.bio.program.scf.SCF$Parser.parsePrivate(SCF.java:391) at org.biojava.bio.program.scf.SCF$Parser.parse(SCF.java:349) at org.biojava.bio.program.scf.SCF$ParserFactory.parse(SCF.java:202) at org.biojava.bio.program.scf.SCF.load(SCF.java:145) at org.biojava.bio.program.scf.SCF.load(SCF.java:140) at org.biojava.bio.program.scf.SCF.create(SCF.java:126) 1.5-beta2 version of SCF class. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 3 17:13:54 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 3 Jan 2007 12:13:54 -0500 Subject: [Biojava-dev] [Bug 2175] IndexOutOfBoundsException still occurring on SCF.create(File file) In-Reply-To: Message-ID: <200701031713.l03HDsoN016548@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2175 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Comment #2 from holland at ebi.ac.uk 2007-01-03 12:13 ------- 1) please check that your SCF file is version 2 or version 3. More recent versions are not yet supported. 2) the exception occurs whilst parsing a PRIVATE block in your SCF file. The block is supposed to specify its size in the header and its offset from the start, then the parser uses this size to read exactly the right amount of data from the right location. In your case it sounds like the header contains an incorrect (too large) size or an incorrect (too late) offset, and so the parser is attempting to read more data than is actually present at the given offset. This would be a bug in the SCF file not the parser. Please could you check the above and get back to me - the file itself would be useful too. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From mark.schreiber at novartis.com Thu Jan 4 03:14:36 2007 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 4 Jan 2007 11:14:36 +0800 Subject: [Biojava-dev] nio for io? Message-ID: Hello - I have been reading about the NIO api recently (very remiss of me to leave it this long). There seems to be potential for this to greatly speed up our parsers such as memory mapping etc, however .... Our current Format objects want to see something like a BufferedReader. We would probably need to make an extension to the Format interface to use a FileChannel of some sort as input. If I do something so naive as use the Channels utility to wrap a Channel into a BufferedReader I get no advantage (it's even a bit slower). There has been some talk of Sun reprogramming normal java.io objects to use NIO internally, does anyone know if this has happened (if it has there is probably not much point in us looking into it much)? Are there people more experienced with this API that can see some potential for it to improve parsing speed (probably the biggest bioinformatics bottleneck)? Comments greatly appreciated. - Mark Mark Schreiber Research Investigator (Bioinformatics) Novartis Institute for Tropical Diseases (NITD) 10 Biopolis Road #05-01 Chromos Singapore 138670 www.nitd.novartis.com www.dengueinfo.org phone +65 6722 2973 fax +65 6722 2910 From heuermh at acm.org Thu Jan 4 06:02:55 2007 From: heuermh at acm.org (Michael Heuer) Date: Thu, 4 Jan 2007 01:02:55 -0500 (EST) Subject: [Biojava-dev] nio for io? In-Reply-To: Message-ID: Mark Schreiber wrote: > There has been some talk of Sun reprogramming normal java.io objects to > use NIO internally, does anyone know if this has happened (if it has there > is probably not much point in us looking into it much)? I seem to remember the jdk release notes around 1.5 saying this was the case. Very unscientifically, $ grep nio jdk1.6.0/src/java/io/*.java ByteArrayOutputStream.java: * default character set. The {@linkplain java.nio.charset.CharsetDecoder} ByteArrayOutputStream.java: * the specified {@link java.nio.charset.Charset charsetName}. The length of ByteArrayOutputStream.java: * java.nio.charset.CharsetDecoder} class should be used when more control ByteArrayOutputStream.java: * {@linkplain java.nio.charset.Charset charset} Console.java:import java.nio.charset.Charset; Console.java:import sun.nio.cs.StreamDecoder; Console.java:import sun.nio.cs.StreamEncoder; Console.java: * {@link java.io.Reader#read(java.nio.CharBuffer) read(java.nio.CharBuffer)} File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * The {@linkplain java.nio.charset.CharsetEncoder} class should be used when more OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset() default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { $ grep nio jdk1.5.0_08/src/java/io/*.java File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { :) michael From mark.schreiber at novartis.com Thu Jan 4 06:26:51 2007 From: mark.schreiber at novartis.com (mark.schreiber at novartis.com) Date: Thu, 4 Jan 2007 14:26:51 +0800 Subject: [Biojava-dev] nio for io? Message-ID: OK , probably no gains to be made here then. Another good reason for people to upgrade to 1.5 or 1.6 if they have not already done so. It may also explain why things slowed down when I used the converter in Channels. I was wrapping a Channel into something that already used one. - Mark Michael Heuer Sent by: biojava-dev-bounces at lists.open-bio.org 01/04/2007 02:02 PM To: mark.schreiber at novartis.com cc: biojava-dev at biojava.org Subject: Re: [Biojava-dev] nio for io? Mark Schreiber wrote: > There has been some talk of Sun reprogramming normal java.io objects to > use NIO internally, does anyone know if this has happened (if it has there > is probably not much point in us looking into it much)? I seem to remember the jdk release notes around 1.5 saying this was the case. Very unscientifically, $ grep nio jdk1.6.0/src/java/io/*.java ByteArrayOutputStream.java: * default character set. The {@linkplain java.nio.charset.CharsetDecoder} ByteArrayOutputStream.java: * the specified {@link java.nio.charset.Charset charsetName}. The length of ByteArrayOutputStream.java: * java.nio.charset.CharsetDecoder} class should be used when more control ByteArrayOutputStream.java: * {@linkplain java.nio.charset.Charset charset} Console.java:import java.nio.charset.Charset; Console.java:import sun.nio.cs.StreamDecoder; Console.java:import sun.nio.cs.StreamEncoder; Console.java: * {@link java.io.Reader#read(java.nio.CharBuffer) read(java.nio.CharBuffer)} File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * The {@linkplain java.nio.charset.CharsetEncoder} class should be used when more OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset() default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset() default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { $ grep nio jdk1.5.0_08/src/java/io/*.java File.java: * {@link java.nio.channels.FileLock FileLock} File.java: * {@link java.nio.channels.FileLock FileLock} FileInputStream.java:import java.nio.channels.FileChannel; FileInputStream.java:import sun.nio.ch.FileChannelImpl; FileInputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileInputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() FileOutputStream.java:import java.nio.channels.FileChannel; FileOutputStream.java:import sun.nio.ch.FileChannelImpl; FileOutputStream.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} FileOutputStream.java: *

The initial {@link java.nio.channels.FileChannel#position() InputStreamReader.java:import java.nio.charset.Charset; InputStreamReader.java:import java.nio.charset.CharsetDecoder; InputStreamReader.java:import sun.nio.cs.StreamDecoder; InputStreamReader.java: * java.nio.charset.Charset charset}. The charset that it uses InputStreamReader.java: * @see java.nio.charset.Charset InputStreamReader.java: * {@link java.nio.charset.Charset charset} InputStreamReader.java: * @see java.nio.charset.Charset OutputStreamWriter.java:import java.nio.charset.Charset; OutputStreamWriter.java:import java.nio.charset.CharsetEncoder; OutputStreamWriter.java:import sun.nio.cs.StreamEncoder; OutputStreamWriter.java: * java.nio.charset.Charset charset}. The charset that it uses OutputStreamWriter.java: * @see java.nio.charset.Charset OutputStreamWriter.java: * {@link java.nio.charset.Charset charset} OutputStreamWriter.java: * @see java.nio.charset.Charset PrintStream.java: * {@linkplain java.nio.charset.Charset#defaultCharset default charset} PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintStream.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintStream.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset PrintWriter.java: * java.nio.charset.Charset#defaultCharset default charset} for this PrintWriter.java: * The name of a supported {@linkplain java.nio.charset.Charset RandomAccessFile.java:import java.nio.channels.FileChannel; RandomAccessFile.java:import sun.nio.ch.FileChannelImpl; RandomAccessFile.java: * java.nio.channels.FileChannel#force(boolean) force(boolean)} method of RandomAccessFile.java: * the {@link java.nio.channels.FileChannel} class, passing arguments of RandomAccessFile.java: * @see java.nio.channels.FileChannel#force(boolean) RandomAccessFile.java: * Returns the unique {@link java.nio.channels.FileChannel FileChannel} RandomAccessFile.java: *

The {@link java.nio.channels.FileChannel#position() Reader.java: public int read(java.nio.CharBuffer target) throws IOException { :) michael _______________________________________________ biojava-dev mailing list biojava-dev at lists.open-bio.org http://lists.open-bio.org/mailman/listinfo/biojava-dev From bugzilla-daemon at portal.open-bio.org Thu Jan 4 16:54:06 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Thu, 4 Jan 2007 11:54:06 -0500 Subject: [Biojava-dev] [Bug 2175] IndexOutOfBoundsException still occurring on SCF.create(File file) In-Reply-To: Message-ID: <200701041654.l04Gs6NG014233@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2175 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #3 from holland at ebi.ac.uk 2007-01-04 11:54 ------- I've added a workaround to this in the head of CVS, but not in the beta branches etc. Basically I was right - the file given as an example has incorrect values in its header data declaring that the private block is much bigger (835) than it actually is (698). The workaround causes the parser to notice this and not attempt to read the excess data. As the private block is not used anywhere inside the parser class and is not visible to outside users, this should not affect anyone's code. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 10:16:02 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 05:16:02 -0500 Subject: [Biojava-dev] [Bug 2177] New: Unclosed streams in org.biojava.bio.program.scf.SCF Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2177 Summary: Unclosed streams in org.biojava.bio.program.scf.SCF Product: BioJava Version: 1.4 Platform: All OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi, There are problems in the following methods where the input streams have not been closed. This can cause a 'too many open files' os error when working rapidly over large data sets. org.biojava.bio.program.scf.SCF.load(File f) - FileInputStream fin; org.biojava.bio.program.scf.SCF.ParserFactory.parse(InputStream in, SCF out, long initOffset) - DataInputStream din -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 10:42:45 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 05:42:45 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051042.l05Agj4l030583@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #1 from andyyatz at gmail.com 2007-01-05 05:42 ------- (In reply to comment #0) > Hi, > > There are problems in the following methods where the input streams have not > been closed. This can cause a 'too many open files' os error when working > rapidly over large data sets. > > org.biojava.bio.program.scf.SCF.load(File f) > - FileInputStream fin; > > org.biojava.bio.program.scf.SCF.ParserFactory.parse(InputStream in, SCF out, > long initOffset) > - DataInputStream din > After a quick look at the source: 1). Yes SCF.load(File f) needs to be changed to: protected void load(File f) throws IOException, UnsupportedChromatogramFormatException { FileInputStream fin = new FileInputStream(f); try { load(fin, 0); } finally { fin.close(); } } Since this method opens the InputStream to the SCF file it has to be responsible for closing the stream. 2). I don't think that parse(InputStream in, SCF out, long initOffset) should be closing streams since it does not create them. It should be creating method's responsibility to close these streams. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 10:55:32 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 05:55:32 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051055.l05AtWi4031158@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #2 from andyyatz at gmail.com 2007-01-05 05:55 ------- Created an attachment (id=535) --> (http://bugzilla.open-bio.org/attachment.cgi?id=535&action=view) Patch for SCF class First patch file I've created so sorry if it is wrong but I've tested the patching process on my machine and it seems to work. Can someone please do a quick compile with patch for me please? -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 11:07:01 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:07:01 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051107.l05B71LE031749@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #3 from holland at ebi.ac.uk 2007-01-05 06:07 ------- I've tested and applied Andy's patch in CVS head. All seems to work nicely now. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 11:07:21 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:07:21 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051107.l05B7L8f031793@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #4 from holland at ebi.ac.uk 2007-01-05 06:07 ------- I've tested and applied Andy's patch in CVS head. All seems to work nicely now. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 11:10:07 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:10:07 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051110.l05BA7tM031932@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 keiranmraine at gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | ------- Comment #5 from keiranmraine at gmail.com 2007-01-05 06:10 ------- I don't mean the input stream in the second method. It's the DataInputStream that should be closed here, see below. public static void parse(InputStream in, SCF out, long initOffset) throws IOException, UnsupportedChromatogramFormatException { DataInputStream din; try { din = new DataInputStream(in); SCF.Parser parser = createParser(din, out, initOffset); parser.parse(); } finally { din.close(); } } -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 11:21:14 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:21:14 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051121.l05BLEXp032535@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED ------- Comment #6 from holland at ebi.ac.uk 2007-01-05 06:21 ------- Publicly visible methods that accept InputStreams should never ever close them - that is the responsibility of the caller. If the DataInputStream wrapping the InputStream were closed, it would also close the InputStream, thus breaking this contract. The DataInputStream will be implicitly closed when the caller closes the original InputStream after calling the method in question. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Fri Jan 5 11:27:30 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Fri, 5 Jan 2007 06:27:30 -0500 Subject: [Biojava-dev] [Bug 2177] Unclosed streams in org.biojava.bio.program.scf.SCF In-Reply-To: Message-ID: <200701051127.l05BRUUa000422@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2177 ------- Comment #7 from keiranmraine at gmail.com 2007-01-05 06:27 ------- (In reply to comment #6) > Publicly visible methods that accept InputStreams should never ever close them > - that is the responsibility of the caller. If the DataInputStream wrapping the > InputStream were closed, it would also close the InputStream, thus breaking > this contract. The DataInputStream will be implicitly closed when the caller > closes the original InputStream after calling the method in question. > Ahhh, sorry sbout that, I did not realise that closing the DataInputStream would close the InputStream. Thanks -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Tue Jan 16 17:35:53 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Tue, 16 Jan 2007 12:35:53 -0500 Subject: [Biojava-dev] [Bug 2186] New: ABIFparser never releases file resouce when generated with a File Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2186 Summary: ABIFparser never releases file resouce when generated with a File Product: BioJava Version: 1.4 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi all, I've detected a resource problem in the use of the following object constructor org.biojava.bio.program.abi.ABIFParser(File f) If you generate the parser in this manner the generated RandomAccessFile is never closed and causes a resource leak. The way the code is written I cannot see an obvious place to close this, but there appears to be a simple fix in that you can use the alternative method: org.biojava.bio.program.abi.ABIFParser(InputStream in) and control the closing outside of Biojava. As I say I'm not sure at which point it's safe to close the stream in ABIFParser but the File method could be removed?? Keiran -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 09:45:10 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 04:45:10 -0500 Subject: [Biojava-dev] [Bug 2186] ABIFparser never releases file resouce when generated with a File In-Reply-To: Message-ID: <200701170945.l0H9jAcx003234@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2186 ------- Comment #1 from andyyatz at gmail.com 2007-01-17 04:45 ------- (In reply to comment #0) > Hi all, > > I've detected a resource problem in the use of the following object constructor > > org.biojava.bio.program.abi.ABIFParser(File f) > > If you generate the parser in this manner the generated RandomAccessFile is > never closed and causes a resource leak. The way the code is written I cannot > see an obvious place to close this, but there appears to be a simple fix in > that you can use the alternative method: > > org.biojava.bio.program.abi.ABIFParser(InputStream in) > > and control the closing outside of Biojava. > > As I say I'm not sure at which point it's safe to close the stream in > ABIFParser but the File method could be removed?? > > Keiran > It would seem that way without a close method introduced into the parser which then causes more problems. I would prefer a deprecation of the constructor to warn future users that this is not the preferred way of creating an ABIFParser. Maybe an extension to this class should be a static builder method which takes in a file, creates the required stream, passes out the finished object and makes sure to clean up after itself. I don't know it this is possible as I've only every gone into the guts of the ABI parser once. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 10:41:45 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 05:41:45 -0500 Subject: [Biojava-dev] [Bug 2186] ABIFparser never releases file resouce when generated with a File In-Reply-To: Message-ID: <200701171041.l0HAfjR9005812@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2186 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from holland at ebi.ac.uk 2007-01-17 05:41 ------- I found a way of changing it but it involved adding a method to the ABIFParser.DataAccess interface. This does not affect anything internally to BioJava but may affect user code - but I very much doubt anyone is using it. Changes have been committed to the HEAD of biojava-live. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 15:47:36 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 10:47:36 -0500 Subject: [Biojava-dev] [Bug 2187] New: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2187 Summary: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Product: BioJava Version: 1.4 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi, Just a nicety for anyone using the class in programs for use by non-programmers. When catching the IllegalSymbolException the stack trace is printed in org.biojava.bio.program.scf.SCF$V3Parser.parseBases. I suggest that the UnsupportedChromatogramFormatException be extended to take the Throwable and the 'ise.printStackTrace(System.err);' removed. e.g. catch (IllegalSymbolException ise) { ise.printStackTrace(System.err); throw new UnsupportedChromatogramFormatException("Base call decoding failure"); } BECOMES catch (IllegalSymbolException ise) { throw new UnsupportedChromatogramFormatException("Base call decoding failure", ise); } -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 15:47:46 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 10:47:46 -0500 Subject: [Biojava-dev] [Bug 2188] New: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Message-ID: http://bugzilla.open-bio.org/show_bug.cgi?id=2188 Summary: Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases Product: BioJava Version: 1.4 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: bio AssignedTo: biojava-dev at biojava.org ReportedBy: keiranmraine at gmail.com Hi, Just a nicety for anyone using the class in programs for use by non-programmers. When catching the IllegalSymbolException the stack trace is printed in org.biojava.bio.program.scf.SCF$V3Parser.parseBases. I suggest that the UnsupportedChromatogramFormatException be extended to take the Throwable and the 'ise.printStackTrace(System.err);' removed. e.g. catch (IllegalSymbolException ise) { ise.printStackTrace(System.err); throw new UnsupportedChromatogramFormatException("Base call decoding failure"); } BECOMES catch (IllegalSymbolException ise) { throw new UnsupportedChromatogramFormatException("Base call decoding failure", ise); } -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 16:00:28 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 11:00:28 -0500 Subject: [Biojava-dev] [Bug 2188] Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases In-Reply-To: Message-ID: <200701171600.l0HG0S0X030332@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2188 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |DUPLICATE ------- Comment #1 from holland at ebi.ac.uk 2007-01-17 11:00 ------- *** This bug has been marked as a duplicate of 2187 *** -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 16:00:32 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 11:00:32 -0500 Subject: [Biojava-dev] [Bug 2187] Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases In-Reply-To: Message-ID: <200701171600.l0HG0WRv030352@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2187 ------- Comment #1 from holland at ebi.ac.uk 2007-01-17 11:00 ------- *** Bug 2188 has been marked as a duplicate of this bug. *** -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From bugzilla-daemon at portal.open-bio.org Wed Jan 17 16:03:22 2007 From: bugzilla-daemon at portal.open-bio.org (bugzilla-daemon at portal.open-bio.org) Date: Wed, 17 Jan 2007 11:03:22 -0500 Subject: [Biojava-dev] [Bug 2187] Stack trace printed: org.biojava.bio.program.scf.SCF$V3Parser.parseBases In-Reply-To: Message-ID: <200701171603.l0HG3MZU030882@portal.open-bio.org> http://bugzilla.open-bio.org/show_bug.cgi?id=2187 holland at ebi.ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from holland at ebi.ac.uk 2007-01-17 11:03 ------- I've made the change as suggested. Committed to CVS biojava-live HEAD. -- Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From holland at ebi.ac.uk Fri Jan 19 15:54:45 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Fri, 19 Jan 2007 15:54:45 -0000 Subject: [Biojava-dev] SimpleGFFRecord In-Reply-To: <200612201658.02312.tamir@imp.univie.ac.at> References: <200612201658.02312.tamir@imp.univie.ac.at> Message-ID: <458963F3.9020706@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thanks for pointing this out. I have fixed it on the HEAD branch of CVS. cheers, Richard Ido M. Tamir wrote: > Hi, > SimpleGFFRecord puts out one additional semicolon > at the end of the attributes. Shifting sBuff.append(";") > to the test changes that. > > old: > > public static String stringifyAttributes(Map attMap) { > StringBuffer sBuff = new StringBuffer(); > Iterator ki = attMap.keySet().iterator(); > while (ki.hasNext()) { > String key = (String) ki.next(); > sBuff.append(key); > List values = (List) attMap.get(key); > for (Iterator vi = values.iterator(); vi.hasNext();) { > String value = (String) vi.next(); > if (isText(value)) { > sBuff.append(" \"" + value + "\""); > } else { > sBuff.append(" " + value); > } > } > sBuff.append(";"); <---!! > if (ki.hasNext()) { > sBuff.append(" "); > } > } > return sBuff.substring(0); > } > > > public static String stringifyAttributes(Map attMap) { > StringBuffer sBuff = new StringBuffer(); > Iterator ki = attMap.keySet().iterator(); > while (ki.hasNext()) { > String key = (String) ki.next(); > sBuff.append(key); > List values = (List) attMap.get(key); > for (Iterator vi = values.iterator(); vi.hasNext();) { > String value = (String) vi.next(); > if (isText(value)) { > sBuff.append(" \"" + value + "\""); > } else { > sBuff.append(" " + value); > } > } > if (ki.hasNext()) { > sBuff.append(";"); <---!! > sBuff.append(" "); > } > } > return sBuff.substring(0); > } > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFiWPy4C5LeMEKA/QRAmJWAJ9jmAvPhQYF0YlJEYye7/XdPa7NhgCbBI5t lImvTgNuqgd6/RukpFd4Pik= =y7hf -----END PGP SIGNATURE----- From ayates at ebi.ac.uk Fri Jan 19 16:18:05 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Fri, 19 Jan 2007 16:18:05 -0000 Subject: [Biojava-dev] how to run unittest in eclipse In-Reply-To: References: Message-ID: <459A68DE.4020506@ebi.ac.uk> Hi, This sounds like a problem more with bad project setup where Eclipse has not been told where the resources directory is located. In eclipse right click on the project and go to: Build Path -> Configure Build Path... Click on the source tab and then click on the button Add Folder. Select the resources directory from the root of the BioJava project and then click ok. If everything has gone okay when you now run the test the Eclipse JUnit runner should pick up on the resources classpath and you should have a bit more luck with them. Andy Yates Huang Zhibin wrote: > Dear all, > First all,thanks for the contribution of BioJava. > I downloaded the BioJava and compile apps, demos, tests and runtests > using ant. It is ok. But when importing this project into eclipse, I do > not know hot to runtests. For example, when clicking file of > /tests/org.biojava.bio.alignment/FlexibleAlignmentTest.java, choose Run > As | JUnit Test, it fails. Info in Console will be listed below. > I know maybe it failed in the step of initialization, but I do now know > how to solve it. > Can someone who run junittest in JAVA IDE share the experience or give > me some suggestions? I will appreciate it. > Best regards, > Zhibin > > ------------------------------ > Info printed in Console: > > org.biojava.bio.BioError: Unable to initialize DNATools > at org.biojava.bio.seq.DNATools.(DNATools.java:117) > at > org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:74) > > > at > org.biojava.bio.alignment.FlexibleAlignmentTest.(FlexibleAlignmentTest.java:46) > > > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown > Source) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown > Source) > at java.lang.reflect.Constructor.newInstance(Unknown Source) > at junit.framework.TestSuite.createTest(TestSuite.java:135) > at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) > at junit.framework.TestSuite.(TestSuite.java:75) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) > > > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > > > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > > > 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.(AlphabetManager.java:148) > at org.biojava.bio.seq.DNATools.(DNATools.java:80) > ... 15 more > java.lang.NoClassDefFoundError > at org.biojava.bio.seq.ProteinTools.(ProteinTools.java:76) > at > org.biojava.bio.alignment.FlexibleAlignmentTest.parse(FlexibleAlignmentTest.java:76) > > > > _________________________________________________________________ > ??????????,??? MSN Messenger: http://messenger.msn.com/cn > > > ------------------------------------------------------------------------ > > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev From td2 at sanger.ac.uk Wed Jan 31 09:53:21 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 09:53:21 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression Message-ID: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> Hi, A few weeks ago, this patch removed a couple of apparently-redundant lines from JDBCPooledDataSource: http://code.open-bio.org/cgi/viewcvs.cgi/biojava-live/ src/org/biojava/utils/JDBCPooledDataSource.java.diff? r1=1.2&r2=1.3&cvsroot=biojava This change causes at least some DataSource objects created using this class to fail with a NullPointerException the first time a connection is actually requested. Using biojava-ensembl to access an Ensembl MySQL database demonstrates this problem consistently. Reverting to revision 1.2 of JDBCPooledDataSource.java solves the problem. It looks like the PoolableConnectionFactory constructor has a side effect of registering the factory with the specified ObjectPool. This side effect doesn't seem to be documented particularly clearly, but the example code towards the bottom of: http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/ commons/dbcp/package-summary.html#package_description seems to rely on this behavior. Would it be possible to roll this source file back to revision 1.2? Or, alternatively, is there someone who can set me up with commit access on the new CVS server (I think I still have an account there, but my password doesn't work since the server move). Thanks, Thomas. From holland at ebi.ac.uk Wed Jan 31 11:04:05 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Wed, 31 Jan 2007 11:04:05 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> Message-ID: <45C077A5.4070706@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Thomas. I have made the change on Head as you have requested. cheers, Richard. Thomas Down wrote: > Hi, > > A few weeks ago, this patch removed a couple of apparently-redundant > lines from JDBCPooledDataSource: > > http://code.open-bio.org/cgi/viewcvs.cgi/biojava-live/ > src/org/biojava/utils/JDBCPooledDataSource.java.diff? > r1=1.2&r2=1.3&cvsroot=biojava > > This change causes at least some DataSource objects created using > this class to fail with a NullPointerException the first time a > connection is actually requested. Using biojava-ensembl to access an > Ensembl MySQL database demonstrates this problem consistently. > Reverting to revision 1.2 of JDBCPooledDataSource.java solves the > problem. > > It looks like the PoolableConnectionFactory constructor has a side > effect of registering the factory with the specified ObjectPool. > This side effect doesn't seem to be documented particularly clearly, > but the example code towards the bottom of: > > http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/ > commons/dbcp/package-summary.html#package_description > > seems to rely on this behavior. > > > Would it be possible to roll this source file back to revision 1.2? > Or, alternatively, is there someone who can set me up with commit > access on the new CVS server (I think I still have an account there, > but my password doesn't work since the server move). > > Thanks, > > Thomas. > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwHel4C5LeMEKA/QRAkZbAJ4s+fGGxsKDUhgYuWiTgw5JRk4XxQCdEFmq Lt0ZjTmBS2K+JGc3TF4R9Qg= =kaAs -----END PGP SIGNATURE----- From ayates at ebi.ac.uk Wed Jan 31 11:06:03 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 11:06:03 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> Message-ID: <45C0781B.7030304@ebi.ac.uk> Hi, I would say that this class' method is trying to do too much. We have a method which is creating a BasicDataSource then not bothering to return it in favour of a custom one which implements a hashcode & equals method. Can you try your test case when it returns the BasicDataSource & not the custom one and see if that works please? Thanks, Andy Yates Thomas Down wrote: > Hi, > > A few weeks ago, this patch removed a couple of apparently-redundant > lines from JDBCPooledDataSource: > > http://code.open-bio.org/cgi/viewcvs.cgi/biojava-live/ > src/org/biojava/utils/JDBCPooledDataSource.java.diff? > r1=1.2&r2=1.3&cvsroot=biojava > > This change causes at least some DataSource objects created using > this class to fail with a NullPointerException the first time a > connection is actually requested. Using biojava-ensembl to access an > Ensembl MySQL database demonstrates this problem consistently. > Reverting to revision 1.2 of JDBCPooledDataSource.java solves the > problem. > > It looks like the PoolableConnectionFactory constructor has a side > effect of registering the factory with the specified ObjectPool. > This side effect doesn't seem to be documented particularly clearly, > but the example code towards the bottom of: > > http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/ > commons/dbcp/package-summary.html#package_description > > seems to rely on this behavior. > > > Would it be possible to roll this source file back to revision 1.2? > Or, alternatively, is there someone who can set me up with commit > access on the new CVS server (I think I still have an account there, > but my password doesn't work since the server move). > > Thanks, > > Thomas. > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev From td2 at sanger.ac.uk Wed Jan 31 11:59:31 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 11:59:31 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C0781B.7030304@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> Message-ID: <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> On 31 Jan 2007, at 11:06, Andy Yates wrote: > Hi, > > I would say that this class' method is trying to do too much. We > have a > method which is creating a BasicDataSource then not bothering to > return > it in favour of a custom one which implements a hashcode & equals > method. Can you try your test case when it returns the > BasicDataSource & > not the custom one and see if that works please? Patching the current revision to return a PoolingDataSource (I assume that's what you meant) rather than a MyPoolingDataSource works fine. However, patching revision 1.3 the same way does not work. The problem I reported is definitely orthogonal to the question of exactly which type of PoolingDataSource gets returned. I'm not sure what the original rationale was for returning the custom PoolingDataSource subclass -- but I can't really see how it's going to do any harm. Thomas. From ayates at ebi.ac.uk Wed Jan 31 12:06:17 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:06:17 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> Message-ID: <45C08639.7080600@ebi.ac.uk> Hi, Sorry I was meaning if that if that method just becomes: public static DataSource getDataSource(final String driver, final String url, final String user, final String pass) throws Exception { BasicDataSource ds = new BasicDataSource(); ds.setUrl(url); ds.setDriverClassName(driver); ds.setUsername(user); ds.setPassword(pass); // Set BasicDataSource properties such as maxActive and maxIdle, as described in // http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html ds.setMaxActive(10); ds.setMaxIdle(5); ds.setMaxWait(10000); return ds; } Does that still work? I think the original rationale was to ensure that any two datasources do actually point to the same resource. However this seems a bit too much defensive programming & I don't know why anyone would program themselves into a situation where this is required. Andy Thomas Down wrote: > > On 31 Jan 2007, at 11:06, Andy Yates wrote: > >> Hi, >> >> I would say that this class' method is trying to do too much. We have a >> method which is creating a BasicDataSource then not bothering to return >> it in favour of a custom one which implements a hashcode & equals >> method. Can you try your test case when it returns the BasicDataSource & >> not the custom one and see if that works please? > > Patching the current revision to return a PoolingDataSource (I assume > that's what you meant) rather than a MyPoolingDataSource works fine. > However, patching revision 1.3 the same way does not work. The problem > I reported is definitely orthogonal to the question of exactly which > type of PoolingDataSource gets returned. > > I'm not sure what the original rationale was for returning the custom > PoolingDataSource subclass -- but I can't really see how it's going to > do any harm. > > Thomas. From td2 at sanger.ac.uk Wed Jan 31 12:21:10 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 12:21:10 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08639.7080600@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> Message-ID: <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> On 31 Jan 2007, at 12:06, Andy Yates wrote: > Hi, > > Sorry I was meaning if that if that method just becomes: > > public static DataSource getDataSource(final String driver, > final String url, > final String user, > final String pass) > throws Exception { > > BasicDataSource ds = new BasicDataSource(); > ds.setUrl(url); > ds.setDriverClassName(driver); > ds.setUsername(user); > ds.setPassword(pass); > // Set BasicDataSource properties such as maxActive and > maxIdle, as described in > // http://jakarta.apache.org/commons/dbcp/api/org/apache/ > commons/dbcp/BasicDataSource.html > ds.setMaxActive(10); > ds.setMaxIdle(5); > ds.setMaxWait(10000); > > return ds; > } > > Does that still work? Hmmm, I was assuming that BasicDataSource didn't actually do any pooling itself, and that you needed another layer on top to manage a connection pool -- that seems to be how all previous revisions of JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. But yes, BasicDataSource does seem to do pooling itself (confirmed by reading the source), so maybe your simpler version is a better idea. It certainly works okay for me. Thomas. From ayates at ebi.ac.uk Wed Jan 31 12:28:42 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:28:42 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> Message-ID: <45C08B7A.3060102@ebi.ac.uk> Thomas Down wrote: > > On 31 Jan 2007, at 12:06, Andy Yates wrote: > >> Hi, >> >> Sorry I was meaning if that if that method just becomes: >> >> public static DataSource getDataSource(final String driver, >> final String url, >> final String user, >> final String pass) >> throws Exception { >> >> BasicDataSource ds = new BasicDataSource(); >> ds.setUrl(url); >> ds.setDriverClassName(driver); >> ds.setUsername(user); >> ds.setPassword(pass); >> // Set BasicDataSource properties such as maxActive and maxIdle, >> as described in >> // >> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >> >> ds.setMaxActive(10); >> ds.setMaxIdle(5); >> ds.setMaxWait(10000); >> >> return ds; >> } >> >> Does that still work? > > Hmmm, I was assuming that BasicDataSource didn't actually do any pooling > itself, and that you needed another layer on top to manage a connection > pool -- that seems to be how all previous revisions of > JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. > But yes, BasicDataSource does seem to do pooling itself (confirmed by > reading the source), so maybe your simpler version is a better idea. It > certainly works okay for me. > > Thomas. That's what I thought should have happened :). Can I suggest that this revised version goes into CVS? Anyone got any objections? Andy From holland at ebi.ac.uk Wed Jan 31 12:40:46 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Wed, 31 Jan 2007 12:40:46 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08B7A.3060102@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> Message-ID: <45C08E4E.2050308@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andy could you make the change to your local copy of the source file and email the file to me, that way I can make sure I don't get it wrong when I commit it. Richard. PS. You should probably have your own CVS account - email the OBF helpdesk and ask for one, saying I told you to. :) Andy Yates wrote: > > Thomas Down wrote: >> On 31 Jan 2007, at 12:06, Andy Yates wrote: >> >>> Hi, >>> >>> Sorry I was meaning if that if that method just becomes: >>> >>> public static DataSource getDataSource(final String driver, >>> final String url, >>> final String user, >>> final String pass) >>> throws Exception { >>> >>> BasicDataSource ds = new BasicDataSource(); >>> ds.setUrl(url); >>> ds.setDriverClassName(driver); >>> ds.setUsername(user); >>> ds.setPassword(pass); >>> // Set BasicDataSource properties such as maxActive and maxIdle, >>> as described in >>> // >>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>> >>> ds.setMaxActive(10); >>> ds.setMaxIdle(5); >>> ds.setMaxWait(10000); >>> >>> return ds; >>> } >>> >>> Does that still work? >> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling >> itself, and that you needed another layer on top to manage a connection >> pool -- that seems to be how all previous revisions of >> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. >> But yes, BasicDataSource does seem to do pooling itself (confirmed by >> reading the source), so maybe your simpler version is a better idea. It >> certainly works okay for me. >> >> Thomas. > > That's what I thought should have happened :). Can I suggest that this > revised version goes into CVS? Anyone got any objections? > > Andy > _______________________________________________ > biojava-dev mailing list > biojava-dev at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/biojava-dev > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwI5O4C5LeMEKA/QRApbHAJ4pfXb4YqqBdCynKNK2Z3xzgGqcvQCfbl2K 6llWxdpbPek1cSCTAakt/5Q= =0Zam -----END PGP SIGNATURE----- From td2 at sanger.ac.uk Wed Jan 31 12:50:23 2007 From: td2 at sanger.ac.uk (Thomas Down) Date: Wed, 31 Jan 2007 12:50:23 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08B7A.3060102@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> Message-ID: On 31 Jan 2007, at 12:28, Andy Yates wrote: >> >> Hmmm, I was assuming that BasicDataSource didn't actually do any >> pooling >> itself, and that you needed another layer on top to manage a >> connection >> pool -- that seems to be how all previous revisions of >> JDBCConnectionPool worked, so I guess I wasn't alone in thinking >> this. >> But yes, BasicDataSource does seem to do pooling itself (confirmed by >> reading the source), so maybe your simpler version is a better >> idea. It >> certainly works okay for me. >> >> Thomas. > > That's what I thought should have happened :). Can I suggest that this > revised version goes into CVS? Anyone got any objections? The one problem I can think of is that this might break any code which relies on DataSource objects having reliable hashCode/equals. I've found one place where this might be a problem, in OntologySQL.getOntologySQL. That's a deprecated class, so maybe it's not a big issue -- but it might be worth asking around. Thomas. From ayates at ebi.ac.uk Wed Jan 31 12:56:29 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:56:29 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> Message-ID: <45C091FD.3020501@ebi.ac.uk> Thomas Down wrote: > > On 31 Jan 2007, at 12:28, Andy Yates wrote: >>> >>> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling >>> itself, and that you needed another layer on top to manage a connection >>> pool -- that seems to be how all previous revisions of >>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. >>> But yes, BasicDataSource does seem to do pooling itself (confirmed by >>> reading the source), so maybe your simpler version is a better idea. It >>> certainly works okay for me. >>> >>> Thomas. >> >> That's what I thought should have happened :). Can I suggest that this >> revised version goes into CVS? Anyone got any objections? > > The one problem I can think of is that this might break any code which > relies on DataSource objects having reliable hashCode/equals. I've > found one place where this might be a problem, in > OntologySQL.getOntologySQL. That's a deprecated class, so maybe it's > not a big issue -- but it might be worth asking around. > > Thomas. If this is a problem then there is nothing wrong I guess with subclassing BasicDataSource & implementing the hashcode & equals methods from there. BasicDataSource gives access to URI/password/username so it should be a very simple matter of generating the correct methods. I can do that as the submitted version if required Andy From holland at ebi.ac.uk Wed Jan 31 13:07:58 2007 From: holland at ebi.ac.uk (Richard Holland) Date: Wed, 31 Jan 2007 13:07:58 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C090A6.10909@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> <45C08E4E.2050308@ebi.ac.uk> <45C090A6.10909@ebi.ac.uk> Message-ID: <45C094AE.1030101@ebi.ac.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've committed your changes Andy. Thomas, I wouldn't worry about OntologySQL. It's highly deprecated and not supported - the whole biojavax/Hibernate thing made that code redundant. Richard. Andy Yates wrote: > Okay I've attached the fix here. > > I just did this in a text editor but I believe that the imports are > okay. If you can just do a quick scan as well to make sure I haven't > deleted anything that was very important. > > I'll get on to the helpdesk now as well :) > > Andy > > Richard Holland wrote: > Andy could you make the change to your local copy of the source file and > email the file to me, that way I can make sure I don't get it wrong when > I commit it. > > Richard. > > PS. You should probably have your own CVS account - email the OBF > helpdesk and ask for one, saying I told you to. :) > > > Andy Yates wrote: >>>> Thomas Down wrote: >>>>> On 31 Jan 2007, at 12:06, Andy Yates wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> Sorry I was meaning if that if that method just becomes: >>>>>> >>>>>> public static DataSource getDataSource(final String driver, >>>>>> final String url, >>>>>> final String user, >>>>>> final String pass) >>>>>> throws Exception { >>>>>> >>>>>> BasicDataSource ds = new BasicDataSource(); >>>>>> ds.setUrl(url); >>>>>> ds.setDriverClassName(driver); >>>>>> ds.setUsername(user); >>>>>> ds.setPassword(pass); >>>>>> // Set BasicDataSource properties such as maxActive and >>>>>> maxIdle, as described in >>>>>> // >>>>>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>>>>> >>>>>> ds.setMaxActive(10); >>>>>> ds.setMaxIdle(5); >>>>>> ds.setMaxWait(10000); >>>>>> >>>>>> return ds; >>>>>> } >>>>>> >>>>>> Does that still work? >>>>> Hmmm, I was assuming that BasicDataSource didn't actually do any >>>>> pooling itself, and that you needed another layer on top to manage a >>>>> connection pool -- that seems to be how all previous revisions of >>>>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking >>>>> this. But yes, BasicDataSource does seem to do pooling itself >>>>> (confirmed by reading the source), so maybe your simpler version is >>>>> a better idea. It certainly works okay for me. >>>>> >>>>> Thomas. >>>> That's what I thought should have happened :). Can I suggest that >>>> this revised version goes into CVS? Anyone got any objections? >>>> >>>> Andy >>>> _______________________________________________ >>>> biojava-dev mailing list >>>> biojava-dev at lists.open-bio.org >>>> http://lists.open-bio.org/mailman/listinfo/biojava-dev >>>> > ------------------------------------------------------------------------ > /* > * BioJava development code > * > * This code may be freely distributed and modified under the > * terms of the GNU Lesser General Public Licence. This should > * be distributed with the code. If you do not have a copy, > * see: > * > * http://www.gnu.org/copyleft/lesser.html > * > * Copyright for this code is held jointly by the individual > * authors. These should be listed in @author doc comments. > * > * For more information on the BioJava project and its aims, > * or to join the biojava-l mailing list, visit the home page > * at: > * > * http://www.biojava.org/ > * > */ > package org.biojava.utils; > import javax.sql.DataSource; > import org.apache.commons.dbcp.BasicDataSource; > import org.apache.commons.dbcp.PoolingDataSource; > import org.apache.commons.pool.ObjectPool; > /** > * Returns a DataSource that implements connection pooling > * > * Uses Jakarta Commons DBCP and Pool packages. > * See the description of the dbcp package at > * http://jakarta.apache.org/commons/dbcp/api/overview-summary.html#overview_description > * > * @author Simon Foote > * @author Len Trigg > */ > public class JDBCPooledDataSource { > public static DataSource getDataSource(final String driver, > final String url, > final String user, > final String pass) > throws Exception { > BasicDataSource ds = new BasicDataSource(); > ds.setUrl(url); > ds.setDriverClassName(driver); > ds.setUsername(user); > ds.setPassword(pass); > // Set BasicDataSource properties such as maxActive and maxIdle, as described in > // http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html > ds.setMaxActive(10); > ds.setMaxIdle(5); > ds.setMaxWait(10000); > return dataSource; > } > // Adds simple equals and hashcode methods so that we can compare if > // two connections are to the same database. This will fail if the > // DataSource is redirected to another database etc (I doubt this is > // ever likely to be used). > /** > * @depercated This is no longer used in favor of {@link BasicDataSource} > * from DBCP > */ > static class MyPoolingDataSource extends PoolingDataSource { > final String source; > public MyPoolingDataSource(ObjectPool connectionPool, String source) { > super(connectionPool); > this.source = source; > } > public boolean equals(Object o2) { > if ((o2 == null) || !(o2 instanceof MyPoolingDataSource)) { > return false; > } > MyPoolingDataSource b2 = (MyPoolingDataSource) o2; > return source.equals(b2.source); > } > public int hashCode() { > return source.hashCode(); > } > } > public static void main(String[] args) { > try { > DataSource ds1 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); > DataSource ds2 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); > System.err.println(ds1); > System.err.println(ds2); > System.err.println(ds1.equals(ds2)); > } catch (Exception e) { > e.printStackTrace(); > } > } > } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwJSu4C5LeMEKA/QRAgt1AJ9dtk3SBbDwtah469igyc9DYWGzMwCgqAad X1KXpdlqqhBfuL1MisMj/yo= =nlGe -----END PGP SIGNATURE----- From ayates at ebi.ac.uk Wed Jan 31 13:25:12 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 13:25:12 +0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C094AE.1030101@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> <45C08E4E.2050308@ebi.ac.uk> <45C090A6.10909@ebi.ac.uk> <45C094AE.1030101@ebi.ac.uk> Message-ID: <45C098B8.7030107@ebi.ac.uk> Cheers mate. If this hash/equals is a problem then this can be solved later on. Richard Holland wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I've committed your changes Andy. > > Thomas, I wouldn't worry about OntologySQL. It's highly deprecated and > not supported - the whole biojavax/Hibernate thing made that code redundant. > > Richard. > > Andy Yates wrote: >> Okay I've attached the fix here. >> >> I just did this in a text editor but I believe that the imports are >> okay. If you can just do a quick scan as well to make sure I haven't >> deleted anything that was very important. >> >> I'll get on to the helpdesk now as well :) >> >> Andy >> >> Richard Holland wrote: >> Andy could you make the change to your local copy of the source file and >> email the file to me, that way I can make sure I don't get it wrong when >> I commit it. >> >> Richard. >> >> PS. You should probably have your own CVS account - email the OBF >> helpdesk and ask for one, saying I told you to. :) >> >> >> Andy Yates wrote: >>>>> Thomas Down wrote: >>>>>> On 31 Jan 2007, at 12:06, Andy Yates wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> Sorry I was meaning if that if that method just becomes: >>>>>>> >>>>>>> public static DataSource getDataSource(final String driver, >>>>>>> final String url, >>>>>>> final String user, >>>>>>> final String pass) >>>>>>> throws Exception { >>>>>>> >>>>>>> BasicDataSource ds = new BasicDataSource(); >>>>>>> ds.setUrl(url); >>>>>>> ds.setDriverClassName(driver); >>>>>>> ds.setUsername(user); >>>>>>> ds.setPassword(pass); >>>>>>> // Set BasicDataSource properties such as maxActive and >>>>>>> maxIdle, as described in >>>>>>> // >>>>>>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>>>>>> >>>>>>> ds.setMaxActive(10); >>>>>>> ds.setMaxIdle(5); >>>>>>> ds.setMaxWait(10000); >>>>>>> >>>>>>> return ds; >>>>>>> } >>>>>>> >>>>>>> Does that still work? >>>>>> Hmmm, I was assuming that BasicDataSource didn't actually do any >>>>>> pooling itself, and that you needed another layer on top to manage a >>>>>> connection pool -- that seems to be how all previous revisions of >>>>>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking >>>>>> this. But yes, BasicDataSource does seem to do pooling itself >>>>>> (confirmed by reading the source), so maybe your simpler version is >>>>>> a better idea. It certainly works okay for me. >>>>>> >>>>>> Thomas. >>>>> That's what I thought should have happened :). Can I suggest that >>>>> this revised version goes into CVS? Anyone got any objections? >>>>> >>>>> Andy >>>>> _______________________________________________ >>>>> biojava-dev mailing list >>>>> biojava-dev at lists.open-bio.org >>>>> http://lists.open-bio.org/mailman/listinfo/biojava-dev >>>>> > >> ------------------------------------------------------------------------ > >> /* >> * BioJava development code >> * >> * This code may be freely distributed and modified under the >> * terms of the GNU Lesser General Public Licence. This should >> * be distributed with the code. If you do not have a copy, >> * see: >> * >> * http://www.gnu.org/copyleft/lesser.html >> * >> * Copyright for this code is held jointly by the individual >> * authors. These should be listed in @author doc comments. >> * >> * For more information on the BioJava project and its aims, >> * or to join the biojava-l mailing list, visit the home page >> * at: >> * >> * http://www.biojava.org/ >> * >> */ >> package org.biojava.utils; > >> import javax.sql.DataSource; > >> import org.apache.commons.dbcp.BasicDataSource; >> import org.apache.commons.dbcp.PoolingDataSource; >> import org.apache.commons.pool.ObjectPool; > >> /** >> * Returns a DataSource that implements connection pooling >> * >> * Uses Jakarta Commons DBCP and Pool packages. >> * See the description of the dbcp package at >> * http://jakarta.apache.org/commons/dbcp/api/overview-summary.html#overview_description >> * >> * @author Simon Foote >> * @author Len Trigg >> */ > >> public class JDBCPooledDataSource { > >> public static DataSource getDataSource(final String driver, >> final String url, >> final String user, >> final String pass) >> throws Exception { > >> BasicDataSource ds = new BasicDataSource(); >> ds.setUrl(url); >> ds.setDriverClassName(driver); >> ds.setUsername(user); >> ds.setPassword(pass); >> // Set BasicDataSource properties such as maxActive and maxIdle, as described in >> // http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >> ds.setMaxActive(10); >> ds.setMaxIdle(5); >> ds.setMaxWait(10000); > >> return dataSource; >> } > > >> // Adds simple equals and hashcode methods so that we can compare if >> // two connections are to the same database. This will fail if the >> // DataSource is redirected to another database etc (I doubt this is >> // ever likely to be used). >> /** >> * @depercated This is no longer used in favor of {@link BasicDataSource} >> * from DBCP >> */ >> static class MyPoolingDataSource extends PoolingDataSource { >> final String source; >> public MyPoolingDataSource(ObjectPool connectionPool, String source) { >> super(connectionPool); >> this.source = source; >> } >> public boolean equals(Object o2) { >> if ((o2 == null) || !(o2 instanceof MyPoolingDataSource)) { >> return false; >> } >> MyPoolingDataSource b2 = (MyPoolingDataSource) o2; >> return source.equals(b2.source); >> } >> public int hashCode() { >> return source.hashCode(); >> } >> } > > >> public static void main(String[] args) { >> try { >> DataSource ds1 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); >> DataSource ds2 = getDataSource("org.hsqldb.jdbcDriver", "jdbc:hsqldb:/tmp/hsqldb/biosql", "sa", ""); >> System.err.println(ds1); >> System.err.println(ds2); >> System.err.println(ds1.equals(ds2)); >> } catch (Exception e) { >> e.printStackTrace(); >> } >> } >> } > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFwJSu4C5LeMEKA/QRAgt1AJ9dtk3SBbDwtah469igyc9DYWGzMwCgqAad > X1KXpdlqqhBfuL1MisMj/yo= > =nlGe > -----END PGP SIGNATURE----- From jburdick at keyfitz.org Mon Jan 22 16:46:44 2007 From: jburdick at keyfitz.org (Josh Burdick) Date: Mon, 22 Jan 2007 16:46:44 -0000 Subject: [Biojava-dev] reading a subsequence from a .nib file Message-ID: <1169483375.5340.39.camel@localhost.localdomain> I wrote some code to read a chunk of DNA sequence from a file in Jim Kent's blat ".nib" file format. This is a simple format using four bits/base. I didn't attach the code, to avoid spamming the whole list; but it, and a (very crude!) JUnit test, are at http://www.keyfitz.org/jburdick/read_nib_file_java/NibFile.java http://www.keyfitz.org/jburdick/read_nib_file_java/NibFileTest.java You could use 2 bits/base, but then you can't have ambiguous bases. 4 bits/base seems like a reasonable compromise; plus sites that have "blat" installed will need to have the .nib files on a server somewhere anyway, and this way repeat-masking can be included, which may be convenient. Also, it doesn't support writing a .nib file; again, presumably people will be using Jim Kent's faToNib program to do that. It would need some tweaking to be included in BioJava, because it returns a plain String of ACGT, instead of a PackedSequence object. (Probably this would just involve rewriting the setupBuffer() and addToBuffer() methods in the code.) Also, the coordinate information could come from a Range object. If similar code is already somewhere in BioJava, please ignore this; but I couldn't find it with thirty seconds of Googling, so I figured it hadn't been written... Josh Burdick programmer, Vivian Cheung's lab, Children's Hospital of Philadelphia jburdick at keyfitz.org From ayates at ebi.ac.uk Wed Jan 31 12:50:53 2007 From: ayates at ebi.ac.uk (Andy Yates) Date: Wed, 31 Jan 2007 12:50:53 -0000 Subject: [Biojava-dev] JDBCPooledDataSource regression In-Reply-To: <45C08E4E.2050308@ebi.ac.uk> References: <416B41DF-91E1-4D1F-A4B4-799FE712B032@sanger.ac.uk> <45C0781B.7030304@ebi.ac.uk> <5DDBC6F5-7DC3-4446-A982-3CD9B3931A06@sanger.ac.uk> <45C08639.7080600@ebi.ac.uk> <8689C307-0643-46D9-90A6-A9958681D1D0@sanger.ac.uk> <45C08B7A.3060102@ebi.ac.uk> <45C08E4E.2050308@ebi.ac.uk> Message-ID: <45C090A6.10909@ebi.ac.uk> Okay I've attached the fix here. I just did this in a text editor but I believe that the imports are okay. If you can just do a quick scan as well to make sure I haven't deleted anything that was very important. I'll get on to the helpdesk now as well :) Andy Richard Holland wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Andy could you make the change to your local copy of the source file and > email the file to me, that way I can make sure I don't get it wrong when > I commit it. > > Richard. > > PS. You should probably have your own CVS account - email the OBF > helpdesk and ask for one, saying I told you to. :) > > > Andy Yates wrote: >> Thomas Down wrote: >>> On 31 Jan 2007, at 12:06, Andy Yates wrote: >>> >>>> Hi, >>>> >>>> Sorry I was meaning if that if that method just becomes: >>>> >>>> public static DataSource getDataSource(final String driver, >>>> final String url, >>>> final String user, >>>> final String pass) >>>> throws Exception { >>>> >>>> BasicDataSource ds = new BasicDataSource(); >>>> ds.setUrl(url); >>>> ds.setDriverClassName(driver); >>>> ds.setUsername(user); >>>> ds.setPassword(pass); >>>> // Set BasicDataSource properties such as maxActive and maxIdle, >>>> as described in >>>> // >>>> http://jakarta.apache.org/commons/dbcp/api/org/apache/commons/dbcp/BasicDataSource.html >>>> >>>> ds.setMaxActive(10); >>>> ds.setMaxIdle(5); >>>> ds.setMaxWait(10000); >>>> >>>> return ds; >>>> } >>>> >>>> Does that still work? >>> Hmmm, I was assuming that BasicDataSource didn't actually do any pooling >>> itself, and that you needed another layer on top to manage a connection >>> pool -- that seems to be how all previous revisions of >>> JDBCConnectionPool worked, so I guess I wasn't alone in thinking this. >>> But yes, BasicDataSource does seem to do pooling itself (confirmed by >>> reading the source), so maybe your simpler version is a better idea. It >>> certainly works okay for me. >>> >>> Thomas. >> That's what I thought should have happened :). Can I suggest that this >> revised version goes into CVS? Anyone got any objections? >> >> Andy >> _______________________________________________ >> biojava-dev mailing list >> biojava-dev at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/biojava-dev >> > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2.2 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFFwI5O4C5LeMEKA/QRApbHAJ4pfXb4YqqBdCynKNK2Z3xzgGqcvQCfbl2K > 6llWxdpbPek1cSCTAakt/5Q= > =0Zam > -----END PGP SIGNATURE----- -------------- next part -------------- A non-text attachment was scrubbed... Name: JDBCPooledDataSource.java Type: text/x-java Size: 3155 bytes Desc: not available URL: