Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 33984 invoked from network); 6 Jan 2008 04:31:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jan 2008 04:31:35 -0000 Received: (qmail 49046 invoked by uid 500); 6 Jan 2008 04:31:23 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 49007 invoked by uid 500); 6 Jan 2008 04:31:23 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 48996 invoked by uid 99); 6 Jan 2008 04:31:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Jan 2008 20:31:23 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ole.ersoy@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Jan 2008 04:30:57 +0000 Received: by py-out-1112.google.com with SMTP id f31so3028863pyh.19 for ; Sat, 05 Jan 2008 20:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=QFLay6aRfcuDNOZVSe+V+Il+HXkhbiabaf0seP7Tyx8=; b=GwwjmfWmwKs58848JTZ+IkRorkMVLL5IztBg6YaVRlAU9vGz456eH5dgEikGR+KHd2m+xoV4eeFtZzTOQ1Uz6hJDF5JiSDzFlA7HyNpX4GekCxW1PAzm8eiIpMoTcKFwHEzLEs2vQSE7t4xbE7VH6xT1VWcSnranx3mzDfejenU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=tH2LSZNL/jCnnwOi8eVwodUG6Pk/iSnGxvM1K8uFo6mmbxnUUVbi9Yg5fuBlYaGR6DdPuUisjQPPhwvyLDM0aamraw79aO8ugYkIoRevRGl7WbVB+8fWZDqxwWyo4QdKru0qTZBiF0Kgb/TcXyfYKhzkEIkimEx/bXSVG1dgsV0= Received: by 10.65.81.10 with SMTP id i10mr38847513qbl.75.1199593861912; Sat, 05 Jan 2008 20:31:01 -0800 (PST) Received: from localhost.localdomain ( [98.193.70.182]) by mx.google.com with ESMTPS id a16sm1060432rof.3.2008.01.05.20.30.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Jan 2008 20:30:59 -0800 (PST) Message-ID: <47805981.6020207@gmail.com> Date: Sat, 05 Jan 2008 22:30:57 -0600 From: Ole Ersoy User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: [RANT] Stupid configuration and all those idiotic XML References: <4780117C.2050808@gmail.com> In-Reply-To: <4780117C.2050808@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Emmanuel, Happy new year. It does look like development could be a little friendlier in this case. David mentioned that there's a circular dependency that needs to be handled delicately and it looks like the trace should have a built in fast track fixer as well. It seems like what you are trying to do should be really simple. Just load some xml to get a component initialized so you can run some tests using the initialized component? When I do that type of stuff I usually create an EMF model (from an XML Schema definition or Annotated Java Interfaces) and generate the code for it. This results in the java beans that will store the configuration. Then for testing I just create instance of the beans and initialize them programmatically. Then the initialized configuration gets passed to the objects that do the work... If you think this type of approach might be helpful I can help explore it more with real world code, etc. Wish I had some simpler more rapid fixes to suggest. If you describe the general process being done in more detail maybe we could come up with some simpler solutions. One thing that did come to mind as I was reading David's reply is configuration validation. It sounds like two components are being initialized and if one component's configuration is invalid, the other one gets hosed. So just validating the configuration of the bean could provide better messages for debugging. EMF also has a nice validation framework for that type of stuff. Cheers, - Ole Emmanuel Lecharny wrote: > > Now, I'm really pissed off ! > > I have spent a full day and almost last night to get something supposely > simple to get working. No way. > > I may be totally stupid, but considering the committer status is being > meritocratic, I guess that users will be totally fooled by the current > configuration we have. > > I just can't stand to loose my time to try to setup a f***ing xml file > to understand what I basically want to do : initialize a bloody java > structure with a list of elements. Period. Prerequisite : having some > access to preset data... > > I'm just lost in hundred of stack traces more stupid than the previous > hundred ones, and it seems to be a maze without exit. > > WTF for X sake do we have to write such a piece of garbage : > > > class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> > local='directoryService'/> > name="targetMethod">newEntry > > > > ou=system > > > objectClass: top > objectClass: organizationalUnit > objectClass: extensibleObject > ou: system > > > > > > just to call a bloody method with two arguments, to get this as a result : > > _ _ ____ ____ / \ _ > __ __ _ ___| |__ ___| _ \/ ___| / _ \ | '_ \ / _` |/ __| > '_ \ / _ \ | | \___ \ / ___ \| |_) | (_| | (__| | | | __/ |_| > |___) | /_/ \_\ .__/ \__,_|\___|_| |_|\___|____/|____/ > > |_| > Exception in thread "main" > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'MainADS' defined in URL > [file:/home/elecharny/apacheds/bigbang/installers/apacheds-noarch/server.xml]: > Cannot resolve reference to bean 'directoryService' while setting > constructor argument; nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name 'directoryService' defined in URL > [file:/home/elecharny/apacheds/bigbang/installers/apacheds-noarch/server.xml]: > Cannot create inner bean '(inner bean)' of type > [org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition] > while setting bean property 'systemPartition'; nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name '(inner bean)' defined in URL > [file:/home/elecharny/apacheds/bigbang/installers/apacheds-noarch/server.xml]: > Initialization of bean failed; nested exception is > org.springframework.beans.TypeMismatchException: Failed to convert > property value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry'; nested exception is java.lang.IllegalArgumentException: > Cannot convert value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry': no matching editors or conversion strategy found > Caused by: org.springframework.beans.factory.BeanCreationException: > Error creating bean with name 'directoryService' defined in URL > [file:/home/elecharny/apacheds/bigbang/installers/apacheds-noarch/server.xml]: > Cannot create inner bean '(inner bean)' of type > [org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition] > while setting bean property 'systemPartition'; nested exception is > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name '(inner bean)' defined in URL > [file:/home/elecharny/apacheds/bigbang/installers/apacheds-noarch/server.xml]: > Initialization of bean failed; nested exception is > org.springframework.beans.TypeMismatchException: Failed to convert > property value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry'; nested exception is java.lang.IllegalArgumentException: > Cannot convert value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry': no matching editors or conversion strategy found > Caused by: org.springframework.beans.factory.BeanCreationException: > Error creating bean with name '(inner bean)' defined in URL > [file:/home/elecharny/apacheds/bigbang/installers/apacheds-noarch/server.xml]: > Initialization of bean failed; nested exception is > org.springframework.beans.TypeMismatchException: Failed to convert > property value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry'; nested exception is java.lang.IllegalArgumentException: > Cannot convert value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry': no matching editors or conversion strategy found > Caused by: org.springframework.beans.TypeMismatchException: Failed to > convert property value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry'; nested exception is java.lang.IllegalArgumentException: > Cannot convert value of type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry': no matching editors or conversion strategy found > Caused by: java.lang.IllegalArgumentException: Cannot convert value of > type [java.lang.String] to required type > [org.apache.directory.server.core.entry.ServerEntry] for property > 'contextEntry': no matching editors or conversion strategy found > at > org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231) > > at > org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) > > at > org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:380) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1105) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421) > > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:215) > > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:127) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1099) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:861) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421) > > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) > > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) > > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261) > > at > org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109) > > at > org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:389) > > at > org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:120) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:799) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717) > > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:384) > > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) > > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) > > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) > > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287) > > at > org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352) > > at > org.apache.xbean.spring.context.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:149) > > at > org.apache.xbean.spring.context.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:48) > > at org.apache.directory.server.Service.init(Service.java:60) > at org.apache.directory.server.UberjarMain.main(UberjarMain.java:56) > > > Is it *supposed* to help ??? How many insanity like this will we support > before we can work on real stuff, like how to write a serious LDAP > server? Do we have to whip ourselves, crawl on sandpaper, walk on fire > just to be allowed to bring some line of not totally meaningless code, > or is there a way to get rid of all those shitty buzzwords called IOC, > XML, XSD, Spring, Xbean and any of such over rated and over abused so > called 'technologies' ? > > WE ARE LOOSING OUR TIME WITH ALL THOSE USELESS CRAPS !!! KISS, damn ! > > > > yes, I'm just pissed off ;( >