JSP如何调用Easerver的组件?

zm1616 2004-11-22 02:52:06
我早网上找了一篇文章,但怎么试都不成功
<%@ page import="org.omg.CORBA.ORB" %>

<%@ page import="org.omg.CosNaming.NamingContext" %>

<%@ page import="org.omg.CosNaming.NamingContextHelper" %>

<%@ page import="org.omg.CosNaming.NameComponent" %>

<%@ page import="org.omg.CORBA.ORB" %>

<%@ page import="market.*" %>
//我的easerver组件
<%@ page import="CTS.PBUserException" %>

<HTML>
<HEAD>
</HEAD>
<BODY>


<%
String s1;
String s2;

n_market nvo;

java.util.Properties props = new java.util.Properties();

props.put("org.omg.CORBA.ORBClass", "com.sybase.CORBA.ORB");

props.put("com.sybase.CORBA.NameServiceURL", "iiop://localhost:9000");

ORB orb = ORB.init((String[]) null, props);

try

{

NamingContext context = NamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
//这个NameService我一直不知道改填什么?

NameComponent[] name = { new NameComponent("market/n_market")};

SessionManager.Factory factory = SessionManager.FactoryHelper.narrow(context.resolve(name));

nvo = n_marketHelper.narrow(factory.create("jagadmin", ""));

}

catch(org.omg.CORBA.ORBPackage.InvalidName aException){}

catch(org.omg.CosNaming.NamingContextPackage.NotFound aException){}

catch(org.omg.CosNaming.NamingContextPackage.CannotProceed aExceptiont){}

catch(org.omg.ConNaming.NamingContextPackage.InvalidName aException){}

try

{

String rt = "";

rt = nvo.nf_test();

out.println(rt);
}

catch (CTS.PBUserException e){}

%>


</BODY></HTML>
...全文
130 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
gweidian 2004-12-22
  • 打赏
  • 举报
回复
老大,这是一个corba的分布式程序,需要运行orbd和server端
zm1616 2004-11-22
  • 打赏
  • 举报
回复
顶一下
zm1616 2004-11-22
  • 打赏
  • 举报
回复
错误如下:
500 Servlet jspservlet: unable to service request: Unable to compile class for JSP An error occured between lines: 26 and 75 in the jsp file: /test1.jsp Generated servlet error: C:\Program Files\Sybase\EAServer\work\Jaguar\Servlet\WebApp-shop\shop_0005ftest1$jsp.java:117: Wrong number of arguments in constructor. NameComponent[] name = { new NameComponent("market/n_market")}; ^ An error occured between lines: 26 and 75 in the jsp file: /test1.jsp Generated servlet error: C:\Program Files\Sybase\EAServer\work\Jaguar\Servlet\WebApp-shop\shop_0005ftest1$jsp.java:131: Class org.omg.ConNaming.NamingContextPackage.InvalidName not found. catch(org.omg.ConNaming.NamingContextPackage.InvalidName aException){} ^ 2 errors

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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