A hint for the “Object foo is not a known entity type” errors from Glassfish

As a JavaEE-codemonkey you have perhaps noticed this error:

java.lang.IllegalArgumentException: Object: Ting@193c227 is not a known entity type.

This will occur when you have redeployed an app f.ex through Eclipse to Glassfish, the Glassfish server has not quite understood that it`s time to update its version, so what you need to do then is to simply restart the server (or domain).

Show/hide a div with javascript

Looking for a simple javascript to show/hide a given text/element?

Here`s all you need! 🙂

<!--
   Simple show/hide system
   @author - Tor Henning Ueland
-->
<script language="javascript" type="text/javascript">

        //ShowHide function - takes the div ID as argument
        function showHide(divId) {

                //Switch the display mode for the the div to hide
                var theDiv = document.getElementById(divId);
                if(theDiv.style.display == 'block')
                        theDiv.style.display = 'none';
                else
                        theDiv.style.display = 'block';

                //Remove this part if you dont want a "show/hide" text
                var showText = document.getElementById("showText");
                var hideText = document.getElementById("hideText");

                //Switch the display mode for the the show/hide text/div
                if(showText.style.display == 'block') {
                        showText.style.display = 'none';
                        hideText.style.display = 'block';
                } else {
                        showText.style.display = 'block';
                        hideText.style.display = 'none';
                }
        }
</script>

<div id="showHideMe" style="display:none;">
        Now you see me!
</div>

<a href="#" onClick="showHide('showHideMe')">
        <div id="showText" style="display:block;">Show</div>
        <div id="hideText" style="display:none;">Hide</div>
</a>

Fix for the “Out of memory! Callback called exit.” error in Request Tracker (RT)

When RT is upgraded, users can experience WSOD(White Screen Of Death), all the log will say is:
“Out of memory! Callback called exit.”. Not so informative eh?

The solution is pretty simple, run this query in the database:

“ALTER TABLE sessions CHANGE a_session a_session LONGBLOB;”

Then clear the table with:

TRUNCATE TABLE `sessions`;

Any logged in users will be logged out, but the problem should disappear.