Click here to close now.

Welcome!

Java Authors: Carmen Gonzalez, Plutora Blog, Harry Trott, Liz McMillan, Pat Romanski

Related Topics: Java

Java: Article

Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate

Creating a Pet Store Application with JavaServer Faces, Spring, and Hibernate

JavaServer Faces (JSF) technology is a new user interface framework for J2EE applications. This article uses the familiar Pet Store application to demonstrate how to build a real-world Web application using JSF, the Spring Framework, and Hibernate. Since JSF is a new technology, this article will concentrate on the use of JSF. It presents several advanced features in JSF development, including Tiles integration and business logic-tier integration.

Java Pet Store
The Java Pet Store is a sample application from the Java Enterprise BluePrints program. It documents best practices, design patterns, and architectural ideas for J2EE applications.

MyPetStore, the sample application for this article, is a reimplementation of the Java Pet Store using JSF, Spring, and Hibernate.

I won't be able to cover all the features of the Pet Store in one article. MyPetStore allows a user to browse through a catalog and purchase pets using a shopping cart. Figure 1 provides the page-flow diagram.

JSF
JSF is a server-side, user interface component framework for J2EE applications. JSF contains an API that represents UI components and manages their states; handles events, server-side validation, and data conversion; defines page navigation; supports internationalization; and provides extensibility for all these features. It also contains two JSP (JavaServer Pages) custom tag libraries, HTML and Core, for expressing UI components within a JSP page and wiring components to server-side objects.

JSF is not just another Web framework. It's particularly suited, by design, for use with applications based on the MVC (Model-View-Controller) architecture. The Swing-like object-oriented Web application development, the bean management facility, an extensible UI component model, the flexible rendering model, and the extensible conversion and validation model are the unique features that differentiate JSF from other Web frameworks.

Despite its strength, JSF is not mature at its current stage. Components, converters, and validators that ship with JSF are basic. The per-component validation model cannot handle many-to-many validation between components and validators. In addition, JSF custom tags cannot integrate with JSTL (JSP Standard Tag Library) seamlessly.

High-Level Architecture
MyPetStore uses a multitiered nondistributed architecture. For a multitiered architecture, the functionalities of an application are partitioned into different tiers, e.g., presentation, business logic, integration, etc. Well-defined interfaces isolate each tier's responsibility. A nondistributed architecture means that all the tiers are physically located in the same application server. Figure 2 shows you the high-level architecture of MyPetStore.

JSF is used in the presentation tier to collect and validate user input, present data, control page navigation, and delegate user input to the business-logic tier. Tiles is used to manage the layout of the application.

Spring is used to implement the business-logic tier. The architectural basis of Spring is an Inversion of Control (IOC) container based around the use of JavaBean properties. Spring is a layered application framework that can be leveraged at many levels. It contains a set of loosely coupled subframeworks. The use of the bean factory, application context, declarative transaction management, and Hibernate integration are demonstrated in this application.

The integration tier is implemented with the open source O/R (object/relational) mapping framework - Hibernate. Hibernate relieves us of low-level JDBC coding. It's less invasive than other O/R mapping frameworks, such as JDO and CocoBase. Rather than utilize bytecode processing or code generation, Hibernate uses runtime reflection to determine the persistent properties of a class. The objects to be persisted are defined in a mapping document, which describes persistent fields and associations, as well as any subclasses or proxies of the persistent object. The compilation of the mapping documents and SQL generation occurs at system startup time.

The combination of the business logic tier and the integration tier can also be referred to as the middle tier.

The integration between different tiers is not a trivial task. MyPetStore demonstrates how to use the JSF bean management facility and ServiceLocator pattern to integrate JSF with the business logic tier. By using Spring, the business logic tier and integration tier can be wired up easily.

Implementation
Now, let's go through the implementation details, tier by tier, of the UpdateShoppingCart, the most important and complex use case in this application.

Presentation Tier
The presentation tier tasks include creating and registering the backing beans (explained later), writing JSP pages, defining navigation rules, integrating with Tiles, and integrating with the middle tier. Our shopping cart screen looks like Figure 3.

Backing Bean
Backing bean is a JSF-specific term. A backing bean defines the properties and handling logic associated with the UI components used on a JSF page. Each backing bean property is bound to either a component instance or its value. A backing bean also defines a set of methods that performs functions for the component.

Let's create a backing bean - CartBean - that contains not only the properties maps to the data for the UI components on the page, but also three actions: addItemAction, removeItemAction, and updateAction. Because the JSF bean management facility is based on Java reflection, our backing bean does not need to implement any interface. Listing 1 provides the code segment of the CartBean.

The CartBean contains a reference to a Cart business object. The Cart business object contains all the shopping cart-related data and business logic (the Cart class will be discussed later). This approach, to include the business object directly inside the backing bean, is simple and efficient. However, it tightly couples the backing bean with the back-end business object. Another approach is to decouple the backing bean and the business object. The drawback of this approach is that mapping has to be performed between the objects. Data needs to be copied between the backing bean and the business object.

