[Biojava-dev] [Bug 2046] Cannot read in more than one serialized ProfileHMM object, attempt crashes
bugzilla-daemon at newportal.open-bio.org
bugzilla-daemon at newportal.open-bio.org
Tue Aug 1 09:08:22 UTC 2006
http://bugzilla.open-bio.org/show_bug.cgi?id=2046
------- Comment #3 from holland at ebi.ac.uk 2006-08-01 05:08 -------
I did a bit more investigation, and found that on each pass of the
deserializer, two sets of symbols from two alphabets are involved. The symbols
from the first alphabet are deserialized correctly each time, but the second
time round the second alphabet symbols are _not_. See log below from the
example code above plus a slightly modified SimpleDistribution#readObject:
SymbolWeightMemento[] swm = (SymbolWeightMemento[]) stream.readObject();
for (int m = 0; m < swm.length; ++m) {
try {
System.err.println("Looking for: "+swm[m].symbol);
System.err.println("Alphabet is: "+alpha);
weights[indexer.indexForSymbol(swm[m].symbol)] = swm[m].weight;
} catch (IllegalSymbolException ex) {
throw new IOException("Symbol in serialized stream can't be found
in the alphabet");
}
}
I am not sure what is causing this. Could someone who knows more about
deserializing alphabets have a look?
---
Writing HMM
Wrote 22561 bytes
Reading HMM
Looking for:
org.biojava.bio.symbol.AlphabetManager$WellKnownAtomicSymbol at 16cd7d5
Alphabet is:
org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 64f6cd
...
Alphabet is:
org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 64f6cd
Looking for: org.biojava.bio.dp.SimpleDotState: d-2
Alphabet is: Transitions from d-1
Looking for: org.biojava.bio.dp.SimpleEmissionState at 70610a
...
Looking for: org.biojava.bio.dp.SimpleEmissionState at a7dd39
Alphabet is: Transitions from m-8
Read HMM
Reading HMM again!
Looking for:
org.biojava.bio.symbol.AlphabetManager$WellKnownAtomicSymbol at 16cd7d5
Alphabet is:
org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 64f6cd
...
Looking for:
org.biojava.bio.symbol.AlphabetManager$WellKnownAtomicSymbol at cdedfd
Alphabet is:
org.biojava.bio.symbol.AlphabetManager$ImmutableWellKnownAlphabetWrapper at 64f6cd
Looking for: org.biojava.bio.dp.SimpleDotState: d-2
Alphabet is: Transitions from d-1
Exception in thread "main" java.io.IOException: Symbol in serialized stream
can't be found in the alphabet
at
org.biojava.bio.dist.SimpleDistribution.readObject(SimpleDistribution.java:101)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at java.util.HashMap.readObject(HashMap.java:1015)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at sandbox.TestByteArray.testSerialize(TestByteArray.java:49)
at sandbox.TestByteArray.main(TestByteArray.java:114)
--
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.
More information about the biojava-dev
mailing list