forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <>
Subject Re: Building Forrest 2
Date Wed, 13 Dec 2006 13:14:25 GMT
Gav.... wrote:
>> -----Original Message-----
>> From: Ross Gardler []
>> Sent: Thursday, 23 November 2006 9:13 AM
>> To:
>> Subject: Re: Building Forrest 2
> <snip>
>> I really am trying to do too many things tonight (the Ashes have start
>> as well, so that's me out of the real world for 5 days)
>> It's in
>> re/org/apache/forrest/core/
>> The CLI calls the default constructor which calls
>> this("src/locationmap.xml", "src/forrestContext.xml");
>> The file resolution is in the parameterised constructor and consists of
>> two parts:
>> final File file = new File(contextPath);
>> and
>> this.context = new FileSystemXmlApplicationContext(file
>> .getAbsolutePath());
>> (contextPath in the first line is the "src/forrestContext.xml")
>> The problem is that getAbsolutePath() should be getPath().
>> I've made the change, please test.
>> Ross
> Just got round to trying this and mine fails :-
>      [java] 828  [main] DEBUG
> org.apache.forrest.core.locationMap.LocationMap (?
> :?)  - Adding location:
> Matcher:org.apache.forrest.core.matcher.REMatcher@1242b1
> 1
>      [java] org.apache.forrest.core.exception.ProcessingException: Unable to
> cre
> ate the output documents for helloWorld.html because null caused by null

Now there is a useful error message! It has been improved in the latest 
SVN, I think, but if you did an SVN up then obviously not.

Anyway, I just tried the "Getting Started" instructions word for word 
and reproduced the error you report. I must have broken something in my 
recent work. All the automated tests run, but the getting started 
instructions do not.

I'll look at this ASAP, but it won't be for a few days.

If you are interested in looking into the problem the key is:

      [java]  Processing request for helloWorld.html
      [java] 4717 [main] DEBUG org.apache.forrest.cli.CLI ( 
  - Proces
sing: helloWorld.html
      [java] 4717 [main] DEBUG 
org.apache.forrest.core.locationMap.LocationMap (L  - Getting potential locations for request of
      [java] 4777 [main] INFO 
org.apache.forrest.core.locationMap.LocationMap (L  - 1 potential location from pattern (.*)/(.*).html
      [java] org.apache.forrest.core.exception.ProcessingException: 
Unable to cre
ate the output documents for helloWorld.html caused by Unable to get a 
source do
cument for request helloWorld.html
      [java]     at 
      [java]     at org.apache.forrest.cli.CLI.processURIs(
      [java]     at org.apache.forrest.cli.CLI.main(
      [java] 4787 [main] ERROR org.apache.forrest.cli.CLI ( 
  - org.ap
ache.forrest.core.exception.ProcessingException: Unable to create the 
output doc
uments for helloWorld.html caused by Unable to get a source document for 
      [java] Caused by: 
org.apache.forrest.core.exception.ProcessingException: Un
able to get a source document for request helloWorld.html

(note the improved error messages in the latest version)

It looks like the reader is unable to find the source document, but it 
is finding a potential match in the locationmap.

Three possibilities immediately jump to mind:

- the reader is not finding the resource (perhaps it is not being copied 
into the classpath by the build system - it's not copyless yet)

- the reader is incorrectly loading the source document (I've done lots 
of refactoring of the readers and internal docs recently, so this could 
be the case - need to add better log messages to the readers to trace 
this - or step through with a debugger)

- The locationmap is not being resolved correctly and hence the reader 
is looking in the wrong place (again need to improve logging in the reader)

You understand I'm not asking you to debug this, just documenting the 
potential issues in an attempt to help build an understanding of how 
things work internally.


View raw message