Tuesday, December 8, 2009

Mac OX X irritants

I just started working on Mac OS X 1.5 and hit some major irritants which needed work-around:

  1. Mac OS X (at-least 1.5.x) has no easy way to display date and time in the menu bar. Followed instructions at MacInstruct website to copy the date format and paste it in time format. Note: I had to change all the time formats (short, long, medium, all) before making it work. I also had to go back to clock menu and remove "Show day of the week". Can't figure out how Mac hasn't solved such a big usability problem so far.
  2. By default you can't use tab in firefox to focus on drop down menus. This is easy to fix. Just need to go to Mac Preferences->Keyboard & Mouse->Keyboard Shortcuts and check "All controls" at the bottom under "Full keyboard access" topic.

Wednesday, June 3, 2009

Firefox: HOW TO REMOVE: "This Website Does Not Supply Identity Information"

This is a major irritant while adding bookmarks.

See Mozilla Support Forum for original post.

1. open the preferences page with the link about:config( i.e. type about:config in the location bar)

if the browser complains, click on the button to calm it :)

2. write: tips

3. in the list of prefs, find: browser.chrome.toolbar_tips

4. double click on it to change to false

5. tips disabled!

Wednesday, March 11, 2009

Ignoring loading external DTD while reading/parsing XML files

I encountered this problem while using xalan-J for XPath queries. We were using default xerces xml parser implementation. Our XML files referred to a DTD which we didn't have access to.

There are a number of workarounds for this. Choose the best that fits your situation.
  1. Remove the DTD declaration from XML file.
  2. Create an empty DTD file and turn off DTD validation.
  3. Turn off downloading of external DTDs and validation if the XML reader/parser implementation supports it. To do this for xerces, we did following:

    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    // Ignore loading external DTD
    dfactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
    // turn-off validation which will require DTD to be present
    dfactory.setFeature(”http://xml.org/sax/features/validation”, false);
Somehow above code fragment does not wrap-around nicely when viewed in FF3. If anybody knows how to fix, let me know.

Thanks to Denish for the 3rd workaround.

Monday, February 23, 2009

JBoss 4.2 class loading problems

By default Jboss 4.2 does non-scoped class loading i.e. all EARs share the same class loader. This is non-J2EE but default way of doing things in JBoss. If you want an EAR to have its own class-loader (you wan different versions of the same library in different EARs), you need to include jboss-app.xml with following configuration:


<jboss-app>
<loader-repository>
${package-name}:archive=${unique-name}
</loader-repository>
</jboss-app>

An example:
<jboss-app>
<loader-repository>
com.shital:archive=test1
</loader-repository>
</jboss-app>


This needs to be done for each EJB which needs a scoped class loader. Make sure that unique-name in above example is unique for each EAR!

This file should be packaged in the same dir as application.xml.