IllegalArgumentException with Constructor.newInstance

Hi,

I am having problem in the following piece of code . Its giving exception atcode line

Servant tieInstance = (Servant) tieConstructor.newInstance(constructorArgs);

Can you plz let me know what might be the problem.

private Servant createTie()

{

String className = getClassNameForTie();

className = className.substring(className.lastIndexOf(46) + 1, className.length() - 4);

String tieName = getTieClassPackage() + "." + className +

TIE_CLASSNAME_POSTFIX;

try

{

Class tieClass = Class.forName(tieName);

Constructor tieConstructor = tieClass.getDeclaredConstructors()[0];

Object constructorArgs[] = new Object[2];

constructorArgs[0] = this;

constructorArgs[1] = PDMEServer.getTheRootPOA();

System.out.println("00000 constructorArgs[0]= " + constructorArgs[0]);

System.out.println("11111 constructorArgs[1]= " + constructorArgs[1]);

Servant tieInstance = (Servant) tieConstructor.newInstance(constructorArgs);

return tieInstance;

}

catch(ClassNotFoundException ex)

{

MappingFaultHandler.unexpectedException(this, ex, false);

}

catch(IllegalAccessException ex)

{

MappingFaultHandler.unexpectedException(this, ex, false);

}

catch(InstantiationException ex)

{

MappingFaultHandler.unexpectedException(this, ex, false);

}

catch(InvocationTargetException ex)

{

MappingFaultHandler.unexpectedException(this, ex, false);

}

catch(IllegalArgumentException ex)

{System.out.println("*********** IllegalArgumentException caught");

MappingFaultHandler.unexpectedException(this, ex, false);

}

return null;

}

[1771 byte] By [amitproda] at [2007-11-27 3:21:20]
# 1
what does the constructor for the class that getClassNameForTie() names look like?
georgemca at 2007-7-12 8:24:04 > top of Java-index,Core,Core APIs...