• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 41
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
author & internet detective
Posts: 42109
934
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic