 | I received an email stating that AOL finally aband... |
|
TOP THREE LINKS YOU MUST CLICK ON
FrontPage Feature
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.
Reader Feedback: Page 1 of 2
#24 |
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.
|
#23 |
en3rgizer commented on 26 Jun 2008
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
|
#22 |
Zakaria Chakih commented on 25 May 2008
@ en3rgizer
Could you please give me your working mypetstore!?
|
#21 |
Zakaria chakih commented on 25 May 2008
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??
|
#20 |
danny commented on 31 Mar 2008
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
|
#19 |
en3rgizer commented on 26 Mar 2008
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:)))
|
#18 |
en3rgizer commented on 26 Mar 2008
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!
|
#17 |
Gopu commented on 28 Feb 2008
I would like to know the url to download the source code, b'cos the one given in this article doesn't work.
|
#16 |
Mamatha commented on 26 Feb 2008
very very useful information
|
#15 |
Betty commented on 3 Oct 2005
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 ?
|
#14 |
Niko commented on 23 May 2005
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
|
#13 |
Paul Byford commented on 2 Apr 2005
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
|
#12 |
Vladimir Cholak commented on 31 Mar 2005
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.
|
#11 |
Tom Autera commented on 1 Mar 2005
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)
|
#10 |
Shankar Kolinjavadi commented on 27 Feb 2005
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
|
YOUR FEEDBACK  | By Alan Williamson erdem wrote: ... |  | By Michael Nonemacher erdem wrote: comments. I love this Sohbet & Chat site as it contains good materials Kameralı Sohbe... |  | By Michael Remijan Firstname Lastname wrote: A similar solution is to create a MySQL driver. That is, create a class derived from com.mysql.jdbc.NonRegisteringDriver. Create a static initializer block to register the class with java.sql.DriverManager, following the example in com.mysql.jdbc.Driver. Override the following functions:
publ... |  | By Onno Kluyt şehmuz çokyer wrote: Thank you very much for this useful article and the comments. I love this site as it contains good materials.
------------------------------------------
adtech... |  | By Rini Gahir Ha wrote: Hi, there are many ways beyond the portal framework itself to substantially increase the throughput up to 10x and to reduce the time that the browser needs to build the page.
We have throughput numbers around 20 pages for a large portal on 1 CPU base. Feel free to read more on http://hhvo.wordpress... |
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS |
SYS-CON FEATURED WHITEPAPERS  | By Java News Desk JavaScript is pretty much everywhere you look these days, reaching far beyond your desktop browser. ... | By Java News Desk The Java Community Process (JCP) Program Management Office has announced the final results of the 20... | If you think your network is safe from the new strains of content security threats, think again. Tod... | By .NETDJ News Desk Tidal Software has announced Intersperse 8.0, a product that monitors J2EE and .NET applications and... | By Java News Desk ILOG has announced ILOG JViews 8.5, the latest version of ILOG’s Java-based visualization suite, w... | By Enterprise Open Source News Desk Emulex has announced that it will offer Fibre Channel Host Bus Adapters (HBA) and Fibre Channel over... | By BlackBerry News Desk The BlackBerryR Technical Webcast Series is designed to help BlackBerry administrators better manage... | By BlackBerry News Desk The BlackBerry Technical Seminar is back this fall with breakthrough new sessions you won’t want t... | By Maureen O'Gara In an effort to head off its disappearance below the horizon, Sun is going to lay off 5,000-6,000 pe... | By Cloud Computing News Desk Working across all of Sun, Senior Vice President, Dave Douglas, has been appointed today to lead the... | By Virtualization News Desk In 45 jam-packed minutes that will include case studies and live technology demonstrations, the VP o... | By Cloud Computing News Desk Increasingly, a businesses competitive advantage is gained by processing large flows of raw data int... | By Avigdor Luttinger When picturing the relationship between the enterprise and the Software-as-a-Service (SaaS) business... | By Maureen O'Gara The toxic virus of soft consumer spending has hit Best Buy forcing it to axe its earnings guidance f... | By Jeff Davis The open source community includes many early advocates of the recent wave of emerging SOA-related t... | By Maureen O'Gara Storage has been like a penitential chain around Sun’s neck and it’s left unspeakable gouges. Su... | By JDJ News InterSystems has announced that Ochsner Health System has selected the Progeny Anatomic Pathology (A... | By Cloud Computing News Desk SYS-CON's Cloud Computing Journal, founded in July 2008 as the world's first publication devoted exc... | By Alan Williamson The line between what is considered a cloud and what is paramount to hosting is a blurry line at the... | By Ross Mason Over the course of the past few decades, the consumer media industry has evolved from a slow-moving ... |
SPONSORED BY INFRAGISTICS In every field of design one of the first things students do is learn from the work of others. They ... Oct. 7, 2008 11:15 PM | There are many forces that influence technological evolution. After a decade of building enterprise ... Jun. 30, 2008 03:45 PM | 2008 is going to be an important year for Rich Internet Applications. Most organizations are deliver... Jun. 20, 2008 12:45 PM | The OpenAjax Alliance is developing an Ajax industry wishlist for future browsers, using a dedicated... Jun. 18, 2008 07:45 PM | Infragistics announced the availability of two Community Technology Preview (CTP) User Interface (UI... Jun. 4, 2008 08:00 AM | The YUI development team has released version 2.5.2; you can download the new release from SourceFor... Jun. 2, 2008 05:00 AM |
|