weblogic6.1sp2 EJB部署问题

wcarry21 2002-07-09 08:03:05
在EJB部署的时候出现问题:
JBuilder6 + weblogic6.1sp2 +win2000 server
在JBuilder里面部署Entity Bean,报错为
weblogic.j2ee.DeploymentException

at weblogic.deploy.deploy(deploy.java:683)

at weblogic.deploy.runBody(deploy.java:373)

at weblogic.utils.compiler.Tool.run(Tool.java:79)

at weblogic.deploy.main(deploy.java:1616)

weblogic.j2ee.DeploymentException

at weblogic.deploy.deploy(deploy.java:683)

at weblogic.deploy.runBody(deploy.java:373)

at weblogic.utils.compiler.Tool.run(Tool.java:79)

at weblogic.deploy.main(deploy.java:1616)


weblogic控制台不报错,在weblogic控制台可以查看到该EJB,但是在运行时却报JNDI找不到的错误:
javax.naming.NameNotFoundException: Unable to resolve DemoEJB. Resolved: '' Unresolved:'DemoEJB' ; remaining name ''

at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:85)

at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:262)

at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:229)-- Failed initializing bean access.



at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)

at $Proxy0.lookup(Unknown Source)

at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:339)

at javax.naming.InitialContext.lookup(InitialContext.java:350)

at com.boyun.demo.model.SessionEJBTest.<init>(SessionEJBTest.java:32)

at com.boyun.demo.model.SessionEJBTest.main(SessionEJBTest.java:167)

第一次部署可以成功,可是我该了文件重新部署就出现该问题,请高手指点
...全文
45 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wcarry21 2002-07-11
  • 打赏
  • 举报
回复
谢谢大家,我已经解决。是我在打包的时候,一些公用文件没有打包进去,rmi问题。以前orion不用打包,没有遇见这个问题,呵呵。
liwanlin 2002-07-11
  • 打赏
  • 举报
回复
你在weblogic server的JNDI树上究竟能不能看到你部署的Entity Bean?
如果能说明部署成功,不能就没部署成功。

第二次部署用redeploy而不是deploy

silentmoon 2002-07-10
  • 打赏
  • 举报
回复
up
wcarry21 2002-07-09
  • 打赏
  • 举报
回复
这种方法在orion服务器中是没有问题的,但现在在weblogic中不知道为什么原因,请大侠指点。
wcarry21 2002-07-09
  • 打赏
  • 举报
回复
Datasource没有问题,现在我发现我写了一个ejbfindany()方法,但是好像根本就没有调用,程序如下:
public Integer ejbFindAny() throws RemoteException, FinderException
{

System.out.println("11111111111111111111111111111");
Vector dbResult = new Vector();
Vector result = new Vector();
Dcols dcols = new Dcols();
Integer integer1 = null;
DemoHelper helper = new DemoHelper();
String strSql = "select ID from SYS_DEMO" ;
System.out.println("strSQL is "+strSql);
DataSource ds = new DataSource();
try
{

if(ds.executeQuery(strSql))
{
dbResult = ds.getAllData();
System.out.println("dbResult is "+dbResult.size());

dcols = (Dcols)dbResult.elementAt(0);
//helper.strID = dcols.getInt("SYSDEMOID");
integer1 = new Integer(dcols.getInt("ID"));
System.out.println("helper.strID is "+helper.strID);
//result.addElement(helper);

}
}
catch (Exception e)
{
System.out.println("findAny error");
}
return new Integer(helper.strID);

}

在servlet中调用为
private Context getInitialContext() throws Exception
{
String url = "t3://localhost:7001";
String user = null;
String password = null;
Properties properties = null;
try
{
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null)
{
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
}
return new InitialContext(properties);
}
catch(Exception e)
{
System.out.println("Unable to connect to WebLogic server at " + url);
System.out.println("Please make sure that the server is running.");
throw e;
}
}


Context ctx = getInitialContext();
Object ref = ctx.lookup("DemoEJB");
DemoHome DemoHome1 = (DemoHome) PortableRemoteObject.narrow(ref, DemoHome.class);
System.out.println("DemoHome1 is "+ref.toString());
DemoRemote remote = ((DemoHome) home).findAny();
pigczc 2002-07-09
  • 打赏
  • 举报
回复
进入控制台在该ejb的configuration里面看看employed时不时被沟上了
如果不是钩上他,apply,看看WebLogic包什么异常
pigczc 2002-07-09
  • 打赏
  • 举报
回复
或者是不是两次发布不是一样的
比方说 一次是jar发布
另一次是ear发布
pigczc 2002-07-09
  • 打赏
  • 举报
回复
WebLogic 支持 热插拔的!
你看看事不是EntityBean需要的DataSource在Weblogic 里面没有!
wcarry21 2002-07-09
  • 打赏
  • 举报
回复
可是我都这样做了
oceanboywjk 2002-07-09
  • 打赏
  • 举报
回复
重新部署前先把原先部署的ejb删了
zmrljl 2002-07-09
  • 打赏
  • 举报
回复
重新启动weblogic了吗,weblogic 不支持热插拔的

1,236

社区成员

发帖
与我相关
我的任务
社区描述
企业软件 中间件技术
社区管理员
  • 中间件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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