Unable to locate page with name "Main"

4 views
Skip to first unread message

Ted Stockwell

unread,
Feb 25, 2009, 9:01:33 AM2/25/09
to arib...@googlegroups.com
Hi All,

I use Eclipse and I have successfully generated and run a Master-Detail AppCore/MetaUI Java Database App using the AribaWeb Eclipse plugin.
However, going forward I don't want to be dependent on using the AribaWeb ant build file to generate and run a MetaUI project. Instead I want to be able to develop apps in the 'traditional' Eclipse fashion - by creating a Dynamic Web Project. So, that is what I am trying to do and I am having a problem.

I have ported the generated Master/Detail project to an Eclipse Dynamic Web project and am trying to get the new project to run. I am currently getting the error 'Unable to locate page with name "Main"'.
Full stack trace shown below.

Seems like AribaWeb is looking for a resource named 'Main.awl'.
However, what is confusing me is that I cannot find any such resource in the generated Master/Detail project (which runs fine).
So, I'm stumped.

Any clue would be appreciated.
Thanks,

-ted



------------------------------------------

ariba.ui.aribaweb.util.AWGenericException: Unable to locate page with name "Main"

at ariba.ui.aribaweb.core.AWConcreteApplication.createPageWithName(AWConcreteApplication.java:502)
at ariba.ui.aribaweb.core.AWConcreteApplication.mainPage(AWConcreteApplication.java:529)
at ariba.ui.aribaweb.core.AWComponentActionRequestHandler.processFrontDoorRequest(AWComponentActionRequestHandler.java:599)
at ariba.ui.servletadaptor.AWServletApplication$DefaultSessionValidatior.handleComponentActionSessionValidationError(AWServletApplication.java:463)
at ariba.ui.aribaweb.core.AWConcreteApplication.handleComponentActionSessionValidationError(AWConcreteApplication.java:795)
at ariba.ui.aribaweb.core.AWConcreteRequestHandler.handleComponentActionSessionValidationError(AWConcreteRequestHandler.java:90)
at ariba.ui.aribaweb.core.AWComponentActionRequestHandler.handleRequest(AWComponentActionRequestHandler.java:772)
at ariba.ui.aribaweb.core.AWConcreteServerApplication._dispatchRequest(AWConcreteServerApplication.java:493)
at ariba.ui.aribaweb.core.AWConcreteServerApplication.dispatchRequest(AWConcreteServerApplication.java:537)
at ariba.ui.aribaweb.core.AWConcreteApplication.dispatchRequest(AWConcreteApplication.java:864)
at ariba.ui.servletadaptor.AWDispatcherServlet.aribawebDispatcher(AWDispatcherServlet.java:191)
at ariba.ui.servletadaptor.AWDispatcherServlet.doGet(AWDispatcherServlet.java:260)




Craig Federighi

unread,
Feb 25, 2009, 10:09:22 AM2/25/09
to arib...@googlegroups.com
Hi Ted,

The AribaWeb Ant files do a whole bunch of stuff behind the scenes so
that your project directory can stay free of icky configuration files
and static resources. If you want to build another way you're either
going to have to replicate some of that logic, or copy some of those
static files into your project.

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
(Yes, this is absurd, but hibernate's JPA class scanning support
for J2SE containers creates separate "persistence units" for each jar,
thereby breaking relationships across domain classes in different jars)

- Web server resources extracted from aribaweb/widgets jars to
webapps docroot directory

Let us know how it goes! :-)

- craig

p.s. your particular error was the result of a missing
aribaweb.properties file.

Ted Stockwell

unread,
Feb 25, 2009, 10:00:40 PM2/25/09
to arib...@googlegroups.com

--- 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.










Craig Federighi

unread,
Feb 25, 2009, 10:38:39 PM2/25/09
to arib...@googlegroups.com
Ted,

Fabulous! Thanks for the fix. I'll make sure it's shipped in GA.

Any insight on how to get Eclipse to automatically do all the things
that our Ant files are doing (so that you don't have to manually
flatten all this derivable content into your source project)?

- craig

Ted Stockwell

unread,
Feb 26, 2009, 4:05:55 PM2/26/09
to arib...@googlegroups.com


--- 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"
>

> Any insight on how to get Eclipse to automatically do all
> the things
> that our Ant files are doing (so that you don't have to
> manually
> flatten all this derivable content into your source
> project)?
>

yes, here's one...
You can avoid the need to put the ariba.appcore.jar into the app.MasterDetail.jar by putting the ariba.appcore.jar in the WEB-INF/lib folder and then putting this line in app.MasterDetail.jar/META-INF/persistence.xml....

<jar-file>ariba.appcore.jar</jar-file>

...inside the <persistence-unit> element.

This line tells the Hibernate persistence manager to scan the denoted jar file for annotated classes. The <jar-file> element may be repeated as many times as necessary.

See http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/configuration.html


Ted Stockwell

unread,
Feb 26, 2009, 5:02:43 PM2/26/09
to arib...@googlegroups.com
Oops, sorry.
Disregard this suggestion, I fooled myself into thinking this worked when really I had forgotten to remove the appcore classes from the MasterDetail jar.


--- On Thu, 2/26/09, Ted Stockwell <emor...@yahoo.com> wrote:
Reply all
Reply to author
Forward
0 new messages