From wiki.ucalgary.ca
Jump to: navigation, search

WebObjects Java Debugging

Instructions online at [1]

To tap into jdb, add this to your Monitor settings for an app:

-Xdebug -Xrunjdwp:transport=dt_socket,address=8121,server=y,suspend=n

To fire up a debugger, do this:

$ jdb -attach 8121

Make sure the address (in this case, 8121) is the same in Monitor and the jdb call. And, it has to be unique for each java app, so increment as needed if there are more java apps running on the same box that you will want to insert a debugging session into.

Then, to get to the gooey core of the thread status:

where all

That will suspend all threads so you can dump their state, dump the state of all threads, and resume the app, and then quit the debugging session.

PreviewGen Thumbnail Location

defaults write NSGlobalDomain APPreviewRootPath /Library/WebServer/Documents/resources/apollo/previews

PreviewGen hostname Config

If PreviewGen isn't storing the correct URL for preview images, be sure the hostname for the server is correct. Add an entry to /etc/hostconfig like:

# Network configuration

This should ensure that the proper URLs are stored for image previews.

Note: You can test this before making it permanent, by using this:

sudo hostname www.pachyderm.org

Then, restart the WebObjects app(s) and see if it worked. If that solved the problem, make it permanent by adding the entry to /etc/hostconfig

MySQL UTF-8 Character Encoding

To make sure that the MySQL java connector uses UTF-8 when dealing with strings, set the connection URL thusly:

URL = "jdbc:mysql://localhost/assets_mav?useUnicode=true&characterEncoding=UTF-8";