You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2008/01/06 00:23:40 UTC
[RANT] Stupid configuration and all those idiotic XML
<rant>
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 :
<spring:bean id="systemContextEntry"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<spring:property name="targetObject"><spring:ref
local='directoryService'/></spring:property>
<spring:property
name="targetMethod"><spring:value>newEntry</spring:value></spring:property>
<spring:property name="arguments">
<spring:list>
<spring:value xmlns="http://www.springframework.org/schema/beans">
ou=system
</spring:value>
<spring:value xmlns="http://www.springframework.org/schema/beans">
objectClass: top
objectClass: organizationalUnit
objectClass: extensibleObject
ou: system
</spring:value>
</spring:list>
</spring:property>
</spring:bean>
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.<init>(FileSystemXmlApplicationContext.java:149)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(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 !
</rant>
yes, I'm just pissed off ;(
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [RANT] Stupid configuration and all those idiotic XML
Posted by Emmanuel Lecharny <el...@gmail.com>.
Graham Leggett wrote:
> Emmanuel Lecharny wrote:
>
>> 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' ?
>
> I share you pain, truly I do. :(
Thanks Graham ! And Happy new year btw :)
I'm a little bit better this morning, after having slept a bit, so I
will try to fix this problem... Sometime, you just need to share your
feelings, not that it helps, but it's better than to beat somebody
randomly just to get some relief.
I also have to buy a new keyboard ;)
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [RANT] Stupid configuration and all those idiotic XML
Posted by Graham Leggett <mi...@sharp.fm>.
Emmanuel Lecharny wrote:
> 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' ?
I share you pain, truly I do. :(
Regards,
Graham
--
Re: [RANT] Stupid configuration and all those idiotic XML
Posted by David Jencks <da...@yahoo.com>.
You are running into problems because you are trying to do something
that is extremely tricky with a circular dependency between
components. I.e., an extremely bad idea in a component oriented
project and probably in any project.
Circular dependency:
ds needs partitions before it's completely initialized
partitions need server entry before they are completely initialized,
ready to go into the ds
server entry comes from ds.
Asking any component system to handle this kind of circular
dependency is ridiculous IMO, and any code you write to do it is
going to be impossible for the naive user to understand and likely to
be prone to very subtle bugs that everyone will spend weeks trying to
diagnose.
I suspect if you construct a bootstrap server entry factory component
that can be used by the partitions used by ds a lot of the problems
will go away.
You can also do things like having a server entry data object that is
injected into the partition and the partition can figure out how to
turn it into a server entry.
From what I've heard on IRC I think I'd recommend:
1. a Registries bean that starts up with the bootstrap registries.
2. partitions get a ref to the registries bean and get a server entry
data object (using a property editor). They construct the
ServerEntry themselves.
3. ds gets a reference to the registries bean; it uses the bootstrap
registries as needed and can tell the registries bean to replace the
registries with the correct ones when it knows what they are.
You might be able to replace (2) with some kind of factory bean
arrangement but unless you can find some really simple spring syntax
to make it work I don't think its worth the trouble.
One nice thing about spring is that the xml makes it pretty clear how
the components are hooked up together and just about everyone
understands how to use it. Writing your own component framework (or,
IMO, even putting the configuration data in the DIT) will make it
much harder for non-insiders to quickly see how the server is put
together and harder to customize it.
thanks
david jencks
On Jan 5, 2008, at 3:23 PM, Emmanuel Lecharny wrote:
> <rant>
> 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 :
>
> <spring:bean id="systemContextEntry"
>
> class="org.springframework.beans.factory.config.MethodInvokingFactoryB
> ean">
> <spring:property name="targetObject"><spring:ref
> local='directoryService'/></spring:property>
> <spring:property name="targetMethod"><spring:value>newEntry</
> spring:value></spring:property>
> <spring:property name="arguments">
> <spring:list>
> <spring:value xmlns="http://www.springframework.org/schema/
> beans">
> ou=system
> </spring:value>
> <spring:value xmlns="http://www.springframework.org/schema/
> beans">
> objectClass: top
> objectClass: organizationalUnit
> objectClass: extensibleObject
> ou: system
> </spring:value>
> </spring:list>
> </spring:property>
> </spring:bean>
>
> 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.JdbmPartit
> ion] 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.JdbmPartit
> ion] 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.AbstractAutowireCapableBeanF
> actory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:
> 1105)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.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.AbstractAutowireCapableBeanF
> actory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:
> 1099)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.populateBean(AbstractAutowireCapableBeanFactory.java:861)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.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.resolveC
> onstructorArguments(ConstructorResolver.java:389)
> at
> org.springframework.beans.factory.support.ConstructorResolver.autowire
> Constructor(ConstructorResolver.java:120)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:
> 799)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.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.p
> reInstantiateSingletons(DefaultListableBeanFactory.java:287)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh
> (AbstractApplicationContext.java:352)
> at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>
> (FileSystemXmlApplicationContext.java:149)
> at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>
> (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 !
>
> </rant>
>
> yes, I'm just pissed off ;(
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
Re: [RANT] Stupid configuration and all those idiotic XML
Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi Ole,
thanks for your support.
Sadly, what you are proposing is totally off-side. I ranted because I
felt like XML is just a PITA, and over-abusing it just makes the
situation even worse. Diving into the EMF soup will just make it a
little bit stickier...
Anyways, I will find my way out today, now that I cooled down and had
some sleep :)
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [RANT] Stupid configuration and all those idiotic XML
Posted by Ole Ersoy <ol...@gmail.com>.
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:
> <rant>
> 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 :
>
> <spring:bean id="systemContextEntry"
>
> class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
> <spring:property name="targetObject"><spring:ref
> local='directoryService'/></spring:property>
> <spring:property
> name="targetMethod"><spring:value>newEntry</spring:value></spring:property>
> <spring:property name="arguments">
> <spring:list>
> <spring:value xmlns="http://www.springframework.org/schema/beans">
> ou=system
> </spring:value>
> <spring:value xmlns="http://www.springframework.org/schema/beans">
> objectClass: top
> objectClass: organizationalUnit
> objectClass: extensibleObject
> ou: system
> </spring:value>
> </spring:list>
> </spring:property>
> </spring:bean>
>
> 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.<init>(FileSystemXmlApplicationContext.java:149)
>
> at
> org.apache.xbean.spring.context.FileSystemXmlApplicationContext.<init>(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 !
>
> </rant>
>
> yes, I'm just pissed off ;(
>