Announcement Announcement Module
Collapse
No announcement yet.
URGENT -- Problem with dataSource in JBoss Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • URGENT -- Problem with dataSource in JBoss

    ok I have a war that was working in WebSphere but I need to get it into JBoss. here is the top of the stack trace. I have no idea what it is fussing about.

    Code:
    08:45:20,218 INFO  [ConnectionProviderFactory] Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
    08:45:20,250 INFO  [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [dataSource,factory,serverDAOHibernate,servDAOPg,appDAOHibernateManaged,filterInvocationInterceptor,securityInterceptor,aclServerAdminVoter,aclServerUpdateVoter,aclServerReadVoter,aclAppAdminVoter,aclAppUpdateVoter,aclAppReadVoter,aclAccessDecisionManager,IDGenerator,viewResolver,roleVoter,txProxyTemplate,transactionManager,personWareHouseDAOHibernate,appDAOHibernate,appRoleDAOHibernate,appRightsDAOHibernate,profilerAround,exceptionInterceptor,profilingAutoProxy,filterChainProxy,httpSessionContextIntegrationFilter,securityEnforcementFilter,httpRequestAccessDecisionManager,requestMethodsFilter,authenticationManager,passwordEncoder,daoAuthenticationProvider,cacheManager,userCacheBackend,userCache,loggerListener,authenticationProcessingFilter,authenticationProcessingFilterEntryPoint,baseFilterInvocationInterceptor,bjuidAuthenticationDAO,switchUserProcessingFilter,baseSecurityInterceptor,SimpleAclEntry.ADMINISTRATION,SimpleAclEntry.READ_WRITE,SimpleAclEntry.READ,baseAclAdminVoter,baseAclUpdateVoter,baseAclReadVoter,baseAclAccessDecisionManager,aclManager,basicAclProvider,basicAclExtendedDao,afterInvocationManager,afterAclCollectionRead,afterAclRead]; root of BeanFactory hierarchy}
    08:45:20,250 ERROR [ContextLoader] Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factory' defined in ServletContext resource [/WEB-INF/aemApp-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: At least one handler method must be found in class [class $Proxy49]
    java.lang.IllegalArgumentException: At least one handler method must be found in class [class $Proxy49]
    	at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.<init>(ThrowsAdviceInterceptor.java:86)
    	at org.springframework.aop.framework.adapter.ThrowsAdviceAdapter.getInterceptor(ThrowsAdviceAdapter.java:41)
    	at org.springframework.aop.framework.adapter.DefaultAdvisorAdapterRegistry.getInterceptors(DefaultAdvisorAdapterRegistry.java:77)
    	at org.springframework.aop.framework.AdvisorChainFactoryUtils.calculateInterceptorsAndDynamicInterceptionAdvice(AdvisorChainFactoryUtils.java:77)
    	at org.springframework.aop.framework.HashMapCachingAdvisorChainFactory.getInterceptorsAndDynamicInterceptionAdvice(HashMapCachingAdvisorChainFactory.java:47)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:156)
    	at $Proxy51.getConnection(Unknown Source)
    	at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:80)
    	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
    	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1823)
    	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1143)
    	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:800)
    	at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:726)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
    	at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    And here is some of my context file.
    Code:
    	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    		<property name="driverClassName">
    			<value>com.ibm.db2.jcc.DB2Driver</value>
    		</property>
    		<property name="url">
    			<value>jdbc:db2://bjuptsrv.bju.edu:50010/BJUPROD2</value>
    		</property>
    		<property name="username">
    			<value>db2pbt</value>
    		</property>
    		<property name="password">
    			<value>db2</value>
    		</property>
    		<property name="connectionProperties">
    		<map>
    			<entry key="currentSchema">
    				<value>AEM</value>
    			</entry>
    		</map>
    		</property>
    	</bean>
    	<bean id="factory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    		<property name="mappingResources">
    			<list>
    				<value>edu/bju/aem/model/Service.hbm.xml</value>
    				<value>edu/bju/aem/model/OS.hbm.xml</value>
    				<value>edu/bju/aem/model/mapping/Server.hbm.xml</value>
    				<value>edu/bju/aem/model/Database.hbm.xml</value>
    				<value>edu/bju/shared/model/people/mapping/PersonWareHouse.hbm.xml</value>
    				<value>edu/bju/shared/model/security/mapping/App.hbm.xml</value>
    				<value>edu/bju/shared/model/security/mapping/AppRole.hbm.xml</value>
    				<value>edu/bju/shared/model/security/mapping/AppRights.hbm.xml</value>
    				<value>edu/bju/shared/model/security/mapping/AclObjectIdentity.hbm.xml</value>
    				<value>edu/bju/shared/model/security/mapping/AclPermission.hbm.xml</value>
    			</list>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
    				<prop key="hibernate.show_sql">true</prop>
    				<prop key="format_sql">true</prop>
    			</props>
    		</property>
    		<property name="dataSource">
    			<ref bean="dataSource" />
    		</property>
    	</bean>

  • #2
    Datasource to be defined in Jboss?????

    You have something called oracle-ds.xml for oracle database file in Jboss\default\deploy folder u need to specify the datasource in jboss iam not sure if you have done that.


    It seems you are tryin to connect to DB2 Database then name it as DB-ds.xml Jboss on start up caches and creates the Datasource object at startup it should nto through any exception at startup in the console if it does then thr is something wrong u have defined abt the database or class is not in classpath for driver or username/password wrong combination or probably the url.

    If problem still persists let me know ,may be i will give a try at my end on Oracle k.

    Comment


    • #3
      If you want to use JBoss datasources, the naming requirements are *-ds.xml, e.g. you can use blah-ds.xml if you like.

      You'd then create a Spring bean something like this:

      Code:
      <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
      <property name="jndiName"><value>jdbc/BlahDS</value></property>
      </bean>
      There are sample *-ds.xml files in the JBoss samples directory.

      Comment

      Working...
      X