robert burrell donkin wrote:

AFAIK only enclosing instances of enclosing classes are allowed to create instances of inner classes. (whether by reflection or directly.)

so, if it's an inner class (as opposed to a nested static class) then one solution would be to use an FactoryCreateRule and an implementation of ObjectCreationFactory which is also an enclosing class for the inner class.
Thanks. I will read JLS next time before :-) That worked the way you described.

-- Jeanfrancois


- robert

On Saturday, January 11, 2003, at 03:24 AM, Jeanfrancois Arcand wrote:

Hi,

before investigating further, I would like to see if somebody else have seen this problem (or aware of...nothing in bugzilla). I have a framework that use the digester this way:

public class HandlerChainDispatcher{

[...]

protected void loadConfiguration(){ Digester digester = new Digester();
digester.setValidating(false);
digester.addObjectCreate("dispatcher/protocol-
mappings/protocol-mapping", ProtocolMappingConfig.class); [...]
ProtocolMappingConfig is an inner class of HandlerChainDispatcher. ProtocolMappingConfig has a default constructor and it is not abstract.

I'm always having this exception:

[java] java.lang.InstantiationException: HandlerChainDispatcher. $ProtocolMappingConfig
[java] at [java] at java.lang.Class.newInstance0(Class.
java:291)
[java] at java.lang.Class.newInstance(Class.java:259)
[java] at org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.ja
va:253)

I have tried making the inner class final without success.

My framework is very simple and doesn't use special classloader. I'm trying to track down the problem (and fix it). Any ideas?

Thanks,

-- Jeanfrancois




--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED].
org>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED].
org>


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to