Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)  RSS feed

 
maya brown
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is baffling me.. for one thing I never get this error when viewing my photo site from home, only when on another machine..

ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

this always prints in logs in conjunction with a nullpointer...

for nullpointer it gives line in jsp servlets, it's always this line:
if (imgsList.length == 0) {

what I do is I use java.io to count how many images are in 'images' dir (diff no. of images in 'images' dir for every page in my photosite).. is it possible that when that code runs sometimes the app hasn't quite loaded and read that 'images' dir yet? is there an equiv in JSP to jQuery's $(document).ready or something so that I'm sure app has fully loaded before it reads how many images are in 'images' dir? again, this error occurs intermittently, and never in my machine at home.. I only find out the hard way whenever am looking @ my site in an internet cafe or something... (even at work I never get it.. even if I clear cache...)

this is code I run to count images in 'images' dir:
FPath = "/chroot/home/............../apache-tomcat-5.5.25/webapps/" + sContext + "/" + sCurrSection + "/" + sCurrPage + "/images/";

File dir = new File(FPath);
String[] imgsList;
imgsList = dir.list();
if (imgsList.length == 0) { // etc...

I have been using this code unchanged in my app for about three years.. don't get why it's throwing this weird error now (intermittently at that...)

thank you..


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maya brown wrote:is it possible that when that code runs sometimes the app hasn't quite loaded and read that 'images' dir yet?

No.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!