More notes on getting Sakai to run

The first problem I am going to tackle today is fixing Samigo, which fails on Tomcat startup.

So Samigo comes first, as it chokes first on start-up. The complaint is that web.xml terminates early, and indeed it does. Digging down into the Samigo directory (sakai/sam/) I ran a find . -name web.xml | xargs ls -l and found two such files (not counting the ones in the maven output):

-rw-r--r-- 1 james users 12764 May 28 21:57 ./samigo-app/sakai-samigo/webapp/WEB-INF/web.xml
-rw-r--r-- 1 james users     0 May 28 21:57 ./samigo-app/src/webapp/WEB-INF/web.xml

Clue! Sure enough, the maven.xml doesn’t pull in the sakai-samigo/webapp stuff, and the war file web.xml is zero sized.

I fixed things, putting resources into the war plugin configuration, as per the following diff

===================================================================
--- samigo-app/pom.xml  (revision 31497)
+++ samigo-app/pom.xml  (working copy)
@@ -627,16 +627,32 @@
</dependencies>
<build>+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <version>2.0</version>
+        <configuration>
+          <webResources>
+            <resource>
+              <!-- this is relative to the pom.xml directory -->
+              <directory>${basedir}/sakai-samigo/webapp</directory>
+            </resource>
+          </webResources>
+         </configuration>
+       </plugin>
+    </plugins>
-
-
<resources>
+      <!-- webapp is not necessary to specify as it is canonical and
+           anyway should be in the war/webReources/resource config if
+           it is different -->
+      <!--       <resource> -->
+      <!--         <directory>src/webapp/WEB-INF</directory> -->
+      <!--       </resource> -->
<resource>
-        <directory>src/webapp/WEB-INF</directory>
-      </resource>
-      <resource>
<directory>${basedir}/src/java</directory>
<excludes>
<exclude>**/*.java</exclude>

That got the right thing into the m2-target directory:

james@emma64:/data/tmpjames/sakai/sakai/sam$ find . -name web.xml | xargs ls -l
-rw-r--r-- 1 james users 12764 Jun  8 12:48 ./samigo-app/m2-target/samigo-M2/WEB-INF/web.xml
-rw-r--r-- 1 james users 12764 May 28 21:57 ./samigo-app/sakai-samigo/webapp/WEB-INF/web.xml
-rw-r--r-- 1 james users     0 May 28 21:57 ./samigo-app/src/webapp/WEB-INF/web.xml

Which in turn gets the right thing into the samigo.war file.

(I submitted the above patch to the Sakai JIRA site.  Hope I did that right).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s