From: George T. <geo...@fr...> - 2005-12-23 14:27:12
|
> Hi, > > [...] >>> org.tmapi.core.TopicMap tm; >>> AssociationRole ar = (AssociationRole)tm.getObjectById(idAssocRole); > >>> java.lang.StackOverflowError >> [...] >>> if the idAssocRole is not correct, the call gives null, >>> but if the idAssocRole is correct, StackOverflowError > > I think I've found the failure. > The method > Object wrap(Object obj, TMAPITopicMapImpl tm) > > forgets an argument (the player) if the "obj" is a Member instance and > calls itself again and again. It should call > AssociationRole wrap(org.tm4j.topicmap.Member obj, > org.tm4j.topicmap.Topic player, > TMAPITopicMapImpl tm) > > Maybe the attached patch helps. > Note, that the patch is only a hack (see the TODO annotation) and is > not tested. > > Best regards, > Lars > -- > http://semagia.com Hello, up to now I was using TM4J binary release, in order to use your patch, I removed the jars tm4j-0.9.8.jar tm4jadmintool-0.9.8.jar tm4jdbc-0.9.8.jar tm4j-tmapi-0.9.8.jar tm4j-tologx-0.9.8.jar tm4ozone-0.9.8.jar and I included the sources into my project. (I have a Hibernate database) I suppose there is something I am not doing it in the right way and when the TMAPITopicMapImpl.getHelperObject (Class interfaceClass) calls HelperObjectMap.getHelperObjectClassName(interfaceClass.getName()); here are my results... public static String getHelperObjectClassName(String interfaceName) { System.out.println (interfaceName); //prints: org.tmapi.index.core.TopicsIndex if (instance == null) instance = new HelperObjectMap(); if (instance.m_cache.containsKey(interfaceName)) { return (String)instance.m_cache.get(interfaceName); } // Step 1: Look up mapping in system properties String implClassName = System.getProperty(interfaceName); System.out.println ("implClassName"); System.out.println (implClassName!=null); //prints: false <<<<<<<<<<<<<<<< // Step 2: Lookup the mapping in JRE_DIR/lib/tmapi.properties if (implClassName == null) { implClassName = instance.m_props.getProperty(interfaceName); System.out.println (implClassName!=null); //prints: false <<<<<<<<<<<<<<<< } // Step 3: Look up the mapping in META-INF/services resource directory if (implClassName == null) { URL u = instance.getClass().getResource("/META-INF/services/" + interfaceName); System.out.println (u!=null); //prints: false <<<<<<<<<<<<<<<< if (u != null) { System.out.println (u.toString()); BufferedReader rdr = null; try { rdr = new BufferedReader(new InputStreamReader(u.openStream())); implClassName = rdr.readLine(); } catch (IOException e) { m_log.error("Unable to read JAR services entry " + interfaceName + ". ", e); } finally { try { if (rdr != null) rdr.close(); } catch (IOException ex) { // Ignore failure to close the stream. } } } } System.out.println (implClassName!=null); //prints: false <<<<<<<<<<<<<<<< if (implClassName != null) instance.m_cache.put(interfaceName, implClassName); return implClassName; //returns null <<<<<<<<<<<<<<<< } I have also included the META-INF/services in my .jar file what could be the problem? Thank you in advance. Cheers ____________________________________________________________________ http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ. http://www.freemail.gr - free email service for the Greek-speaking. |