Do you think that the problem is with
expander.io.converters.EnrichmentSolConverter.unmarshal()?

It is a method that was generated to support some DS changes in prev
versions.
Should I try to get rid of this converter?

I do not know if this helps but the code of the method is 

public Object unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext arg1) {
                if (! reader.hasMoreChildren()) 
                        return null;
                
                Class cType = arg1.getRequiredType();
                reader.moveDown();
                try
                {
                        String nodeName = reader.getNodeName();         
                        boolean prevVer = false;
                        float[][]  rawPVals=null, relativeFreqs=null;
                        double minRawPVal=2;
                        if(nodeName.equals("rawPVals")){ //funcAnal prev 
version{
                                prevVer = true;
                                rawPVals = 
(float[][])arg1.convertAnother(arg1.currentObject(),
float[][].class);
                        }else 
if(nodeName.equals("relativeFreqs")){//PromAnalSol prevVersion
                                prevVer = true;
                                relativeFreqs = 
(float[][])arg1.convertAnother(arg1.currentObject(),
float[][].class);
                        }
                        if(!prevVer){//default converter can do the work
                                reader.moveUp();
                                Converter defaultConverter =
conLookup.lookupConverterForType(GeneralSolution.class);
                                Object res =  
defaultConverter.unmarshal(reader, arg1);
                                return res;//defaultConverter.unmarshal(reader, 
arg1);
                        }
                        Hashtable hitsHash=null, pwmLengthHash=null;
                        String seqsFilePath=null ;
                        reader.moveUp();
                        reader.moveDown();
                        String next = reader.getNodeName();
                        if(cType.equals(FuncAnalSol.class)){
                                minRawPVal = 
Double.parseDouble(reader.getValue());
                                reader.moveUp();
                                reader.moveDown();
                        }
                        else//PromoterAnalSol
                        {
                                hitsHash =  
(Hashtable)arg1.convertAnother(arg1.currentObject(),
Hashtable.class);
                                reader.moveUp();
                                reader.moveDown();
                                pwmLengthHash =  
(Hashtable)arg1.convertAnother(arg1.currentObject(),
Hashtable.class);
                                reader.moveUp();
                                reader.moveDown();
                                seqsFilePath = 
(String)arg1.convertAnother(arg1.currentObject(),
String.class);
                                reader.moveUp();
                                reader.moveDown();
                                
                        }
                 next = reader.getNodeName();
                        
                        
                        String[] catNames = 
(String[])arg1.convertAnother(arg1.currentObject(),
String[].class);
                        reader.moveUp();
                        reader.moveDown();
                        if(reader.getNodeName().equals("coverage")){
                                reader.moveUp();
                                reader.moveDown();
                        }
                        float[][] freqs = 
(float[][])arg1.convertAnother(arg1.currentObject(),
float[][].class);
                        reader.moveUp();
                        reader.moveDown();
                        float[][] pVals = 
(float[][])arg1.convertAnother(arg1.currentObject(),
float[][].class);
                        reader.moveUp();
                        reader.moveDown();
                        String[][][][] enrichmntGenes =
(String[][][][])arg1.convertAnother(arg1.currentObject(),
String[][][][].class);
                        reader.moveUp();
                        reader.moveDown();
                        reader.moveUp();
                        reader.moveDown();
                        double threshPVal = 
Double.parseDouble(reader.getValue());
                        reader.moveUp();
                        reader.moveDown();
                        if(relativeFreqs == null)
                                relativeFreqs = freqs;
                        ArrayList<EnrichmentResult> enrichments =
generateEnrichmentsList(catNames/*,coverage*/, relativeFreqs, 
                                        pVals, rawPVals,enrichmntGenes, 
threshPVal );
                        
                        String baseSetsKey = reader.getValue();
                        reader.moveUp();
                        reader.moveDown();
                        String studyID = reader.getValue();
                        reader.moveUp();
                        reader.moveDown();
                //      double minPVal = Double.parseDouble(reader.getValue());
                        reader.moveUp();
                        reader.moveDown();
                        ArrayList opInfo = (ArrayList)  
arg1.convertAnother(arg1.currentObject(),
ArrayList.class);
                        reader.moveUp();
                        reader.moveDown();
                        reader.moveUp();
                        reader.moveDown();
                        String solName = reader.getValue();
                        reader.moveUp();
                        reader.moveDown();
                        IOStorage opInput = 
(IOStorage)arg1.convertAnother(arg1.currentObject(),
IOMgr.class);
                        reader.moveUp();
                        reader.moveDown();
                        String key = reader.getValue();
                        reader.moveUp();
                        EnrichmentSol res=null;
                        if(cType.equals(FuncAnalSol.class))
                                        res = new FuncAnalSol(solName, opInfo, 
opInput, catNames,enrichments,
baseSetsKey,studyID,baseSetsDetector);
                        else if(cType.equals(PromoterAnalSol.class)){
                                res = new PromoterAnalSol(solName, opInfo, 
opInput,
catNames,enrichments, baseSetsKey,studyID,baseSetsDetector, hitsHash,
pwmLengthHash);
                                
((PromoterAnalSol)res).setSeqsFilePath(seqsFilePath);
        
                        }
                        if(res!=null)
                                res.setKey(key);
                        return res;
                }
                catch(Exception e){
                        e.printStackTrace();
                        return null;
                }
        
                
        }

