This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 41971 - Context log is unavailable/Subsequent use of UI action leads to error
Summary: Context log is unavailable/Subsequent use of UI action leads to error
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 3.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-14 20:06 UTC by Ana.von Klopp
Modified: 2006-06-05 00:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ana.von Klopp 2004-04-14 20:06:02 UTC
To reproduce: 

Day 1. 

1) Bring up the context log and leave it open in 
the editor. Exit the IDE without closing the 
context log. 

Day 2:

2) Open the IDE again. The pld log file is still 
open in the text editor. Normally Tomcat creates a 
log file with the current date on it, but for 
whatever reason, this does not happen. 

If you exit the log file from the tab, and try to 
open it again, nothing happens. Restarting the 
server does not cause a log file to appear. 

This means that the user cannot engage in the 
normal debugging activity of checking what the 
container or their own resources logged to the 
context log.
Comment 1 Ana.von Klopp 2004-04-14 20:59:30 UTC
I get an OutOfMemory error when I try to use the view context log 
action after restarting the IDE. 
Comment 2 Petr Jiricka 2004-04-15 09:22:20 UTC
Milan, can you please look at this?
Comment 3 Milan Kuchtiak 2004-06-01 15:37:19 UTC
In 3.6, I was able to reproduce the issue (except of OutOfMemmory
error). The OutOfMemmory depends likely on the size of the log file.  

Nevertheless, in Promo-D I cannot reproduce the issue at all.
After some investigation I found that it was fixed already.

The explanation :

The FileObject:findResource("logs/"+ lastLogFile.getName());
method returns null in 3.6 for catalinaBase since (Catalina_Base)
filesystem was not refreshed after new log file was created.
That's why the new log file is not open.

Now, there is a

FileObject:base.getFileObject("logs/"+ lastLogFile.getName());
method that returns right file object for newly created log file.
(the implementation of the method is enough smart to refresh the
filesystem automatically)

This is the diff file how to fix the issue for 3.6 :

diff -c -r1.4 LogUtils.java
*** LogUtils.java	19 Feb 2004 12:19:16 -0000	1.4
--- LogUtils.java	1 Jun 2004 14:32:23 -0000
***************
*** 54,59 ****
--- 54,62 ----
          FileSystem base = mng.getCatalinaBaseFileSystem();
          if (base != null) {
              FileObject fo = base.findResource("logs/"+
lastLogFile.getName());
+             // trying to refresh the filesystem
+             if (fo==null) base.refresh();
+             fo = base.findResource("logs/"+ lastLogFile.getName());
              if (fo!=null) {
                  LogUtils.showLogFile(fo); // TextData Object -
trying write to editor window
              }
Comment 4 Milan Kuchtiak 2004-06-01 15:54:12 UTC
There is a small mistake in diff file :
refresh method should be called with boolean argument : refresh (true);
Comment 5 Petr Blaha 2004-08-04 15:10:09 UTC
Build 20040802