This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JForum and the fly likes JForum in Eclipse/Tomcat - gotchas2, the localhost{date} log Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "JForum in Eclipse/Tomcat - gotchas2, the localhost{date} log" Watch "JForum in Eclipse/Tomcat - gotchas2, the localhost{date} log" New topic
Author

JForum in Eclipse/Tomcat - gotchas2, the localhost{date} log

robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
Eclipse reduces it's log monitoring to following stdout. This is not at all helpful for debugging a webapp like JForum, as template errors will not show. In a browser, template errors look like this,

An error has occurred.

For detailed error information, please see the HTML source code, and contact the forum Administrator.

java.lang.NullPointerException


This webpage is derived from the (hard to back-trace) exception.htm. The errors in templates are very important, as code is summoned from them.

The log which is really helpful is,

localhost_access_log.{the currentdate}.txt

Haplessly, unless someone posts a neater solution, a plugin, or some similar help, I currently keep a filebrowser open on the internals of Eclipse.

Where is this set of dated log files? Well, Eclipse constructs a virtual/clone of the deployed Tomcat, so it's not where you think you deployed it. Only way I found is to,

double click on servers in the lower panel

this opens a panel called "overview",

"Open launch configuration" > Arguments > VMArguments

Look for the argument "catalina.base". It looks like,

-Dcatalina.base="{path to Eclipse_workspace}/.metadata/.plugins/org.eclipse.wst.server.core/tmp0

Cut and paste the path into a filebrowser, and the folders of the Virtual Machine will be visible. One of the folders is called "logs", and the host log files are in there.

Not good instructions for me, but maybe I'm missing something,
http://stackoverflow.com/questions/2233053/where-can-i-view-tomcat-log-files-in-eclipse

If anyone has a better way, e.g. knows better than me how to to configure Eclipse for a special view, for example, please post.

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30795
    
157

When launching through Eclipse, the Tomcat std out is in the Eclipse console view. And yes, template errors do show up there.

Not showing details of errors in the browser is actually a security feature. The idea is not to give hackers to much information about the implementation of the code and how close they are getting to an attack.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
robert crowther
Ranch Hand

Joined: Oct 19, 2013
Posts: 41
    
  10
My description is too loose. "Much JForum code is triggered by templates, errors in that code will return the template 'exception.htm'".

As described above, there is good reason for this public action. Eclipse is not geared to help developers here, though (in an odd twist, my deployment environment has better coverage of Tomcat logs).
 
 
subject: JForum in Eclipse/Tomcat - gotchas2, the localhost{date} log