---
title: "EJB异常日记"
author: "javaEEdevelop"
date: "2013-03-21T08:31:47Z"
tags: []
categories: ["开源软件"]
slug: "ejb"
draft: false
lastmod: "2013-03-21T08:31:47Z"
id: 1830719
url: "https://javaeedevelop.iteye.com/blog/1830719"
---

javax.ejb.EJBException: Local and Remote Interfaces cannot have duplicate interface for bean HelloWorldBean  
at org.jboss.ejb3.SessionContainer.checkForDuplicateLocalAndRemoteInterfaces(SessionContainer.java:134)  
@Remote和@Local必须指定接口的class,也就是value值  
例如:  
@Remote(HelloWorld.class)  //申明是一个远程接口,不写默认是本地接口  
@Local(HelloWorldLocal.class)  //申明是一个本地接口

Exception in thread "main" javax.ejb.EJBException: Invalid (i.e. remote) invocation of local interface (null container)  
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:80)  
\--当在不同的jvm内，只能通过远程的JNDI命名格式进行访问,也就是类的实现类/romote  
\--当在同一个jvm内，只能通过远程的JNDI命名格式进行访问,也就是类的实现类/local