Update : it works ! After hours at night trying various solutions, and of course making many mistakes (like forgotting to replace '/' by '.', or to use the FQCN instead of the class name when classloading teh classes), I finally get it working...
I still have to cleanup the code, but I think I'll be able to commit the fix this week-end - if my little stinky gives me some free time ;-) On Tue, Apr 11, 2017 at 10:40 AM, Emmanuel Lecharny <[email protected]> wrote: > So a quick update : > > as expected, it's more complicated than expected. Using a JAR is the way > to go, but the dedicated class loader has to be modified to deal with the > use case. First, we should still accept plain classes, but should consider > the possibility that what we get is a jar. > > In this case, we can't simply class load the class, we need to 'open' the > jar, select the class, and do the same thing with the inner static class. > I'm in the process of modifying the class loader to do that. > > > On Mon, Apr 10, 2017 at 4:13 AM, Emmanuel Lecharny <[email protected]> > wrote: > >> Ok, so here is the situation : >> Previously, we were using the syntaxChecker class file as a block of >> data being sent to the server, and classloaded. Then as it was a class that >> can be instanciate, we were creating an instance and executed it. >> >> Now, the problem is that the new SyntaxChecker has an inner class, which >> leads to get the class split in 3 different files instead of one, so when >> we take only one of those files, we don't have the inner class available. >> >> I guess that the data must be a Jar at this pont, instead of just a >> .class file. >> >> Unless someone has a better idea ? >> >> Note that I think using a jar is probably a better idea in the long run... >> >> On Sun, Apr 9, 2017 at 7:08 AM, Emmanuel Lécharny <[email protected]> >> wrote: >> >>> >>> >>> Le 02/04/2017 à 14:49, Stefan Seelmann a écrit : >>> > On 03/26/2017 01:40 PM, Emmanuel Lécharny wrote: >>> >> I'm almost done with the refactoring of SyntaxCheckers, having added a >>> >> Builder inner class to all of them. I just have to deal with the >>> >> TelephoneNumber SC which is slightly more complex, but it will be done >>> >> by tonite. >>> > Thanks Emmanuel, >>> > >>> > in ApacheDS there were some test failures. >>> > >>> > One was a NPE in TelephoneNumberSyntaxChecker, when that was loaded via >>> > DefaultSchemaManager the regexp/pattern fields were null. Fixed here: >>> > http://svn.apache.org/viewvc?rev=1789879&view=rev >>> > >>> > Other tests load the syntax checker via bytecode from schema. This >>> > doesnt' work anymore because now the class contains the inner Builder >>> > class, so on class loading two classes need to be loaded. Either we >>> need >>> > two bytecode attributes values or concatentate them and make the >>> > SchemaEntityFactory handle that. In the meantime I disabled the tests: >>> > http://svn.apache.org/viewvc?rev=1789880&view=rev >>> >>> I'm fighting with this one. The thing is that the bytecode is outdated, >>> and creating a new one is about copying what has been generated by >>> shared, but as there is an inner class, it's not that easy. >>> >>> I will get it working... >>> >>> -- >>> Emmanuel Lecharny >>> >>> Symas.com >>> directory.apache.org >>> >>> >> >> >> -- >> Regards, >> Cordialement, >> Emmanuel Lécharny >> www.iktek.com >> > > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
