<!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;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span class="postbody">My spring dispatcher is: </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span class="postbody"><br/></span></p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
<span class="jive-xml-tag"><span>&lt;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>"
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>"
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>"
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>"
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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>
&#160;&#160;&#160;&#160;&#160;&#160; </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>"&gt;</span></span>

&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-comment">&lt;!-- packages that will be scanned for annotations --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;context:annotation-config /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;context:component-scan base-package="au.com.deccan" /&gt;</span>&#160; &lt;!-- all packages under this will be scanned --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;</span>

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the default annotation AnnotationHandlerMapping --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the ClassName annotation ClassNameHandlerMapping --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="interceptors"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;list&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;ref bean="measurementInterceptor" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/list&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/property&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/bean&gt;</span>

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the AnnotationHandlerAdapter --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /&gt;</span>

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the Interceptor --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean id="measurementInterceptor" class="au.com.deccan.interceptor.MeasurementInterceptor" /&gt;</span>

&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the Viewresolver --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the JDBC properties --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; p:location="/WEB-INF/jdbc.properties" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Defining the DataSource --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; destroy-method="close" p:driverClassName="${jdbc.driverClassName}"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; p:url="${jdbc.url}" p:username="${jdbc.username}" p:password="${jdbc.password}" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- Configuration for Hibernate --&gt;
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean id="sessionFactory"
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="dataSource" ref="dataSource" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="configLocation"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;value&gt;</span>/WEB-INF/hibernate.cfg.xml<span class="jive-xml-tag">&lt;/value&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/property&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="configurationClass"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;value&gt;</span>org.hibernate.cfg.AnnotationConfiguration<span class="jive-xml-tag">&lt;/value&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/property&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernateProperties"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;props&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;prop key="hibernate.dialect"&gt;</span>${jdbc.dialect}<span class="jive-xml-tag">&lt;/prop&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;prop key="hibernate.show_sql"&gt;</span>true<span class="jive-xml-tag">&lt;/prop&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/props&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/property&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/bean&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;!-- transaction Manager --&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="sessionFactory" ref="sessionFactory" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/bean&gt;</span>
<span class="jive-xml-tag">&lt;/beans&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>My hibernate config is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
&lt;!DOCTYPE hibernate-configuration PUBLIC
&#160;&#160;&#160; <span class="jive-xml-quote">-//Hibernate/Hibernate Configuration DTD//EN</span>
&#160;&#160;&#160; <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>&gt;

 <span class="jive-xml-tag">&lt;hibernate-configuration&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;session-factory&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;mapping class="au.com.deccan.model.User" /&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/session-factory&gt;</span>
 <span class="jive-xml-tag">&lt;/hibernate-configuration&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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>