谁解决了,我以身相许!

qingyunyun 2008-11-20 08:50:50
Myeclipse6.6+weblogic9.2开发EJB第一个Helloworld程序时出现这个问题:
javax.naming.NameNotFoundException: Unable to resolve 'HelloWorld'. Resolved '' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'HelloWorld'. Resolved '']; remaining name 'HelloWorld'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
at weblogic.jndi.internal.ServerNamingNode_920_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.ejb.TestEJB.main(TestEJB.java:24)

TestEJB客户端程序是:
package com.ejb;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import com.interfaces.HelloWorldHome;

public class TestEJB {

/**
* @param args
* @throws NamingException
*/
public static void main(String[] args) throws NamingException {
// TODO Auto-generated method stub
Properties properties=new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL,"t3://localhost:7001");
try{
Context context=new InitialContext(properties);
HelloWorldHome home=(HelloWorldHome)context.lookup("HelloWorld");
HelloWorld hello=(HelloWorld) home.create();
System.out.println(hello.hello());
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

问题到底错在哪里啊!
小女子这厢有礼了?
...全文
499 39 打赏 收藏 转发到动态 举报
写回复
用AI写文章
39 条回复
切换为时间正序
请发表友善的回复…
发表回复
wukaaa 2008-11-24
  • 打赏
  • 举报
回复
呀呀呀呀喜欢
ximenchuixuewang 2008-11-23
  • 打赏
  • 举报
回复
无语,标题太吸引人了,误入!!
oldwolf1987 2008-11-23
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 davidzhang0821 的回复:]
你发个你家地址我,今儿晚上我去你家给你把问题解决了,然后咱们就把事儿顺便也办了吧。。。。。
[/Quote]
很黄很暴力
很好很强大
llpoo 2008-11-21
  • 打赏
  • 举报
回复
这年头,小问题都要以身相许了,大问题要怎么样啊
挨踢民工_0917 2008-11-21
  • 打赏
  • 举报
回复
配置文件对不对?
qingyunyun 2008-11-21
  • 打赏
  • 举报
回复
Myeclipse+weblogic开发EJB中
JNDI命名是手工绑定还是直接由系统自动在ejb_jar.xml中配置?
baidu_hi 2008-11-21
  • 打赏
  • 举报
回复
小a 蜡烛小新呢
baidu_hi 2008-11-21
  • 打赏
  • 举报
回复
汗~!
baobeiSimple 2008-11-21
  • 打赏
  • 举报
回复
这个标题吸引我过来的。。。。
dongqdonglin 2008-11-21
  • 打赏
  • 举报
回复
.。。。。。。。。。。
qingyunyun 2008-11-21
  • 打赏
  • 举报
回复
真的不好意思,引起这个多误会,但是这个问题我在另一个帖子里说了一周没人回答我,我不是故意的,
但是我真的是个女生,有些时候根本没必要撒谎,谢谢各位帮我想法发的大哥哥,我把配置文件发出来你们
帮我看下JNDI有没有绑定了:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ejb-jar (View Source for full doctype...)>
- <ejb-jar>
- <description>
- <![CDATA[ No Description.
]]>
</description>
<display-name>Generated by XDoclet</display-name>
- <enterprise-beans>
- <!-- Session Beans
-->
- <session>
- <description>
- <![CDATA[
]]>
</description>
<ejb-name>HelloWorld</ejb-name>
<home>com.interfaces.HelloWorldHome</home>
<remote>com.interfaces.HelloWorld</remote>
<local-home>com.interfaces.HelloWorldLocalHome</local-home>
<local>com.interfaces.HelloWorldLocal</local>
<ejb-class>com.ejb.HelloWorldSession</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
- <!-- To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the <session></session> markup for those beans.

-->
- <!-- Entity Beans
-->
- <!-- To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.

-->
- <!-- Message Driven Beans
-->
- <!-- To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.

-->
</enterprise-beans>
- <!-- Relationships
-->
- <!-- Assembly Descriptor
-->
- <!-- To specify your own assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.

-->
- <assembly-descriptor>
- <!-- To specify additional security-role elements, add a file in the merge
directory called ejb-security-roles.xml that contains them.

-->
- <!-- method permissions
-->
- <!-- To specify additional method-permission elements, add a file in the merge
directory called ejb-method-permissions.ent that contains them.

-->
- <!-- transactions
-->
- <!-- To specify additional container-transaction elements, add a file in the merge
directory called ejb-container-transactions.ent that contains them.

-->
- <!-- finder transactions
-->
- <!-- message destinations
-->
- <!-- To specify additional message-destination elements, add a file in the merge
directory called ejb-message-destinations.ent that contains them.

-->
- <!-- exclude list
-->
- <!-- To specify an exclude-list element, add a file in the merge directory
called ejb-exclude-list.xml that contains it.

-->
</assembly-descriptor>
</ejb-jar>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE weblogic-ejb-jar (View Source for full doctype...)>
- <weblogic-ejb-jar>
- <description>
- <![CDATA[ Generated by XDoclet
]]>
</description>
- <weblogic-enterprise-bean>
<ejb-name>HelloWorld</ejb-name>
<reference-descriptor />
<jndi-name>HelloWorld</jndi-name>
<local-jndi-name>HelloWorldLocal</local-jndi-name>
</weblogic-enterprise-bean>
- <!--
To add enterprise beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called weblogic-enterprise-beans.xml that contains
the <weblogic-enterprise-bean></weblogic-enterprise-bean> markup for those beans.

-->
- <!--
To add a security-role-assignment section, add
a file to your XDoclet merge directory called weblogic-security-role-assignment.xml that contains
the <security-role-assignment></security-role-assignment> markup.

-->
- <!--
To add a run-as-role-assignment section, add
a file to your XDoclet merge directory called weblogic-run-as-role-assignment.xml that contains
the <run-as-role-assignment></run-as-role-assignment> markup.

-->
</weblogic-ejb-jar>
tojavastudy 2008-11-21
  • 打赏
  • 举报
回复
呵呵额


kao331431214 2008-11-21
  • 打赏
  • 举报
回复
被标题骗进来了~
freedom2001 2008-11-21
  • 打赏
  • 举报
回复
没引入HelloWorld这个类
filec75 2008-11-21
  • 打赏
  • 举报
回复
帮顶
此电脑 2008-11-21
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 davidzhang0821 的回复:]
你发个你家地址我,今儿晚上我去你家给你把问题解决了,然后咱们就把事儿顺便也办了吧。。。。。
[/Quote]

狠.....
lxm223 2008-11-21
  • 打赏
  • 举报
回复
兄弟,不要动不动就以身相许吧
abc130314 2008-11-21
  • 打赏
  • 举报
回复
[Quote=引用 31 楼 dgdlxh 的回复:]
大家都是为了 标题 而来 啊 哈哈
[/Quote]
同道中人,哈哈
dgdlxh 2008-11-21
  • 打赏
  • 举报
回复
大家都是为了 标题 而来 啊 哈哈
zhouyu5241 2008-11-21
  • 打赏
  • 举报
回复
恩!
加载更多回复(19)

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