There's no business logic inside the backing bean actions. The backing bean action simply delegates the user request to the middle tier. The addItemAction takes the item ID from the request, then it looks up the CatalogService through the ServiceLocator and gets the item associated with the item ID. It calls the addItem method on the Cart business object. The business logic of how to add an item to the cart is handled by the Cart business object. Finally, if everything succeeds, the navigation result of success is returned to the JSF implementation.

Backing Bean Registration
To let the JSF bean management facility manage your backing bean, the CartBean must be registered in the JSF configuration resource file faces-managed-beans.xml (see Listing 2).

The CartBean is set to have a scope of a session, which means the JSF implementation creates a CartBean instance if it is referenced inside any JSP page for the first time during a session. The CartBean instance is kept under the session scope. This way the user can interact with the stateful shopping cart, add an item, remove an item, update the cart, and finally check out.

The JSP Page
The cart.jsp is the page to present the content of a shopping cart. It contains UI components and wires the components to the CartBean (see Listing 3).

The page starts out with the tag library declarations. The JSF implementation defines two sets of tags. The core tags are independent of the rendering technology and are defined under prefix f. The HTML tags generate HTML-specific markup and are defined under prefix h. All JSF tags should be contained inside an f:view or f:subview tag.

h:outputText is used to present a message to the user once the shopping cart is empty:

 


<h:outputText value="Your Shopping Cart is Empty"
  styleClass="title" rendered="#{cartBean.numberOfItems <= 0}"/>

The rendered attribute takes a boolean variable. If the value is false, the h:outputText will not be rendered. The rendered attribute can give you the same effect as a JSTL c:if. Since JSF and JSTL are not integrated well, it's good practice to try not to mix them together.

h:dataTable is used to iterate through the items inside the shopping cart and present them inside a HTML table. The value attribute

 


 value="#{cartBean.cartItemList}"

represents the list data over which h:dataTable iterates. The name of each individual item is specified through the var attribute. You can control the presentation style of each individual column through the columnClasses attribute.

Inside h:dataTable, h:inputText is used to take user input - the quantity of the current item:

 


<h:inputText value="#{cartItem.quantity}" size="5"/>

The attribute value="#{cartItem.quantity}" tells the JSF implementation to link the text field with the quantity property of the cart item. When the page is displayed, the getQuantity method is called to obtain the current property value. When the page is submitted, the setQuantity method is invoked to set the value that the user enters.

h:commandButton is used to create the "Update Cart" button, which allows the user to update the shopping cart. The action attribute action="#{cartBean.updateAction}" contains a method-binding expression and tells the JSF implementation to invoke the updateAction method on the CartBean inside the session scope. The updateAction returns a navigation result, which determines the next page to go to.

The Check Out link is implemented with h:outputLink, which generates an HTML anchor element. Once the user clicks the link, it takes the user to the createOrder page.

Navigation
Navigation is one of the key features provided by JSF. For this application, all navigation rules are defined inside the faces-navigation.xml. There are two navigation rules related to the current use case. Here's the definition of the first rule:

 


<navigation-rule>
  <from-view-id>/cart.jsp</from-view-id>
  <navigation-case>
    <from-outcome>success</from-outcome>
    <to-view-id>/cart.jsp</to-view-id>
  </navigation-case>
</navigation-rule>

This rule tells the JSF implementation that from the cart.jsp, if any action finishes successfully and returns success, the cart.jsp will be refreshed to reflect the current state of the shopping cart. The second rule is about error handling and is defined as a global navigation rule. It's not discussed here. Please refer to the faces-navigation.xml for detailed information.

Integration with Tiles
Tiles is a framework that makes using template layouts much easier through the use of a simple but effective tag library. Tiles separates the layout from content, makes your Web application easier to maintain, and keeps a common look and feel among all the pages. JSF and Tiles are a powerful combination.

JSF does not have built-in Tiles support. Tiles definitions cannot be referenced directly inside JSF applications. MyPetStore uses a workaround to integrate Tiles with JSF successfully. Tiles definition is referenced by JSF indirectly through a separate wrapper JSP file. The drawback of this approach is to have two JSP pages for each logical view. One is the content tile and the other is the wrapper JSP page with the Tiles definition. A tile is used to describe a page region managed by the Tiles framework. A tile can contain other tiles.

