I'm not sure what I'm doing wrong but I've been spending way too much time 
trying to get this project off the ground.

The structure I'm trying to use is I have a main maven project, 
waitlist-parent, and it has 4 sub projects;

   <artifactId>waitlist-parent</artifactId>

   <modules>
       <module>../waitlist-core</module>
       <module>../waitlist-db</module>
       <module>../waitlist-web</module>
       <module>../waitlist-war</module>
   </modules>

Waitlist-core will be the business logic; it depends on waitlist-db which will 
be the database stuff.  Waitlist-web depends on waitlist-core.  Waitlist-web 
will be the M and C of MVC; the controllers and models (I'm using Spring MVC).  
Waitlist-war will be the V of MVC; the jsp views.  Waitlist-parent has a 
packaging of pom, waitlist-core, waitlist-db, and waitlist-web hav a packaging 
of jar, and waitlist-war has a packaging of war.

At the moment the only code I have is some tests in waitlist-db to verify that 
I can connect to and pull stuff out of the database.

On my linux system, in a terminal window, if I go into waitlist-parent and do a 
mvn -Ptest package that produces a war file in waitlist-war/target, and if I mv 
that to ~tomcat/webapps it's deployed/started by tomcat without errors.

In eclipse I've set up a tomcat server and it's there in the Servers tab list 
(it's the only one).  If I add the waitlist-war project to it, unlike other 
simple web apps I've done before, it has a + next to it and opening that it 
shows waitlist-core, waitlist-db, and waitlist-web under waitlist-war; which 
makes sense since those are dependencies of waitlist-war.  When I click on the 
Publish to server button (next to the red Stop button) I kept getting this 
error:

Publishing failed
 File not found: 
C:\users\rusty\workspaces\waitlist01\waitlist-web\target\classes\META-INF\MANIFEST.MF.
 File not found: 
C:\users\rusty\workspaces\waitlist01\waitlist-core\target\classes\META-INF\MANIFEST.MF.
 File not found: 
C:\users\rusty\workspaces\waitlist01\waitlist-db\target\classes\META-INF\MANIFEST.MF.

But that's mysteriously stopped happening, so we can ignore that I suppose.

Now when I start tomcat in eclipse by clicking on the green circle arrow button 
it's complaining about not being able to find my Spring applicationContext.xml 
config file; in waitlist-war/src/main/webapp/WEB-INF is my web.xml, which 
contains

   <context-param>
       <param-name>contextConfigLocation</param-name>

       <param-value>
           classpath:config/applicationContext.xml
       </param-value>
   </context-param>

The file applicationContext.xml is in waitlist-war/src/main/resources/config 
(as are waitlist-servlet.xml and logback.xml, not that that matters).

Back on the linux machine, the .war file has these in the right place:

    1706  01-26-09 17:45   WEB-INF/web.xml
     676  01-27-09 10:32   WEB-INF/classes/config/applicationContext.xml
     914  01-27-09 10:32   WEB-INF/classes/config/logback.xml
    1101  01-27-09 10:32   WEB-INF/classes/config/waitlist-servlet.xml

Here's the log output error for the errant file:

Jan 27, 2009 11:00:05 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of 
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: IOException 
parsing XML document from class path resource [config/applicationContext.xml]; 
nested exception is java.io.FileNotFoundException: class path resource 
[config/applicationContext.xml] cannot be opened because it does not exist
        at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
       etc.

So let's stop tomcat and try moving the waitlist-war/src/main/resources/config 
directory to waitlist-war/src/main/webapp/WEB-INF/classes, start tomcat, and 
see what happens ...  Hah!  Success!

So can someone explain to me why I was having these problems?

And feel free to comment (constructively hopefully) on my setup; it's a tad 
rococo and byzantine but it appeals to my eccentric tastes. ;-)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to