From: Pier F. S. <p.s...@we...> - 2004-03-02 11:00:18
|
Hello I tried to run the HAPI under Tomcat enviroment (tomcat 4.1.27) but I found the following problem: ca.uhn.hl7v2.HL7Exception: Couldn't create Message object of type ADT_A08 at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:222) at ca.uhn.hl7v2.app.Responder.processMessage(Responder.java:139) at ca.uhn.hl7v2.app.Receiver$Grunt.run(Receiver.java:115) Caused by: ca.uhn.hl7v2.HL7Exception: No map found for version 2.3.1 at ca.uhn.hl7v2.parser.Parser.getMessageStructureForEvent(Parser.java:390) at ca.uhn.hl7v2.parser.Parser.findMessageClass(Parser.java:263) at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:209) ... 2 more The problem was about the SystemClassLoader. Tomcat, such as many server applications, installs a variety of class loaders. When you deploy a resource (like properties files) under a WebApp, you must use the getResourceAsStream() instead of getSystemResourceAsStream() to retrieve this rosource. So I have changed: InputStream in = Parser.class.getClassLoader().getSystemResourceAsStream(resource); in InputStream in = Parser.class.getClassLoader().getResourceAsStream(resource); in the loadMessageStructures() method of Parser class and all seems to be ok. Is it a bug? this is a valid solution? More information can be found at: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html Hi, Piero. -------------------------------------- Dott. Pier Francesco Sormani Synapsis S.r.l. in Computer Science P.zza Dante, 19/20 57121 Livorno Phone: +39 0586 426790 fax: +39 0586 443954 www.websynapsis.com -------------------------------------- |