Hi Thomas, I have some classes loaded by custom URL class loaders at runtime. I have set that property with the -D switch for my application.
That leads to the following stacktrace: Thread [Thread-70] (Suspended) owns: HashMap<K,V> (id=58) Utils.<clinit>() line: 76 <--- static block refers to SysProperties.JAVA_OBJECT_SERIALIZE, but that static field has not been initialized yet (as the Sysproperties clinit is still running) SysProperties.<clinit>() line: 51 <--- initialization of SysProperties class is still in progress Engine.<init>() line: 32 Engine.<clinit>() line: 29 [local variables unavailable] [...] Kind regards, Christoff Schmitz F I N A R I S Financial Software Partner GmbH Sömmerringstrasse 23 60322 Frankfurt am Main Fon: +49 (0)69 / 254 98 - 24 Mobile: +49 (0)176 / 206 34 186 Fax: +49 (0)69 / 254 98 - 50 eMail: mailto:christoff.schm...@finaris.de www: http://www.finaris.de und http://www.rapidrep.com From: Thomas Mueller <thomas.tom.muel...@gmail.com> To: H2 Google Group <h2-database@googlegroups.com> Date: 2015-04-27 15:41 Subject: Re: [h2] Re: Serialization issue Sent by: h2-database@googlegroups.com Hi Sim, > Can't you create your own topic? I don't understand. As far as I see, it _is_ a separate topic (email subject). > I have set a custom serializer for Java object contained in columns of type OTHER Why can't you use the default serialization mechanism? What problem do you want to solve? > because the Utils class is loaded when the SysProperties class is loaded Yes. Why can't you set the system property before it is loaded? Regards, Thomas On Mon, Apr 27, 2015 at 2:28 PM, sim <sim...@mail.ru> wrote: Hi, Can't you create your own topic? On Monday, April 27, 2015 at 2:51:51 PM UTC+3, schmitzc wrote: Hi, I have set a custom serializer for Java object contained in columns of type OTHER (added JAVA_OBJECT_SERIALIZER='custom.h2.Serializer' to the connect string) In H2 code, there are 2 calls to Utils.serialize (H2 1.3.176) [or JdbcUtils.serialize (in H2 1.4.187)] that pass a NULL argument for the data handler parameter. Unfortunatly, my code runs into one of these (in org.h2.value. ValueJavaObject), and my custom serializer is not used. Additionally, I tried to use the system propoerty "h2.javaObjectSerializer". But this did not help either (H2 1.3.176), because the Utils class is loaded when the SysProperties class is loaded (due to public static final String FILE_ENCODIN = Utils.getProperty( "file.encoding", "Cp1252")). At that point of time, the SysProperties class is not fully initialized yet, and the static block in Utils always refers to NULL as serializer class name. Seems a bit buggy to me. Currently, my only workaround is setting the member "public static JavaObjectSerializer serialize" of class Utils directly from my application (H2 is used as embedded database). Kind regards, Christoff Schmitz F I N A R I S Financial Software Partner GmbH Sömmerringstrasse 23 60322 Frankfurt am Main Fon: +49 (0)69 / 254 98 - 24 Mobile: +49 (0)176 / 206 34 186 Fax: +49 (0)69 / 254 98 - 50 eMail: mailto:christoff.schm...@finaris.de www: http://www.finaris.de und http://www.rapidrep.com ================================================================================================================ Disclaimer The information contained in this e - mail and any attachments ( together the "message") is intended for the addressee only and may contain confidential and/or privileged information. If you have received the message by mistake please delete it and notify the sender and do not copy or distribute it or disclose its contents to anyone. FINARIS Financial Software Partner GmbH, Sömmerringstr. 23, 60322 Frankfurt/Main, Germany Registered at Frankfurt/Main, HRB 52873, Managing Directors: Dipl. Inf. Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl ================================================================================================================ -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout. ================================================================================================================ Disclaimer The information contained in this e - mail and any attachments ( together the "message") is intended for the addressee only and may contain confidential and/or privileged information. If you have received the message by mistake please delete it and notify the sender and do not copy or distribute it or disclose its contents to anyone. FINARIS Financial Software Partner GmbH, Sömmerringstr. 23, 60322 Frankfurt/Main, Germany Registered at Frankfurt/Main, HRB 52873, Managing Directors: Dipl. Inf. Hermann Friebel, Dipl. Ing. Kai Bächle, Dipl. Inf. Werner Märkl ================================================================================================================ -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To post to this group, send email to h2-database@googlegroups.com. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.