Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
robert crowther
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34839
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
robert crowther
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic