aspose file tools*
The moose likes Applets and the fly likes java.io.FileNotFoundException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "java.io.FileNotFoundException:" Watch "java.io.FileNotFoundException:" New topic
Author

java.io.FileNotFoundException:

Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
Hello I inherited a java web application to support. Currently the application is in production and I am trying to build a developer environment for future changes. I am trying to run the application but I get the java.io.FileNotFoundException: error in the Java Console. It seems it is looking for retrotranslator-runtime-1.2.7.jar file which is in my Tomcat5\webapps\jars folder. I have modified my classpath by adding the path to the jar directory. But I still keep getting the same FileNotFoundException. I have check file permissions and it has read access to every account. Unfortunately there was no knowledge transfer with the previous developers. I was able to get some of the modules to work but not all of them. I am currently running Java6, Apache Tomcat 5 on Win XP environment. What else can I check for? Please advise.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

Can you show us the exception stack trace?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
Java Plug-in 1.6.0_18
Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\msimpao

----------------------------------------------------
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>
----------------------------------------------------

security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
network: Cache entry found [url: http://localhost/FDIS/reviewer/rv_loading.gif, version: null] prevalidated=false/0
network: Connecting http://localhost/FDIS/reviewer/rv_loading.gif with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
network: Connecting http://localhost/FDIS/reviewer/rv_loading.gif with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
network: ResponseCode for http://localhost/FDIS/reviewer/rv_loading.gif : 304
network: Encoding for http://localhost/FDIS/reviewer/rv_loading.gif : null
network: Disconnect connection to http://localhost/FDIS/reviewer/rv_loading.gif
security: Blacklist revocation check is enabled
cache: Skip blacklist check as cached value is ok.
network: Cache entry found [url: http://localhost/fdis/jars/FDIS_Reviewer.jar, version: null] prevalidated=true/0
network: Connecting http://localhost/fdis/jars/FDIS_Reviewer.jar with proxy=DIRECT
network: Connecting http://localhost/fdis/jars/FDIS_Reviewer.jar with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
network: ResponseCode for http://localhost/fdis/jars/FDIS_Reviewer.jar : 304
network: Encoding for http://localhost/fdis/jars/FDIS_Reviewer.jar : null
network: Disconnect connection to http://localhost/fdis/jars/FDIS_Reviewer.jar
cache: Read manifest for http://localhost/fdis/jars/FDIS_Reviewer.jar: read=145 full=7771
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 149121 us, pluginInit dt 312855 us, TotalTime: 461976 us
baseUrl = [http://localhost/FDIS/reviewer/] length()=[31]
final servletUrl = [http://localhost/FDIS/fdis/claim]
final exitUrl = [http://localhost/FDIS/reviewer/exit.asp]
cache: Skip blacklist check as cached value is ok.
network: Cache entry found [url: http://localhost/fdis/jars/com.jar, version: null] prevalidated=false/0
network: Connecting http://localhost/fdis/jars/com.jar with proxy=DIRECT
network: Connecting http://localhost/fdis/jars/com.jar with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
network: ResponseCode for http://localhost/fdis/jars/com.jar : 304
network: Encoding for http://localhost/fdis/jars/com.jar : null
network: Disconnect connection to http://localhost/fdis/jars/com.jar
cache: Read manifest for http://localhost/fdis/jars/com.jar: read=145 full=2505
cache: Skip blacklist check as cached value is ok.
network: Cache entry found [url: http://localhost/fdis/jars/systran.jar, version: null] prevalidated=false/0
network: Connecting http://localhost/fdis/jars/systran.jar with proxy=DIRECT
network: Connecting http://localhost/fdis/jars/systran.jar with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
network: ResponseCode for http://localhost/fdis/jars/systran.jar : 304
network: Encoding for http://localhost/fdis/jars/systran.jar : null
network: Disconnect connection to http://localhost/fdis/jars/systran.jar
cache: Read manifest for http://localhost/fdis/jars/systran.jar: read=319 full=319
cache: Skip blacklist check as cached value is ok.
network: Cache entry found [url: http://localhost/fdis/jars/language.jar, version: null] prevalidated=true/0
network: Connecting http://localhost/fdis/jars/language.jar with proxy=DIRECT
network: Connecting http://localhost/fdis/jars/language.jar with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
network: ResponseCode for http://localhost/fdis/jars/language.jar : 304
network: Encoding for http://localhost/fdis/jars/language.jar : null
network: Disconnect connection to http://localhost/fdis/jars/language.jar
cache: Read manifest for http://localhost/fdis/jars/language.jar: read=804 full=804
network: Cache entry not found [url: http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar, version: null]
network: Connecting http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar with proxy=DIRECT
network: Connecting http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
java.io.FileNotFoundException: http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
at sun.plugin.PluginURLJarFileCallBack$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getJarFile(Unknown Source)
at sun.misc.URLClassPath$JarLoader.access$600(Unknown Source)
at sun.misc.URLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(Unknown Source)
at sun.misc.URLClassPath$JarLoader.<init>(Unknown Source)
at sun.misc.URLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.getLoader(Unknown Source)
at sun.misc.URLClassPath.findResource(Unknown Source)
at java.net.URLClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getResourceAsStream(Unknown Source)
at java.lang.Class.getResourceAsStream(Unknown Source)
at FDIS.client.applet.FDISApplet.jbInit(FDISApplet.java:134)
at FDIS.client.applet.FDISApplet.init(FDISApplet.java:56)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
network: Cache entry not found [url: http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar, version: null]
network: Connecting http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
network: Connecting http://localhost/FDIS/fdis/jars/retrotranslator-runtime-1.2.7.jar with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
network: Cache entry not found [url: http://localhost/FDIS/reviewer/FDIS/client/common/Reviewer_en_Logo.jpg, version: null]
network: Connecting http://localhost/FDIS/reviewer/FDIS/client/common/Reviewer_en_Logo.jpg with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
network: Connecting http://localhost/FDIS/reviewer/FDIS/client/common/Reviewer_en_Logo.jpg with cookie "ASPSESSIONIDQCBCSBQA=FKMHGKJCLHKMLHFHFJKMHIJA"
java.lang.NullPointerException
at FDIS.utils.FDISUtils.loadImage(FDISUtils.java:84)
at FDIS.client.applet.FDISApplet.jbInit(FDISApplet.java:135)
at FDIS.client.applet.FDISApplet.init(FDISApplet.java:56)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at FDIS.client.applet.FDISApplet.jbInit(FDISApplet.java:136)
at FDIS.client.applet.FDISApplet.init(FDISApplet.java:56)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
basic: Applet initialized
basic: Applet made visible
basic: Starting applet
basic: completed perf rollup
basic: Applet started
basic: Told clients applet is started
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You're not giving us much to go on, but are you sure the jar is being deployed where you think it is? It *looks* like an applet is trying to load the jar or something. Hard to tell with all the extra stuff in there.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

The stack trace that you are showing us is from an applet.

Applets run on the client, not on the server, where Tomcat runs. If that applets needs a certain JAR file, the JAR file has to be made available at the client; it doesn't matter that it's in your Tomcat5\webapps\jars folder, because that's part of the server side Java code.

So it looks like the problem is on the client side where the applet is missing something; you'll have to focus on that, not on the server side Java code running in Tomcat.

It's long ago that I wrote an applet, so I don't remember the exact things you'd have to do to make a library available to an applet. Sun's tutorial about applets might be useful.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36501
    
  16
Welcome to the Ranch

This question is too difficult for "beginning Java™" so I shall move it.
Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
Thank you for the lead, I will explore that aspect.
Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
I did some checking and it seems the application is using a codebase property to download the needed files from the server or client. Is there a way to determine the codebase property?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
"codebase" is an attribute of the APPLET tag, so you can find its value in the HTML. If it isn't there, then it's the base directory from which the HTML page is served, possibly http://localhost/FDIS/reviewer/ or http://localhost/fdis/jars/

What is the directory layout of all involved files? Which URL are you using to access the web page?


Ping & DNS - updated with new look and Ping home screen widget
Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
I am using the following URL to access the webpage:
http://localhost/FDIS/reviewer

The directory layout of files is Tomcat5\webapps\fdis\jars. All my classes are in the jar files and I placed them on the jars directory in Tomcat.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Be aware that "...FDIS..." and "...fdis..." are not the same.
Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
Yes, I am aware of the case sensitivity, but there is more to the application. The app uses Classic ASP, Microsoft's IIS, Apache Tomcat and a JK2 connector between IIS and Tomcat. In trying to set up a development environment on my XP desktop, I set up a default IIS web site with all caps "FDIS" to point to a local directory in my C drive that has all the ASP and html files. I also created a folder in the webapps folder in Tomcat called lower case "fdis" folder which has all the jar files. The way its suppose to work, the app loads the classic ASP page and based on what the user chooses calls another ASP page that has object declarations embeded in the ASP page. These make calls to Tomcat through the JK2 connector, which supposedly routes them to the jar files that are needed to launch the applet. I dont have experience with IIS talking with Tomcat but as you can see based on the stack trace I sent, the path it is using is

http://localhost/FDIS/fdis/jars. I dont know at this stage if this is correct given the environment I just described. But this is the path that it is trying to use to get to the jar files.

I did a trace on a production client machine that is accessing the application properly and got the following stack.

basic: Plugin2ClassLoader.addURL parent called for https://www.XXX.XXX.com/fdis/jars/retrotranslator-runtime-1.2.7.jar

As you can see it differs there is no capital FDIS. I thought the "FDIS" is referring to IIS first then rerouting it to Tomcat to the "fdis" folder. Has anybody done anything similar to this? Since there was no knowledge transfer with the previous developers, minimal outdated documentation and no development environment, I am pretty much just guessing on how this is set up. Unfortunately we dont have access to the current production environment to see how things really should be set up.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18127
    
    8

This doesn't particularly seem to be a problem about applets. It's more about... well, I don't know. Tomcat? We have a forum for that. Would you like the post moved to that forum? It might get better (or at least different) answers over there. Let me know if you would.
Martin Simpao
Greenhorn

Joined: May 25, 2010
Posts: 11
Yes, please if you can. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.io.FileNotFoundException:
 
Similar Threads
Modifying existing jar file, how?
unable to read the properties file in my jar
SQLite and connecting with Java Swing Application
jar file execution
Jasper Report and JAR file