The task is to try to connect directly to a stateless EJB deployed on Glassfish. I have already done this via Web Service and I can also connect to the EJB by calling a remote java object which uses JNDI to find and load the bean. What I cannot do is directly connect to the EJB with Blazeds. I am using EBJ3Factory BY Ryan Norris (downloaded from adobe site) as follows;
My WEB-INF/flex/services-config.xml has;
<factories>
<factory id="ejb3" class="com.adobe.ac.ejb.EJB3Factory" />
</factories>
My WEB-INF/flex/remoting-config.xml has;
<destination id="MyEJB">
<properties>
<factory>ejb3</factory>
<source>java:global/Together/PSearch!ejb.PSearch</source>
</properties>
</destination>
I have a simple java class that can access the bean so I can use Blazeds to call the class which then calls the bean;
public void getBean() {
PSearch search;
InitialContext ctx;
try {
ctx = new InitialContext();
search = (PSearch) ctx.lookup("java:global/Together/PSearch!ejb.PSearch");
System.out.println("jndi okay");
} catch (NamingException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
}
The asadmin command for the context in glassfish shows me;
./asadmin list-jndi-entries --context java:global/Together
PSearch__3_x_Internal_RemoteBusinessHome__: javax.naming.Reference
PSearch!ejb.PSearchRemote: javax.naming.Reference
PSearch!ejb.PSearch: com.sun.ejb.containers.JavaGlobalJndiNamingObjectProxy
PSearch!ejb.PSearchLocal: com.sun.ejb.containers.JavaGlobalJndiNamingObjectProxy
Yet when I use Eclipse / Flash Builder to try to Import a BlazeDS service I get an introspection error;
java:global/Together/PSearch/!ejb.PSearch is not available in the specified location
I have also tried changing the remoting-config.xml to point to local and remote interfaces but no joy!
Any pointers would be greatly appreciated.