Skip to Content
Former Member
Apr 23, 2005 at 10:57 PM

Unable to co-locate ear files in same WAS instance


Hi all,

I have two J2EE apps, one depending on the other. Everything works fine, until I try to deploy them both in the same instance of the application server. If I run them both in the same instance of WAS, I get an IllegalArgumentException when I call create() on the Home interface. It appears that the underlying stub (dynamic proxy) is botched in some way. Here is a snippet from the stack trace:

java.lang.IllegalArgumentException: object is not an instance of declaring class

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(



at $Proxy11.create(Unknown Source)





The offending code looks like:

String initialContextFactory = "";

String url = "";

Properties env = new Properties();

env.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);

env.put(Context.PROVIDER_URL, url);

String user = "user";

String pw = "pw";

env.put(Context.SECURITY_PRINCIPAL, user);

env.put(Context.SECURITY_CREDENTIALS, pw);

try {

Context ctx = new InitialContext(env);

Object o = ctx.lookup(jndiName);

SBRegistryRemoteHome home = (SBRegistryRemoteHome)PortableRemoteObject.narrow(o, SBRegistryRemoteHome.class);

return home.create();

} catch (Exception e) {



The JNDI lookup works find, but all bombs on the home.create() method.

I suspect this may have something to do with classloading (duplicate class definitions, etc). Keep in mind, this all works fine if the applications are running in separate containers. Also, both apps are full on J2EE apps, not "application clients" in the J2EE sense.

I am running WAS early release 6.4 on window XP.

Anybody seen this before or know what the problem is?