Here are step-by-step instructions on how to integrate JSF with Tiles:

  • Put struts.jar under your application's classpath (Tiles is bundled with Struts1.2).
  • Enable Tiles inside web.xml (see Listing 4). (Listings 4-10 can be downloaded from www.sys-con.com/java/sourcec.cfm.)
  • Build the layout template. The layout of MyPetStore is defined inside layout.jsp (see Listing 5). This template controls the layout of the entire application. Tiles custom tag <tiles:insert attribute="sider" flush="false"/> tells the Tiles framework to insert the tile identified by the value of the specified attribute.
  • Write the base Tiles definition. A Tiles definition allows you to specify the attributes that are used by a layout template. Tiles supports definition inheritance. You can declare a base definition and then create other definitions derived from that base. In MyPetStore, a base Tiles definition is defined inside the tiles.xml (see Listing 6). The base Tiles definition uses layout.jsp as the layout template and defines the common tiles used throughout the application, e.g., header, footer, etc.
  • Write the wrapper JSP page. All the tiles with the real content are defined inside the Tiles directory. For each logical view, there's a wrapper JSP page. Here's the wrapper JSP page for cart.jsp:

 


<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<tiles:insert definition=".mainLayout">
  <tiles:put name="title" value="Shopping Cart Page"/>
  <tiles:put name="body" value="/tiles/cart.jsp"/>
</tiles:insert>

It tells the Tiles framework to insert the content tile /tiles/cart.jsp into the body part of the page defined by the base Tiles definition .mainLayout.

Integration with the Business Logic Tier
The ServiceLocator pattern and the JSF bean management facility are used to integrate the JSF-based presentation tier with the business logic tier. The ServiceLocator abstracts the logic that looks for services. In this application, ServiceLocator is defined as an interface and implemented as a JSF managed bean, ServiceLocatorBean. The ServiceLocatorBean looks up the services from the Spring application context:

 


ServletContext context = FacesUtils.getServletContext();
this.appContext =
  WebApplicationContextUtils.getRequiredWebApplicationContext(context);
this.catalogService = 
  (CatalogService)this.lookupService(CATALOG_SERVICE_BEAN_NAME);
...

The ServiceLocator is defined as a property inside the BaseBean. The JSF bean management facility wires the ServiceLocator implementation with those managed beans that need to access the middle tier.

 


<managed-property>
  <property-name>serviceLocator</property-name>
  <value>#{serviceLocatorBean}</value>
</managed-property>

IOC is used here.

Middle Tier
The tasks in this tier consist of defining the business objects with their mappings, creating the service interfaces with their implementations, implementing the DAOs (data access object), and wiring the objects.

The Business Object
The Cart business object is implemented as a POJO (plain old Java object) (see Listing 7). It contains the data associated with a shopping cart; it also contains actions with business logic, e.g., addItem, getSubTotal, etc.

The Business Service
The CatalogService interface defines all of the catalog management-related services:

 


public interface CatalogService {
  public List getCategoryList() throws MyPetStoreException;
  public Category getCategory(String categoryId)
    throws MyPetStoreException;

  ...
}

Spring Configuration
Listing 8 provides the CatalogService's Spring configuration inside applicationContext.xml.

The Spring declarative transaction management is set up for the CatalogService. Spring bean factory creates and manages a CatalogService singleton object. By using Spring bean factory, the need for customized bean factories is eliminated.

The CatalogServiceImpl is the implementation of the CatalogService, which contains a setter for the CatalogDao. The CatalogDao is defined as an interface and its default implementation is the CatalogDaoHibernateImpl. Spring wires the CatalogServiceImpl with the CatalogDao. Because we are coding to interfaces, we don't tightly couple the implementations. For example, by changing the Spring applicationContext.xml, we can tie the CatalogServiceImpl with a different CatalogDao implementation - Catalog-DaoJDOImpl.

Integration with Hibernate
Listing 9 provides the HibernateSessionFactory's configuration. CatalogDao uses the HibernateTemplate to integrate Spring with Hibernate. Here's the configuration for HibernateTemplate:

 


<bean id="hibernateTemplate"
  class="org.springframework.orm.hibernate.HibernateTemplate">
  <property name="sessionFactory">
    <ref bean="sessionFactory"/>
 		</property> <property name="jdbcExceptionTranslator">
    <ref bean="jdbcExceptionTranslator"/>
  </property>
</bean>

Hibernate maps business objects to the relational database using XML configuration files. Item.hbm.xml expresses the mapping for the Item business object. The configuration files are in the same directory as the corresponding business objects. Listing 10 provides the Item.hbm.xml. Hibernate maintains the relationship between objects. The mapping definition defines a many-to-one relationship between Item and Product.

Finally, CatalogDao is wired with HibernateTemplate by Spring:

 


<bean id="catalogDao"
  class="mypetstore.model.dao.hibernate.CatalogDaoHibernateImpl">
  <property name="hibernateTemplate">
    <ref bean="hibernateTemplate"/>
  </property>
</bean>

End-to-End
Figure 4 demonstrates the end-to-end integration of all the tiers for AddItemToCart: a sub-use case of the UpdateShoppingCart use case.

Technologies and JSF Features Matrix
The UpdateShoppingCart use case doesn't cover all the technologies and advanced JSF features we used in this application, e.g., security, pagination, etc. Table 1 can serve as a reference catalog to help you understand this application.

Configuration and Installation
You can download the source code for MyPetStore from www.sys-con.com/java/sourcec.cfm.

