Which exact version of JBoss AS is this? And since this is EJB3, you don't have to do PortableRemoteObject.narrow:
Object ref1 = jndiContext.lookup(className);
T session = (T) new PortableRemoteObject().narrow( ref1, classOfT);
return session;
Change that to directly return the object that was looked up. Also please post the relevant EJB3 code/configs.