Rakesh Gadre

Ranch Hand
+ Follow
since Feb 22, 2003
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 Rakesh Gadre

Nope
16 years ago
We are using Apache 2.2 and Tomcat 5.5.16 on UNIX.

The application was working fine and all of a sudden Tomcat crashed!! Here is the log:

[Mon Aug 20 11:35:33 2007] [info] ajp_service::jk_ajp_common.c (1721): Receiving from tomcat failed, recoverable operation attempt=0
[Mon Aug 20 11:35:33 2007] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=1
[Mon Aug 20 11:35:33 2007] [info] ajp_connection_tcp_get_message::jk_ajp_common.c (955): Tomcat has forced a connection close for socket 17
[Mon Aug 20 11:35:33 2007] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet)
[Mon Aug 20 11:35:33 2007] [info] ajp_service::jk_ajp_common.c (1721): Receiving from tomcat failed, recoverable operation attempt=0
[Mon Aug 20 11:35:33 2007] [info] ajp_service::jk_ajp_common.c (1749): Sending request to tomcat failed, recoverable operation attempt=1
[Mon Aug 20 11:35:33 2007] [info] jk_open_socket::jk_connect.c (444): connect to 127.0.0.1:8009 failed with errno=146


Any clue?
16 years ago
Hi Chintan,

I am not creating jar file using eclpse, I am using ANT script to do that. I add the jar file in project build path.
18 years ago
Hello,

I am using Eclipse and have 2 projects in it.
I create a jar file of project1 and use it in project2.
The jar file of project1 is added in the path of project2.

Now, the problem..

I have added some new code in one of the java programs of project1.
The jar is created as usual.

If i try to access the newly added code from project2, I get No Such Method exception..

If I expand the jar file from eclipse, I see the new function.
If I decompile the respective class file, I see the new code.
If I use reflection package and print the method names, I DO NOT SEE the enw method..

I am really confused and not sure where the problem is..

I am using JDK1.4, Eclipse 3.1, ANT 1.6.5

Thanks in advance

Rakesh
18 years ago
It looks like a typo error. It seems that the para refers to the requst scope rather than session.
18 years ago
Hi All,
I am using the following code to read an excel file using jsp/Weblogic 8.1 I have already set MIME type in weblogic. Still, it gives junk characters.

Any suggestions ???

Here is the code:
*****************************************
<%@ page import="java.util.*,java.io.* "%>
<html>
<%
String fileNameWithPath = "C:\\test.xls";
FileInputStream fileStream = new FileInputStream (fileNameWithPath);
intnumberOfBytes = fileStream.available ();
byte contents [] = new byte [numberOfBytes];
fileStream.read (contents);
ServletOutputStream sout = response.getOutputStream();
response.setContentType("application/vnd.ms-excel");

response.setHeader("Content-Disposition","inline; filename=\"" + "MyFile" + "\";");
sout.write (contents);
sout.flush ();
%>

</html>
**********************************************
Thanks in advance

Cheers !!

Rakesh
19 years ago
Hi All,
I am using the following code to read an excel file using jsp/Weblogic 8.1 I have already set MIME type in weblogic. Still, it gives junk characters.

Any suggestions ???

Here is the code:
*****************************************
<%@ page import="java.util.*,java.io.* "%>
<html>
<%
String fileNameWithPath = "C:\\test.xls";
FileInputStream fileStream = new FileInputStream (fileNameWithPath);
intnumberOfBytes = fileStream.available ();
byte contents [] = new byte [numberOfBytes];
fileStream.read (contents);
ServletOutputStream sout = response.getOutputStream();
response.setContentType("application/vnd.ms-excel");

response.setHeader("Content-Disposition","inline; filename=\"" + "MyFile" + "\";");
sout.write (contents);
sout.flush ();
%>

</html>
**********************************************
Thanks in advance

Cheers !!

Rakesh
19 years ago
JSP
Hi,
I am trying to display an excel file to the user. In the jsp file, the code is as under:

FileInputStream fileStream = new FileInputStream (fileNameWithPath);
int numberOfBytes = fileStream.available ();
byte contents [] = new byte [numberOfBytes];
fileStream.read (contents);
ServletOutputStream sout = response.getOutputStream();
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","inline; filename=\"" + onlyFileName + "\";");

sout.write (contents);

Now, the problem is as under:

The server does not have MS office(Excel) installed on it. If I try to set the content type as ms-excel, it does not recognises it and what i get is junk code. Is there any way to read the excel without having MS office(Excel) installed on the server ?

