From: George T. <geo...@fr...> - 2005-12-21 16:09:31
|
Thank you, I will test it and I will reply to you about the results Cheers ----- Original Message ----- From: "Lars Heuer" <he...@se...> To: "George Tryfon" <geo...@fr...> Cc: <tm4...@li...> Sent: Wednesday, December 21, 2005 11:55 AM Subject: Re: [Tm4j-developers] TMAPI tm.getObjectById (id_association_role) -> StackOverflowError > 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 ____________________________________________________________________ http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ. http://www.freemail.gr - free email service for the Greek-speaking. |
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. |
From: Lars H. <he...@se...> - 2005-12-25 12:16:05
|
Hi George, [...] > up to now I was using TM4J binary release, > in order to use your patch, I removed the jars [...] > and I included the sources into my project. [...] Did you use the build.xml of TM4J? If I use it everything works fine. Just do a ant all or ant distrib-all and you get the libs with the current date as suffix. An alternative might be to modify or create your tmapi.properties file (see http://tmapi.org/guide/ar01s05s01.html#topicmapsystemfactory-lookup) If you've further problems, please provide more information what you've done to build TM4J from source. Best regards, Lars -- http://semagia.com |
From: George T. <geo...@fr...> - 2005-12-25 23:15:38
|
Hello Lars I build using build.xml and it works OK. Best regards, > Hi George, > > [...] >> up to now I was using TM4J binary release, >> in order to use your patch, I removed the jars > [...] > >> and I included the sources into my project. > [...] > > Did you use the build.xml of TM4J? > > If I use it everything works fine. > > Just do a > ant all > or > ant distrib-all > > and you get the libs with the current date as suffix. > > An alternative might be to modify or create your tmapi.properties file > (see > http://tmapi.org/guide/ar01s05s01.html#topicmapsystemfactory-lookup) > > If you've further problems, please provide more information what > you've done to build TM4J from source. > > Best regards, > Lars > -- > http://semagia.com > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Tm4j-users mailing list > Tm4...@li... > https://lists.sourceforge.net/lists/listinfo/tm4j-users ____________________________________________________________________ http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ. http://www.freemail.gr - free email service for the Greek-speaking. |