The Package Structure
After unzipping the code, you should see the following directory structure:

 


mypetstore
  /bin
  /docs
  /lib
  /src
  /web
    /images
    /tiles
    /WEB-INF
  build.xml

Table 2 explains each part of the directory structure.

System Requirements
You'll need the following tools to build and run the MyPetStore application:

  • JDK 1.4.2 or later
  • Ant
  • Tomcat 5.x
  • MySQL 4.x

Installation Instructions

  • Prepare the database. Run bin/mypetstore.sql against MySQL to build database schema and load seed data. If you'd like to use another RDBMS, this script may need to be modified.
  • Change the configuration (optional for default MySQL installation).
    - Find and open web/WEB-INF/applicationContext.xml.
    - Under the definition of the datasource bean, modify the JDBC connection properties (URL, username, password) to match the database you're using.
    - Save the file.
  • Build the Web application by Ant (the default target is build.war).
  • Copy the dist/mypetstore.war to the <tomcat-home>/webapps directory.
  • Start Tomcat.

For the default Tomcat installation, MyPetStore is accessible from http://localhost:8080/mypetstore

Log on to the application using j2ee as the username and password.

Summary
In this article I tried to provide a picture of how you can integrate JSF, Tiles, Spring, and Hibernate in one application. With minimum theory, you should now be able to start building such typical Web applications as a pet store. If I sparked your interest in studying any of these technologies, my mission was accomplished.