Thanks in advance

Rakesh
19 years ago
JSP
Hi,

Thanks for the reply. I am using Windows XP. The application uses struts. Wil that make any difference ? If i try the same code seperately using a jsp file directly, it works properly..

I am really stuck up it seems :roll:

Rakesh
19 years ago
Hi,
I am trying to open a csv file on the browser. I am facing the following problem :

WHen i click on the link that opens the csv file, it popups a window asking whether to OPEN /SAVE the file. If I click on OPEN, instead of opening the file, it again opens the same dialog box. On clicking the OPEN for the second time, it opens the file in excel.

I want the use to see the file only be clicking OPEN button for the first time.

The code snippet is as under:

File file = new File (fileName);
FileInputStream fileStream = null;
try
{
// Open the file to download
fileStream = new FileInputStream (file);
// Read the contents of the disk file into an in memory byte array
int numberOfBytes = fileStream.available ();
byte contents [] = new byte [numberOfBytes];
fileStream.read (contents);
ServletOutputStream out = res.getOutputStream();
res.setContentType(contentType);

res.setHeader("Content-Disposition","attachment;filename=\"" + downloadFileName + "\";");


out.write (contents);
out.flush ();

I AM USING STRUTS FRAMEWORK.

Thanks in advance,
rakesh
19 years ago
Hi,
I am using a jsp file to open an excel file by using the following Syntax:

<%
String fileName = (String)session.getAttribute("fileName");
%>
<html>
<meta http-equiv="refresh" content="0;URL=<%=fileName%>">
</html>

This code opens up a dialog box that prompts user to OPEN/SAVE the file.

Now, my requirement is that if user saves the file, I want to close the browser window automatically... if he opens it, nothing should happen..

Thanks in advance
19 years ago
JSP
Hi,
I am trying to open a csv file on the browser. I am facing the following problem :

WHen i click on the link that opens the csv file, it popups a window asking whether to OPEN /SAVE the file. If I click on OPEN, instead of opening the file, it again opens the same dialog box. On clicking the OPEN for the second time, it opens the file in excel.

I want the use to see the file only be clicking OPEN button for the first time.

The code snippet is as under:

File file = new File (fileName);
FileInputStreamfileStream = null;
try
{
// Open the file to download
fileStream = new FileInputStream (file);
// Read the contents of the disk file into an in memory byte array
intnumberOfBytes = fileStream.available ();
byte contents [] = new byte [numberOfBytes];
fileStream.read (contents);
ServletOutputStream out = res.getOutputStream();
res.setContentType(contentType);

res.setHeader("Content-Disposition","attachment;filename=\"" + downloadFileName + "\";");


out.write (contents);
out.flush ();

Thanks in advance,
rakesh
19 years ago
JSP
Hi All,
I am using DBMS_OBFUSCATION_TOOLKIT package for encrypting and decrypting the data.
For encryption OR decryption, we use a KEY on the basis of which data is encrypted or decrypted.
My problem is like this :
1. I set a key say 'aaaaaaaa'.
2. Now, all the records will be encrypted using that key and decryption is possible using this key only.
3. Later, I want to change the key.
So, I am decrypting all the records with the old key and then encrypting all with the new key.
Now, there is a problem in this approach as under :
I enter data as 'rakesh' (6 characters). When I decrypt it, it gives me the same string i.e. 'rakesh', but the length will be of 8 characters.( The decrypted string comes in the multiples of 8) .
When i try wo encrypt it with the new KEY, the encryption will happen for 8 characters and not for 6 ( which is the actual length of the string).
so, the strings will never match.
This thing is gonna happen everytime i change the KEY.
What I need is a way by which i can migrate directly from one KEY to other KEY without excryption / decryption.
20 years ago
Hi All,
I am using a customized API for fetching values from the database.
To use that API, i store each row of the ResultSet in a vector and in turn i store all such vectors in another vector.
Now, the problem is that, if the number of records are more for ex. 25000 - 30000 it gives me an error like OutOfMemoryError.
The problem is that, i cannot change code to fetch the values from the database i.e. i cannot skip vectors.
please suggest me something at the earliest.
Thanx in advance.
Rakesh
20 years ago
JSP
Hi all,
I am using J2ee1.2.1 server for EJB applications. I use Oracle Database and thin drivers.
I am having problen with default.properties file of the j2ee server. Whenever I try to access the database from the Deployment wizard, i get error like database not found etc.
Can anyone send me default.properties file which is properly configured for thin drivers ??
Rakesh