We are trying to lookup for an Local EJB in JBoss7.1, but we get an ClassCast Exception. This local lookup is between the same Server:

java.lang.ClassCastException: org.jboss.ejb.client.naming.ejb.EjbNamingContext cannot be cast to com.transaction.ITransaction

We are doing a lookup for the following JNDI name :

ejb:APP/TransactionBean!com.transaction.TransactionLocal

InitialContext context = new InitialContext();

context.lookup(ejb:APP/TransactionBean!com.transaction.TransactionLocal);

Is there any other configuration missing from our side. I read about ejb-client.properties do we need this file ? or its only for remote lookups?

You don't need ejb: namespace lookup for local EJBs. Use the spec mandated JNDI name scheme (either java:global, java:app, java:module depending on the context from where you want to lookup). The server logs will show what JNDI name to use for the lookup.

Jboss7.1 local EJB lookup problem的更多相关文章

  1. 详解JNDI的lookup资源引用java:/comp/env

    ENC的概念:     The application component environment is referred to as the ENC, the enterprise naming c ...

  2. 详解JNDI的lookup资源引用 java:/comp/env

    ENC的概念:     The application component environment is referred to as the ENC, the enterprise naming c ...

  3. Jboss EAP 6 EJB调用常见问题

    1. 调用EJB的三种方法 调用EAP 6 EJB的第一种方法,使用JBoss API,如下: Properties p = new Properties(); p.put("remote. ...

  4. jboss jms 实例

      最近温习了下EJB和JMS,整理了下思路,和大家分享下P2P和Pub/Sub的demo :JBoss 7 集成了HornetQ,JMS可以在HornetQ中间件运行,有时间在和大家分享关于Horn ...

  5. Class loading in JBoss AS 7--官方文档

    Class loading in AS7 is considerably different to previous versions of JBoss AS. Class loading is ba ...

  6. 搭建完整邮件系统(postfix+dovecot+clamAV+Spamassassin+amavisd-new)

    ============================ 相关软件: 1. 发送邮件 --- postfix 2. 身份认证 --- sasl2 3. 接收邮件 --- dovecot 4. 防病毒邮 ...

  7. JDNI

    JNDI是为了一个最最核心的问题:是为了解耦,是为了开发出更加可维护.可扩展的系统JNDI和JDBC起的作用类似:JDBC(Java Data Base Connectivity,java数据库连接) ...

  8. Accepting PayPal in games(完整的Paypal在Unity的支付)

      Hello and welcome back to my blog! In this article I’m going to talk about the process of acceptin ...

  9. Spring 学习记录6 BeanFactory(2)

    主题 除了Spring 学习记录5 BeanFactory 里写的几个接口外,BeanFactory的实现类还实现了一些其他接口,这篇文章主要介绍这些接口和实现类. 结构 DefaultListabl ...

随机推荐

  1. Spring Security OAuth2实现单点登录

    1.概述 在本教程中,我们将讨论如何使用 Spring Security OAuth 和 Spring Boot 实现 SSO(单点登录). 本示例将使用到三个独立应用 一个授权服务器(中央认证机制) ...

  2. CentOS下SSH远程免密登录服务器

    .5服务器上配置,通过ssh远程免密登录192. 1.安装SSH,此处省略 2.生成公钥和私钥,生成的秘钥默认在/root/.ssh/文件夹里面 [root@localhost ~ ::&&a ...

  3. 深度理解C# 的执行原理

    欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由鹅厂优文发表于云+社区专栏 从编译原理说起 虚拟机是什么 C# 是什么,IL 又是什么 .Net Framework vs Mono ...

  4. Centos7下使用yum安装lnmp zabbix3.2

    1:配置epel-release mysql zabbix 源 配置epel源 wget http://mirrors.aliyun.com/epel/epel-release-latest-7.no ...

  5. git第五节--git branch--分支管理

    @git branch :查看当前仓库所有分支,及当前所处的分支 @git branch XXX:创建分支XXX @git checkout XXX:切换到分支XXX下 @git checkout - ...

  6. 数据存储之偏好设置NSUserDefaults

    NSUserDefaults做数据存储也是比较常用,适合轻量级的本地数据存储,读取也很方便. 一.支持的数据类型如下图(NSString.NSArray.NSDictionary.NSData.NSI ...

  7. 从零开始学JAVA(09)-使用SpringMVC4 + Mybatis + MySql 例子(注解方式开发)

    项目需要,继续学习springmvc,这里加入Mybatis对数据库的访问,并写下一个简单的例子便于以后学习,希望对看的人有帮助.上一篇被移出博客主页,这一篇努力排版整齐,更原创,希望不要再被移出主页 ...

  8. C# Owin初探 概念理解(一)

    本文是阅读网上大牛的文章总结而成. 目录 1.Owin定义 2.为什么要用Owin 3.作用 4.总结 1.Owin定义 Owin是Open Web Interface For .NET.也就是.Ne ...

  9. EF数据库优先模式(三)

    今天2018年4月1日,呼叫王伟,81192,收到请返航! 接上次说,本节将LINQ以及lambda表达式 LINQ是C#里面针对SQL Server特有的数据访问操作方法,通俗一点说就是类似于写SQ ...

  10. 设计模式之建造者模式(Buider)(5)

    简介 在软件开发中,也会存在一些构造非常复杂的对象,这些对象拥有一系列的成员属性,这些成员属性有些是基本数据类型,有些是引用类型,总之就是一句话,这个对象的构建比较复杂.在这里我们就将复杂对象当做汽车 ...