WebSphere 进度条运行的时候报错,求大神指点!!
websphere吧
全部回复
仅看楼主
level 1
zhaorich 楼主
WindowsXP+Tomcat 下可用
import java.awt.Color; import java.awt.Toolkit; import javax.swing.JLabel; import javax.swing.JProgressBar; import javax.swing.JWindow;
@SuppressWarnings("serial") public class ProgressBar extends JWindow implements Runnable { // 定义加载窗口大小 public static final int LOAD_WIDTH = 455; //窗口的宽度 public static final int LOAD_HEIGHT = 15;//窗口的高度 public long t1;//程序开始时间 public long t2;//程序结束时间 public int a;//总的数据条数 public long stime;//调配每条数据处理的时间 单位 微秒 1000微秒 = 1秒 根据自己程序的处理计算出处理每条数据所需要的时间 然后填在这里 public boolean RunFlag = false;//执行标志 整个导入过程执行完毕后需要将这个标志置为true 默认这个标志的值为false // 获取屏幕窗口大小 public static final int WIDTH = Toolkit.getDefaultToolkit().getScreenSize().width;//屏幕宽度 public static final int HEIGHT = Toolkit.getDefaultToolkit().getScreenSize().height;//屏幕高度 public JProgressBar progressbar; // 定义进度条组件 public JLabel label; // 定义标签组件 public boolean ParseFlag = false; // 构造函数 public ProgressBar(int t,long ti) { //t 数据条数 ti 每条数据平均处理时间 a = t; stime = ti; // 创建标签 label = new JLabel(); label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT - 15); // 创建进度条 progressbar = new JProgressBar(); // 显示当前进度值信息 progressbar.setStringPainted(true); // 设置进度条边框不显示 progressbar.setBorderPainted(false); // 设置进度条的前景色 progressbar.setForeground(new Color(0, 210, 40)); // 设置进度条的背景色 progressbar.setBackground(new Color(188, 190, 194)); progressbar.setBounds(0, LOAD_HEIGHT - 15, LOAD_WIDTH, 15); // 添加组件 this.add(label); this.add(progressbar); // 设置布局为空 this.setLayout(null); // 设置窗口初始位置 this.setLocation((WIDTH - LOAD_WIDTH) / 2, (HEIGHT - LOAD_HEIGHT) / 2); // 设置窗口大小 this.setSize(LOAD_WIDTH, LOAD_HEIGHT); // 设置窗口显示 this.setVisible(true); } @Override public void run() { t1 = System.currentTimeMillis(); for (int i = 0; i < 100; i++) { try { Thread.sleep(stime); //可以自定义休眠时间 但是需要根据特定的统计分析才能计算出来 } catch (InterruptedException e) { e.printStackTrace(); } progressbar.setValue(i); if(i+1 == 100){ if(RunFlag == false){ --i; continue; } this.dispose(); t2 = System.currentTimeMillis(); } if(ParseFlag == true) { --i; continue; } } System.out.println("每条数据的平均处理时间为:"+ (t2-t1)/a + "微秒");// JOptionPane.showMessageDialog(this, "加载完成"); } public static void main(String[] args) { ProgressBar t = new ProgressBar(100,0); //一百条数据 每条数据处理的时间为100微秒 new Thread(t).start(); } }
2013年01月28日 03点01分 1
level 1
zhaorich 楼主
错误日志
com.ibm.websphere.servlet.error.ServletErrorReport:java.lang.NoClassDefFoundError: com.sinosoft.lis.pubfun.ProgressBar(initialization failure) atorg.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:695) at com.ibm._jsp._MEDiskApplySave._jspService(_MEDiskApplySave.java:288) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) atcom.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443) atcom.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1384) atcom.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131) atfilters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34) atcom.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188) atcom.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116) atcom.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77) atcom.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:852) atcom.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:785) atcom.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443) atcom.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175) atcom.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:121) atcom.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:234) atcom.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91) atcom.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859) atcom.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557) atcom.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173) atcom.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455) atcom.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384) atcom.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83) atcom.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) atcom.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) atcom.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202) atcom.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)Caused by: java.lang.NoClassDefFoundError: com.sinosoft.lis.pubfun.ProgressBar(initialization failure) at java.lang.J9VMInternals.initialize(J9VMInternals.java:140) atcom.sinosoft.lis.med.MedContInsuredBL.dealData(MedContInsuredBL.java:675) atcom.sinosoft.lis.med.MedContInsuredBL.submitData(MedContInsuredBL.java:184) at com.ibm._jsp._MEDiskApplySave._jspService(_MEDiskApplySave.java:237) ... 30 more
2013年01月28日 03点01分 3
level 1
zhaorich 楼主
linux下载websphere上无法正常运行
2013年01月28日 03点01分 4
1