Running Apache MyFaces on Tomcat 5.5.x and below

I’ve recently been looking at JavaServer Faces (specifically Apache’s MyFaces), playing about on my home Tomcat 5.5.27 installation, using Maven2 to do my dependency management, builds etc…

…largely unsuccessfully. I just could not get the darned example app to start, with exceptions along the lines of:

20-Apr-2009 22:27:04 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.NoClassDefFoundError: javax/el/ExpressionFactory
at org.apache.myfaces.webapp.StartupServletContextListener.getFacesInitializer…

appearing in the tomcat localhost log files.
Continue reading “Running Apache MyFaces on Tomcat 5.5.x and below”

Semi-Structured Data and the Web – Day 5.5

Two weeks later, on deadline day…

I think I defeated the XQuery assignment. It took the best part of a week, guessing at around 18 hours,  but my 485 lines of code handle everything I can think of that was within the spec of the assignment. It was loads of fun handling transformations from various combinations of sequences, choices, star-expressions, minOccurs and maxOccurs in an element to a XML description of regular expressions, as well as implementing a combinations generator and a function to filter out unique elements in a sequence of elements.

I’m sure all that stuff with a functional lean is pretty old hat to someone who’s a Python, Erlang, F# or Haskell guru, but for little ol’ me with my OO background, it was pretty painful to swap my thinking over to immutable variables (which I’m sure is a contradiction in terms!), a complete inability to track state and just plain indulgence in recursion.

In short, it was brilliant. Exactly what I’m here for, to get out of my ‘comfort zone’ and learn new ways of thinking. Continue reading “Semi-Structured Data and the Web – Day 5.5”

Semi-Structured Data and the Web – Day 5

It’s been an enlightening week on the homework front.

Having had some experience with XML before, I know how easy it is to mess up writing XML, particularly if you’re doing it by hand. Nesting wrong here, a tag misspelled there… although XML is, technically speaking, ‘human readable’, it’s not exactly human-friendly. It’s extremely precise, tends to be very verbose, and has newlines, tabs and other whitespace mixed in which tickles the ol’ natural human intuition about structure but is structurally meaningless to the machine. (Google ‘xml human readable’ for loads of articles on the subject.) Continue reading “Semi-Structured Data and the Web – Day 5”

Semi-Structured Data and the Web – Day 4

Homework this work was rather tricky – transforming XMLSchema into a tree grammar representation using XQuery. Sounds simple enough, but I now feel a certain revulsion, maybe even extending as far as hatred, towards XQuery. To be honest, I think it’s got a lot to do with the fact that XQuery is a functional language, and I’m new to the whole functional thing. It feels a little like programming by explosion… Towards the deadline, I think I was starting to get the hang of it. You just have to think a little… differently. Unfortunately, it took too long for me to figure this out and get the homework assignment done, so we had to hand in a partially complete assignment. Not liking that much.

On the menu today: More tree grammar stuff, including algorithms to validate an instance document against a grammar, Schematron (a rule-based document validation language)  and XSugar – all of which have more homework assignments set. No time for more blogging, too much work to do!

Semi-Structured Data and the Web – Day 3

Woah.

It always worries me a little when the greek symbols come out. So far, we’ve pretty much avoided them in the Semi-Structured Data and the Web course, so to see them today, whilst not really unexpected, did make my heart sink a little. Continue reading “Semi-Structured Data and the Web – Day 3”

Semi-Structured Data and the Web – Day 2

So, after little snow towards the end of the week, it pelted down on Sunday night, leaving the pavements and roads like an ice rink at 6am – I only narrowly avoided sliding down the hill to the tram stop on my backside. It’s at times like this I’m very glad of my thermos mug of tea!

Scheduling around last week’s coursework didn’t go perfectly – we ended up working til late on the Sunday night to finish off the last bits. Unfortunately, I wasn’t able to meet up with my groupmate last week as it was quite late in the day before we actually sorted out the group assignments. It would have been handy to meet up and get a plan of attack together for the week’s coursework, and we were – perhaps – a little uncoordinated. That said, we just about made it, and everything got in on time. 08:55, for a 9am deadline kind of on-time, that is. Continue reading “Semi-Structured Data and the Web – Day 2”

Semi-Structured Data and the Web – Day 1

I was greeted by a blanket of picture-postcard pristine white snow when I stepped outside this morning. No footprints, no slush, not another person in sight… fantastic. That’s what you get for being up and out at ten to six in the morning though.

It’s the first day of Semi-Structured Data and the Web, (effectively) my first MSc module. Having learnt from my last experience, I emailed the course directors a couple of months ago with their list of recommended pre-requisite knowledge and my description of my experiences in those areas, asking for advice as to whether I was suitable for the course, and what additional preparation I could take.

As much as I’d like to make a self-deprecating quip here, I have to say that one of the two lecturers for the course responded inside of an hour, with a pretty comprehensive point-by-point rundown of my questions, recommending areas of study to concentrate on. Top marks, and I’ve had chance to learn enough to know what the words mean, at least. Continue reading “Semi-Structured Data and the Web – Day 1”

Faster Java – Strings

If you’re building a long String in Java, don’t stick String objects together using ‘+’, for example:

String str = "Hello";
str = str + world;
str = str + "!";

Why not?

It’s really slow when you do it a lot!

What should you do instead?

Use the append(String) method in StringBuffer (Java 1.4.2 on), or StringBuilder (Java 5 on). StringBuilder is slightly faster than StringBuffer, but is not thread safe. Both are much faster than concatenating String objects – by orders of magnitude. For example:

StringBuffer str = new StringBuffer("Hello");
str.append(world);
str.append("!");

Continue reading “Faster Java – Strings”

Semantic Web@Geekup Sheffield

For anyone curious about this Semantic Web thing, you could check out Ian Ibbo’s introductory slideshow…



It’s the first part of series he’s doing at the Sheffield Geekups over the next few months, so there’s more if your appetite is whetted. There were rave reviews from the introductory talk…Next one will be at Sheffield’s Showroom cinema on the first Wednesday of February.Cheers!