• I have updated the JAR files that are needed for the features in Chapter 6. Please download this copy of the ZIP file that contains the JAR files: JAR files for web app lib.
    You can also unzip these directly in ocelot with this command
    unzip ~downeyt/cs/public_html/cgs4854/hibernate-3.2.jars/webapp.jars.zip
  • If you are developing locally, you will need some additional JAR files. These files are already in a shared lib in ocelot, but you will need to add them to your lib dir if you develop locally: JAR files for local development.

    After you upload the WAR file, please delete these JAR files from the lib dir on ocelot.

    1. asm.jar
    2. cglib-2.1.3.jar

  • Additionally, a minor change must be made to all beans that are saved to a database. To mark the id property as the id for the table, use the following code.
    import org.hibernate.validator.NotNull;
    import org.hibernate.validator.Pattern;
    import javax.persistence.Entity;
    import javax.persistence.Transient;
    import javax.persistence.Id;
    import javax.persistence.GeneratedValue;
    
    @Entity
    public class RequestDataPersistent
    {
    
        protected Long id;
    
        @Id
        @GeneratedValue
        public Long getId() { return id; }
    
        private void setId(Long id) { this.id = id; }
        
        //Add additional properties for your bean
        ...
    
    }
  • There are only a few JAR files that are needed at compile time. It is not necessary to have every JAR file in the lib dir in the CLASSPATH. Update the .cshrc file so that the following are the only CLASSPATH statements for JAR files in your lib dir. You still need the CLASSPATH statements for servlet-api and the classes dirs of your web apps.
    setenv CLASSPATH {$CLASSPATH}:$HOME/cgs4854/webapps/book/WEB-INF/lib/ejb3-persistence.jar
    setenv CLASSPATH {$CLASSPATH}:$HOME/cgs4854/webapps/book/WEB-INF/lib/hibernate-3.2.jar
    setenv CLASSPATH {$CLASSPATH}:$HOME/cgs4854/webapps/book/WEB-INF/lib/hibernate-annotations-3.2.jar
    setenv CLASSPATH {$CLASSPATH}:$HOME/cgs4854/webapps/book/WEB-INF/lib/log4j-1.2.11.jar
    setenv CLASSPATH {$CLASSPATH}:$HOME/cgs4854/webapps/book/WEB-INF/lib/commons-beanutils.jar