-
1. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
jaikiran May 24, 2013 2:44 AM (in response to nabitashka)ConnectionFactory factory = (ConnectionFactory) context.lookup("");
Is that real code? I don't see how someone would expect a ConnectionFactory to be returned when the lookup is being passed an empty string on the context root.
-
2. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
nabitashka May 24, 2013 2:59 AM (in response to jaikiran)Sorry, of cause not, I pass the factory name as it's written in the JNDI, will try to update the post
-
3. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
nabitashka May 26, 2013 12:55 PM (in response to nabitashka)Can it be that my specific ObjectFactory.getObjectInstance method is not called?
Should I define it somewhere?
-
4. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
nabitashka May 27, 2013 6:36 AM (in response to nabitashka)It looks like it's a real defect in JBoss.
I created some very simple class and ObjectFactory:
{code}
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) {
localObject1 = (Reference) obj;
Object fruit = localObject1.get("fruit").getContent();
return new Fruit((String)fruit);
} else {
return obj;
}
}
}
{code}
I bind the object into JNDI, when I lookup for this object inside JBoss the right ObjectFactory is called and I get Fruit as a result:
{code}
Fruit f = new Fruit("apple");
context.bind("apple", f);
Fruit f1 = (Fruit)context.lookup("apple");
{code}
But when I do the lookup from remote client, I get the Reference object and not the Fruit, look like the FruitFactory is never called.
Can it be a real defect?
Maybe there is someone for him the remote lookups are woking?
Was it tested?
-
5. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
jaikiran May 28, 2013 9:29 AM (in response to nabitashka)So you are binding some object to the context and then trying to look it up? What exactly are you looking up and why are you binding it? Isn't it made available by the server?
-
6. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
nabitashka May 29, 2013 9:25 AM (in response to jaikiran)Hi,
thanks for your response.
What do you mean by "Isn't it made available by the server"?
We have multi-processes application with JMS.
During JBoss startup we write JMS Connection Facories and some Queues/Topics into JBoss JNDI,
when many processes, not only JBoss, can access the JMS by lookup for the needed Connection Factory - this is why we need the remote lookups working.
This functionality worked very well in JBoss4 and JBoss AS7.1.1 final and seems to be broken in JBoss EAP6 Alfa (and Beta)
-
7. Re: During migration from AS7.1.1 final to EAP6.1 beta remote lookup fails with ClassCastException
jaikiran May 29, 2013 9:38 AM (in response to nabitashka)Natasha Biryukov wrote:
This functionality worked very well in JBoss4 and JBoss AS7.1.1 final and seems to be broken in JBoss EAP6 Alfa (and Beta)
Please file a JIRA https://issues.jboss.org/browse/WFLY with the relevant details and if possible a reproducible application.