Details
-
Bug
-
Resolution: Obsolete
-
Major
-
None
-
8.0.0.Alpha1
-
None
Description
In JBoss EAP6.1 Alfa and Beta during remote lookup for obejct that implements Referenceable the coresponding ObjectFactory is not called, as a result the Reference object is returned and not the real one.
Code example:
public class Fruit implements Referenceable {
String fruit;
public Fruit(String f)
{ fruit = f; }public Reference getReference() throws NamingException
{ return new Reference( Fruit.class.getName(), new StringRefAddr("fruit", fruit), FruitFactory.class.getName(), null); }public String toString()
{ return fruit; }}
public class FruitFactory implements ObjectFactory {
@Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
Reference localObject1;
if (obj instanceof Reference)
else
{ return obj; } }
}
Fruit f = new Fruit("apple");
context.bind("apple", f);
Fruit f1 = (Fruit)context.lookup("apple");