Invoke remote ejb's in Liferay Vaadin Portlets

Hi All

I have deployed stateless beans in jboss as 7 and i use a remote ejb client to access the deployed secure ejb’s,


Client code in vaadin Liferay portlet:


Hashtable p = new Hashtable();
p.put(Context.INITIAL_CONTEXT_FACTORY, “org.jboss.naming.remote.client.InitialContextFactory”);
p.put(Context.PROVIDER_URL, “remote://localhost:4547/”);
p.put(“jboss.naming.client.ejb.context”, true);
p.put(Context.URL_PKG_PREFIXES, “org.jboss.ejb.client.naming”);
p.put(“jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT”, “false”);
p.put(InitialContext.SECURITY_PRINCIPAL, “david”);
p.put(InitialContext.SECURITY_CREDENTIALS, “david123”);
final Context context = new javax.naming.InitialContext(p);


EmployeeManagement employeeManagement = (EmployeeManagement)context.lookup(“ejb:employee/employeeService//EmployeeManagementImpl!my.tests.EmployeeManagement”);

The above code returns the employeeManagement object back if the user and password credentials are valid.

It works well with vaadin servlet with web.xml configuartion as :

EmployeeAudit /* /* users NONE FORM TestRealm users

The same client code in a portlet appliaction throws EJBAccessException with User as
annonymus.

What are the changes that has to be done to access the secure ejb’s from a for liferay Vaadin protlet appliaction.

Thanks in advance :slight_smile:
Suman Alapati.

Hi,
Can Some one Help me out . In case if you come across the issue. I really struck :frowning: