我是新手,我的编译器不知是否有问题?

penny_tian 2002-05-21 11:26:45
JSP的聊天室,不管用JRun还是Weblogic或Jbuilder都是如下错误!
请高手帮忙!一定给分!急急急!
...全文
4 点赞 收藏 12
写回复
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
penny_tian 2002-05-23
to jimjxr(宝宝猫)
我重新配置了CLASSPATH后,出现的是编译错误了
如下:C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:159: illegal character: \65293
probably occurred due to an error in /lemen/login.jsp line 77:
out.println("<tr>");

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:108: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 26:
temp=(Vector)getServletContext().getAttribute("chat1User");

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:141: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 59:
getServletContext().setAttribute("chat1User",temp);

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:144: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 62:
Vector tempmsg=(Vector)getServletContext().getAttribute("chat1Msg");

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:146: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 64:
getServletContext().setAttribute("chat1Msg",tempmsg);

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:201: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 120:
Hashtable userLife=(Hashtable)getServletContext().getAttribute("userLife");

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:203: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 122:
Hashtable userIP=(Hashtable)getServletContext().getAttribute("userIP");

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:210: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 129:
getServletContext().setAttribute("userLife",userLife);

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:211: cannot resolve symbol
probably occurred due to an error in /lemen/login.jsp line 130:
getServletContext().setAttribute("userIP",userIP);

C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java uses or overrides a deprecated API.

--------------------------------------------------------------------------------
Full compiler error(s):
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:159: illegal character: \65293
out.println("<tr>");
//[ /lemen/login.jsp; Line: 77]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:108: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
temp=(Vector)getServletContext().getAttribute("chat1User"); //[ /lemen/login.jsp; Line: 26]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:141: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
getServletContext().setAttribute("chat1User",temp); //[ /lemen/login.jsp; Line: 59]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:144: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
Vector tempmsg=(Vector)getServletContext().getAttribute("chat1Msg"); //[ /lemen/login.jsp; Line: 62]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:146: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
getServletContext().setAttribute("chat1Msg",tempmsg); //[ /lemen/login.jsp; Line: 64]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:201: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
Hashtable userLife=(Hashtable)getServletContext().getAttribute("userLife"); //[ /lemen/login.jsp; Line: 120]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:203: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
Hashtable userIP=(Hashtable)getServletContext().getAttribute("userIP"); //[ /lemen/login.jsp; Line: 122]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:210: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
getServletContext().setAttribute("userLife",userLife); //[ /lemen/login.jsp; Line: 129]
^
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java:211: cannot resolve symbol
symbol : method getServletContext ()
location: class jsp_servlet._lemen.__login
getServletContext().setAttribute("userIP",userIP); //[ /lemen/login.jsp; Line: 130]
^
Note: C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
9 errors

********************************************************************
是不是意味我的编译器没问题了,只是程序有错误?
谢谢指教!
回复
jimjxr 2002-05-23
是的,jsp有错误,\65293和getServletContext。
回复
penny_tian 2002-05-22
javac运行后很正常!出现javac的帮助命令!
我现在正在重装一个win98去试一下!
回复
jimjxr 2002-05-22
不是例子的问题,是你的环境配置的问题。你的Weblogic是在你的用户名下运行吗?在Windows命令行下运行命令javac,出现什么?
回复
jimjxr 2002-05-22
这个不是例子的问题,是你环境配置的问题。你的Weblogic是运行在你的用户名下吗?在Windows命令行输入命令javac,出什么?
回复
javaxbenz 2002-05-22
CLASSPATH设置有问题
回复
jimjxr 2002-05-21
weblogic找不到你的javac.exe,把你的JDK下面的bin目录加入PATH。
回复
rosmada 2002-05-21
这个页面好像没用到bean啊,不过错误好像和bean有关,是不是你的相关jsp文件里的.java有没有解释成.class文件啊?我也不太清楚,java.io.IOException: 是没有导入还是执行没有成功呢?对不起我也是小菜一个,不过倒是挺热心!!^_^
回复
penny_tian 2002-05-21
我的错误如下:请指教:谢谢!
如有何建议也可提出!
源程序为:

***********************************************
<!--this file are written by fancy-->
<html>
<head>
<title>
login the first chat room
</title>
</head>
<%@ page import="java.util.Vector" %>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.Hashtable" %>
<%@ page import="java.util.Date" %>

<%
byte[] username_p;
String username_t=request.getParameter("username");
username_p=username_t.getBytes("ISO8859-1");
String username=new String(username_p);
boolean boolcanlogin=true;
%>

<%
Vector temp=new Vector();
String tempuser;

//*****************************************************************************
temp=(Vector)getServletContext().getAttribute("chat1User");
for(int i=0;i<temp.size();i++)
{
tempuser=temp.elementAt(i).toString();
if(username.equals(tempuser))
{
boolcanlogin=false;
}
}
//*****************************************************************************
if (username.equals(""))
{
boolcanlogin=false;
}

if (username.equals("每一个人"))
{
boolcanlogin=false;
}

if (username.equals("all"))
{
boolcanlogin=false;
}

