站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2SE 专题急!!!路过的请来看看,调用ejb问题,我被折腾的快不行了

急!!!路过的请来看看,调用ejb问题,我被折腾的快不行了

摘要: 急!!!路过的请来看看,调用ejb问题,我被折腾的快不行了


error:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

netBeans5.5+jboss4开发EJB
程序代码:
Context initial=new InitialContext();
Object obj=initial.lookup("ejb/NewSessionBean");
NewSessionRemoteHome home=(NewSessionRemoteHome)PortableRemoteObject.narrow(obj,NewSessionRemoteHome.class);
NewSessionRemote remote=home.create();
boolean result=remote.checkPassword(code,textpassword);

请问jndi.properties里面是这样写吗:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
我已经把jndi.properties放到classpath里面了.

在JBOSS.XML中:



NewSessionBean



iiop

ejb/NewSessionBean






ejb-jar.xml中:
....

jdbc/amt
javax.sql.DataSource
Container
....

jboss-ds.xml中:


MySqlDS
jdbc:mysql://localhost:3306/amt
com.mysql.jdbc.Driver
root
123
.......


烦请各位前辈详细解答......拜谢!!!!!!!!!!!!!!


自己顶一下,求求大家了


我感觉你好像部署上出了问题了
你在细心点看看你部署好没有啊?



↑返回目录
前一篇: ASP如何实现在线支付问题......
后一篇: 还没有达到菜鸟提的问题?