Ron Isac

Greenhorn
+ Follow
since Dec 22, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ron Isac

when i run the servlet the following exception display in the browser.

all the jar files are in classspath.




HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:222)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)

root cause

java.lang.NoSuchMethodError: org.apache.xerces.dom.ElementImpl.<init>(Lorg/apache/xerces/dom/DocumentImpl;Ljava/lang/String V
at TempServlet.doGet(TempServlet.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:696)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)


hai the code is bellow, the normal core java the process will sucess but

servlet the exception is display.


import java.io.*;

import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.*;
import org.apache.xerces.dom.*;
import org.apache.xalan.xslt.*;
import org.apache.xml.serialize.*;



public class TempServlet extends HttpServlet

{
public static FileOutputStream out;
public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
{

try
{
response.setContentType("text/html");
//PrintWriter pw=response.getWriter();

DocumentImpl doc = new DocumentImpl();


ElementImpl elem = new ElementImpl(doc,"LeaveStructure");

ElementImpl LeaveType = new ElementImpl(doc,"EmployeeName");
LeaveType.appendChild(doc.createTextNode("Name"));

elem.appendChild(LeaveType);


ElementImpl LeaveDescription = new ElementImpl(doc,"LeaveType");
LeaveDescription.appendChild(doc.createTextNode("Medical Leave"));
elem.appendChild(LeaveDescription);

ElementImpl NoDays = new ElementImpl(doc,"NoDays");
NoDays.appendChild(doc.createTextNode("10"));
elem.appendChild(NoDays);

Node root = elem;

doc.appendChild(elem);
OutputFormat formato = new OutputFormat(doc, "UTF-8", true);
StringWriter s = new StringWriter();
XMLSerializer ser = new XMLSerializer(s, formato);
ser.serialize(doc);
System.out.println(s.toString());

out = new FileOutputStream("i.html");
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
processor.process(new XSLTInputSource(doc),
new XSLTInputSource("List.xsl"),
new XSLTResultTarget(out));
processor.process(new XSLTInputSource(doc),
new XSLTInputSource("List.xsl"),
new XSLTResultTarget(response.getWriter()));
}catch(Exception e){e.printStackTrace();}
}
}

[ February 11, 2005: Message edited by: Ron Isac ]

[ February 11, 2005: Message edited by: Ron Isac ]
[ February 11, 2005: Message edited by: Ron Isac ]
Hi,
I have created an html file to create a form that will ask the path of the file to be loaded into the servlet program.Please give me a solution,thanks in advance.


<html>
<body bgcolor="green">
<center>
<form method="post" action="http://localhost:8080/examples/servlet/Ron1">
<table>
<tr>
<td><B>ENTER THE PATH OF THE FILE</td>
<td><input type=file name="path"></td>
</tr>
</table>
<input type=submit value= "submit" >
</form>
</body>
</html>

The servlet program that receives the file is shown below. It just only take the name of the file and prints if that is ok.

import java.io.*;
import javax.servlet.*;
import java.lang.*;
import javax.servlet.http.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import com.oreilly.servlet.MultipartRequest;
import org.apache.poi.hssf.usermodel.*;
public class Ron1 extends HttpServlet
{
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String u = request.getParameter("FileToUpload");
out.println("The Path is "+u);
System.out.println("The path is "+u);
MultipartRequest multi = new MultipartRequest(request,u,10 * 1024 * 1024);
System.out.println("path is "+u);
Enumeration files = multi.getFileNames();
File fUploadedFile = null;
String sFileName = "";
out.println("path is "+u);
while(files.hasMoreElements())
{
String name = (String)files.nextElement();
out.println("file is "+name);
sFileName = multi.getFilesystemName(name);
String type = multi.getContentType(name);
fUploadedFile = multi.getFile(name);

}
FileInputStream fis= new FileInputStream(fUploadedFile);

HSSFWorkbook wb=new HSSFWorkbook(fis);
System.out.println("The path is "+u);
out.println("File has identified successfully\n");
out.close();
}
}


I am using HSSF to read values from the excel file. I just want to create an instance of a workbook with that excel file object. But error is occurring with MultipartRequest system call.

Regards,
Ron Isac
19 years ago
Hi,
How can I input an excel file into the java servlet program? I am using POI HSSF programming.I have created a form that will accept the path from the user and in the servlet program, I have called a post method to retrieve the path of the file. I am getting the path of the file as a string.Then I have to access the file to read the data. But it is not working. What should I do?.Please help me.

Regards,
Ron Isac
19 years ago
Hi,
I have a java program that has a string.The string contains different numers(multi digit) and characters. I want to extract these numbers into different variables.
for eg. if the string is c 32 34.
Then I want to extract c, 32 & 34.

Please help me . Thanks in advance.
19 years ago
Hi,
Can we use array of rows in POI HSSF programming to read data from the excel sheet.
I have declared
for(i=0;i<3;i++)
{
HSSFRow row[i]=sheet.getRow[i]();
}
for declaring 3 rows of the same type.But it gives error []expected.Please help me.
19 years ago
Hi,
I want to read the data from an excel sheet and put that data into the postgresql database. There is tables in the database similar to the excel sheet. How can I do that ? Please help me.
Hi,
I want to read data from the excel sheet through java servlet in linux. I want to only read not to create the excel.Please help me.
19 years ago
Hi,
I want to read from excel sheet.Please help me.
19 years ago
Hi,
How can i extract data from excel sheet through java servlets in linux. I have installed Java Excel API. But it is not working properly and the tutorial for that is vague.Please help me.

Regards Ron Isac
19 years ago