index.jsp源代码如下:
*****错误好像发生在这里******************
<%@ page import="Converter,ConverterHome,javax.ejb.*,javax.naming.*, javax.rmi.PortableRemoteObject,java.rmi.RemoteException,java.math.*" %>
****************************************
<%!
   private Converter converter = null;
   public void jspInit() {
      try
        {
         InitialContext ic = new InitialContext();
         Object objRef = ic.lookup("java:comp/env/ejb/TheConverter");
         ConverterHome home =
         (ConverterHome)PortableRemoteObject.narrow(
         objRef, ConverterHome.class);
         converter = home.create();
    }          catch(javax.naming.NamingException ne)
                {                }
                catch(javax.ejb.CreateException ce)
                {
                }
                catch(java.rmi.RemoteException re)
                {
                }
   }%>
<html>
<head>
    <title>Converter</title>
</head><body bgcolor="white">
<h1><center>Converter</center></h1>
<hr>
<p>Enter an amount to convert:</p>
<form method="get">
<input type="text" name="amount" size="25">
<br>
<p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
<%
   String amount = request.getParameter("amount");
   if ( amount != null && amount.length() > 0 ) {
      BigDecimal d = new BigDecimal (amount);
%>
   <p><%= amount %> dollars are
      <%= converter.dollarToYen(d) %>  Yen.
   <p><%= amount %> Yen are
      <%= converter.yenToEuro(d) %>  Euro.
<%
    }
%>
</body>
</html>

解决方案 »

  1.   

    可以试着拷贝新的远程接口类到web application的lib目录下试一下。
      

  2.   

    'public static int compile(String[], java.io.PrintWriter)是没有找到这个方法
      

  3.   

    好像不是包的问题,我在web application中新建了一个默认的jsp文件,没有import什么包。但也报同样的错误:大家快救救我呀,我快疯啦。
    "Jsp2.jsp": java.lang.NoSuchMethodException: com.borland.jbuilder.webserverglue.weblogic.jsp.NadaJavac does not define 'public static int compile(String[], java.io.PrintWriter)'[Compilation errors : ]
    "Jsp2.jsp": java.lang.Exception: [Compilation errors : ]
    Exception in thread "main" 
      

  4.   

    错误好像是提示com.borland.jbuilder.webserverglue.weblogic.jsp.NadaJavac这个包里面没有什么方法。
    但我只发现了这个包jbuilder.jar\com\borland\jbuilder\web\weblogic,而没有上面那个包。难道是我jbuilder有问题?大家说个话呀,帮我顶一下也行。
      

  5.   

    我想可能是你的webserverglue.jar坏了。如果是weblogic8,肯定是不可以的,因为jbuilder7还不支持weblogic8,打开weblogic-jbsp.jar就能看到只到weblogic7。呵呵,我来混分的