-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: struts2+hibernate+spring
PostPosted: Mon May 31, 2010 4:50 pm 
Newbie

Joined: Mon May 31, 2010 4:26 pm
Posts: 5
Can anyone post an example of retrieving data from a table using struts2,hibernate generic dao and spring? I am unable to run my code using struts2,hibernate(genericdao) and spring using oracle database. It gives the following errors:
applicationcontext failed to initialze
unable to load jdbc drivers
error action listeners


Top
 Profile  
 
 Post subject: Re: struts2+hibernate+spring
PostPosted: Tue Jun 01, 2010 3:12 am 
Pro
Pro

Joined: Wed Oct 03, 2007 2:31 pm
Posts: 205
Have you googled for examples of using Struts2, Spring and Hibernate? There are tons of examples on the web. Also you can use Spring in Action, Struts2 reference book as well. Can we get some of the stacktrace as well? The information you've provided is not adequate enough.

Thanks


Top
 Profile  
 
 Post subject: Re: struts2+hibernate+spring
PostPosted: Tue Jun 01, 2010 3:28 am 
Newbie

Joined: Mon May 31, 2010 4:26 pm
Posts: 5
Do I need to connect to my database before i run the application?

Here is the log file

Jun 1, 2010 9:25:56 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive UserExample.war
Jun 1, 2010 9:25:56 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 1, 2010 9:25:56 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/UserExample] startup failed due to previous errors


Top
 Profile  
 
 Post subject: Re: struts2+hibernate+spring
PostPosted: Tue Jun 01, 2010 4:34 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
No, but you need the right jdbc drivers in the classpath when the application starts. As Amin suggested try following a tutorial. The Struts 2 team has some on their website.

--Hardy


Top
 Profile  
 
 Post subject: Re: struts2+hibernate+spring
PostPosted: Wed Jun 02, 2010 3:09 am 
Newbie

Joined: Mon May 31, 2010 4:26 pm
Posts: 5
i added the ojdbc14 jar in tomcat/lib.
The log is

Jun 2, 2010 9:04:18 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/UserExample]
Jun 2, 2010 9:04:29 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive UserExample.war
Jun 2, 2010 9:04:31 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Jun 2, 2010 9:04:31 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/UserExample] startup failed due to previous errors


Top
 Profile  
 
 Post subject: Re: struts2+hibernate+spring
PostPosted: Wed Jun 02, 2010 3:26 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Have you looked at all log files? Tomcat writes several log files? If there no other indicators about the reason of not being able to deploy you have to reconfigure your Tomcat logging.

--Hardy


Top
 Profile  
 
 Post subject: Re: struts2+hibernate+spring
PostPosted: Fri Jun 04, 2010 5:51 am 
Newbie

Joined: Mon May 31, 2010 4:26 pm
Posts: 5
I created an example to integrate struts,spring and hibernate based on the tutorial. I have an error which asks for hibernate.cfg.xml.

type Exception report

message

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

exception

org.hibernate.SessionException: Error! Please, check your JDBC/JDNI Configurations and Database Server avaliability.
Could not open or put a Hibernate Session in ValueStack: /hibernate.cfg.xml not found
com.googlecode.s2hibernate.struts2.plugin.interceptors.SessionTransactionInjectorInterceptor.intercept(SessionTransactionInjectorInterceptor.java:134)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)




Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.