I've done code similar to this. Yore can go one of two ways:
1) Store your properties file in WEB- INF/classes and then call
propFile.load(this.getClass().getClassLoader().getResourceAsStream(application.properties''));
2) Store the properties file anywhere in the webapp and call
that may be the correct path
also check that
package com.deepa.servlet;
at the first line itself
is declared in ur java file
On 1/31/06, Bob Hall [EMAIL PROTECTED] wrote:
Deepa,
As someone pointed out in an earlier post you need to
include the following in your DownloadFile.java file:
that may be the correct path
also check that
package com.deepa.servlet;
at the first line itself
is declared in ur java file
- Show quoted text -
On 1/31/06, vineesh kumar [EMAIL PROTECTED] wrote:
that may be the correct path
also check that
package com.deepa.servlet;
at the first line itself
Here r few lines of codes;
package com.deepa.servlet;
import java.io.*;
import java.util.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.zip.GZIPOutputStream;
public class DownloadFiles extends HttpServlet
{
private static final String DIR =
do u changed ur web.xml also
the code is ok it should work.but u hav to check all the other files
also like web.xml
from the older web.xml file it was written that the servlet class is
Downloadfiles
but u hav to change it to
com.deepa.servlet.Downloadfiles
if all these things are working,
one more thing u can do is put an index.html on ur Downloadfile
directory(ie the root folder of ur app).and try typing
http://localhost:8080/Downloadfile/
then the tomcat should show the html file
if that too is not happening, the problem may be with ur server.xml
or even worse on ur catalina
I hav changed web.xml after including package. In this code i m not accessing
the servlet thr' html rather i m using the url in the browser window.
http://localhost:8080/DownloadFile/servlet/DownloadFiles
vineesh kumar [EMAIL PROTECTED] wrote:
one more thing u can do is put an
that's ok.
the test is for checking the path is recognised by tomcat or not.if
tomcat is not showing the index.html, then the problem is in ur
servel.xml ot context,xml. for making sure what's the problem only i
suggesterd the test
On 1/31/06, DEEPA M N [EMAIL PROTECTED] wrote:
I hav changed
Hi,
wen i checked the log file, i think the error might be in the line of the
code.
root = propFile.getProperty(app.directory);
This code should be able to download the files from the server. so i m using
application.properties where
app.directory=D:\\temp\\files\\
I doubt
DEEPA M N wrote:
Hi,
wen i checked the log file, i think the error might be in the line of the
code.
root = propFile.getProperty(app.directory);
This code should be able to download the files from the server. so i m using application.properties where
--- DEEPA M N [EMAIL PROTECTED] wrote:
Hi
I m using Jdk1.5 and Tomcat 5.0.28 for my proj. I
have written a code which can download a file from
the server. The code is compiling properly. I pasted
the .class file in the
webapps/DownloadFile/WEB-INF/classes/
Also i hav written
Hi
Thank u, I did as u mentioned. But wen i run the appln now, i m getting this
error.
Http status 500:
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
Hi Anto Paul,
Ya I extended HttpServlet method and also service() method.
I also tried wit packages, but also i m getting some sort of error.
Pls help me.
I greatly welcome ur help.
Thank u
Deepa
-
Jiyo
deepa,
plz send ur web.xml and server.xml on each change.so that we can hav
a look on that and understand the problem
regards
vineesh
On 1/30/06, DEEPA M N [EMAIL PROTECTED] wrote:
Hi Anto Paul,
Ya I extended HttpServlet method and also service() method.
I also tried wit packages,
Deepa,
plz check the following things
is ur class is public?
whether the class name is DownloadFiles.class itself?
also check the access permissions of the class and tomcat
directory if ur on a X'nix machine
On 1/30/06, vineesh kumar [EMAIL PROTECTED]
Deepa,
The java.lang.NoClassDefFoundError: com/deepa/servlet/DownloadFiles
(wrong name: DownloadFiles) error message means that you have class
DownloadFiles in the package directory structure
com.deepa.servlet.DownloadFiles, but you ommit the package directive
in the source code, OR you have
Hi Vineesh,
The class name is DownloadFiles.class
Pls let me know wat is access permissions of the class and tomcat.
I m posting my web.xml after including package.
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
On 1/31/06, DEEPA M N [EMAIL PROTECTED] wrote:
Hi Vineesh,
The class name is DownloadFiles.class
Pls let me know wat is access permissions of the class and tomcat.
I m posting my web.xml after including package.
?xml version=1.0 encoding=ISO-8859-1?
!DOCTYPE web-app
PUBLIC
Hi,
Here is a log file. Pls let me know how can i correct it.
2006-01-31 10:30:54 StandardWrapperValve[DownloadFiles]: Allocate exception
for servlet DownloadFiles
javax.servlet.ServletException: Error allocating a servlet instance
at
On 1/31/06, DEEPA M N [EMAIL PROTECTED] wrote:
Hi,
Here is a log file. Pls let me know how can i correct it.
In what package it is defined ?.
Are you sure you deleted the old classfiles and compiled the
classfiles to the right folder ?
Go to WEB-INF\classes and type java
Hi
I did as u said. This is wat the error i m getting.
D:\Tomcat5.0\jakarta-tomcat-5.0.28\webapps\DownloadFile\WEB-INF\classesjava
com.deepa.servlet.DownloadFiles
Exception in thread main java.lang.NoClassDefFoundError:
com/deepa/servlet/DownloadFiles (wrong name: DownloadFiles)
On 1/31/06, DEEPA M N [EMAIL PROTECTED] wrote:
Hi
I did as u said. This is wat the error i m getting.
D:\Tomcat5.0\jakarta-tomcat-5.0.28\webapps\DownloadFile\WEB-INF\classesjava
com.deepa.servlet.DownloadFiles
Exception in thread main java.lang.NoClassDefFoundError:
Deepa this error comes bcos the classpath of urs is not set
correctly.please set the classpath as of to include the
serv;letapi.jar and this directory. and check whether this class is
public.
regards
vineesh
On 1/31/06, DEEPA M N [EMAIL PROTECTED] wrote:
Hi
I did as u said. This is wat
Also check the package name
On 1/31/06, vineesh kumar [EMAIL PROTECTED] wrote:
Deepa this error comes bcos the classpath of urs is not set
correctly.please set the classpath as of to include the
serv;letapi.jar and this directory. and check whether this class is
public.
regards
Hi,
I hav set the classpath in the environment variables as below
D:\Tomcat5.0\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar
Let me know is this correct?
regards
Deepa
vineesh kumar [EMAIL PROTECTED] wrote:
Deepa this error comes bcos the classpath of urs is not set
and try
accessing your application.
ping me if you require more info.
Regards,
Avinash
-Original Message-
From: DEEPA M N [mailto:[EMAIL PROTECTED]
Sent: Tue 1/31/2006 11:43 AM
To: Tomcat Users List
Cc:
Subject: Re: Download file
Deepa,
As someone pointed out in an earlier post you need to
include the following in your DownloadFile.java file:
(usually, as the first line)
package com.deepa.servlet;
You would also normally place DownloadFiles.java in
a directory that ended in com/deepa/servlet. In
WinSpeak:
27 matches
Mail list logo