Problema para subir aplicação EJB 3.1 em servidor GlassFish

Olá senhores,

Estou tendo problemas para subir a minha aplicação no glassfish 3.1. Insiro um ear com o modulo ejb + war da minha aplicação web. Quando subo o servidor, ele falha em realizar o deploy dizendo que não foi possível resolver o nome ejb-ref pois existem 2 ejbs com o mesmo nome na aplicação. Ao que parece esse é um bug que acontece apenas no glassfish, tenho visto na internet usuários que tiveram esse problema, tentaram rodar a aplicação em um servidor jboss/wildfly e não tiveram problema.

Segue o stacktrace:


2015-01-02T19:56:43.700-0200|Grave: Exception while deploying the app [aceitacao-credito-ear] : Cannot resolve reference Local ejb-ref name=br.com.credito.web.managedbean.SolicitacaoCreditoBean/senderMq,Local 3.x interface =br.com.credito.ejb.dao.mdb.SenderMQDAO,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface br.com.credito.ejb.dao.mdb.SenderMQDAO. 
Some of the possible causes: 
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly. 
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib. 
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.
2015-01-02T19:57:11.561-0200|Informações: Server shutdown initiated
2015-01-02T19:57:15.112-0200|Informações: JMX002: JMXStartupService: Stopped JMXConnectorServer: null
2015-01-02T19:57:15.113-0200|Informações: JMX001: JMXStartupService and JMXConnectors have been shut down.
2015-01-02T19:57:15.113-0200|Informações: Shutdown procedure finished

Valeu!

acredito que o que está acontecendo é que exista um módulo web no módulo ear, por isso o erro diz que existem 2 ejb's. apague o módulo web que está no módulo ear

Debes especificar el atributo beanName de la anotacion, si utilizas dos veces el @EJB sin el atributo lo asigna a ambos con el mismo nombre por defecto.
@EJB(beanName = “DptoGeograficoFacade”)
private DptoGeograficoFacade dptoGeograficoFacade;