<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Data Not retrieved with JBOSS
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/adofo">Harbir Hundal</a> in <i>Datasource Configuration</i> - <a href="http://community.jboss.org/message/609901#609901">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p><span class="postbody">Hi guys, <br/> I am new to using <a class="jive-link-external-small" href="http://www.coderanch.com/forums/f-63/JBoss" target="_new">JBOSS</a>. <br/> <br/> I am a very simple web application, thats is trying to extract some data from a table form the Database, using hibernate. <br/> <br/> Now, the database connection is running fine when it is deployed with tomcar, and the data is getting retrieved from the Datatbase. <br/> When the application is deployed in JBOSS 5.1, there is no data retrieved form the database. <br/> <br/> The following is my <a class="jive-link-external-small" href="http://www.coderanch.com/forums/f-3/JDBC" target="_new">JDBC</a> properties file: </span></p><p><span class="postbody"><br/></span></p><pre class="jive-pre"><code class="jive-code">jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.dialect=org.hibernate.dialect.MySQLDialect
jdbc.url=jdbc:mysql://localhost:3306/deccandatabase
jdbc.username=root
jdbc.password=root5
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span class="postbody">My spring dispatcher is: </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span class="postbody"><br/></span></p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><?xml version="1.0" encoding="UTF-8"?></span>
<span class="jive-xml-tag"><span><beans xmlns="</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/beans" target="_blank">http://www.springframework.org/schema/beans</a><span>"
        xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>" xmlns:p="</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/p" target="_blank">http://www.springframework.org/schema/p</a><span>"
        xmlns:aop="</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/aop" target="_blank">http://www.springframework.org/schema/aop</a><span>" xmlns:tx="</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/tx" target="_blank">http://www.springframework.org/schema/tx</a><span>"
        xmlns:context="</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/context" target="_blank">http://www.springframework.org/schema/context</a><span>"
        xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/beans" target="_blank">http://www.springframework.org/schema/beans</a><span> </span><a class="jive-link-external-small" href="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" target="_blank">http://www.springframework.org/schema/beans/spring-beans-3.0.xsd</a><span>
       </span><a class="jive-link-external-small" href="http://www.springframework.org/schema/aop" target="_blank">http://www.springframework.org/schema/aop</a><span> </span><a class="jive-link-external-small" href="http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" target="_blank">http://www.springframework.org/schema/aop/spring-aop-3.0.xsd</a><span>
</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/tx" target="_blank">http://www.springframework.org/schema/tx</a><span> </span><a class="jive-link-external-small" href="http://www.springframework.org/schema/tx/spring-tx-3.0.xsd" target="_blank">http://www.springframework.org/schema/tx/spring-tx-3.0.xsd</a><span>
</span><a class="jive-link-external-small" href="http://www.springframework.org/schema/context" target="_blank">http://www.springframework.org/schema/context</a><span> </span><a class="jive-link-external-small" href="http://www.springframework.org/schema/context/spring-context-3.0.xsd" target="_blank">http://www.springframework.org/schema/context/spring-context-3.0.xsd</a><span>"></span></span>
        <span class="jive-xml-comment"><!-- packages that will be scanned for annotations -->
        <span class="jive-xml-tag"><context:annotation-config /></span>
        <span class="jive-xml-tag"><context:component-scan base-package="au.com.deccan" /></span>  <!-- all packages under this will be scanned -->
        <span class="jive-xml-tag"><tx:annotation-driven transaction-manager="transactionManager" /></span>
        <!-- Defining the default annotation AnnotationHandlerMapping -->
        <span class="jive-xml-tag"><bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /></span>
       
        <!-- Defining the ClassName annotation ClassNameHandlerMapping -->
        <span class="jive-xml-tag"><bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"></span>
                <span class="jive-xml-tag"><property name="interceptors"></span>
                        <span class="jive-xml-tag"><list></span>
                                <span class="jive-xml-tag"><ref bean="measurementInterceptor" /></span>
                        <span class="jive-xml-tag"></list></span>
                <span class="jive-xml-tag"></property></span>
        <span class="jive-xml-tag"></bean></span>
        <!-- Defining the AnnotationHandlerAdapter -->
        <span class="jive-xml-tag"><bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /></span>
        <!-- Defining the Interceptor -->
        <span class="jive-xml-tag"><bean id="measurementInterceptor" class="au.com.deccan.interceptor.MeasurementInterceptor" /></span>
        <!-- Defining the Viewresolver -->
        <span class="jive-xml-tag"><bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
                p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /></span>
       
        <!-- Defining the JDBC properties -->
        <span class="jive-xml-tag"><bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
                p:location="/WEB-INF/jdbc.properties" /></span>
        <!-- Defining the DataSource -->
        <span class="jive-xml-tag"><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
                destroy-method="close" p:driverClassName="${jdbc.driverClassName}"
                p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /></span>
       
        <!-- Configuration for Hibernate -->
        <span class="jive-xml-tag"><bean id="sessionFactory"
                class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"></span>
                <span class="jive-xml-tag"><property name="dataSource" ref="dataSource" /></span>
                <span class="jive-xml-tag"><property name="configLocation"></span>
                        <span class="jive-xml-tag"><value></span>/WEB-INF/hibernate.cfg.xml<span class="jive-xml-tag"></value></span>
                <span class="jive-xml-tag"></property></span>
                <span class="jive-xml-tag"><property name="configurationClass"></span>
                        <span class="jive-xml-tag"><value></span>org.hibernate.cfg.AnnotationConfiguration<span class="jive-xml-tag"></value></span>
                <span class="jive-xml-tag"></property></span>
                <span class="jive-xml-tag"><property name="hibernateProperties"></span>
                        <span class="jive-xml-tag"><props></span>
                                <span class="jive-xml-tag"><prop key="hibernate.dialect"></span>${jdbc.dialect}<span class="jive-xml-tag"></prop></span>
                                <span class="jive-xml-tag"><prop key="hibernate.show_sql"></span>true<span class="jive-xml-tag"></prop></span>
                        <span class="jive-xml-tag"></props></span>
                <span class="jive-xml-tag"></property></span>
        <span class="jive-xml-tag"></bean></span>
       
        <!-- transaction Manager --></span>
        <span class="jive-xml-tag"><bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"></span>
                <span class="jive-xml-tag"><property name="sessionFactory" ref="sessionFactory" /></span>
        <span class="jive-xml-tag"></bean></span>
<span class="jive-xml-tag"></beans></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My hibernate config is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><?xml version="1.0" encoding="UTF-8"?></span>
<!DOCTYPE hibernate-configuration PUBLIC
    <span class="jive-xml-quote">-//Hibernate/Hibernate Configuration DTD//EN</span>
    <span class="jive-xml-quote"><a class="jive-link-external-small" href="http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" target="_blank">http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd</a></span>>
<span class="jive-xml-tag"><hibernate-configuration></span>
    <span class="jive-xml-tag"><session-factory></span>
        <span class="jive-xml-tag"><mapping class="au.com.deccan.model.User" /></span>
        <span class="jive-xml-tag"></session-factory></span>
<span class="jive-xml-tag"></hibernate-configuration></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span class="postbody">There are no erros or exceptions is the log. <br/> Can, someone please let me know what may be causing this behavious. <br/> <br/> Regrads <br/> Adofo</span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/609901#609901">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Datasource Configuration at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>