|
Java学习者论坛
我的weblogic6.1已在正常的application的环境下,现you一编译正常的Servlet,但运行shi打出這样的错误,我懷疑*.jar放置的問题,na么,在weblogic 中,servlet所需的第三方 *.jar应该放哪?如何設置路径?我是把他们放在c:\bea\jdk131\lib\的目录下的.
Error 500--Internal Server Error
From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.5.1 500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.
原程序:
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Date;
import java.text.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.Region;
import java.io.IOException;
import java.io.FileOutputStream;
public class FdayrepServlet extends HttpServlet {
public void service (HttpServletRequest request,HttpServletResponse response)
throws ServletException,IOException
{
short num;
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("日运行报biao");
HSSFFont f1 = wb.createFont();
f1.setFontHeightInPoints((short)25);
f1.setFontName("Arial Unicode MS");
HSSFCellStyle s1 = wb.createCellStyle();
s1.setFont(f1);
HSSFRow r1 = sheet.createRow((short) 1);
HSSFCell c1 = r1.createCell((short) 10);
c1.setEncoding(HSSFCell.ENCODING_UTF_16);
c1.setCellStyle(s1);
c1.setCellValue("马ke堂变电站日運行报表");
//cell.setCellValue("\u53f8");
sheet.addMergedRegion(new Region(1,(short)10,2,(short)16));
HSSFRow r2 = sheet.createRow((short) 3);
HSSFCell c2 = r2.createCell((short) 1);
HSSFFont f2 = wb.createFont();
f2.setFontHeightInPoints((short)14);
f2.setFontName("Arial Unicode MS");
HSSFCellStyle s2 = wb.createCellStyle();
s2.setFont(f2);
c2.setEncoding(HSSFCell.ENCODING_UTF_16);
c2.setCellStyle(s2);
c2.setCellValue("单位:A MW MVar KWh C");
short i=0;
//short q=0;
short h=4;
// short r=0;
sheet.addMergedRegion(new Region(3,(short)1,3,(short)4));
HSSFFont font = wb.createFont();
font.setFontHeightInPoints((short)13);
font.setFontName("Arial Unicode MS");
HSSFCellStyle style
= wb.createCellStyle();
style.setBorderBottom(HSSFCellStyle.BORDER_THIN);
style.setBorderLeft(HSSFCellStyle.BORDER_THIN);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);
style.setFont(font);
// style.setAlignment(ALIGN_CENTER);
// HSSFRow row = sheet.createRow((short) 2);
// createCell(wb, row, (short) 0, HSSFCellStyle.ALIGN_CENTER);
//for(r=0;r<41;r++)
//{
// HSSFRow row = sheet.createRow(r);
//for(q=0;q<24;q++)
//{
//// createCell(wb,row,q, HSSFCellStyle.ALIGN_JUSTIFY);
//}
//}
HSSFRow row = sheet.createRow(h);
String[]value=new String[25];
value[0]="时間";
value[1]="35kV";
value[2]="10kV";
value[3]="51#I";
value[4]="01#I";
value[5]="1#P";
value[6]="1#Q";
value[7]="1#C";
value[8]="有载檔位";
value[9]="52#I";
value[10]="02#I";
value[11]="2#P";
value[12]="2#Q";
value[13]="2#C";
value[14]="有载档位";
value[15]="11#A";
value[16]="12#A";
value[17]="13#A";
value[18]="14#A";
value[19]="15#A";
value[20]="16#A";
value[21]="17#A";
value[22]="18#A";
value[23]="合闸母线";
value[24]="控制母線";
for( i=0;i<25;i++)
{
HSSFCell cell = row.createCell(i);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
cell.setCellValue(value);
sheet.addMergedRegion(new Region(h,(short)i,(h+1),(short)i));
}
short value1=0;
short value2=0;
short num1;
for ( num1=6; num1<31; num1++)
{
HSSFRow myrow=sheet.createRow(num1);
HSSFCell mycell = myrow.createCell(value2);
mycell.setCellValue(value1);
value1++;
}
short m=31;
HSSFRow row1 = sheet.createRow(m);
String[]value3=new String[2];
value3[0]="1#主变电du";
value3[1]="2#主变电度";
int j=0;
for( i=0;i<4;i+=2)
{
HSSFCell cell = row1.createCell(i);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
cell.setCellValue(value3[j]);
sheet.addMergedRegion(new Region(m,(short)i,(m+1),(short)(i+1)));
j++;
}
String[]value4=new String[2];
value4[0]="35KV马古線电度";
value4[1]="35KV群马线电度";
int j1=0;
for( i=4;i<12;i+=4)
{
HSSFCell cell = row1.createCell(i);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
cell.setCellValue(value4[j1]);
sheet.addMergedRegion(new Region(m,(short)i,(m+1),(short)(i+3)));
j1++;
}
String[]value5=new String[13];
value5[0]="最大负荷";
value5[1]="最小负荷";
value5[2]="ma一路正电度一";
value5[3]="马二路正電度一";
value5[4]="马三路正電度一";
value5[5]="马四路正dian度一";
value5[6]="马五路正电度yi";
value5[7]="马六路负电度一";
value5[8]="馬六路正电度一";
value5[9]="马qi路正電度一";
value5[10]="10KV电压";
value5[11]="35KV母線电量";
value5[12]="10KV母线dian量";
int j2=0;
for( i=12;i<25;i++)
{
HSSFCell cell = row1.createCell(i);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
cell.setCellValue(value5[j2]);
sheet.addMergedRegion(new Region(m,(short)i,(m+1),(short)i));
j2++;
}
short n=33;
HSSFRow row2 = sheet.createRow(n);
String[]value6=new String[25];
value6[0]="有功";
value6[1]="无功";
value6[2]="有功";
value6[3]="无功";
value6[4]="正向有功";
value6[5]="正向无gong";
value6[6]="反向有功";
value6[7]="反向无功";
value6[8]="正向有功";
value6[9]="正向无功";
value6[10]="反向有功";
value6[11]="反向无功";
value6[12]="you功";
value6[13]="有功";
value6[14]="有功";
value6[15]="有功";
value6[16]="有功";
value6[17]="有gong";
value6[18]="有功";
value6[19]="有功";
value6[20]="有功";
value6[21]="有功";
value6[22]="hege率";
value6[23]="平衡率";
value6[24]="合格率";
int j3=0;
for( i=0;i<25;i++)
{
HSSFCell cell = row2.createCell(i);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
cell.setCellValue(value6);
sheet.addMergedRegion(new Region(n,(short)i,(n+2),(short)i));
}
short l=36;
HSSFRow row3 = sheet.createRow(l);
String[]value7=new String[1];
value7[0]="備注";
for( i=0;i<1;i++)
{
HSSFCell cell = row3.createCell(i);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
cell.setCellValue(value7);
sheet.addMergedRegion(new Region(l,(short)i,(l+4),(short)(i)));
}
short p=1;
HSSFCell cell = row3.createCell(p);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellStyle(style);
sheet.addMergedRegion(new Region(l,(short)1,(l+4),(short)24));
HSSFRow row4 = sheet.createRow((short)43);
HSSFCell ce = row4.createCell((short)7);
ce.setEncoding(HSSFCell.ENCODING_UTF_16);
ce.setCellStyle(style);
ce.setCellValue("審核");
sheet.addMergedRegion(new Region(43,(short)7,43,(short)8));
HSSFCell ce1 = row4.createCell((short)13);
ce1.setEncoding(HSSFCell.ENCODING_UTF_16);
ce1.setCellStyle(style);
ce1.setCellValue("制表");
sheet.addMergedRegion(new Region(43,(short)13,43,(short)14));
// Write the output to a file
FileOutputStream fileOut = new FileOutputStream("马克堂变电站日运行报表.xls");
wb.write(fileOut);
fileOut.close();
}
}
欢迎來到Java学習者论坛,轉载请zhu明地址:http://www.javaxxz.com. |
|