XML怪问题

lydvqq 2006-04-13 03:00:47
头有点晕。
单独可以产生。
package com.apach.framework.util;
import java.io.*;
import org.jdom.output.*;

import org.jdom.*;
public class MyXMLBase {
public void insert(){
try {
Document d = new Document(new Element("root"));
Element root = d.getRootElement();
Element content = new Element("Content");
root.addContent(content);
XMLOutputter outputter = new XMLOutputter();
FileOutputStream file = new FileOutputStream("c:\\lyllldvqq.xml");
outputter.output(d, file);
//file.close();
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
new MyXMLBase().insert();//create OK.
}
}

在JSP页面直接创建也OK。
<%@page import="com.apach.framework.util.*,org.jdom.output.*,java.io.*,org.jdom.*" %>
<html>
<head>
</head>
<body>

<%
try {//创建也OK
Document d = new Document(new Element("root"));
Element root = d.getRootElement();
Element content = new Element("Content");
root.addContent(content);

XMLOutputter outputter = new XMLOutputter();
FileOutputStream file = new FileOutputStream("c:\\lydvqq.xml");
outputter.output(d, file);
//file.close();
} catch (Exception e) {
e.printStackTrace();
}
//MyXMLBase xx = new MyXMLBase(); //但是这句就会有错误。
%>
</body>
</html>
//MyXMLBase xx = new MyXMLBase(); //但是这句就会有错误。如下:
[4/13/06 14:56:29:907 CST] 59c8fd61 WebGroup I SRVE0180I: [myweb] [/myweb] [Servlet.LOG]: /ttt.jsp: init
[4/13/06 14:56:29:969 CST] 59c8fd61 WebGroup E SRVE0026E: [Servlet Error]-[(class: com/apach/framework/util/MyXMLBases, method: insert signature: ()V) Incompatible argument to method]: java.lang.VerifyError: (class: com/apach/framework/util/MyXMLBases, method: insert signature: ()V) Incompatible argument to method
at org.apache.jsp._ttt._jspService(_ttt.java:87)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:344)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:683)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:781)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1019)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:592)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:912)

...全文
125 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lydvqq 2006-04-13
  • 打赏
  • 举报
回复
但我就是试了几台电脑。JDom1.0用的是www.jdom.org上下的。服务器是eclipse+websphere.还找了个朋友试了。也一样。晕
kill8108 2006-04-13
  • 打赏
  • 举报
回复
兄弟,我试了下你的程序没问题呢,只是用了jdom.jar呢!
lydvqq 2006-04-13
  • 打赏
  • 举报
回复
那我不是要改很多地方,因为两个版本有些操作不一样。
lydvqq 2006-04-13
  • 打赏
  • 举报
回复
开始用的是jodm1.0.
晕死,换了个jdom旧版本居然可以了。但是为什么呢,是不是jodm版本BUG??

67,512

社区成员

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

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