if (username.length()>8)
{
boolcanlogin=false;
}
//*****************************************************************************
if(boolcanlogin==true)
{
temp.addElement(username); //如果检查通过则在用户向量中加入新的用户名
getServletContext().setAttribute("chat1User",temp);
session.putValue("username",username); //设置session记录用户名
//添加欢迎信息到消息向量里
Vector tempmsg=(Vector)getServletContext().getAttribute("chat1Msg");
tempmsg.addElement("<font size='2' color='red'>"+username+"来了["+request.getRemoteAddr()+"],大家欢迎!</font><br>");
getServletContext().setAttribute("chat1Msg",tempmsg);


//输出欢迎页面
out.println("<p align='center'><font color='#8080FF'>未名聊天室1</font></p>");
out.println("<hr width='80%' color='#0000FF'>");
out.println("<div align='center'><center>");
out.println("<table border='0' width='86%' height='233'>");
out.println("<tr>");
out.println("<td width='4%' height='23'><img src='new.gif' width='20' height='20'");
out.println("alt='new.gif (970 bytes)'></td>");
out.println("<td width='96%' height='23' bgcolor='#B5B5FF'>各位聊客,欢迎使用本聊天室,本聊天室支持人数无上限,每隔10秒刷新消息队列,每隔</td>");
out.println("</tr>");
out.println("<tr>");-
out.println("<td width='4%' height='13'></td>");
out.println("<td width='96%' height='13' bgcolor='#B5B5FF'>两分钟刷新用户列表,如果用户在四分钟内没有任何动作的话,那么此用户将被注销.</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td width='4%' height='11'><img src='new.gif' width='20' height='20'");
out.println("alt='new.gif (970 bytes)'></td>");
out.println("<td width='96%' height='11' bgcolor='#CACAFF'>本聊天室支持34种动作,31种表情,悄悄话等功能,今后将加入图形化功能,及跳转功能,</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td width='4%' height='7'></td>");
out.println("<td width='96%' height='7' bgcolor='#CACAFF'>新建聊天室等功能.</td>");
out.println(" </tr>");
out.println("<tr>");
out.println("<td width='4%' height='19'><img src='new.gif' width='20' height='20'");
out.println("alt='new.gif (970 bytes)'></td>");
out.println("<td width='96%' height='19' bgcolor='#D2D2FF'>如果你要离开本聊天室,请点击右边窗口内的"关闭".</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td width='4%' height='20'><img src='new.gif' width='20' height='20'");
out.println("alt='new.gif (970 bytes)'></td>");
out.println("<td width='96%' height='20' bgcolor='#EEEEFF'>如果您有什么批评及建议,请到"三角地"发表文章.</td>");
out.println("</tr>");
out.println("<tr>");
out.println("<td width='4%' height='22'><img src='new.gif' width='20' height='20'");
out.println("alt='new.gif (970 bytes)'></td>");
out.println("<td width='96%' height='22' bgcolor='#F4F4FF'>请不要在本聊天室内发表反动言论及对他人进行人身攻击.</td>");
out.println("</tr>");
out.println("</table>");
out.println("</center></div>");
out.println("<p align='center'><a href='main.html' target='_top'>请进</a></p>");
}
else
{
out.println("<center><font color='red' size='2'>用户名相同");
out.println("<a href='login.html'>重新申请ID</a></font></center>");
}
%>

<%
if (boolcanlogin==true)
{
//用一个哈希表来记录用户在聊天室呆的时间
Hashtable userLife=(Hashtable)getServletContext().getAttribute("userLife");
//用一个哈希表记录在聊用户的IP地址
Hashtable userIP=(Hashtable)getServletContext().getAttribute("userIP");
//取得用户登录时间
Date userTime=new Date();
//记录用户登录时间
userLife.put((String)session.getValue("username"),new Long(userTime.getTime()));
//记录用户IP地址
userIP.put((String)session.getValue("username"),request.getRemoteAddr());
getServletContext().setAttribute("userLife",userLife);
getServletContext().setAttribute("userIP",userIP);
}
%>
<body>

</body>
</html>
**************************************************************
谢谢指教!

Compilation of 'C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java' failed:
--------------------------------------------------------------------------------
C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java error=2

--------------------------------------------------------------------------------
Full compiler error(s):
java.io.IOException: CreateProcess: javac -classpath C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp;C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp;C:\bea\jdk131\jre\lib\rt.jar;C:\bea\jdk131\jre\lib\i18n.jar;C:\bea\jdk131\jre\lib\sunrsasign.jar;C:\bea\jdk131\jre\classes;.;C:\bea\wlserver6.1\lib\weblogic_sp.jar;C:\bea\wlserver6.1\lib\weblogic.jar -d C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp C:\bea\wlserver6.1\config\mydomain\applications\DefaultWebApp\WEB-INF\_tmp_war_myserver_myserver_DefaultWebApp\jsp_servlet\_lemen\__login.java error=2
at java.lang.Win32Process.create(Native Method)
at java.lang.Win32Process.<init>(Win32Process.java:66)
at java.lang.Runtime.execInternal(Native Method)
at java.lang.Runtime.exec(Runtime.java:551)
at java.lang.Runtime.exec(Runtime.java:477)
at java.lang.Runtime.exec(Runtime.java:443)
at weblogic.utils.Executable.exec(Executable.java:147)
at weblogic.utils.Executable.exec(Executable.java:111)
at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:550)
at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:359)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:381)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:189)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:154)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:366)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:240)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


回复
star123qiu 2002-05-21
编译器肯定没有问题,你还是好好看看你的程序代码吧。我现在用的是jrun,一点问题都没有!
回复
Andrawu 2002-05-21
呵呵,书上的例子一般都没有错的,可能是你的环境或路径有问题。
回复
penny_tian 2002-05-21
to jimjxr(boa
我加了path并把低版本的jdk去除但还是不行,
我是用的一个书上的例程作为学习的例子的,如果可以我把它发给你
帮我看一下,我一定给分的!如何?谢谢!
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告