Hi

I have a spring bean/object which has the type "x.x.x". The type x.x.x is a class which is derived from Spring.Objects.Factory.IFactoryObject. It implements ObjectType and GetObject as per usual and the Spring config injects into the Type property, setting it to "y.y.y".

This all works perfectly, in code, I can get the instance of type "y.y.y" from the application context no problem.

Now I need to dynamically choose between two factory types at runtime, "x.x.x" or "x2.x2.x2", so I'm using a config property in place of the type definition:

<object id="ob1" type="$props{which.type}" ... etc...

The Spring config loads okay and, in fact, if I point which.type to something bogus, it fails so the config replacement appears to be working correctly.

The problem is that when I try and get the instance of type "y.y.y" programmatically from the applicationContext, it can't find any values of that type. All that has changed is the factory type substitution which appears to be working.

Any ideas? Pulling my hair out a bit...

Thanks