Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials


 

 

Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Struts Hibernate Spring Integrate

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

25 comments so far (post your own) View All Comments Latest 10 Comments:

Hi, I am getting an 404 error and the stack trace is like this. Can you please help to resolve this issue.

Sep 7, 2010 1:12:22 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:546)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:502)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:677)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 36 more
Caused by: org.xml.sax.SAXParseException: The content of element type "class" is incomplete, it must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:791)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
... 40 more
Sep 7, 2010 1:12:22 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart

Thanks in Advance

Jyothi

Posted by jyothi on Wednesday, 09.8.10 @ 00:01am | #99440

Hi, I downloaded the code but there is no sql script to create the database.

plase help.

thanks

Posted by Majid on Wednesday, 03.31.10 @ 19:30pm | #96018

I can't download "applicationContext-hibernate.xml", "jdbc.properties" and "build.xml" files

Posted by Jose Angel on Thursday, 11.19.09 @ 23:39pm | #92723

Hi,
I have a build fail error, it shows 'Target "build" does not exist in project blank"'.
How should I solve this problem? I've done all that is from the above.

Posted by Jia Bin on Wednesday, 01.14.09 @ 12:21pm | #83825

Hi,

While going through the above tutorial, I found various broken links for files such as:
1)"applicationContext-hibernate.xml"
2)"jdbc.properties"
3)"build.xml".

Please provide the complete code of these files as it is becoming really confusing to run this tutorial.

Thanks & Regards,
Deepali Shahabadi

Posted by Deepali Shahabadi on Monday, 01.12.09 @ 00:59am | #83729

hi Deepak,
i am trying to download all the three files build.xml,applicationContext-hibernate.xml,jdbc.propert. but i am getting an error. i am trying to build this application in my local. This article is helping me lot. please try to send these files or keep the proper links so that i will download and complete my application.
Thanks
venkatesh

Posted by venkatesh on Saturday, 01.3.09 @ 10:09am | #83448

Hai,
I am manjunath.I got your tutorials.Its very useful to my project.Can you tell how to run this application on netbeans ..and what are the settings i have to do for this application..

please its urgent,anybody can send me a suggestions...

Regards,
Manju

Posted by manjunath on Tuesday, 11.18.08 @ 04:47am | #81780

Hi,
Can you tell me how to run this application on NetBeans?

Thanks!

Posted by dbvc on Sunday, 11.16.08 @ 14:28pm | #81723

I am new to Struts, Spring and Hibernate just started to fallow your example. Can you explain fallowing step further more.

Extract "struts-blank.war" into copy the directory "struts-blank" to "integrated\src" and rename the directory struts-blank to project.

Posted by Prasad on Monday, 10.27.08 @ 11:30am | #81343

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class [com.mysql.jdbc.Driver]; nested exception is java.lang.ClassNotFoundException: com.mysql.jdbc.Driver]
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class [com.mysql.jdbc.Driver]; nested exception is java.lang.ClassNotFoundException: com.mysql.jdbc.Driver]
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1032)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
org.apache.catalina.startup.Catalina.start(Catalina.java:552)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


root cause

PropertyAccessExceptionsException (1 errors)
org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:670)
org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:642)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1023)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
org.apache.catalina.startup.Catalina.start(Catalina.java:552)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.27

Posted by anand on Wednesday, 10.22.08 @ 16:58pm | #81247

applicationContext-hibernate.xml and jdbc.properties
please help me!!
thanks and best regards!!

Posted by Viet on Wednesday, 10.8.08 @ 10:10am | #80958

Just wondering why this problem occurred while i was checking the tutorial..

javax.servlet.ServletException: Cannot open connection

what do you think might cause this problem..

Thank you

Posted by Michael Bardos on Wednesday, 07.2.08 @ 21:47pm | #65395

how can i do this project using eclipse europa ?
i want some exemples like this tutorial but using eclipse ide please ?

Posted by nmonix on Sunday, 03.16.08 @ 23:25pm | #52946

Hi
Thanks for this interesting tutorial !!
I can't uncompress the project.zip, the file is corrupt.
please check href links...

Thanks in advance !!
Doxumd

Posted by doxumd on Wednesday, 02.6.08 @ 15:28pm | #47408

It is really helpful for quick learning.

Posted by Raghu on Thursday, 11.29.07 @ 16:14pm | #40886

Hi ,
Can you tell me how to run this application on MyEclipse .

CAn you provide me a Login application only of Struts and database combination.

Posted by Pankaj on Sunday, 11.18.07 @ 10:05am | #37686

Deepak,

I have the app working on Weblogic, but I get the error below when trying to login with an invalid username. Any thoughts?

java.lang.NoSuchMethodError: com.mycompany.work.web.struts.action.UserLoginAction.saveErrors(Ljavax/servlet/http/HttpServletRequest;Lorg/apache/struts/action/ActionMessages;)V
at com.mycompany.work.web.struts.action.UserLoginAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3245)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

Posted by Gary on Friday, 09.28.07 @ 00:42am | #30099

How different are the deploy steps to get this running on weblogic server?

Posted by Gary on Wednesday, 09.19.07 @ 19:48pm | #27862

Hi Deepak,
Most of the download link are broken,beside this it is good approach.

Praveen Kumar

Posted by praveen kumar on Monday, 09.3.07 @ 08:14am | #24838

sir i have not downloaded this code

Posted by surya on Saturday, 08.4.07 @ 17:22pm | #22652

notes is good fr learnimg see thi

Posted by naresh on Tuesday, 07.17.07 @ 12:10pm | #21424

There are several broken links. Please check the accordingly.

Thanks,
Akash

Posted by Akash Borkar on Friday, 12.1.06 @ 14:49pm | #321

Hi,

The correct file is http://www.roseindia.net/struts/hibernate-spring/project.zip

I have updated the page. Thanks for pointing out the boken link issue.

Deepak

Posted by Deepak Kumar on Wednesday, 11.29.06 @ 21:03pm | #207

Hi Deepak,

The struts-spring-hibernate.zip is not accessible. I hope it can be fixed as soon as possible.

Thank you.

Posted by newbie on Wednesday, 11.29.06 @ 20:06pm | #206

Hi Deepak,
Its a great thing to put forward an application integrating struts,spring and hibernate.
Most of the download links on this page are broken.
Regards
Raju

Posted by raju on Friday, 11.24.06 @ 10:53am | #69

Ask programming questions?

 

 

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2007. All rights reserved.