JBoss Community

Data Not retrieved with JBOSS

created by Harbir Hundal in Datasource Configuration - View the full discussion

Hi guys,
I am new to using JBOSS.

I am a very simple web application, thats is trying to extract some data from a table form the Database, using hibernate.

Now, the database connection is running fine when it is deployed with tomcar, and the data is getting retrieved from the Datatbase.
When the application is deployed in JBOSS 5.1, there is no data retrieved form the database.

The following is my JDBC properties file:


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

 

 

My spring dispatcher is:

 


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
        xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

        <!-- packages that will be scanned for annotations -->
        <context:annotation-config />
        <context:component-scan base-package="au.com.deccan" />  <!-- all packages under this will be scanned -->
        <tx:annotation-driven transaction-manager="transactionManager" />

        <!-- Defining the default annotation AnnotationHandlerMapping -->
        <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
        
        <!-- Defining the ClassName annotation ClassNameHandlerMapping -->
        <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
                <property name="interceptors">
                        <list>
                                <ref bean="measurementInterceptor" />
                        </list>
                </property>
        </bean>

        <!-- Defining the AnnotationHandlerAdapter -->
        <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />

        <!-- Defining the Interceptor -->
        <bean id="measurementInterceptor" class="au.com.deccan.interceptor.MeasurementInterceptor" />

        <!-- Defining the Viewresolver -->
        <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
                p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />
        
        <!-- Defining the JDBC properties -->
        <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
                p:location="/WEB-INF/jdbc.properties" />
        <!-- Defining the DataSource -->
        <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}" />
        
        <!-- Configuration for Hibernate -->
        <bean id="sessionFactory"
                class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
                <property name="dataSource" ref="dataSource" />
                <property name="configLocation">
                        <value>/WEB-INF/hibernate.cfg.xml</value>
                </property>
                <property name="configurationClass">
                        <value>org.hibernate.cfg.AnnotationConfiguration</value>
                </property>
                <property name="hibernateProperties">
                        <props>
                                <prop key="hibernate.dialect">${jdbc.dialect}</prop>
                                <prop key="hibernate.show_sql">true</prop>
                        </props>
                </property>
        </bean>
        
        <!-- transaction Manager -->
        <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
                <property name="sessionFactory" ref="sessionFactory" />
        </bean>
</beans>

 

My hibernate config is:

 

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
    -//Hibernate/Hibernate Configuration DTD//EN
    http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd>

 <hibernate-configuration>
    <session-factory>
        <mapping class="au.com.deccan.model.User" />
        </session-factory>
 </hibernate-configuration>

 

 

There are no erros or exceptions is the log.
Can, someone please let me know what may be causing this behavious.

Regrads
Adofo

Reply to this message by going to Community

Start a new discussion in Datasource Configuration at Community