The solution to the problem is to change the "spring-version" property in the properties section of jpetstore's pom.xml.
Before the fix:
Code:
<properties>
<spring.version>3.0.0.BUILD-SNAPSHOT</spring.version>
...snip...
</properties>
After the fix:
Code:
<properties>
<spring.version>3.0.3.RELEASE</spring.version>
...snip...
</properties>
To get the server.sh script to run (to start the hsqldb database), I did all of the following. Don't know if all were necessary, just know the server.sh script did actually work after doing the following:
1) Used the directions at http://en.wikipedia.org/wiki/Shebang_%28Unix%29 to add the 1st line shown in the server.sh script below as shipped, server.sh only has 2 lines:
Code:
#!/bin/sh
cd `dirname $0`
mvn -e -Ddb.file=./jpetstore exec:java
2) At a terminal window:
Code:
cd Documents/rdg/spring3Samples/spring-samples/jpetstore/trunk/org.springframework.samples.jpetstore/db/hsqldb
new-host:hsqldb rdg$ chmod 777 server.bat
new-host:hsqldb rdg$ ./server.sh
3) in STS: a) project...clean jpetstore; b) run as ... Maven Package
4) Started TC Server and got the following error:
Code:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Jul 27, 2010 10:17:37 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
5) As directed by error message, went to http://www.slf4j.org/codes.html#StaticLoggerBinder where it said:
Code:
Failed to load class org.slf4j.impl.StaticLoggerBinder
This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.
You can download SLF4J bindings from the project download page
6) Added the following to jpetstore's pom.xml (I copied it from the pom.xml of the mvc-showcase sample:
Code:
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
7) added the following to the properties section of pom.xml:
Code:
<org.slf4j-version>1.5.10</org.slf4j-version>
8) After starting the tc server there were, at first glance, to errors. However nothing happened when I typed in FireFox: http://localhost:8080/jpetstore
9) Looked more carefully and found this message in the log:
Code:
INFO: Initializing Spring FrameworkServlet 'petstore'
[TomcatAspectJWeavingClassLoader@41584807] warning javax.* types are not being woven because the weaver option '-Xset:weaveJavaxPackages=true' has not been specified
Jul 27, 2010 10:27:48 PM org.apache.catalina.core.ApplicationContext log
10) Googled and found a hit in a Spring Forum post at:
http://forum.springsource.org/showthread.php?t=84682.
11) I give up trying to figure out the error message. Instead, I remove the war file from TC server and then install the war back into TC server. When I start TC server it seems to give more messages that look healthy. I right click on index.html and select "Run on Server"
12) jperstore starts up in a browser and works okay.
13) I notice the url that jpetstore is running at: http://localhost:8080/org.springfram...ore/index.html
14) Who would have ever guessed that url? I had assumed it would be http://localhost:8080/jpetstore.
Am I the only one who has to do all this to get jpetstore to run?