--- On Wed, 2/25/09, Craig Federighi <
craig.f...@gmail.com> wrote:
> From: Craig Federighi <
craig.f...@gmail.com>
> Subject: Re: Unable to locate page with name "Main"
> <snip>
> One way to verify that you've covered all of the bases
> is to diff your
> generated webapps directory and the contents of the
> application jar
> file, with what the AW Ant build is producing. There are
> several
> things to look out for:
>
> - App Jar:
> - log4j.properties file
> - META-INF/aribaweb.properties file
> - META-INF/persistence.xml file
> - For appcore.jar-based projects (e.g. Master Detail) the
> contents
> of appcore.jar need to be "flattened" into the
> app jar
> <snip>
> p.s. your particular error was the result of a missing
> aribaweb.properties file.
>
>
Hi Craig,
Actually, I had already included META-INF/aribaweb.properties in my project.
Not only was AW not finding the aribaweb.properties file in my project but it also wasn't finding the aribaweb.properties in any of the AW jar files.
Anyway, by debugging and stepping through code I was able to discover why, and I think I have discovered a small problem in the AW code.
The short story is that AW does not recognize jar file URLs in my environment.
BTW, I have been trying to run AW from within the Eclipse IDE.
When I run Tomcat from inside Eclipse I am not running the 'official' version of Tomcat but am instead running some version of Tomcat that is embedded inside an Eclipse plugin, and the Tomcat classloader appears to work slightly different than the off-the-shelf version of Tomcat.
Anyway, here is a typical URL to an aribaweb.properties file as reported by the Tomcat classloader when running inside the Eclipse IDE...
jar:file:C:\\temp\\workspace\\ariba.metaui.jar!/META-INF/aribaweb.properties
The ariba.ui.aribaweb.util.AWClasspathResourceDirectory class uses this static Pattern object to detect when a resource is inside a jar file...
static final Pattern _URLJarNamePattern = Pattern.compile(".*/(.+)\\.(jar|zip)\\!/.*");
This pattern matcher does match against the URL above because of the backslashes in the URL (I'm running on Windows).
Changing the regular expression above to this....
static final Pattern _URLJarNamePattern = Pattern.compile(".*[/\\\\](.+)\\.(jar|zip)\\!/.*");
...fixes my problem.
It would be great if this change made it into SVN.
Thanks,
-ted
PS. AribaWeb is a fantastic contribution to the open source Java community. Many thanks to Ariba for making AribaWeb available.