In the web.xml of your war, have the following entry:

原创 2007年09月23日 14:22:00
 

HTML Tags and JavaScript tutorial



In the web.xml of your war, have the following entry:





In the web.xml of your war, have the following entry:
Code:
<ejb-ref>
    <ejb-ref-name>GiveAnyNameByWhichYouWouldLikeToReferTheBeanInYourWebApp</ejb-ref-name>
    <ejb-ref-type>session</ejb-ref-type>
    <home>packageName.ClassNameOfTheHomeObjectOfTheBeanYouWantToRefer</home>
    <remote>packageName.ClassNameOfTheRemoteObjectOfTheBeanYouWantToRefer</remote>
  </ejb-ref> 
In the jboss-web.xml of your war, have the following entry:
Code:
 <ejb-ref>
    <ejb-ref-name>GiveAnyNameByWhichYouWouldLikeToReferTheBeanInYourWebApp(This should be same as the one given in the
 web.xml above)</ejb-ref-name>
    <jndi-name>TheJndiNametoWhichTheBeanIsBound(Example:somecontext/somejndiName)YouWillFindThisJndiNameInTheJboss.
xmlOfTheEJB</jndi-name>
   </ejb-ref> 
 
For more info, have a look at the dtds of web.xml :
http://java.sun.com/dtd/web-app_2_3.dtd

and jboss-web.xml:
http://www.jboss.org/j2ee/dtd

In your code, do the lookup as:
Code:
  Context ic = new InitialContext();
  Object ejbHome = ic.lookup("java:comp/env/TheNameThatYouHadGivenInTheEJB-REF-NAMETagOfJbossWeb.xmlAbove"); 
Here's an example:
web.xml:
Code:
<ejb-ref>
    <ejb-ref-name>MyTestBean</ejb-ref-name>
    <ejb-ref-type>session</ejb-ref-type>
    <home>com.test.ejb.MyBeanHome</home>
    <remote>com.test.ejb.MyBeanRemote</remote>
  </ejb-ref> 
 
jboss-web.xml:
Code:
 <ejb-ref>
  <ejb-ref-name>MyTestBean</ejb-ref-name>
  <jndi-name>myejb/test/MyTestBean</jndi-name>
 </ejb-ref> 
Lookup code:
Code:
Context ic = new InitialContext();
  Object ejbHome = ic.lookup("java:comp/env/MyTestBean"); 
 


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

41.You have recently collected statistics on certain objects of a schema in your database. But you o

41.You have recently collected statistics on certain objects of a schema in your database. But you o...

We are unable to complete the review of your app since one or more of your In App Purchases have not

当我苦苦等待的项目在8天后,收到了一个苹果的的“ Rejected”!太纠结了......太苦逼了...... 首先说明,这个项目是有内置购买的。 苹果的反馈信息是: Missing IAP...

Scene is unreachable due to lack of entry points and does not have an identifier for runtime access

警告: Scene is unreachable due to lack of entry points and does not have an identifier for runtime acc...

The String class is provided in the Java library. Provide your own implementation for the following

The String class is provided in the Java library. Provide your ownimplementation for the following m...

Git: The following paths are ignored by one of your .gitignore files: xxx.dll

问题描述:The following paths are ignored by one of your .gitignore files: xxx.dll Use -f if you really w...

mybatis报“com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL s”

做项目时mybatis报这个错 ### The error occurred while setting parameters ### Cause: com.mysql.jdbc.exceptions...

完美解决 ERROR 1064 (42000): You have an error in your SQL syntax ... near …

在MySQL命令行使用sql语句进行建表时,MySQL 报错,这个问题之前遇到过几次,但是总是会因为疏忽又相遇,今天把这个问题写出来,加深印象吧。sql语句:CREATE TABLE 'lrs_aud...

JBPM工作流之出现Could not synchronize database state with session以及You have an error in your SQL syntax;的异

在开始写第一个jbpm4工作流框架的例子时出现了下面的异常:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL

1、错误描述 org.hibernate.exception.SQLGrammarException: error executing work at org.hibernate.exception...

MySql建表时出错ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that correspond

在看黑马javaEE32期教程的时候,跳过前面前端的教程。直接看数据库相关,拿起了PPT上面的笔记先建了个数据库。建表的时候,出现了: ERROR 1064 (42000): You have an ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)