If this is not what you meant then which method are you referring to?

Thanks
Adi


Jörg Schaible-3 wrote:
> 
> Hi Adi,
> 
> adimaron wrote:
> 
>> 
>> Thanks for you reply.
>> The full stack was as follows:
> 
> [snip]
> 
>> Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException:
>> edu.tau.compbio.io.IOMgr-Constraints
>> at
>> 
> com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:56)
> 
> [snip]
> 
> As already seen here:
> 
>> Details: com.thoughtworks.xstream.converters.ConversionException: Could
>> not call edu.tau.compbio.util.OrderedHash.readObject() :
>> edu.tau.compbio.io.IOMgr-Constraints
>> ---- Debugging information ----
>> message             : Could not call
>> edu.tau.compbio.util.OrderedHash.readObject()
>> cause-exception     :
>> com.thoughtworks.xstream.mapper.CannotResolveClassException
>> cause-message       : edu.tau.compbio.io.IOMgr-Constraints
> 
> [snip]
> 
>> The IOMgr is my class and it uses OrderedHash which is also my class.
>> Will it help if I put the code?
> 
> It does not complain about "edu.tau.compbio.io.IOMgr", it complains about
> a 
> type "edu.tau.compbio.io.IOMgr-Contraint". Seems to be an inner class.
> 
>> When I tried adding the code from the compatibility link that you
>> suggested to support 1.1 objects
>> Which is initializing xstream as follows:
>> 
>> XStream xstream = new XStream(new XppDriver(new
>> XStream11XmlFriendlyReplacer())) {
>>     protected boolean useXStream11XmlFriendlyMapper() {
>>         return true;
>>     }
>> };
>> 
>> 
>> I got a whole different exception:
>> java.lang.IndexOutOfBoundsException: only START_TAG can have attributes
>> at org.xmlpull.mxp1.MXParser.getAttributeValue(MXParser.java:1005)
>> at
>> com.thoughtworks.xstream.io.xml.XppReader.getAttribute(XppReader.java:139)
>> at
>> 
> com.thoughtworks.xstream.io.ReaderWrapper.getAttribute(ReaderWrapper.java:52)
>> at
>> 
> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:421)
>> at
>> 
> com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:233)
>> at
>> 
> expander.io.converters.EnrichmentSolConverter.unmarshal(EnrichmentSolConverter.java:72)
> 
> 
> What does this method? It seems to corrupt the state of the parser. To me
> it 
> looks as if you run now in the next problem, but the type from above can
> be 
> resolved now.
> 
> [snip]
> 
> - Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 
-- 
View this message in context: 
http://old.nabble.com/ConversionException-when-using-XStream-1.4.2-caused-by-CannotResolveClassException-tp34199308p34209571.html
Sent from the xstream - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to