Java.io.FilenotFoundException (bad File Discriptor)
in my project i am facing one exception that is :
Java.io.FileNotFoundException (Bad File Discriptor)
when this exception coming tell me briefly
Either your filesystem has gone awry or you are doing something wrong in your code. I suspect the latter.
Please post your formatted code using the code tags.
Similar Messages
-
I started jetty in nonstop server on port 18095 and it was running fine, few days later suddenly noticed it consumes more CPU, when I check the log noticed the following log writing continiously
2015-07-08 13:25:48.606:WARN:oejs.ServerConnector:qtp26807578-18-acceptor-0@182e42f-ServerConnector@1f02fde {HTTP/1.1}{0.0.0.0:18095}:
java.io.IOException: Bad file descriptor (errno:4009)
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:241)
at org.eclipse.jetty.server.ServerConnector.accept(ServerConnector.java:377)
at org.eclipse.jetty.server.AbstractConnector$Acceptor.run(AbstractConnector.java:500)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:724)
Can any one guess the root cause. Thanks.I am using jdbc to connect the database. I want to update the blob fields that is picture into the database. Now i am using preparedstatement to update the fields. When it causes error, it will closed automatically. At that time, it causes bad file descriptor.
-
Exception clearing file manager: java.io.IOException: Bad file number
I see the following exception when closing the environment. Not reproducible easily, happens only with production user's data occasionally. Any ideas on what causes this and what can be done to resolve it?
com.sleepycat.je.RunRecoveryException: (JE 3.2.74)
Exception clearing file manager: java.io.IOException: Bad file number
at com.sleepycat.je.dbi.EnvironmentImpl.doClose(EnvironmentImpl.java:1123)
at com.sleepycat.je.dbi.EnvironmentImpl.close(EnvironmentImpl.java:995)
at com.sleepycat.je.Environment.close(Environment.java:322)Thanks for the pointers.
We are running on Solaris.
I located a narrow window in our code where another thread from the same process was permitted to close the environment when a close is already in progress. Will plug that window. -
Forwarding/Redirecting throws java.io.FileNotFoundException but file exists
http://www.mydomain.com/common/handler.jsp:
<jsp:forward page="/common/error_page.jsp" />This throws a java.io.FileNotFoundException:
java.io.FileNotFoundException: resource not found: /common/error_page.jspHowever, I can go to http://www.mydomain.com/common/error_page.jsp and verify that it does indeed exist.
Why would it throw a FileNotFoundException if not only does the forwarding page exist but exists within the exact same web module?
I checked ibm-web-ext.xml for the "common" web module to notice that fileServingEnabled="true".
Any ideas why this is happening?A forward is relative to the context root - not the server's root.
So assuming you have a web application called "common", and "common" is its context name, then "/" would already refer to http://www.mydomain.com/common/
Thus your forward should just be to "/handler.jsp"
A redirect is slightly different, because it is resolved on the client, not the server.
So if you had a web context "myContext"
You access it with http://www.mydomain.com/myContext
<jsp:forward page="/mypage.jsp"> (or getRequestDispatcher("/mypage.jsp")) would refer you to http://www.mydomain.com/myContext/mypage.jsp.
to achieve the same destination with a redirect you would have to have
response.sendRedirect("/myContext/mypage.jsp"); -
Upload-Szenario - WDRuntimeException Bad file descriptor
Hi All,
i'm using the Adobe Document Services on a NW04, ADS SP 19, NWDS 2.0.19 with IE 6.0.2900 SP2.
If i use the Upload-UI-Element to show a PDF i got the error: Bad file descriptor !!
The PDF to upload is not corrupt, an i can open it with Acrobat Reader or the Tutorial (Download-Upload-Szenario) - Example.
I had a binary Value-Attribute mapped as Data-Element of the UploadUI-Element. Read the Context-Value-Attribute to the controller context element and the Interactive Form Element had the reference to the attribute as pdfsource. The same code as the tutorial.
What's wrong ?
I didn't find anything about the error !
Thanks for help.
Regards Jürgen
Exception(com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Bad file descriptor) during processing a Web Dynpro Application, Session with IDs: (J2EE7802600)ID1177271450DB10984010199363513659End,78651230d78a11db9c34000d608e44df,Id78651230d78a11db9c34000d608e44df6
[EXCEPTION]
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Bad file descriptor
at com.sap.tc.webdynpro.clientimpl.http.client.AbstractHttpClient.updateUpLoad(AbstractHttpClient.java:478)
at com.sap.tc.webdynpro.progmodel.context.ModifiableBinaryType.parse(ModifiableBinaryType.java:95)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.doParse(DataContainer.java:1418)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.validatePendingUserInput(DataContainer.java:1328)
at com.sap.tc.webdynpro.clientserver.data.DataContainer.validatePendingUserInput(DataContainer.java:672)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.validate(ClientComponent.java:624)
at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.validate(ClientApplication.java:741)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.transportData(WebDynproMainTask.java:712)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:160)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.io.IOException: Bad file descriptor
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:177)
at com.sap.tc.webdynpro.clientimpl.http.client.AbstractHttpClient.writeIn2Out(AbstractHttpClient.java:493)
at com.sap.tc.webdynpro.clientimpl.http.client.AbstractHttpClient.updateUpLoad(AbstractHttpClient.java:435)
... 29 moreTwo things I think helped to solve this
PROPAGATE_EXCEPTIONS = True
in config.py and I removed threading from my vassal ini file the ending uwsgi files looked like this:
/etc/uwsgi/emperor.ini:
[uwsgi]
emperor = /etc/uwsgi/vassals
master = true
plugins = python2
uid = http
gid = http
[/etc/uwsgi/vassals/test.ini:
[uwsgi]
chdir = /srv/http/test_dir/src
wsgi-file = run.py
callable = app
processes = 4
stats = 127.0.0.1:9191
max-requests = 5000
enable-threads = true
vacuum = true
thunder-lock = true
socket = /run/uwsgi/test-sock.sock
chmod-socket = 664
harakiri = 60
logto = /var/log/uwsgi/test.log
Not sure on the
PROPAGATE_EXCEPTIONS = True
but removing the threads option in test.ini and making sure there was a master option in emperor.ini seemed to have solved the issue of sql being tossed around to different treads, or at least it complaining about it and crashing the site out, either or.
Also don't use the uwsgi from this distribution, get it from pip, the distros are broken. -
Bad File Descriptor when I try to create an Tale
I am getting the following error when I execute the ./dbca on Red Hat Linux
java.io.IOException: Bad file descriptor
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:194)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:408)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:450)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:182)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine$ErrorStreamReader.run(SQLEngine.java:1985)
at java.lang.Thread.run(Thread.java:534)Hello Naveen,
I am experiencing exactly the same error message when trying to create a database through dbca(RH LInux). The assistant guides me through the process of locating the directories and naming the database but when I validate all choices and try to finish up the process I get the following error and dbca seem to enter some kind of loop. However nothing of the database is created. Did you manage to pass that stage if yes could you let me know how you went throught it. I am stuck to that point and no script was generated to manually create the DB.
If anyone else has a clue your advices are much awaited thanks in advance.
Nzavi
java.io.IOException: Bad file descriptor
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder$CharsetSD.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine$ErrorStreamReader.run(SQLEngine.java:1985)
at java.lang.Thread.run(Unknown Source) -
Bad file number - comes when i upload the file
While i tried to upload the file more 300 kb (any file type)to 2 apache server using nfsmount (nfsmnt-apache 1 and nfsmnt2 -apache 2) through weblogic 9.2 (it is running in linux), i got the following exception, but less 200kb file i can upload the file (any type) to both apache server.
java.io.IOException: Bad file number at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileInputStream.java:177) at
anybody known this prob, pls help meSuggestion: read [the documentation|http://commons.apache.org/fileupload/using.html] for it.
By default it will store files in memory up to about 10k. Larger than that will be written to disk.
If you are really worried about memory, perhaps you should take a look at the [streaming API|http://commons.apache.org/fileupload/streaming.html]
How large are the files being uploaded?
How many users are we talking about? -
I am installing OIM/OAM in a cluster configuration using release 11.1.1.7.
I looked at the EDG here:
http://docs.oracle.com/cd/E28280_01/core.1111/e12035/toc.htm
And its pointing me to the 11.1.1.5 version
http://docs.oracle.com/cd/E21764_01/core.1111/e12035/toc.htm
So that is the guide I am following.
I am at this step:
18.1.5.2 Integrating Oracle Access Manager with Oracle Identity Manager by Using idmConfigTool
http://docs.oracle.com/cd/E21764_01/core.1111/e12035/wiring.htm#sthref356
When I run the config tool I get SEVERE messages like this one:
SEVERE: java.io.FileNotFoundException: ./config/jps-config.xml (No such file or directory)
Any suggestions on how to fix this ?
Please note that I can see jps-config.xml under the domain configuration in the fmwconfig directory.
Here is the complete output
Enter sso access gate password :
Enter sso keystore jks password :
Enter sso global passphrase :
Enter mds db schema password :
Enter idstore admin password :
Enter admin server user password :
********* Seeding OAM Passwds in OIM *********
Completed loading user inputs for - CSF Config
Completed loading user inputs for - Dogwood Admin WLS
Connecting to t3://admin.mycompany.com:7001
Connection to domain runtime mbean server established
Seeding credential :SSOAccessKey
Seeding credential :SSOGlobalPP
Seeding credential :SSOKeystoreKey
********* Activating OAM Notifications *********
Completed loading user inputs for - MDS DB Config
Jun 6, 2013 1:46:05 PM oracle.mds
NOTIFICATION: PManager instance is created without multitenancy support as JVM flag "oracle.multitenant.enabled" is not set to enable multitenancy support.
Jun 6, 2013 1:46:06 PM oracle.security.jps.internal.config.xml.XmlConfigurationFactory initDefaultConfiguration
SEVERE: java.io.FileNotFoundException: ./config/jps-config.xml (No such file or directory)
Jun 6, 2013 1:46:06 PM oracle.mds
NOTIFICATION: Auditing is disabled for component MDS.
Initialized MDS resources
Jun 6, 2013 1:46:06 PM oracle.mds
NOTIFICATION: PManager instance is created without multitenancy support as JVM flag "oracle.multitenant.enabled" is not set to enable multitenancy support.
Jun 6, 2013 1:46:06 PM oracle.security.jps.internal.config.xml.XmlConfigurationFactory initDefaultConfiguration
SEVERE: java.io.FileNotFoundException: ./config/jps-config.xml (No such file or directory)
Jun 6, 2013 1:46:06 PM oracle.mds
NOTIFICATION: Auditing is disabled for component MDS.
Jun 6, 2013 1:46:07 PM oracle.mds
NOTIFICATION: transfer operation started.
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: transfer is completed. Total number of documents successfully processed : 1, total number of documents failed : 0.
Upload to DB completed
Releasing all resources
Notifications activated.
********* Seeding OAM Config in OIM *********
Completed loading user inputs for - OAM Access Config
Validated input values
Initialized MDS resources
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: PManager instance is created without multitenancy support as JVM flag "oracle.multitenant.enabled" is not set to enable multitenancy support.
Jun 6, 2013 1:46:08 PM oracle.security.jps.internal.config.xml.XmlConfigurationFactory initDefaultConfiguration
SEVERE: java.io.FileNotFoundException: ./config/jps-config.xml (No such file or directory)
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: Auditing is disabled for component MDS.
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: transfer operation started.
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: transfer is completed. Total number of documents successfully processed : 1, total number of documents failed : 0.
Download from DB completed
Releasing all resources
Updated /oracle/product/fmw/Oracle_IAM/server/oamMetadata/db/oim-config.xml
Initialized MDS resources
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: PManager instance is created without multitenancy support as JVM flag "oracle.multitenant.enabled" is not set to enable multitenancy support.
Jun 6, 2013 1:46:08 PM oracle.security.jps.internal.config.xml.XmlConfigurationFactory initDefaultConfiguration
SEVERE: java.io.FileNotFoundException: ./config/jps-config.xml (No such file or directory)
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: Auditing is disabled for component MDS.
Jun 6, 2013 1:46:08 PM oracle.mds
NOTIFICATION: transfer operation started.
Jun 6, 2013 1:46:09 PM oracle.mds
NOTIFICATION: transfer is completed. Total number of documents successfully processed : 1, total number of documents failed : 0.
Upload to DB completed
Releasing all resources
OAM configuration seeded. Please restart oim server.
********* Configuring Authenticators in OIM WLS *********
Completed loading user inputs for - LDAP connection info
Connecting to t3://admin.mycompany.com:7001
Connection to domain runtime mbean server established
Starting edit session
Edit session started
Connected to security realm.
Validating provider configuration
Validated desired authentication providers
OAM Asserter already exists in the security realm
OAMIDAsserter is already configured to support 11g webgate
OIM Signature Authenticator already exists in the security realm
A type of LDAP Authenticator already exists in the security realm. Please create authenticator manually if different LDAP provider is required.
Control flags for authenticators set sucessfully
Reordering of authenticators done sucessfully
Saving the transaction
Transaction saved
Activating the changes
Changes Activated. Edit session ended.
Connection closed sucessfully
The tool has completed its operation. Details have been logged to automation.logi found this task :
JDev 11.1.1.1.0 + ADF+ BC4J application on Tomcat6 -
File Making Directories Problem. java.io.FileNotFoundException
When ever I run my program it is SUPPOSED to make the directories, instead it tells me the file doesn't exist and fails.
Here is my Code:
* To change this template, choose Tools | Templates
* and open the template in the editor.
package passworddatamacsetup;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
* @author jacobgarber
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
try {
File PasswordDATA = new File("/Applications/PasswordDATA");
PasswordDATA.mkdirs();
File passwords = new File("/Applications/PasswordDATA/PasswordFiles");
passwords.mkdirs();
File main = new File("./PasswordDATA_-_MAC.jar");
File out = new File(PasswordDATA.getPath()+"/PasswordDATA.jar");
copy(main, PasswordDATA);
JOptionPane.showMessageDialog(null, "Framework setup complete!", "Completed!", JOptionPane.INFORMATION_MESSAGE);
} catch(Exception ex) {
JOptionPane.showMessageDialog(null, ex);
// Copies src file to dst file.
// If the dst file does not exist, it is created
public static void copy(File src, File dst) throws IOException {
try {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
in.close();
out.close();
} catch (FileNotFoundException ex) {
JOptionPane.showMessageDialog(null, ex);
}Here is my exception:
java.io.FileNotFoundException: /Applications/PasswordDATAThis looks suspicious:
File out = new File(PasswordDATA.getPath()+"/PasswordDATA.jar");
copy(main, PasswordDATA);You probably meant:
File out = new File(PasswordDATA.getPath()+"/PasswordDATA.jar");
copy(main, out); -
Java error message - Bad version number in .class file
I get the error noted below in Safari, Firefox, and Chrome when I try to view java containing web pages.
Specifically this page: http://aviationweather.gov/adds/tafs/java/
My Java Preferences are as follows
My OS is 10.5.8
Thanks!
Java Plug-in 1.6.0_26
Using JRE version 1.5.0_30-b03-389-9M3425 Java HotSpot(TM) Client VM
User home directory = /Users/ernest
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Plugin2ClassLoader.java :1014)
at sun.plugin2.applet.Plugin2ClassLoader.access$100(Plugin2ClassLoader.java:69)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:991)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:9 55)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:134)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:675)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.ja va:1498)
at java.lang.Thread.run(Thread.java:655)
Exception: java.lang.UnsupportedClassVersionError: Bad version number in .class fileHi, thank you for the reply. However, java is definitely enabled on my computer, on all my browsers. In fact, if I go to the SUN website and run the java test, I get that all is OK.
I think it may have something to do with the .class (maybe in .jar-file) compiled with a higher version of java than the virtual machine trying to run it.
The example I found (google search) is .class-file that is compiled with JDK 6 and I am trying to run it with 1.4 JVM.
There is some software error going on somewhere... but I do not know enough to fix it.
Many thanks for all your help -
Hi All,
am getting the following error, help me out. Thanks in advance...
java.io.FileNotFoundException: test.txt (The system cannot find the file specified)
java.io.FileInputStream.open(Native Method)
java.io.FileInputStream.<init>(FileInputStream.java:106)
java.io.FileInputStream.<init>(FileInputStream.java:66)
BinaryStreamServlet.doGet(BinaryStreamServlet.java:13)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
I have placed "test.txt" in the path"D:\Backup\Tomcat web server\apache-tomcat-6.0.14\webapps\examples\WEB-INF\classes\test.txt".
web.xml entry is as follows,
<servlet>
<servlet-name>demoservlet2</servlet-name>
<servlet-class>BinaryStreamServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>demoservlet2</servlet-name>
<url-pattern>/demoservlet2</url-pattern>
</servlet-mapping>
Source code:
import java.io.*;
import java.net.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class BinaryStreamServlet extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{
response.setContentType("text/plain"); /* set the MIME type */
File f= new File("test.txt");
byte[] arBytes = new byte[(int) f.length()];
FileInputStream is= new FileInputStream("test.txt");
is.read(arBytes);
OutputStream os = response.getOutputStream();
os.write(arBytes);
os.flush();
}I have one Drivers.xml file in /WEB-INF that i want to read .but everytime i get exception file not found..
i m trying to read this xml file in DriverUtilties.java (a non servlet class)
inside of /WEB-INF/classess folder is there and hierarchy for non-servlet class DriverUtilties is :- com.dds.apps.ptes.pidentifier.admin.util.common.DriverUtilties
what code shall i write so that i can read the xml file. ???
where i set in classpath ?
MYCODE is like this :
public static final String DEFAULT_FILE = "/WEB-INF/drivers.xml";
InputStream in = new FileInputStream(DEFAULT_FILE);
Thanks in advance -
Java.io.FileNotFoundException (Too many file open)
Hi,
I have an application wherein I have to open an XMl file, make amends to it and then write it back. It is possible that the same XML file be opened more than once. After processing lots of XMl files I get the following error:
[java] java.io.FileNotFoundException: /nas/bansalp/app/databases/databases/IntActe_human_528_psimi.xml (Too many open files)
[java] at java.io.FileInputStream.open(Native Method)
[java] at java.io.FileInputStream.<init>(FileInputStream.java:106)
[java] at java.io.FileInputStream.<init>(FileInputStream.java:66)
[java] at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
[java] at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
[java] at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:653)
[java] at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
[java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
[java] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
[java] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
[java] at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
[java] at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
[java] at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
[java] at alliance.dps.Commons.makedocument(Unknown Source)Code for makedocument is as follows:
public static Document makedocument(File file) throws Exception
Document response = null;
DocumentBuilder builder = null;
try
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
builder = builderFactory.newDocumentBuilder();
if (file==null)
response = builder.newDocument();
else
response = builder.parse(file);
catch(Exception e) { e.printStackTrace(); }
return response;
}Here also I am not explicitely opening any handle. parse method should close the file after creating a DOM tree.
I would appreciate if someone could give me some directions as to what might be wrong.
- ParitI'm finding that builder.parse(File) doesn't close the file. I now create a FileInputStream from the File and make sure I close it myself in a finally{} block.
-
Receiving java.io.FileNotFoundException: (No such file or directory)
Hi,
I'm trying to use XML Bursting program in 11.5.10. I have uploaded the control file, data template. But the XML Publisher Bursting program completes with error and below is the error message in the log file:
XML/BI Publisher Version : 5.6.3
Request ID: 51460124
All Parameters: ReportRequestID=51460123:DebugFlag=Y
Report Req ID: 51460123
Debug Flag: Y
Updating request description
Updated description
Retrieving XML request information
Node Name:WWWPDCDSORACD01
Preparing parameters
null output =/wdevp/ora/applmgr/comn/admin/out/WDEVP_wwwpdcdsoracd01/o51460124.out
inputfilename =/wdevp/ora/applmgr/comn/admin/out/WDEVP_wwwpdcdsoracd01/o51460123.out
Data XML File:/wdevp/ora/applmgr/comn/admin/out/WDEVP_wwwpdcdsoracd01/o51460123.out
Set Bursting parameters..
Temp. Directory:/tmp
[060211_015430388][][STATEMENT] Oracle XML Parser version ::: Oracle XDK Java 9.0.4.0.0 Production
[060211_015430412][][STATEMENT] setOAProperties called..
Bursting propertes.....
{user-variable:cp:territory=US, user-variable:cp:ReportRequestID=51460123, user-variable:cp:language=en, user-variable:cp:responsibility=54886, user-variable.OA_MEDIA=http://wwwpdcdsoraca01.wyn.wyndhamworldwide.com:8018/OA_MEDIA, burstng-source=EBS, user-variable:cp:DebugFlag=Y, user-variable:cp:parent_request_id=51460123, user-variable:cp:locale=en-US, user-variable:cp:user=CDUSER, user-variable:cp:application_short_name=XDO, user-variable:cp:request_id=51460124, user-variable:cp:org_id=6188, user-variable:cp:reportdescription=Separate Remittance Advice - BIP}
Start bursting process..
Bursting process complete..
Generating Bursting Status Report..
--Exception
/tmp/060211_015430711/Remit_Advice_100454.pdf (No such file or directory)
java.io.FileNotFoundException: /tmp/060211_015430711/Remit_Advice_100454.pdf (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.zipOutputFiles(JCP4XDOBurstingEngine.java:523)
at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:292)
at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
I do not see any sub folder 060211_015430711 under /tmp folder.
Any help ...
Thanks
AnandHi,
Yes, i was able to fix the issue. The template associated with the bursting process needs to be in a single table. I had 2 separate tables due to which the program was completing with error. When i placed both those tables in a single table the issue was resolved.
Regards,
Anand -
Getting java.io.FileNotFoundException: Too many open files
I have search for different strings in a file again and again. I am using following code:
try
fileReaderObject = new BufferedReader(new FileReader(fileObject));
String inputLine;
while ((inputLine = fileReaderObject.readLine()) != null)
if (zipCode.equalsIgnoreCase(inputLine.split("\t")[0]))
s = inputLine;
fileReaderObject.close();
return s;
fileReaderObject.close();
catch (Exception e)
Utils.writeMessage(e.toString());
e.printStackTrace();
}But getting java.io.FileNotFoundException:file/emp_info (Too many open files)
1. Whats the main reason of this exception and how can it be removed.
2. Is there any way to move the pointer to the start of the file. I tried reset() but its seems to have some problem.
-vcA hint: your fileReaderObject is not closed if an exception occurs.
Lacking desctructors, the Java-ish way is to close in a finally clause. -
We are using WL 8.1 SP4 on RH Linux 7.2 and have this (non-critical, but annoying) error during runtime. When it hits, the same error gets printed out like a 100 times.
This one is really blowing my mind. I have searched through all our files (including binaries) for "dummylog" and "dummylog.txt" and can't find anything referring to this log file, so where the heck could it be coming from?
This error happens at least each time a user logs in to our application:
java.io.FileNotFoundException: d:/tmp/dummylog.txt (No such file or directory)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
at java.io.FileWriter.<init>(FileWriter.java:90)
at com.takecargo.utils.SimpleDebugger.write(SimpleDebugger.java:27)
at com.takecargo.utils.SimpleDebugger.debug(SimpleDebugger.java:17)
at com.takecargo.services.ldap.authentication.LdapLoginModuleImpl.abort(LdapLoginModuleImpl.java:251)
at weblogic.security.service.DelegateLoginModuleImpl.abort(DelegateLoginModuleImpl.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
at javax.security.auth.login.LoginContext.login(LoginContext.java:540)
at weblogic.security.service.PrincipalAuthenticator.authInternal(PrincipalAuthenticator.java:331)
at weblogic.security.service.PrincipalAuthenticator.authenticate(PrincipalAuthenticator.java:284)
at weblogic.jndi.WLInitialContextFactoryDelegate.authenticateLocally(WLInitialContextFactoryDelegate.java:582)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:525)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:341)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:313)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:239)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.takecargo.utils.jms.asp.MessageSenderClient.getInitialContext(MessageSenderClient.java:170)
at com.takecargo.utils.jms.asp.MessageSenderClient.initialize(MessageSenderClient.java:46)
at com.takecargo.utils.jms.asp.MessageSenderClient.sendMessage(MessageSenderClient.java:89)
at com.takecargo.facade.message.messagesender.transportXml.TransportXmlSender.sendMessage(TransportXmlSender.java:1239)
at com.takecargo.facade.message.messagesender.transportXml.TransportXmlSender.sendTransportXml(TransportXmlSender.java:243)
at com.takecargo.facade.message.messagesender.MessageSenderBean.sendMessage(MessageSenderBean.java:210)
at com.takecargo.facade.message.messagesender.MessageSenderBean.sendMessage(MessageSenderBean.java:148)
at com.takecargo.facade.message.messagesender.MessageSender_uog2mo_ELOImpl.sendMessage(MessageSender_uog2mo_ELOImpl.java:46)
at com.takecargo.facade.message.JMSSendMessageQueueDispatcher.onMessage(JMSSendMessageQueueDispatcher.java:98)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:370)
at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:262)
at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2678)
at weblogic.jms.client.JMSSession.execute(JMSSession.java:2598)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Message was edited by:
nickleusFrom the stacktrace,
com.takecargo.utils.SimpleDebugger.write(SimpleDebugger.java:27)
this seems to try to write the file. Do you know what that is? Also create the file with that name manually and see if it works.
Thanks,
-satya
Maybe you are looking for
-
Hi All, this is in BI7.0 In 0Material , there are two navigational attributes as 0division, 0matl_grp_4. In my BEx Query , 0 material is in ROWS and 0division and 0matl_grp_4 are in the filter section with variable for each one. when user executes th
-
Windows 8.1 with boot camp on mac mini troubles
After installing a licensed Windows 8.1 with boot camp on my mac mini (2012,i7,4gb ram) my mac os Mavericks have trouble with starting,and i can't run recovery and safe mode.Another problem-i don't have sound in windows,but windows show me no trouble
-
Why is my Itunes "Purchased" list empty?
My Ipod is missing "Ten Million Slaves" by Otis Taylor, I would download it again, but not able to. I checked my computer in the music and media files and its not there either...and not on the Ipod. I went to the Itunes store and there are no purchas
-
Folder View - Folders arranged alphabetically first than all other files ..
Hi, is it possible to view folders like windows or linux? I found nothing in the internet, only a lot of of people having the same problem like me. I want a folder view, where the folders came first sorted alphabetically than all other files ( not so
-
Unsanity related blue screen of death
I decided to post this as a separate thread from the ongoing blue screen of death, as that thread seems to be mostly related to those upgrading to Leopard. My situation is slightly different. There appears to be two separate issues related to this bl