Resources

  • JavaServer Faces: http://java.sun.com/j2ee/javaserverfaces
  • Tiles (bundled with Struts1.2): http://struts.apache.org
  • The Spring Framework: http://springframework.org
  • Hibernate: http://hibernate.org
  • MySQL: http://mysql.com/
  • Tomcat: http://jakarta.apache.org/tomcat/
  • Java Pet Store: http://java.sun.com/developer/releases/petstore
  • Johnson, R. (2002). Expert One-on-One J2EE Design and Development (Programmer to Programmer). Wrox.
  • Singh, I., et al, (2002). Designing Enterprise Applications with the J2EE Platform. Addison-Wesley Professional.
  • More Stories By Derek Yang Shen

    Derek is a senior software engineer at Overture Services, Inc., in
    Pasadena, California. Derek is a Sun Certified Enterprise Architect and has
    been working with J2EE exclusively for the past five years. He holds an
    MS in computer science from UCLA.

    Comments (24) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    Most Recent Comments
    en3rgizer 10/10/08 04:15:23 AM EDT

    Hi there! Since my last post about working version of petstore, i've received a lot of letters with requests for it, so i felt like i'm working for technical support of petstore application :)) so i've shared archive with it on rapidshare.com. You can download archive with working files from here: http://rapidshare.com/files/152595290/mypetstore.rar. If you still getting errors, probably you're doing something wrong. I'm using Tomcat 5.5.26 and MySQL Server 4.1 and have no errors at all. Try to complete all installation steps from beginning. Wish you good luck!

    P.S. Best wishes and great respect to author of this article.

    en3rgizer 06/26/08 03:38:28 AM EDT

    to: Zakaria Chakih
    if you provide me your email, i could send working project to you. or feel free to write me a letter to en3rgizer[at]mail[dot]ru

    Zakaria Chakih 05/25/08 09:15:42 AM EDT

    @ en3rgizer

    Could you please give me your working mypetstore!?

    Zakaria chakih 05/25/08 08:19:31 AM EDT

    Hallo,

    I tryed to in install mypetstore as described above but i dosen't function. i get all time the failure:
    [ServletException in:/layout.jsp] javax.servlet.jsp.JspException: javax.faces.el.PropertyNotFoundException: Can't instantiate class: 'Can't get value from value reference expression: '#{serviceLocatorBean}'.'.'
    hat anyone an idea why??

    danny 03/31/08 03:40:23 AM EDT

    hi,i've downloaded the program in zip file.when i try to run the war file it show the error below.what causes the error?i even try to put the common.pool jar but still not working.anyone know what's wrong?

    16:37:04,369 INFO XmlBeanDefinitionReader:118 - Loading XML bean definitions from resource [/WEB-INF/applicationContext.xml] of ServletContext
    16:37:04,431 ERROR ContextLoader:106 - Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in resource [/WEB-INF/applicationContext.xml] of ServletContext: Class that bean class [org.apache.commons.dbcp.BasicDataSource] depends on not found; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
    java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool

    en3rgizer 03/26/08 10:18:41 AM EDT

    Source can be downloaded from here:
    http://res.sys-con.com/story/46977/mypetstore.zip

    I have faced the same problem about Tom Authera wrote on 1 Mar 2005 ( All works well until I press the Check-Out link. MySql throws a foreign-key constraint error. Here is the trace:
    10:57:34,055 INFO HibernateTransactionManager:315 - Initiating transaction commit
    10:57:34,086 WARN JDBCExceptionReporter:38 - SQL Error: 1216, SQLState: 23000
    10:57:34,086 ERROR JDBCExceptionReporter:46 - null, message from server: "Cannot add or update a child row: a foreign key constraint fails"......)

    After doing some reverse engineering on database 'mypetstore' with JBoss Tools I've found that generated mapping for Order.hbm.xml differents from original mapping from example. So I've changed few strings hibernate mapping Order.hbm.xml:

    Before: set name="lineItems" cascade="all"

    After:
    set name="lineItems" inverse="true"

    And it started working!
    Thanks a lot to autor for great work!

    p.s. In previous post I've made a mistake when writing source (I'm not familiar with WIKI format:)))

    en3rgizer 03/26/08 10:11:26 AM EDT

    Source can be downloaded from here:
    http://res.sys-con.com/story/46977/mypetstore.zip

    I have faced the same problem about Tom Authera wrote on 1 Mar 2005 ( All works well until I press the Check-Out link. MySql throws a foreign-key constraint error. Here is the trace:
    10:57:34,055 INFO HibernateTransactionManager:315 - Initiating transaction commit
    10:57:34,086 WARN JDBCExceptionReporter:38 - SQL Error: 1216, SQLState: 23000
    10:57:34,086 ERROR JDBCExceptionReporter:46 - null, message from server: "Cannot add or update a child row: a foreign key constraint fails"......)

    After doing some reverse engineering on database 'mypetstore' with JBoss Tools I've found that generated mapping for Order.hbm.xml differents from original mapping from example. So I've changed few strings hibernate mapping Order.hbm.xml:

    Before:

    <one-to-many class="LineItem"/>

    After:

    <one-to-many class="LineItem" />

    And it started working!
    Thanks a lot to autor for great work!

    Gopu 02/28/08 11:13:56 PM EST

    I would like to know the url to download the source code, b'cos the one given in this article doesn't work.

    Mamatha 02/26/08 03:11:07 AM EST

    very very useful information

    Betty 10/03/05 02:14:48 PM EDT

    I am unable to locate the source from the url mentioned in the article. Is there a new location from which the source can be downloaded ?

    Niko 05/23/05 03:41:20 PM EDT

    If you try to run the sources shipped with the article be sure that your database tables and columns are named in proper case (at least under MySQL 4.1/Linux the case does matter).

    Regardings libs: add commons-pool.jar from jakarta, and exlcude servlet.jar for building the war file.

    ... then it runs like a charme.
    Very nice article, Thanks!
    -- Niko

    Paul Byford 04/02/05 04:10:37 AM EST

    Derek,
    Again first class article! In my view the integration of open source frameworks is a key concern going forward. You have succeeded in your aim to encourage investigation of these topic.
    Paul

    Vladimir Cholak 03/31/05 06:20:19 PM EST

    What does the author teach regarding decoupling presentation tier from business tier?
    Just look at Listing 1.
    At one line the author demonstrate how to call business method indirectly via ServiceLocator. It's OK.
    But at the next line he breaks that principle and call business method directly. Why don't he use the same principle? It should be done like this:
    this.getServiceLocator().getCartService().addItem(item);
    And of course, the reference to Cart business object should be removed from CartBean.

    Tom Autera 03/01/05 01:39:23 PM EST

    Tutorial is great. I'm having 1 issue though. All works well until I press the Check-Out link. MySql throws a foreign-key constraint error. Here is the trace:
    10:57:34,055 INFO HibernateTransactionManager:315 - Initiating transaction commit
    10:57:34,086 WARN JDBCExceptionReporter:38 - SQL Error: 1216, SQLState: 23000
    10:57:34,086 ERROR JDBCExceptionReporter:46 - null, message from server: "Cannot add or update a child row: a foreign key constraint fails"
    10:57:34,086 WARN JDBCExceptionReporter:38 - SQL Error: 1216, SQLState: 23000
    10:57:34,086 ERROR JDBCExceptionReporter:46 - null, message from server: "Cannot add or update a child row: a foreign key constraint fails"
    10:57:34,102 ERROR JDBCExceptionReporter:38 - Could not execute JDBC batch update
    java.sql.BatchUpdateException: null, message from server: "Cannot add or update a child row: a foreign key constraint fails"
    at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1469)
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeBatch(DelegatingPreparedStatement.java:231)
    at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:54)
    at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:118)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2311)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2261)
    at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2187)
    at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
    at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:386)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:316)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:189)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:148)
    at $Proxy2.saveOrder(Unknown Source)
    at mypetstore.view.bean.OrderBean.createOrderAction(OrderBean.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
    at javax.faces.component.UICommand.broadcast(UICommand.java:312)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:266)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:380)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at mypetstore.view.util.SecurityFilter.doFilter(SecurityFilter.java:73)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    10:57:34,102 ERROR SessionImpl:2269 - Could not synchronize database state with session
    net.sf.hibernate.JDBCException: Could not execute JDBC batch update
    at net.sf.hibernate.impl.BatcherImpl.executeBatch(BatcherImpl.java:125)
    at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2311)
    at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2261)

    Shankar Kolinjavadi 02/27/05 12:04:14 AM EST

    I had the same issue with the jsp compilation. It happens to be a problem with tomcat losing the class path to java libraries. There is a open bug on some versions of 5.x Tomcat installations. removing and reinstall of Tomcat fixed this issue, after a day of frustrating trials and errors.

    Cheers

    Jason Grundy 02/02/05 02:20:31 PM EST

    Great article. I deployed to JBoss4.0.1 but I receive an error when trying to access the URL. Any ideas?

    2005-02-02 12:25:57,784 ERROR [org.apache.jasper.compiler.Compiler] Error compiling file: /C:/jboss-4.0.1/server/default/work/jboss.web/localhost/mypetstore//org/apache/jsp\main_jsp.java [javac] Compiling 1 source file

    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:88: _jspx_meth_tiles_put_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_0(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:93: _jspx_meth_tiles_put_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_1(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^
    2 errors

    2005-02-02 12:25:57,814 ERROR [org.jboss.web.localhost.Engine] ApplicationDispatcher[/mypetstore] Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP

    Generated servlet error:
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:88: _jspx_meth_tiles_put_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_0(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^

    Generated servlet error:
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:93: _jspx_meth_tiles_put_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_1(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^
    2 errors

    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)
    2005-02-02 12:25:57,814 ERROR [org.jboss.web.localhost.Engine] ApplicationDispatcher[/mypetstore] Servlet.service() for servlet Faces Servlet threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP

    Generated servlet error:
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:88: _jspx_meth_tiles_put_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_0(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^

    Generated servlet error:
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:93: _jspx_meth_tiles_put_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_1(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^
    2 errors

    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)
    2005-02-02 12:25:57,824 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: Unable to compile class for JSP

    Generated servlet error:
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:88: _jspx_meth_tiles_put_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_0(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^

    Generated servlet error:
    C:\jboss-4.0.1\server\default\work\jboss.web\localhost\mypetstore\org\apache\jsp\main_jsp.java:93: _jspx_meth_tiles_put_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.main_jsp cannot be applied to (org.apache.struts.taglib.tiles.InsertTag,javax.servlet.jsp.PageContext)
    if (_jspx_meth_tiles_put_1(_jspx_th_tiles_insert_0, _jspx_page_context))
    ^
    2 errors

    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:670)
    at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:637)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:534)

    mike 11/21/04 08:33:37 PM EST

    It is a really great artical and if you are a Java programer (developer/architect) you can learn a lot.
    At the same time it shows why J2EE application development sucks (big time). One has to download Spring (13M), Hibernate(15M) and spend a couple of hours just to make this application working. I guess it is not worth mentioning how much time it takes to learn both of those frameworks. Or that the author himself concedes "JSF technology is not mature at this stage". So just go ahead learn this new exciting technology though you probably will not be able to use it soon for real applications. I live off Java but it is getting more (unnecessary) complicated with each new day (each new second). Like JSP 2.0 EL (expression language), for example. Could anybody explain me why is '${1 + 2}' better than '<%=(1+2)%>'? I do have opportunity to see various experts, senior developers, architects that do not know how to write a simple outer join or group by SQL query, but surely they can talk about EL (and other crap) for hours.
    At the end I do really have an admiration for the author who obviouosly learnt all three technologies (JSF, Hibernate and Spring) and succeded to create a very nice application on the top of them. As I already said this is a very nice article and one of the best articals in the recent (and not so recent) JDJ issues.

    Tim 11/21/04 04:21:53 PM EST

    There should be more follow up articles on this interesting and evolving architecture. Great article!!!

    Bill Dudney 11/13/04 10:16:00 AM EST

    The open source one is called myfaces. You can find it on the apache incubator.

    dami 11/12/04 08:36:57 AM EST

    I like JSF:

    1) with SUN Java Creator I can drag and drop my web tier in 10 minutes. Creator supports to connect JSF with RowSet, EJBs or web services. I have to sorted out, how to connect the JSF with my business delegate ..

    2) I think that the biggest advantage is that we have now 4 JSF implementations: SUN, Oracle, IBM and some open source one

    Looksky 11/12/04 05:47:17 AM EST

    From a documentation point of view, Hibernate is one of the most notable exception in the world of LGPL'ed projects. Check out its website.

    indRTY 11/11/04 02:50:37 AM EST

    What a breath of fresh air! Thank you Derek. This is just what J2EE needs. Great article.

    Garima 11/10/04 07:37:54 AM EST

    I have worked on Struts and IBatis earlier. This article was very interesting and it gave me a good idea about JSF and Hibernate. I was not very clear on what you wrote on IOC and Hibernate template. Also I do not know the exact role Spring played here. I am shocked that JSF does not have validation framework, does not integrate with JSTL and does not have a concept of Tiles. I thought the JSF creators should have added these features, specially since Struts has these features.

    David Morris 11/09/04 11:09:55 PM EST

    I have been used Hibernate, Struts, and Tiles for a few years and am always looking for a better way to build applications. This article covers a set of technologies that seem promising. The use of tiles with JSF makes me wonder if JSF is ready for prime time since JSF and JSP don't seem to mix well. Also, I wonder about the artifical tie to Struts to pick up tiles.

    Would the author recommend this combination of technologies? After reading the last sentence "If I sparked your interest in studying any of these technologies, my mission was accomplished." I wonder if this was merely a research project.

    @ThingsExpo Stories
    Roberto Medrano, Executive Vice President at SOA Software, had reached 30,000 page views on his home page - http://RobertoMedrano.SYS-CON.com/ - on the SYS-CON family of online magazines, which includes Cloud Computing Journal, Internet of Things Journal, Big Data Journal, and SOA World Magazine. He is a recognized executive in the information technology fields of SOA, internet security, governance, and compliance. He has extensive experience with both start-ups and large companies, having been involved at the beginning of four IT industries: EDA, Open Systems, Computer Security and now SOA.
    The industrial software market has treated data with the mentality of “collect everything now, worry about how to use it later.” We now find ourselves buried in data, with the pervasive connectivity of the (Industrial) Internet of Things only piling on more numbers. There’s too much data and not enough information. In his session at @ThingsExpo, Bob Gates, Global Marketing Director, GE’s Intelligent Platforms business, to discuss how realizing the power of IoT, software developers are now focused on understanding how industrial data can create intelligence for industrial operations. Imagine ...
    Operational Hadoop and the Lambda Architecture for Streaming Data Apache Hadoop is emerging as a distributed platform for handling large and fast incoming streams of data. Predictive maintenance, supply chain optimization, and Internet-of-Things analysis are examples where Hadoop provides the scalable storage, processing, and analytics platform to gain meaningful insights from granular data that is typically only valuable from a large-scale, aggregate view. One architecture useful for capturing and analyzing streaming data is the Lambda Architecture, representing a model of how to analyze rea...
    SYS-CON Events announced today that Vitria Technology, Inc. will exhibit at SYS-CON’s @ThingsExpo, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. Vitria will showcase the company’s new IoT Analytics Platform through live demonstrations at booth #330. Vitria’s IoT Analytics Platform, fully integrated and powered by an operational intelligence engine, enables customers to rapidly build and operationalize advanced analytics to deliver timely business outcomes for use cases across the industrial, enterprise, and consumer segments.
    The explosion of connected devices / sensors is creating an ever-expanding set of new and valuable data. In parallel the emerging capability of Big Data technologies to store, access, analyze, and react to this data is producing changes in business models under the umbrella of the Internet of Things (IoT). In particular within the Insurance industry, IoT appears positioned to enable deep changes by altering relationships between insurers, distributors, and the insured. In his session at @ThingsExpo, Michael Sick, a Senior Manager and Big Data Architect within Ernst and Young's Financial Servi...
    SYS-CON Events announced today that Open Data Centers (ODC), a carrier-neutral colocation provider, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place June 9-11, 2015, at the Javits Center in New York City, NY. Open Data Centers is a carrier-neutral data center operator in New Jersey and New York City offering alternative connectivity options for carriers, service providers and enterprise customers.
    The explosion of connected devices / sensors is creating an ever-expanding set of new and valuable data. In parallel the emerging capability of Big Data technologies to store, access, analyze, and react to this data is producing changes in business models under the umbrella of the Internet of Things (IoT). In particular within the Insurance industry, IoT appears positioned to enable deep changes by altering relationships between insurers, distributors, and the insured. In his session at @ThingsExpo, Michael Sick, a Senior Manager and Big Data Architect within Ernst and Young's Financial Servi...
    PubNub on Monday has announced that it is partnering with IBM to bring its sophisticated real-time data streaming and messaging capabilities to Bluemix, IBM’s cloud development platform. “Today’s app and connected devices require an always-on connection, but building a secure, scalable solution from the ground up is time consuming, resource intensive, and error-prone,” said Todd Greene, CEO of PubNub. “PubNub enables web, mobile and IoT developers building apps on IBM Bluemix to quickly add scalable realtime functionality with minimal effort and cost.”
    Sensor-enabled things are becoming more commonplace, precursors to a larger and more complex framework that most consider the ultimate promise of the IoT: things connecting, interacting, sharing, storing, and over time perhaps learning and predicting based on habits, behaviors, location, preferences, purchases and more. In his session at @ThingsExpo, Tom Wesselman, Director of Communications Ecosystem Architecture at Plantronics, will examine the still nascent IoT as it is coalescing, including what it is today, what it might ultimately be, the role of wearable tech, and technology gaps stil...
    The Internet of Things (IoT) is causing data centers to become radically decentralized and atomized within a new paradigm known as “fog computing.” To support IoT applications, such as connected cars and smart grids, data centers' core functions will be decentralized out to the network's edges and endpoints (aka “fogs”). As this trend takes hold, Big Data analytics platforms will focus on high-volume log analysis (aka “logs”) and rely heavily on cognitive-computing algorithms (aka “cogs”) to make sense of it all.
    With several hundred implementations of IoT-enabled solutions in the past 12 months alone, this session will focus on experience over the art of the possible. Many can only imagine the most advanced telematics platform ever deployed, supporting millions of customers, producing tens of thousands events or GBs per trip, and hundreds of TBs per month. With the ability to support a billion sensor events per second, over 30PB of warm data for analytics, and hundreds of PBs for an data analytics archive, in his session at @ThingsExpo, Jim Kaskade, Vice President and General Manager, Big Data & Ana...
    In the consumer IoT, everything is new, and the IT world of bits and bytes holds sway. But industrial and commercial realms encompass operational technology (OT) that has been around for 25 or 50 years. This grittier, pre-IP, more hands-on world has much to gain from Industrial IoT (IIoT) applications and principles. But adding sensors and wireless connectivity won’t work in environments that demand unwavering reliability and performance. In his session at @ThingsExpo, Ron Sege, CEO of Echelon, will discuss how as enterprise IT embraces other IoT-related technology trends, enterprises with i...
    When it comes to the Internet of Things, hooking up will get you only so far. If you want customers to commit, you need to go beyond simply connecting products. You need to use the devices themselves to transform how you engage with every customer and how you manage the entire product lifecycle. In his session at @ThingsExpo, Sean Lorenz, Technical Product Manager for Xively at LogMeIn, will show how “product relationship management” can help you leverage your connected devices and the data they generate about customer usage and product performance to deliver extremely compelling and reliabl...
    One of the biggest impacts of the Internet of Things is and will continue to be on data; specifically data volume, management and usage. Companies are scrambling to adapt to this new and unpredictable data reality with legacy infrastructure that cannot handle the speed and volume of data. In his session at @ThingsExpo, Don DeLoach, CEO and president of Infobright, will discuss how companies need to rethink their data infrastructure to participate in the IoT, including: Data storage: Understanding the kinds of data: structured, unstructured, big/small? Analytics: What kinds and how responsiv...
    Since 2008 and for the first time in history, more than half of humans live in urban areas, urging cities to become “smart.” Today, cities can leverage the wide availability of smartphones combined with new technologies such as Beacons or NFC to connect their urban furniture and environment to create citizen-first services that improve transportation, way-finding and information delivery. In her session at @ThingsExpo, Laetitia Gazel-Anthoine, CEO of Connecthings, will focus on successful use cases.
    Sensor-enabled things are becoming more commonplace, precursors to a larger and more complex framework that most consider the ultimate promise of the IoT: things connecting, interacting, sharing, storing, and over time perhaps learning and predicting based on habits, behaviors, location, preferences, purchases and more. In his session at @ThingsExpo, Tom Wesselman, Director of Communications Ecosystem Architecture at Plantronics, will examine the still nascent IoT as it is coalescing, including what it is today, what it might ultimately be, the role of wearable tech, and technology gaps stil...
    The true value of the Internet of Things (IoT) lies not just in the data, but through the services that protect the data, perform the analysis and present findings in a usable way. With many IoT elements rooted in traditional IT components, Big Data and IoT isn’t just a play for enterprise. In fact, the IoT presents SMBs with the prospect of launching entirely new activities and exploring innovative areas. CompTIA research identifies several areas where IoT is expected to have the greatest impact.
    Wearable devices have come of age. The primary applications of wearables so far have been "the Quantified Self" or the tracking of one's fitness and health status. We propose the evolution of wearables into social and emotional communication devices. Our BE(tm) sensor uses light to visualize the skin conductance response. Our sensors are very inexpensive and can be massively distributed to audiences or groups of any size, in order to gauge reactions to performances, video, or any kind of presentation. In her session at @ThingsExpo, Jocelyn Scheirer, CEO & Founder of Bionolux, will discuss ho...
    SYS-CON Events announced today that GENBAND, a leading developer of real time communications software solutions, has been named “Silver Sponsor” of SYS-CON's WebRTC Summit, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. The GENBAND team will be on hand to demonstrate their newest product, Kandy. Kandy is a communications Platform-as-a-Service (PaaS) that enables companies to seamlessly integrate more human communications into their Web and mobile applications - creating more engaging experiences for their customers and boosting collaboration and productiv...
    From telemedicine to smart cars, digital homes and industrial monitoring, the explosive growth of IoT has created exciting new business opportunities for real time calls and messaging. In his session at @ThingsExpo, Ivelin Ivanov, CEO and Co-Founder of Telestax, shared some of the new revenue sources that IoT created for Restcomm – the open source telephony platform from Telestax. Ivelin Ivanov is a technology entrepreneur who founded Mobicents, an Open Source VoIP Platform, to help create, deploy, and manage applications integrating voice, video and data. He is the co-founder of TeleStax, a...