Las Avasa

Greenhorn
+ Follow
since Jul 22, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Las Avasa

Hi
We just deployed WLS 9.2 cluster with Apache 2.0.52 as reverse proxy.

I am using 'mod_wl128_20.so' since our users connect using https:// to the website.

Users saw this scary error trying to get to our web application..
'Cannot open TEMP post file '/tmp/_wl_proxy/....' for POST of 11046 bytes...'
'...Internal Server error. Cannot continue..'

I checked the apache (error_log, ssl_error_log, ssl_request_log ) but they don't show any more information of what could cause the problem.
I had to restart Apache to clear the problem. The users haven't seen the problem since I restarted.

I start the server as 'root' . The user/group in httpd.conf is set to apache/apache. The permissions for /tmp/_wl_proxy directory "drwxr-xr-x" with apache as owner . The Size of file the error was reported on wasn't very big either.

At this point, I am not sure what else I can do ? Any help/suggestions are greatly appreciated.

Thanks
17 years ago
If your application has a different context-root, try <virtual-directory-mapping> in weblogic.xml to point to this new path.
17 years ago
Hmm. That would explain why Firefox appends a .xls to the file name and Excel is not translating the comma-separated values anymore. I looked for a mime-type for .csv that will allow us to associate Ms-Excel when the browser downloads it. I couldn't find one. If I remove the mime-type mapping, even IE fails now. The file is being opened inline in the browsers as-is (commas, quotes are being displayed in the browser window ).

I guess I could change the format to tab-delimited and name the file .xls and use the mime-type.

Would that work ? Is that a good practice ?

Thanks a lot for your comments/suggestions, they've been very helpful. I am still rying to see if my original code will work for slow n/w users. So if you have any thoughts on what i am doing wrong in my code, I'd really appreciate it.
[ July 23, 2007: Message edited by: Las Avasa ]
17 years ago
JSP
Yes. Originally I was writing comma-separated content to the ServletOutputStream. But we have an issue when the request comes over a slow dial-up network. Part of the csv content is lost/ chopped off.

So, I was trying to see if serving the content as a static resource would help. But now I ran into the firefox issue.

The original code I had was ....
------------------------------------------------------------------------
ByteArrayOutputStream ostr = new ByteArrayOutputStream();

PrintWriter printW = new PrintWriter(ostr,true);

lformat.formatCSV((printW)); // iterates over serveral 1000 records and write comma-separated data to printW
printW.flush();

out.print(ostr);
out.flush();

lformat=null;
-----------------------------------------------------------------------

There are no browser formatting issues with the above code, except that for requests over a slow connection( < 14 kbps ), the downloaded file was incomplete.

I couldn't figure out how to fix this problem and have been trying alternatives/workarounds.
17 years ago
JSP
I have been trying to address a download CSV issue and one of the options I am trying is to write the results of a user request in comma-separated format to a static file and then redirect the user to a url pointing to the dynamically created file.

code snippet ...
-----------------------------------------------

ByteArrayOutputStream ostr = new ByteArrayOutputStream();

PrintWriter printW = new PrintWriter(ostr,true);

lformat.formatCSV((printW));

printW.flush();

String csvFileName = "SB_ABS"+ startTimeInMillis +""+actionUsrId+".csv";

String baseDir="/home/weblogic/bea/mydomain/undermydomain/excel/";
String csvFileFullName=baseDir + csvFileName;

PrintWriter csvWriter = new PrintWriter(new BufferedWriter(new FileWriter(csvFileFullName)));
csvWriter.print(ostr);
csvWriter.close();

response.sendRedirect("/excel/"+csvFileName);

------------------------------------------

I enclose data elements in quotes since they could contain commas. The download shows up fine in IE. However when Firefox is used, it is trying to open *.csv.xls and the data comes up in a single column in Excel displaying the quotes in them.

I have set the mime-type in web.xml as follows
---
<mime-mapping>
<extension>csv</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>

----


Can anyone suggest how I can get around this problem.
17 years ago
JSP
I have a JSP that writes out results in csv format on user request. When I issue a request from a broadband connection, the entire data comes to the browser( tried both IE and firefox and reproduced the issue ). But when I use a dial-up network and speeds very low ( e.g., < 14kbps ), part of the data gets lost. Even files about 1MB in size don't get through completely.

The data is fetched from the database and the JSP code looks like this...We are using Weblogic 8.1 as app server/web server. But the problem was reproducible using WLS 9.2 Cluster with Apache Proxy


-------------------------------------------------------------------
ByteArrayOutputStream ostr = new ByteArrayOutputStream();

PrintWriter printW = new PrintWriter(ostr,true);


lformat.formatCSV((printW)); // lformat is our application object that iterates over a list of java objects and does a bunch of println() statements to the PrintWriter.

printW.flush();
out.print(ostr);
out.flush();

lformat=null;
------------------------------------------------------------------

Prior to this we were passing 'out' directly to the formatting object but that had its own issues when users with slow n/w tried the action.

I am wondering if there is a better way to do what I am trying to do.

Please help.
17 years ago
JSP