The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

user_00 (2) [Avatar] Offline

I'm using EJB3, GlassFish 3.0.1 and eclipse helios

I have a remote EJB
@Stateless (mappedName="TestBean")
public class TestBean implements TestBeanRemote {
public int add(int a, int b){
return a+b;

And the Remote Interface
public interface TestBeanRemote {
public int add(int a, int b);

<?xml version="1.0" encoding="UTF-8"?>
<application xmlnssmiliesi="" xmlns="" xmlns:application="" xsi:schemaLocation="" id="Application_ID" version="6">

I have an empty sun-ejb-jar.xml and I did not define ejb-jar.xml as I read that it's optional since EJB3
I'm putting my EJB in the EAR along with the WEB

I'm trying to call this EJB in a POJO class
InitialContext ic = new InitialContext();

I get the following exception
javax.naming.NamingException: Lookup failed for java:global/ear.proj/ejb.proj/TestBean' in SerialContext [Root exception is javax.naming.NameNotFoundException: ear.proj]

I guess that the problem is in the EJB setup in my EAR as it's said in the GlassFish EJB FAQ that Each portable global JNDI name is printed out to the server.log during deployment while I can not find any portable keyword in the log

Instead I can see the following
INFO: Cannot find module ejb.proj.ejb.jar in application bundle

Is there something I'm missing?