Promote JS!

September 27th, 2010 by Henning Spjelkavik

JavaScript Reference, JavaScript Guide, JavaScript API, JS API, JS Guide, JS Reference, Learn JS, JS Documentation

Yet another org.hibernate.LazyInitializationException!

July 15th, 2010 by Henning Spjelkavik

Have you inherited a rather old web-app that used Hibernate, Spring, Struts and OpenSessionInViewFilter, and after upgrading to the latest version of everything, you get a nasty org.hibernate.LazyInitializationException - No session - even though you have OpenSessionInViewFilter and OpenSessionInViewInterceptor?

We had several problems in our configuration. One was that the spring config was loaded twice - once through the webapp loader (ContextLoaderListener) and once through the spring plugin.

The next case gave us the LazyInitializationException even though the debugger showed that the OpenSessionInViewFilter was on the stacktrace! How come? Well, more tracing showed that the proxied object was fetched from the session - and the proxy looked for the same session as it had been initialized with - but that session was now closed. Solution? Reattach or Hibernate.initialize.

IMHO best practice is to avoid OpenSessionInViewFilter - but that’s more work with an old app than it’s worth. I think.

ivy 2.1, ant and cygwin

November 20th, 2009 by Henning Spjelkavik

Do you get this nice error message when trying to compile on cygwin?

impossible to configure ivy:settings with given file:
C:\data\properties\ant\ivy2-conf.xml :
java.text.ParseException: failed to load settings from
file:/C:/data/properties/ant/ivy2-conf.xml: impossible to
add configured child for ivy on class
org.apache.ivy.plugins.resolver.FileSystemResolver: ivy
pattern must be absolute

You need to override the dest.repo.dir -property to be a a full path on windows. The easiest way to do it is to specify a system property when running ant:
ant -Ddest.repo.dir=c:/data/ivy-root install

Taming Jawr

October 26th, 2009 by Gregers

Jawr is a servlet for delivering javascript, css and images as fast as possible, as few times as possible. That it does very well! What it’s not very good at is being fail safe. With default settings it takes over your /js and /css folders, and tries to prepare everything they contain. That might be very good if you’re running a small blog or a simple company profile page. But if you’re trying to make it work on a multi-domain-portal which runs on a cluster. It most certainly will give you a few headaches, but in the end it will give you amazing load-time results! See our results at the end of the article.
Read the rest of this entry »

Verdistrømanalyse på Smidig2009

October 23rd, 2009 by Henning Spjelkavik

Takk til alle som deltok på Lean-sesjonene og diskusjonene etterpå under Smidig2009! Her er slides fra mitt foredrag om verdistrømanalyse (value stream mapping).

Tandberg-gutta har allerede lagt ut video av (nesten) alle foredragene på Smidig2009. Se Henning live. :)

Henning Spjelkavik

Lean - Reading list

October 23rd, 2009 by Henning Spjelkavik

In an Open space discussion at Smidig 2009 we discussed which books to read in order to learn more about lean, and specifically kanban in IT. Here are some suggestions:

Running VisualVM through an ssh tunnel with SOCKS

October 8th, 2009 by Henning Spjelkavik

More productivity => more time for skiing!VisualVM was included for the first time with JDK 6u07, and is improving with every release.

For our production environment there is one huge show stopper: It doesn’t work very well through firewalls. RMI allocates a random port number, which is unpractical when we want to tunnel the traffic with SSH. A possibility has been to use WideCap, tsocks or a similar proxifier, but we were really looking for a cleaner solution.

With a combination of a SOCKS proxy (like putty or openssh!), and setting some system properties on startup, we’ll traverse the firewalls!

Run “ssh -D 9696 your.production.internal.com” and you’ll have a SOCKS server on localhost. (Or add a dynamic tunnel in Putt). In this way you can tunnel jstat traffic with a command like this:
jstat -gcutil -J-DsocksProxyHost=localhost -J-DsocksProxyPort=9696 25883@cluster1.internal.com

ExplorerBut unfortunately VisualVM does not support the system properties setting a global SOCKS proxy. However, VisualVM is based on Netbeans, and in the sources we find that Netbeans have a more advanced support for proxies, letting you select between http proxies or SOCKS proxies.

We finally managed to run VisualVM over SSH with the following command line:
visualvm.exe -J-Dnetbeans.system_socks_proxy=localhost:9696 -J-Djava.net.useSystemProxies=true

Resizing a tablespace

July 29th, 2009 by Henning Spjelkavik

Some time ago the webcam history table exploded. It’s now purged, and will be kept at a managable size. However, the tablespace was auto-extending, and eating up all the disk space. It’s possible to resize an oracle datafile, down to the highest block that is in use.

alter database datafile ’skiinfo_01.dbf’ resize 1500m;

From metalink, asktom ++ you can find scripts for generating a “map” of the tablespace. We rebuilt tables and indexes that were allocated at the end of the tablespace, and had almost 1000 fragments of free space at the end. The tablespace has automatic segment management, but they were not coalesced (neither automatically by SMON, nor manually worked)- and they were not freeable. We purged the recyclebin of the user, but we still got ORA-03297.

Finally, the solution that worked for us was to logon as /, and issue

purge dba_recyclebin

Seconds later the free space segments were coalesced, and the resize command worked!

Testing pluggins - part 1

May 2nd, 2009 by Erlend

We are trying out a few WordPress plugins for user feedback. We want you, the Skiinfo users, to come with new ideas and feed back on existing features. First plugin out is UserVoice, let’s see how this works…

To test it you need to open this post (click the tile) and use the “Feedback” button on the right hand side.

Thank you for testing! Feel free to give feedback on the feedback plugin in comments or in the tool itself ;-)

Auditing in Oracle

April 18th, 2008 by Henning Spjelkavik

Our Oracle database experienced a resource intensive query every 30 minutes. Sounds like a cron-job, but I couldn’t find any of ours. However, somewhere in the enterprise manager a query was counting the number of failed logins the last days. But our AUD$ table had 22 million rows… and it had a full scan. A truncate table sys.aud$ got rid of that.
Probably, the full auditing was enabled at some time for debugging, but never turned off.