Hi Stefan, Thanks for the response - I'll give it a shot.
Re. the factory... FWIW I sometimes think that code gets "over patterned". I only use the factory pattern when I have a realistic expectation that the implementation of an interface is likely to be done in another way (ie. a socket implementation and an RMI implementation of a remote service). If not, then good old constructors with a reasonable set of defaults and overloaded with various parameters make life easier. Less objects is always better unless there is a need for them. In the same way that the core schema is read only and in the jar resource path, you can do the same with default properties read in constructors. Which leads me to... My app is a layered OSGI app and I want to embed ApacheDS in an OSGI bundle. I've noticed some text about OSGI on the website - is that very far advanced? If not, I'm happy to help out... I'm not a big fan of Spring (I also think you can get "over frameworked") in the OSGI space and so the config of ApacheDS looks like a prime candidate for some refactoring to use the osgi config management facility at the same time it is registered as a service. Is there any interest for some help in that space? Cheers...Pete On 26/03/2010, at 4:46 PM, Stefan Zoerner wrote: > Hi Peter! > > Peter Horne wrote: >> Thanks for the replies and I'll look forward to the updates. One place >> where you may want to start is with installer/apacheds-noarch. As I was >> trying to work out what was wrong with my code, I thought I'd get it >> (installer/apacheds-noarch) going and then make some exploratory changes. >> It worked fine after a maven build and running the apacheds.sh script. >> However when I removed arg[0] from the script (target/plan/server.xml) to >> make it use the defaults, it crashed with the same exception that my code >> had... Exception in thread "main" java.lang.NullPointerException at >> org.apache.directory.server.core.schema.DefaultSchemaService.initialize(DefaultSchemaService.java:382) >> at >> org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1425) >> at >> org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:907) > > > This is the same error I ran into when I tried to update the example for the > custom partition example found here: > > http://directory.apache.org/apacheds/1.5/61-how-to-write-a-simple-custom-partition-for-apacheds.html > > Problem was the way I created the DirectoryService. The SchemaManager was > missing afterwards. > > Currently I do the following > > ... > DirectoryServiceFactory factory = DefaultDirectoryServiceFactory.DEFAULT; > factory.init("default"); > DirectoryService directoryService = factory.getDirectoryService(); > ... > > which works. There is a discussion on our dev-list about whether this is the > intended and most easiest way to accomplish the task programmaticaly. > > http://mail-archives.apache.org/mod_mbox/directory-dev/201003.mbox/%[email protected]%3e > > Feel free to join the discussion. Sorry for the inconvenience. > Greetings from Bielefeld, > StefanZ >
