Maven classpath issues at compile time

Here’s a very weird Maven/Java issue. The error message (below) occurs in my build phase where JaxB is called to produce some Java objects from XML. JaxB calls HyperJaxB, and on some systems it crashes. [ERROR] XJC while compiling schema(s): org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log ...

February 8, 2008 · Nigel Sim

ManyToOne reference loading with JPA/Hibernate

In this example an InvestigationType has many SampleType’s. If I load an InvestigationType via em (entity manager) find it also loads the samples. InvestigationType inv2 = (InvestigationType) em.find( InvestigationType.class, inv.getId()); System.out.println(“Inv2 ID="+inv2.getId()); System.out.println(“Inv2 Title="+inv2.getTitle()); assertTrue(inv2.getSample().size() == 2); However, if I load a SampleType the investigation field is null, unless I refresh the object. // Get a sample SampleType s3 = (SampleType) em.find( SampleType.class, inv2.getSample().get(0).getId()); em.refresh(s3); System.out.println(convertDataToXmlString(s3)); InvestigationType inv3 = s3.getInvestigation(); assertNotNull(inv3); From my understanding I should not have to do this as the fetching should be the same in both instances, ie resolving the parent by default. Similarly, if I query for both objects the references are correctly loaded. ...

January 8, 2008 · Nigel Sim

Slashdot | Is Apple Killing Linux on the Desktop?

Slashdot | Is Apple Killing Linux on the Desktop? This is a summary of my experiences walking the path between Linux (Ubuntu/Gnome) and OSX. For background I’ve been using Linux on the desktop for about 7 years, and only in the past 2 months have purchased a MacBook. For years I’ve been using linux on the desktop, first Debian/Gnome and more recently Ubuntu/Gnome. I must say I really appreciated how well configured the Ubuntu desktop was out-of-the-box, and through good things coming together, how well the dynamic monitor configuration worked. As a programmer, web monkey, researcher and academic writer I had no complaints about the Linux desktop per se. I didn’t really miss any applications, and VM ware could certainly facilitate whatever was required. ...

January 6, 2008 · Nigel Sim

Hibernate, spring, and different jars

The situation is this. I had a working application which used Hibernate annotated classes, and JTA for data bindings, within a spring framework. Then I moved the annotated classes into a Jar file, and the application stopped working. Hibernate knew nothing about the classes because the PersistenceAnnotationBeanPostProcessor does not traverse into the JARS on the classpath. Further neither the entity manager or HibernateJpaVendorAdapter have options to specify the explicit paths to the classes. ...

November 25, 2007 · Nigel Sim

Spring 2.0.6 and ACEGI

Because ACEGI depends on spring 1.2.6, we need to override a few dependencies if we want to use spring 2.0.6. To do this, we use the following exclusions:

October 1, 2007 · Nigel Sim

Setting up Tomcat behind Apache 2.2 in a hierarchical path

The situation I want to deal with is this: Public Web Root |-plone \-portals |-portal1 (server A) \-portal2 (server B) In apache 2.2 they (the writers of the Apache docs) seem to prefer the use of mod_proxy_ajp, which is an AJP/1.3 driver for mod_proxy. At the apache end we just install mod_proxy_ajp and add a line such as the following to the proxy_ajp.conf file: ProxyPass /portals/portal1 ajp://nigel-dev:8009/portals/portal1 Note that the paths on the proxy host and the application server are the same. This is important, as at the application end it will only know its path name from its context, and unless you want to do some url rewriting, and possible use something called ProxyHTMLURLMap. It, like most potentially useful software, isn’t available in Red Hat, so we can’t investigate this option. ...

September 28, 2007 · Nigel Sim

Maven-Ant hybrid

Some brief background. Ant is the stock standard Java build system, much as Make is for C/C++. Maven is a newer Java build system which tried to, amongst other things, solver the Jar dependency hell problem, as well as make a standard project directory layout. From the Maven guide: <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.9</version> </dependency> Now when you go to compile with maven it goes and gets all the dependencies, puts them in your local repository (~/.m2/repository) and then into your project’s build class path. This is covered in more detail at the Maven website. ...

July 20, 2007 · Nigel Sim

Multi-node PBS script for non-mpi jobs

function spawn() { NODE=$1 COUNT=$2 echo Spawning $COUNT on $NODE rsh $NODE -n “~/mark.sh” & #rsh $NODE -n “cd $PWD ; ./run.sh –agent –threads $COUNT” & } LAST= COUNT=0 for N in $NODES ; do if [ “$N” = “$LAST” ] ; then COUNT=$[COUNT+1] else if [ 0 -ne $COUNT ] ; then spawn $LAST $COUNT fi COUNT=1 LAST=$N fi done if [ 0 -ne $COUNT ] ; then spawn $LAST $COUNT fi ...

July 5, 2007 · Nigel Sim

Topic has moved on every forum post w/ fix.

On one of my sites which has been around since 4.6, and now runs 5.1 I was having an issue where all my forum posts ended up with “Topic has moved” messages, which pointed to nowhere (term/0). This seems to have been caused by us originally allowing multiple selections of forum topics. Of course the newest versions of Forum do no allow this, and prevent you from selecting this option. However it was still enabled on this site due to the migration path. So, a few SQL queries to fix the issue. First we need to fix the broken posts ...

May 30, 2007 · Nigel Sim

Handy login hint

I had need to replace the standard “Access Denied” page in drupal with a login form, which is when I discovered that you can specify a message following the node/login path. IE, under Admin/Settings/Error Handling, my Default 403 page is now: user/login/Access was denied. Perhaps you need to login or register. So when someone doesn’t have an account and needs to be logged in they are presented with the message, and when they login will be sent back to the area they were trying to access. ...

April 11, 2007 · Nigel Sim