Open File in a Servlet-Method
Hi @ all,
I want to open a simple textfile in my Servlet-Java Method
on a Resin Aplication Server. But I don't know how I have
to build my path. I actually don't know on which plattform
the Resin is running (not I set up the Resin), but I think its a Windows- or Unix-PC.
How should I build the path? ("../test.txt" or "c:\resin\tmp\test.txt")
Thanks and bye
Ben
Forward slashes works fine on Windows. Backslash does not work on unix. And "c:" does not exist on unix. So of the two you mention, "../test.txt" is far more portable.
Other options are to require the filename (or directory) in the startup parameters for the servlet, or to use ClassLoader.getResource().
Similar Messages
-
Okay... I'm new to using servlets. Not so much to jsp, just to using servlets. I have one process on our site that is using servlets and I'm trying to mimic how that is using em but am having no luck.
I am trying to open files with a servlet. I have the class built and compiled, but mainly pulled it from Java World. I evenually will need to pass the servlet the filename and path I want open but in this example it has the file set. My problem is I want to send users to a jsp file where I check user authentication and call the servlet to open the doc, but I don't know how to call the servelet or what to send it. If someone could maybe walk me through this.
Here's my servlet:
package cmxx.fileServe;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class fileServe extends HttpServlet {
final static String CONTENT_TYPE_DOC = "application/msword";
final static String CONTENT_TYPE_HTML = "text/html";
final static String document = "/docs/form_41.doc";
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
doGet(request, response);
public void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
PrintWriter out;
out = response.getWriter();
HttpSession websession = request.getSession(true);
response.reset();
response.setDateHeader ("Expires", 0);
response.setDateHeader("max-age", 0);
try {
response.setContentType(CONTENT_TYPE_DOC);
FileInputStream fileInputStream = new FileInputStream(document);
ServletOutputStream servletOutputStream = response.getOutputStream();
int bytesRead = 0;
byte byteArray[] = new byte[4096];
while((bytesRead = fileInputStream.read(byteArray)) != -1) {
servletOutputStream.write(byteArray, 0, bytesRead);
servletOutputStream.flush();
servletOutputStream.close();
fileInputStream.close();
} catch(Exception ex) {
throw new ServletException(ex.getMessage());
} /* end doget */
} /* end class */I'm trying a new servlet. But am getting a few compile errors. Can someone help?
Here are my Errors:
43 cannot resolve symbol
symbol : class URL
location: class cmis.fileServe.fileServe2
URL url = new URL(fileURL);
^
43 cannot resolve symbol
symbol : class URL
location: class cmis.fileServe.fileServe2
URL url = new URL(fileURL);
^
57 cannot resolve symbol
symbol : class MalformedURLException
location: class cmis.fileServe.fileServe2
} catch(final MalformedURLException e) {
^
Code:
package cmis.fileServe;
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class fileServe2 extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
ServletOutputStream out = res.getOutputStream();
// Set the output data's mime type
res.setContentType( "application/pdf" ); // MIME type for pdf doc
// create an input stream from fileURL
String fileURL = "http://www.adobe.com/aboutadobe/careeropp/pdfs/adobeapp.pdf";
// Content-disposition header - don't open in browser and
// set the "Save As..." filename.
// *There is reportedly a bug in IE4.0 which ignores this...
res.setHeader("Content-disposition", "attachment; filename=Example.pdf" );
// PROXY_HOST and PROXY_PORT should be your proxy host and port
// that will let you go through the firewall without authentication.
// Otherwise set the system properties and use URLConnection.getInputStream().
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try {
URL url = new URL(fileURL);
// Use Buffered Stream for reading/writing.
bis = new BufferedInputStream(url.openStream());
bos = new BufferedOutputStream(out);
byte[] buff = new byte[2048];
int bytesRead;
// Simple read/write loop.
while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead);
} catch(final MalformedURLException e) {
System.out.println ( "MalformedURLException." );
throw e;
} catch(final IOException e) {
System.out.println ( "IOException." );
throw e;
} finally {
if (bis != null)
bis.close();
if (bos != null)
bos.close();
} /* end class */ -
"Preview this File" Does Nothing + Blinding GTK+ open file dialogs...
...I have two problems in KDEMod4...did anyone have these problems and how do you fix them?
Right clicking a file and clicking "Preview this File" does nothing...including folder views, Konqueror, and Dolphin.
GTK+ open file dialogs alternate between the normal background for my text box and blindingly white background.Hi,
I also have the same problem, but with my JNI and C++ expertise, I was able to isolate the problem.
My platform:
- Microsoft Windows XP, Family Edition (French), Version 2002, Service Pack 3
- JRE 1.6.0_21
In the source of the JDK6 (Src/windows/classes/sun/awt/windows/WDesktopPeer.java), the Desktop.open(file) calls the native method
ShellExecute(*uri.toString()*, "open")
For example, if you try to open "c:\helloworld.pdf",
uri.toString() = "*file:/c:/helloworld.pdf*"if I call ShellExecute("C:\\helloworld.pdf", "open"), it works
but if I call ShellExecute(" file:/c:/helloworld.pdf", "open"), it doesn't work on my platform.
In both case, the ShellExecuteW or ShellExecuteA function of the Windows API return the integer 42 (> 32), saying that the functions succeeded. If the file object is not correct, the function should return a value <= 32.
=> The bug is not due to Java implementation, but to a bug in the Windows API.
Other remark:
I also tried the "ShellExec_RunDLL" entry point of the Shell32.dll library using RunDll32 utility. Both commands below are running correctly:
rundll32 SHELL32.DLL,ShellExec_RunDLL "C:\hello.pdf"
rundll32 SHELL32.DLL,ShellExec_RunDLL "file:/C:/hello.pdf"My conclusion:
1) A workaround could be implemented in the JRE: use the file path without the "file:/" protocol prefix.
2) This bug seems to be present only one some version of Windows XP (to confirm).
Rodolphe. -
I 've seen this on a user's computer:
Desktop.getInstance().open(myFile);
does nothing: no exception, no stacktrace, nothing.
It doesn't work for pdf or for xls files (and probably for all other file types too).
However, if he double clicks on a pdf or xls file in Windows Explorer it opens (in acrobat reader / MS Excel).
This also works in DOS-prompt: "start C:\myFile.pdf"
Making it canonical first doesn't work either:
Desktop.getInstance().open(myFile.getCanonicalFile());
Environment:
Java 6 update 16
Windows XP SP 3
A webstart application with all security permissions.
I've removed all JRE's and even removed the USER_HOME/application data/Sun map.
He upgraded from Windows XP SP2 to SP3 with no change.
Has anyone any idea what is causing this?
This problem has been metioned before, but they don't mention a cause or solution: http://forums.sun.com/thread.jspa?threadID=5338022Hi,
I also have the same problem, but with my JNI and C++ expertise, I was able to isolate the problem.
My platform:
- Microsoft Windows XP, Family Edition (French), Version 2002, Service Pack 3
- JRE 1.6.0_21
In the source of the JDK6 (Src/windows/classes/sun/awt/windows/WDesktopPeer.java), the Desktop.open(file) calls the native method
ShellExecute(*uri.toString()*, "open")
For example, if you try to open "c:\helloworld.pdf",
uri.toString() = "*file:/c:/helloworld.pdf*"if I call ShellExecute("C:\\helloworld.pdf", "open"), it works
but if I call ShellExecute(" file:/c:/helloworld.pdf", "open"), it doesn't work on my platform.
In both case, the ShellExecuteW or ShellExecuteA function of the Windows API return the integer 42 (> 32), saying that the functions succeeded. If the file object is not correct, the function should return a value <= 32.
=> The bug is not due to Java implementation, but to a bug in the Windows API.
Other remark:
I also tried the "ShellExec_RunDLL" entry point of the Shell32.dll library using RunDll32 utility. Both commands below are running correctly:
rundll32 SHELL32.DLL,ShellExec_RunDLL "C:\hello.pdf"
rundll32 SHELL32.DLL,ShellExec_RunDLL "file:/C:/hello.pdf"My conclusion:
1) A workaround could be implemented in the JRE: use the file path without the "file:/" protocol prefix.
2) This bug seems to be present only one some version of Windows XP (to confirm).
Rodolphe. -
PROBLEM while using URL in order to open a file from a servlet
Hi,
I am having a problem while trying to open a file from my servlet by using URL connection. Following is my code sample. what happens is when I first run my project it opens the file but after that when I rerun it again and again it sometimes opens it and sometimes not. if it can't open it it gives an error saying "the file is damaged and couldn't be repaired". I don't get any exceptions. if you guys can help me I will appreciate it so much... thanks.
here is my code :
URL url = new URL("http://demobcs.ibm.com:81/test.pdf");
resp.setContentType(getContentType("http://demobcs.ibm.com:81/test.pdf"));
ServletOutputStream sos = null;
BufferedInputStream bis = null;
try {
sos = resp.getOutputStream();
} catch (Exception e) {
System.out.println("exception !!!!");
e.printStackTrace();
System.out.println("burada2");
try {
byte[] bytes = new byte[4096];
//bis = new BufferedInputStream(conn.getInputStream());
DataInputStream in = new DataInputStream(url.openStream());
//DataInputStream in = new DataInputStream(conn.getInputStream());
bis = new BufferedInputStream(in);
int j;
while ((j = bis.read(bytes, 0, 4096)) != -1) {
try {
sos.write(bytes, 0, 4096);
System.out.println("file is being read ...:");
} catch (Exception e) {
e.printStackTrace();
in.close();
bis.close();
//sos.close();
} catch (Exception e) {
System.out.println("exception :"+e.toString());
e.printStackTrace();
}You are writing (<filesize> mod 4096) bytes of crap at the end of the file. Use your variable j instead for the number of bytes to write in your loop.
-
Open File Dialog appears TWICE when using servlet to download an attachment
Hi,
This is KILLING me!!! Please HELP.....
I am using a servlet to download an xml file, which I build on the fly based on user interaction.
The open file dialog appears nicely and I hit open. The dialog pops up again immediately and I have to click open again in order to open the file.
This works fine when file extension is txt and I DONOT have to click twice. Here is the code:
String xmlString = getXMLString(); //builds xml
String fileName = "myFile.xml";
response.setContentType("application/x-download");
response.setHeader("Content-disposition", "attachment;filename=" +fileName);
PrintWriter out = response.getWriter();
out.print(xmlString);
out.flush();
I am using IE6.0 sp2http://forums.java.sun.com/thread.jspa?threadID=596940&tstart=20
-
Opening multiple excel files thorugh a servlet
Hi
In my system , i have excel reports in my server disk . And i am opening the excel files through an servlet class like /viewReport.do?id=23 .....and thus from the servlet will open my excel file .
After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server
How can i avoid this ??
The reason why i am opening the excel file through a servlet is , i need to perform some operations before opening that excel report
Can any one let me know how to go abt this ??I had a similar porblem....
I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
This is my code in servlet...
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet spreadSheet = wb.createSheet("Users");
spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
// Creating Rows
HSSFRow row = spreadSheet.createRow(0);
HSSFCell cell = row.createCell((short) 1);
cell.setCellValue("Year 2005");
cell = row.createCell((short) 2);
cell.setCellValue("Year 2004");
HSSFRow row1 = spreadSheet.createRow(1);
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
cell = row1.createCell((short) 0);
cell.setCellValue("Revenue ($)");
cell = row1.createCell((short) 1);
cell.setCellValue("25656");
cell = row1.createCell((short) 2);
cell.setCellValue("15457");
FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
ServletOutputStream out = response.getOutputStream();
wb.write(output);
output.flush();
output.close();
forward = null;
In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......
Thanks in advance...
Message was edited by:
onlycoding -
Hi guys.
I use QT SDK to write a sample to load movie files.
when install QuickTime7.7.1 and call QT SDK's interface(OpenMovieFile method) to open file, it doesn't work. i will get error(-36). but when i use QT 7.6.9, it works well.
so how can i use QT SDK(install QT7.7.1 and OS is windows xp) to open movie file which fullpath include wide unicode characters(like D:\Media動画).
much appreciate.This forum is for questions about the Communities themselves. You'll be more likely to get a quick and helpful answer if you post in the forum dedicated for your product. The QuickTime forum can be found here:
QuickTime
Regards. -
Tif files not opening via Acrobat Javascript openDoc() method
Hi,
I am trying to open a .tif file via Acrobat Javascript using the following code snippet which I have in config.js file in Acrobat Javascripts folder:
trustedOpenDoc = app.trustedFunction( function (File)
app.beginPriv();
var doc = app.openDoc({
cPath: File,
bUseConv: true
app.endPriv();
return doc;
Problem is that openDoc opens up all other images but it has problem with multi page tif files, I mean it does not open some tif files. I have directly tried to open files in Acrobat professional 8/9 from File --> Open but got same result.
The same happens also with some heavy (above 1 MB) .bmp files but with .bmp files this behaviour is not so frequent, on the other hand .tif files always give the same result.
Any PDF Gladiator who can save my project deadline!
Look please; I have this problem for the last 12 days and miserably my project is getting late becoz of this.
Thanks in advance for the resolution/suggestion.You guys are not getting my point.
I am using Adobe Acrobat Professional 8/9 for creating a PDF that picks up text files and image (Jpg, bmp, tif) files from a network shared folder and inserts them into an empty Template PDF file by making use of Acrobat events through Javascript.
This all works fine as long I dont include any Tif file and PDF is created successfully.
Now all other file types including text files, jpgs, gif are opening up but problem is with .tif files.
You can check this by directly opening image files in Adobe Acrobat Profesional 8/9 from File --> Open menu option.
Other images will open up but most Tif files won't open in it. Such tif files also not open in "Winodws Picture and Fax Viewer" software but will open in softwares like "Imaging Professional" , "IrfanView" etc, which I think use some special codec for it.
If you know of any Acrobat plugin that can be incorporated in Acrobat professional and convert these tif files to PDF on the fly, would be of great help or have some any other suggestion you feel is right.
Thanks -
Getting java.io.IOException: Too many open files+ClassNotFoundException
Dear All
We have a web application deployed on Rational Application Developer 6.0 (Operating System is Windows 2000 professional) our users are randomly getting java.io.IOException: Too many open files+ClassNotFoundException when they click on some servlet or jsp link, but they are getting this error randomly for example when they click some link they may get these exceptions but refreshing page or clicking once again on same link executes servlet successfully.If anyone could help on this topic we will be grateful
ThanksI think this these two exceptions are occuring in differrent environment
java.io.IOException is occuring under heavy load to web server its stack trace is as follows:
JSPG0225E: An error occurred at line: 2 in the statically included file: /SessionCheck.jsp
JSPG0093E: Generated servlet error from file: /Admin/AdminInsuranceCertificates.jsp
E:\WebSphere_6\AppServer\profiles\AUSECert\temp\centraNode04\server1\AUSECert\Vero.war\Admin\_AdminInsuranceCertificates.java:259: cannot access com.bplus.natmar.LoginDetails
bad class file: E:\WebSphere_6\AppServer\java\jre\lib\core.jar(java/io/Writer.class)
unable to access file: E:\WebSphere_6\AppServer\profiles\AUSECert\installedApps\centraNode04Cell\AUSECert.ear\Vero.war\WEB-INF\classes\com\bplus\natmar\LoginDetails.class (Too many open files)
Please remove or make sure it appears in the correct subdirectory of the classpath.
(source unavailable)
1 error
]: com.ibm.ws.jsp.JspCoreException: JSPG0049E: /Admin/AdminInsuranceCertificates.jsp failed to compile :
this error always occurs in reference to logindetails class this clas is used to make a session check on different roles in our project for e.g., user having end user role should not be able to log in as a user having admin role
we have included a sessioncheck.jsp in our every jsp page in this jsp we have simply used logindetails class as useBean and called its getresource() method
above stacktrace is from our live application server
while testing same project on our local system we are not getting too many open files exception but we are getting following ClassNotFoundException
[11/30/05 17:11:42:797 EST] 0000004a SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'mainEdit.jsp' and IsEndUser=1
[11/30/05 17:12:50:891 EST] 000001eb SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'InsuranceCertificates.jsp' and IsEndUser=1
[11/30/05 17:17:40:828 EST] 0000008d SystemOut O AppURL is: http://www.VeroECert.com/Vero/indexU.jsp
[11/30/05 17:17:58:141 EST] 0000008b SystemOut O SELECT count(*) as NoofRecs FROM resourcerolebindings WHERE ResourceName = 'InsuranceCertificates.jsp' and IsEndUser=1
[11/30/05 17:20:41:703 EST] 00000034 ServletWrappe E SRVE0026E: [Servlet Error]-[com.servlet.UserHelpServlet]: java.lang.ClassNotFoundException: com.servlet.UserHelpServlet
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
at java.beans.Beans.instantiate(Beans.java:202)
at java.beans.Beans.instantiate(Beans.java:63)
at com.ibm.ws.webcontainer.servlet.ServletWrapper$3.run(ServletWrapper.java:1384)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1312)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:84)
at com.ibm.ws.webcontainer.extension.InvokerExtensionProcessor.handleRequest(InvokerExtensionProcessor.java:238)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2841)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:220)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:204)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java(Compiled Code))
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java(Compiled Code))
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
this error is occuring on concurrent clicks suppose three users click on same button then it is possible that one user gets correct output while other users experience this exception
Also one more point we are not using web.xml for calling servlets we are directly calling it giving its full path.
Thanks -
Weblogic Server Switch over automatically due to too many open files error.
Hi,
I am facing problem in production environment. I am using Weblogic 8.1 SP4 application.
Weblogic Server automatically switch over every 3 weeks due to few reasons.
1. out of memorry error.
2. Too many open files error.
Please see my below portalserver. log files. Kindly provide some good solution to solve this problem.
The following log is portalserver.log file
###<May 6, 2009 8:28:15 PM ICT> <Notice> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000205> <After having failed to listen, the server is now listening on port 9001.>
####<May 6, 2009 8:28:15 PM ICT> <Critical> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 9001, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
####<May 6, 2009 8:28:15 PM ICT> <Error> <HTTP> <ebizdr> <portalServer> <ExecuteThread: '5' for queue: 'default'> <<WLS Kernel>> <> <BEA-101019> <[ServletContext(id=18480784,name=NBIAProject,context-path=)] Servlet failed with IOException
java.io.FileNotFoundException: /var/opt/weblogic/user_projects/domains/eBizPortalDomain/portalServer/.wlnotdelete/NBIAPortalApp/NBIAProject/images/go.gif (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at weblogic.utils.classloaders.FileSource.getInputStream(FileSource.java:23)
at weblogic.servlet.FileServlet.sendFile(FileServlet.java:563)
at weblogic.servlet.FileServlet.service(FileServlet.java:206)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:293)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
####<May 6, 2009 8:28:16 PM ICT> <Notice> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000205> <After having failed to listen, the server is now listening on port 9001.>
####<May 6, 2009 8:28:16 PM ICT> <Critical> <WebLogicServer> <ebizdr> <portalServer> <ListenThread.Default> <<WLS Kernel>> <> <BEA-000204> <Failed to listen on port 9001, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
####<May 6, 2009 8:28:16 PM ICT> <Error> <HTTP> <ebizdr> <portalServer> <ExecuteThread: '5' for queue: 'default'> <<WLS Kernel>> <> <BEA-101019> <[ServletContext(id=18480784,name=NBIAProject,context-path=)] Servlet failed with IOException
java.io.FileNotFoundException: /var/opt/weblogic/user_projects/domains/eBizPortalDomain/portalServer/.wlnotdelete/NBIAPortalApp/NBIAProject/images/search_right.gif (Too many open files)
Thanks & Regards,
Suriyaprakash.VSorry for the late resp. Here's what dev suggests be investigated:
I would want to know:
Can they do a "$ORACLE_HOME/bin/dmstool -dump" and
save/compress/send the results?
Are there any errors printed in the Apache error_log while this leak occurs?
The customer could/should re-check their TCP settings, especially the TCP time wait interval and generally follow the TCP settings recommended in Chapter 5 of the iAS Performance Guide for 9.0.2.
Is there anything else interesting/unusual about the site?
Let us know how it goes. -
Sudden increase in open file descriptors
Our system is live since an year and half and for the first time I encountered the following exception
"java.net.SocketException: Too many open files"
When our internet application stopped responding I immediately checked the number of open file descriptors on my Solaris machine by using the "lsof" command and found that it was an abnormal 600 value and as I continued monitoring it reached 1024 in matter of minutes and WebLogic gave the above exception. The current setting for file descriptors is 1024. But all these days the average number of open file descriptors was well below 220.
I also took thread dumps and found that most of the threads were stuck at the following location
""ExecuteThread: '3' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x00883a90 nid=0x10 runnable [6d080000..6d0819c0]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sybase.jdbc2.timedio.RawDbio.reallyRead(RawDbio.java:202)
at com.sybase.jdbc2.timedio.Dbio.doRead(Dbio.java:243)
at com.sybase.jdbc2.timedio.InStreamMgr.readIfOwner(InStreamMgr.java:512)
at com.sybase.jdbc2.timedio.InStreamMgr.doRead(InStreamMgr.java:273)
at com.sybase.jdbc2.tds.TdsProtocolContext.getChunk(TdsProtocolContext.java:561)
at com.sybase.jdbc2.tds.PduInputFormatter.readPacket(PduInputFormatter.java:229)
at com.sybase.jdbc2.tds.PduInputFormatter.read(PduInputFormatter.java:62)
at com.sybase.jdbc2.tds.TdsInputStream.read(TdsInputStream.java:81)
at com.sybase.jdbc2.tds.TdsInputStream.readUnsignedByte(TdsInputStream.java:114)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1850)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)"
There is no file descriptor leak in the application. My question is since all the threads are hung at JDBC and socket level, does it mean that a faulty query would have triggered this problem(may be the database was too busy executing a faulty query).
I suspect this because I recieved a database exception soon after the problem appeared. One of my database insert transaction had timed out after 300 seconds. Also this was the first time I recieved this kind of an exception
java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 299 seconds
Xid=BEA1-11FE69525362E51BFA16(6404670),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=299,seconds left=60,activeThread=Thread[ExecuteThread: '22' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=started,assigned=none),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@a68c0),SCInfo[Mizuho-RWS+myserver]=(state=active),properties=({weblogic.jdbc=t3://10.104.8.81:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.104.8.81:7001+Mizuho-RWS+t3+, XAResources={},NonXAResources={})],CoordinatorURL=myserver+10.104.8.81:7001+Mizuho-RWS+t3+)]'. No further JDBC access is allowed within this transaction.
at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:118)
at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:127)
Any inputs regarding this problem?Raghu S wrote:
Hi,
I am using WebLogic 8.1 SP2 on a Solaris machine.Ok, good enough. Once WebLogic times out a transaction, it rolls it back on the
connection. That Sybase driver's rollback doesn't unfortunately affect it's
own running statements. For 81sp3 we added code to explicitly cancel any ongoing
statement during a rollback. This may be what you need to free up those
threads and the socekts the driver may be keeping open. If you can upgrade
to a newer version of 8.1, this code will free you up. Alternately, you can
try either upgrading to Sybase'e latest driver or to our BEA driver for Sybase.
Ask support for the latest BEA driver package for 8.1.
Joe
>
Stacktrace of one of the threads at the time I took the thread dump....All the threads at the time of taking the thread dump are stuck in a similar fashion.
ExecuteThread: '3' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x00883a90 nid=0x10 runnable [6d080000..6d0819c0]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sybase.jdbc2.timedio.RawDbio.reallyRead(RawDbio.java:202)
at com.sybase.jdbc2.timedio.Dbio.doRead(Dbio.java:243)
at com.sybase.jdbc2.timedio.InStreamMgr.readIfOwner(InStreamMgr.java:512)
at com.sybase.jdbc2.timedio.InStreamMgr.doRead(InStreamMgr.java:273)
at com.sybase.jdbc2.tds.TdsProtocolContext.getChunk(TdsProtocolContext.java:561)
at com.sybase.jdbc2.tds.PduInputFormatter.readPacket(PduInputFormatter.java:229)
at com.sybase.jdbc2.tds.PduInputFormatter.read(PduInputFormatter.java:62)
at com.sybase.jdbc2.tds.TdsInputStream.read(TdsInputStream.java:81)
at com.sybase.jdbc2.tds.TdsInputStream.readUnsignedByte(TdsInputStream.java:114)
at com.sybase.jdbc2.tds.Tds.nextResult(Tds.java:1850)
at com.sybase.jdbc2.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:204)
at com.sybase.jdbc2.jdbc.SybStatement.nextResult(SybStatement.java:187)
at com.sybase.jdbc2.jdbc.SybStatement.executeLoop(SybStatement.java:1698)
at com.sybase.jdbc2.jdbc.SybStatement.execute(SybStatement.java:1690)
at com.sybase.jdbc2.jdbc.SybCallableStatement.execute(SybCallableStatement.java:129)
at weblogic.jdbc.wrapper.PreparedStatement.execute(PreparedStatement.java:68)
at com.mizuho.rws.report.business.dao.FIReportsDAO.getReportList(FIReportsDAO.java:3463)
at com.mizuho.rws.report.business.businessObject.FIReports.getReportList(FIReports.java:98)
at com.mizuho.rws.report.business.ejb.FIReportsBean.getReportList(FIReportsBean.java:96)
at com.mizuho.rws.report.business.ejb.FIReports_4f92ds_EOImpl.getReportList(FIReports_4f92ds_EOImpl.java:270)
at com.mizuho.rws.report.client.delegates.FIReportsBusinessDelegates.getReportList(FIReportsBusinessDelegates.java:173)
at com.mizuho.rws.report.client.web.FIReportsAction.handleFIReportsBean(FIReportsAction.java:1759)
at com.mizuho.rws.report.client.web.FIReportsAction.performAction(FIReportsAction.java:349)
at com.mizuho.foundation.presentation.AppBaseAction.perform(AppBaseAction.java:143)
at com.mizuho.foundation.presentation.AppActionServlet.processActionPerform(AppActionServlet.java:518)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
at com.mizuho.foundation.presentation.AppActionServlet.doPost(AppActionServlet.java:562)
at com.mizuho.foundation.presentation.AppActionServlet.doGet(AppActionServlet.java:544)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
And the stack trace of the exception I recieved.
java.sql.SQLException: The transaction is no longer active - status: 'Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 299 seconds
Xid=BEA1-11FE69525362E51BFA16(6404670),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=299,seconds left=60,activeThread=Thread[ExecuteThread: '22' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=started,assigned=none),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@a68c0),SCInfo[Mizuho-RWS+myserver]=(state=active
),properties=({weblogic.jdbc=t3://10.104.8.81:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.104.8.81:7001+Mizuho-RWS+t3+, XAResources={},NonXAResources={})],CoordinatorURL=myserver+10.104.8.81:7001+Mizuho-RWS+t3+)]'. No further JDBC access is allowed within this transaction.
at weblogic.jdbc.wrapper.JTSConnection.checkIfRolledBack(JTSConnection.java:118)
at weblogic.jdbc.wrapper.JTSConnection.checkConnection(JTSConnection.java:127)
at weblogic.jdbc.wrapper.Statement.checkStatement(Statement.java:222)
at weblogic.jdbc.wrapper.PreparedStatement.setString(PreparedStatement.java:414)
at com.mizuho.rws.services.mail.business.dao.FIReportMailDAO.insertMailClientDetails(FIReportMailDAO.java:2790)
at com.mizuho.rws.services.mail.business.businessObject.FIReportMail.sendMail(FIReportMail.java:645)
at com.mizuho.rws.services.mail.business.ejb.MailerBean.sendFIReportMail(MailerBean.java:87)
at com.mizuho.rws.services.mail.business.ejb.Mailer_fyyt2g_EOImpl.sendFIReportMail(Mailer_fyyt2g_EOImpl.java:662)
at com.mizuho.rws.services.mail.client.delegates.MailerBeanBusinessDelegates.sendFIReportMail(MailerBeanBusinessDelegates.java:153)
at com.mizuho.rws.services.mail.business.businessObject.SendMailHandler.sendFIReportMail(SendMailHandler.java:181)
at com.mizuho.rws.services.mail.business.businessObject.SendMailHandler.resolveMail(SendMailHandler.java:429)
at com.mizuho.rws.services.mail.business.businessObject.SendMailHandler.notify(SendMailHandler.java:651)
at com.mizuho.foundation.utils.AppNotificationListener.handleNotification(AppNotificationListener.java:66)
at weblogic.time.common.internal.TimerListener$1.run(TimerListener.java:48)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.time.common.internal.TimerListener.deliverNotification(TimerListener.java:44)
at weblogic.management.timer.Timer.deliverNotifications(Timer.java:578)
at weblogic.time.common.internal.TimerNotification$1.run(TimerNotification.java:118)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
Regards
Raghu -
Problem:Accessing the file system with servlets ???
Hi...
I have a strange problem with my servlets that run on Win2000 with Apache and 2 Tomcat instances.
I cannot open files through servlets whereas exactly the same code lines work in local standalone java programm.
It seems to be somehting like a rights problem...but I dont know what to do.
thanks for any help
here are my configuration files for Apache and Tomcat:
Apache: *******************************************************
### Section 1: Global Environment
ServerRoot "D:/Webserver_and_Applications/Apache2"
PidFile logs/httpd.pid
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0
</IfModule>
Listen 80
LoadModule jk_module modules/mod_jk.dll
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule imap_module modules/mod_imap.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule userdir_module modules/mod_userdir.so
### Section 2: 'Main' server configuration
ServerAdmin [email protected]
ServerName www.testnet.com:80
UseCanonicalName Off
DocumentRoot "D:/Webserver_and_Applications/root"
JkMount /*.jsp loadbalancer
JkMount /servlet/* loadbalancer
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "D:/Webserver_and_Applications/root">
Order allow,deny
Allow from all
</Directory>
UserDir "My Documents/My Website"
DirectoryIndex index.html index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog logs/error.log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access.log common
ServerTokens Full
ServerSignature On
Alias /icons/ "D:/Webserver_and_Applications/Apache2/icons/"
<Directory "D:/Webserver_and_Applications/Apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /manual "D:/Webserver_and_Applications/Apache2/manual"
<Directory "D:/Webserver_and_Applications/Apache2/manual">
Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "d:/webserver_and_applications/root/cgi-bin/"
<Directory "D:/Webserver_and_Applications/root/cgi-bin/">
AllowOverride None
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
IndexOptions FancyIndexing VersionSort
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddLanguage zh-tw .tw
AddLanguage hr .hr
LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw
ForceLanguagePriority Prefer Fallback
AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
AddType application/x-tar .tgz
AddType image/x-icon .ico
AddHandler type-map var
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
ScriptAlias /php/ "d:/webserver_and_applications/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
Tomcat:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
<Server port="11005" shutdown="SHUTDOWN" debug="0">
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<!-- Define an AJP 1.3 Connector on port 11009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="11009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<!-- Define the top level container in our container hierarchy -->
<Engine jvmRoute="tomcat1" name="Standalone" defaultHost="localhost" debug="0">
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<Realm className="org.apache.catalina.realm.MemoryRealm" />
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<!-- Tomcat Root Context -->
<Context path="" docBase="d:/webserver_and_applications/root" debug="0"/>
<!-- Tomcat Manager Context -->
<Context path="/manager" docBase="manager"
debug="0" privileged="true"/>
<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_examples_log." suffix=".txt"
timestamp="true"/>
<Ejb name="ejb/EmplRecord" type="Entity"
home="com.wombat.empl.EmployeeRecordHome"
remote="com.wombat.empl.EmployeeRecord"/>
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/EmployeeAppDb">
<parameter><name>user</name><value>sa</value></parameter>
<parameter><name>password</name><value></value></parameter>
<parameter><name>driverClassName</name>
<value>org.hsql.jdbcDriver</value></parameter>
<parameter><name>driverName</name>
<value>jdbc:HypersonicSQL:database</value></parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
</Context>
</Host>
</Engine>
</Service>
<!-- Define an Apache-Connector Service -->
<Service name="Tomcat-Apache">
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="Apache" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="apache_log." suffix=".txt"
timestamp="true"/>
</Engine>
</Service>
</Server>
*** and here is my workers.properties : *******************************
# workers.properties
# In Unix, we use forward slashes:
ps=/
# list the workers by name
worker.list=tomcat1, tomcat2, loadbalancer
# First tomcat server
worker.tomcat1.port=11009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat1.cachesize
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=100
# Second tomcat server
worker.tomcat2.port=12009
worker.tomcat2.host=localhost
worker.tomcat2.type=ajp13
# Specify the size of the open connection cache.
#worker.tomcat2.cachesize
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.tomcat2.lbfactor=100
# Load Balancer worker
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1, tomcat2
# END workers.properties
thanks againHi joshman,
no I didn't get error messages as the relevant lines for reading/writing where between try statements, but you were where right it was/is just a simple path problem.
I expected the refering directory without using a path to be the directory where the servlet is in, but it is not !!??
Do you know if I set this in the setclasspath.bat of tomcat ?
*** set JAVA_ENDORSED_DIRS=%BASEDIR%\bin;%BASEDIR%\common\lib ***
thanks again
Huma -
Finder throwing error -1401 when attempting to open files on mounted volume
Alright, this is driving me nuts. At random, Finder will refuse to open files on a mounted volume on my server. It throws the error "The application can't be opened. -1401" and then "The operation can’t be completed. An unexpected error occurred (error code -1401)." back to back. It doesn't matter what the file type is, as far as I can tell (.jpg, .xlsx and .pdf are on there).
From that point on, I can navigate those volumes to the point that I have navigated them since the volume was mounted at start up, but can't go any deeper into the directories or open anything. Finder also won't eject the volume. I can't open files from within applications, either.
I have to reboot for it to work again.
However, if I jump into Parallels I can open anything on the server. Even Acrobat files, which open in the Mac environment and not within the virtual machine.
Does anyone have any insight to what might be causing this? I searched and can't find anything.
Thanks,
BrianRestart your computer with the Shift key held down,
and then open the Startup Items folder inside the
System Folder. Throw away all of the aliases you find
in this folder and then empty the trash.
To quit AppleWorks or another application when it
won't respond, hold down the Option, Command, and Esc
keys, and then click the Force Quit button. You
should also use the Disk First Aid application in the
Applications (Mac OS 9):Utilities folder to verify
your hard disk, as something may have been damaged
when you shut the machine down using that method.
(11882) -
Snow Leopard 10.6.2 CS4 InDesign can't open files with a "#" in file path
Snow Leopard 10.6.2 CS4 InDesign can't open files with a "#" in file path using any of these perfectly normal methods:
1. double-click file in the Finder (e.g in a Folder on your Mac or on your Mac desktop etc.)
2. select file and choose "File... Open" command-o in the Finder
3. drag file to the application icon in the Finder.
4. Select file in Bridge and double-click, choose File.. Open.. or Drag icon to InDesign icon in dock.
If you try to open an ID file named with a "#", you will get an error message "Missing required parameter 'from' for event 'open.'"
This happens to any InDesign file that has a "#" (pound sign, number sign, or hash) in the filename or in the file path (any parent folder).
To reproduce
Name an InDesign file Test#.idd Try to open it in the Finder or Bridge (as opposed to the "Open" dilaog of InDeisng itself).
"Solution"
The file WILL open using File... Open... command-o while in InDesign application.
Rename the file or folders that have a "#" (shift-3) in the filename.
Report to Adobe if it bugs you.
This does not occur in "plain" Leopard 10.5 nor Tiger 10.4
Untested in Panther or before and
Untested with CS3 and earlier in Snow Leaopard.
Anyone have those and want to try this... ?In case this really bothers you: we've added a workaround for this into Soxy. If you enable the option, these documents will open fine on double-click.
You need Soxy 1.0.7 from:
http://www.rorohiko.com/soxy
Go to the 'Soxy' - 'Preferences' - 'Other' dialog window, and enable 'Open InDesign via Script'
(Irrelevant background info (it's all invisible to the user): the workaround works by special-casing how Soxy opens documents in InDesign: instead of using AppleScript, Soxy will use ExtendScript to instruct InDesign to open the document - which works fine).
Maybe you are looking for
-
Web Page hangs in Firefox when loading Google Analytics
About 1 month ago I noticed that Firefox hangs when loading websites while loading analytics. I know this because it shows analytics loading on the lower left side of the screen. I've read many posts around the net and I don't have a solution yet. Of
-
White default background color in indesign pdf file
When I export in indesign cs6 pdf file (I made a digital flipbook and I want to upload it on my website) there is a white default color in the background. Is there a way to get rid of this white default color or make it transparent in indesign?
-
I've had this problem ever since I loaded Leopard, but not sure it's related. I have a Canon MP800 printer hooked up to Airport and never have had a problem, but all of a sudden, I can't print to the printer unless I unhook it from the base station a
-
Link ECC roles to Portal roles (Portal is using LDAP source for UME)
Hi all, If a user is assigned a certain ECC ABAP role, they should also receive a related portal role. Our portal is using LDAP. If our portal ume source was an ABAP system, I think it would be easy to achieve the ECC to ABAP role linkage. We were t
-
SOS, need solution! Applet!
Hi all, I urgently need solution for this program in Java, if sobebody can make this program for me, or even tell me where I can find solution and how? Thanks You are required to create an interface with the following choices: �Choice1: Enter a New R