axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndthuy <nd_t...@yahoo.com>
Subject Problem with Using Spring and Hibernate with Axis2
Date Thu, 29 Nov 2007 18:08:08 GMT

Hi All,

I am using Spring and Hibernate with Axis2. I have the problem with loading
the applicationContext.xml. Does anyone has similar problems? 
Attached are service.xml, applicationContext.xml and error meesage.

Thanks a lot.

service.xml

<?xml version="1.0" encoding="UTF-8"?>
<!-- This file was auto-generated from WSDL -->
<!-- by the Apache Axis2 version: 1.3  Built on : Aug 10, 2007 (04:45:47
LKT) -->
<serviceGroup>
	<service name="SpringInit" class="com.cvg.ap.util.SpringInit">
		<description>This web service initializes Spring.</description>
		<parameter name="ServiceClass">
			sample.spring.service.SpringInit
		</parameter>
		<parameter name="ServiceTCCL">composite</parameter>
		<parameter name="load-on-startup">true</parameter>
		<operation name="springInit">
			<messageReceiver
				class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver" />
		</operation>
	</service>

	<service name="AdminRetrieveUserService">
		<messageReceivers>
			<messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
			
class="com.cvg.ap.ws.service.publicservices.adminretrieveuserservice.AdminRetrieveUserServiceMessageReceiverInOut"
/>
		</messageReceivers>
		<parameter name="ServiceClass">
			com.cvg.ap.ws.service.publicservices.impl.AdminRetrieveUserServiceImpl
		</parameter>
		<parameter name="ServiceObjectSupplier">
		
org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier
		</parameter>
		<parameter name="SpringBeanName">
			springAdminRetrieveUserService
		</parameter>
		<parameter name="useOriginalwsdl">true</parameter>
		<parameter name="modifyUserWSDLPortAddress">true</parameter>
		<operation name="retrieveUserProfile"
			mep="http://www.w3.org/ns/wsdl/in-out">
			<actionMapping>urn:retrieveUserProfile</actionMapping>
			<outputActionMapping>
			
http://AdminRetrieveUserService.publicservices.service.ws.ap.cvg.com/AdminRetrieveUserServicePortType/retrieveUserProfileResponse
			</outputActionMapping>
		</operation>
	</service>
</serviceGroup>


ApplicationContext.xml

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

	<bean id="applicationContext"
	
class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"
/>
		
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="configLocation"
			value="classpath:hibernate.cfg.xml">
		</property>
		<property name="dataSource">
			<ref local="c3poDataSource" />
		</property>
	</bean>
	<bean id="propertyConfigurer"
	
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location">
			<value>
			
file:${ACCESSPOINT_WS_CFG_HOME}/accesspoint_ws/config/accesspoint_ws.properties
			</value>
		</property>
	</bean>
	<bean id="c3poDataSource"
		class="com.mchange.v2.c3p0.ComboPooledDataSource"
		destroy-method="close">
		<property name="driverClass">
			<value>oracle.jdbc.driver.OracleDriver</value>
		</property>
		<property name="jdbcUrl">
			<value>
				jdbc:oracle:thin:@${jdbc.host}:${jdbc.port}:${jdbc.database}
			</value>
		</property>

		<property name="properties">
			<props>
				<prop key="user">${jdbc.username}</prop>
				<prop key="password">
					${ACCESSPOINT_DB_PWD_DECRYPTED}
				</prop>
				<prop key="c3p0.min_size">
					${jdbc.connectionPool.minSize}
				</prop>
				<prop key="c3p0.max_size">
					${jdbc.connectionPool.maxSize}
				</prop>
				<prop key="c3p0.acquire_increment">
					${jdbc.connectionPool.increment}
				</prop>
				<prop key="c3p0.idle_test_period">100</prop>
			</props>
		</property>
	</bean>

		
	<bean id="GroupsDAO" class="com.cvg.ap.dao.GroupsDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="UsersDAO" class="com.cvg.ap.dao.UsersDAO">
		<property name="hibernateTemplate">
			<ref bean="hibernateTemplate" />
		</property>
	</bean>
	
	
	<bean id="MetadataDAO" class="com.cvg.ap.dao.MetadataDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
		

	<bean id="hibernateTemplate"
		class="org.springframework.orm.hibernate3.HibernateTemplate">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>


	<bean id="transactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory">
			<ref local="sessionFactory" />
		</property>
	</bean>

	<bean id="hibernateInterceptor"
		class="org.springframework.orm.hibernate3.HibernateInterceptor">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>

	<bean id="usersEntityInterceptor"
	
class="org.springframework.transaction.interceptor.TransactionInterceptor">
		<property name="transactionManager">
			<ref local="transactionManager" />
		</property>
		<property name="transactionAttributes">
			<props>
				<prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
				<prop key="save*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="delete*">PROPAGATION_REQUIRED</prop>
				<prop key="updateUserForSuccessfulAuthentication*">
					PROPAGATION_REQUIRED
				</prop>
				<prop key="updateUserForFailedAuthentication*">
					PROPAGATION_REQUIRED
				</prop>
			</props>
		</property>
	</bean>

	<bean id="usersEntityProxyTargetBean"
		class="com.cvg.ap.dbms.UsersEntity">
		<property name="apUsersDAO">
			<ref local="UsersDAO" />
		</property>
	</bean>

	<bean id="usersEntityProxyBean"
		class="org.springframework.aop.framework.ProxyFactoryBean">
		<property name="proxyTargetClass">
			<value>true</value>
		</property>
		<property name="interceptorNames">
			<list>
				<value>hibernateInterceptor</value>
				<value>usersEntityInterceptor</value>
			</list>
		</property>
		<property name="target">
			<ref local="usersEntityProxyTargetBean" />
		</property>
	</bean>

	<bean id="metadataEntity" class="com.cvg.ap.dbms.MetadataEntity">
		<property name="metadataDAO">
			<ref local="MetadataDAO" />
		</property>
	</bean>

	<bean id="acmServicesEntity"
		class="com.cvg.ap.dbms.ACMServicesEntity">
		<property name="acmServicesDAO">
			<ref local="AcmServiceDAO" />
		</property>
	</bean>

	<bean id="apSecurity"
		class="com.cvg.ap.service.privateservices.APSecurity">
		<property name="usersEntity">
			<ref local="usersEntityProxyBean" />
		</property>
		<property name="metadataEntity">
			<ref local="metadataEntity" />
		</property>
	</bean>

	<bean id="groupsEntity" class="com.cvg.ap.dbms.GroupsEntity">
		<property name="groupsDAO">
			<ref local="GroupsDAO" />
		</property>
	</bean>

	<bean id="apUserManagement"
		class="com.cvg.ap.service.privateservices.APUserManagement">
		<property name="usersEntity">
			<ref local="usersEntityProxyBean" />
		</property>
	</bean>

	<bean id="adminRetrieveUserService"
	
class="com.cvg.ap.service.publicservices.impl.AdminRetrieveUserServiceImpl">
		<property name="apSecurity">
			<ref local="apSecurity" />
		</property>
		<property name="apUserManagement">
			<ref local="apUserManagement" />
		</property>
	</bean>



	<!-- Axis2 Web Service, but to Spring, its just another bean that has
dependencies -->
	<bean id="springAdminRetrieveUserService"
	
class="com.cvg.ap.ws.service.publicservices.impl.AdminRetrieveUserServiceImpl">
		<property name="adminRetrieveUserService"
			ref="adminRetrieveUserService" />
	</bean>
</beans>


Errors:

org.apache.axis2.deployment.DeploymentException: Error creating bean with
name 'apSecurity' defined in class path resource [applicationContext.xml]:
Cannot resolve reference to bean 'usersEntityProxyBean' while setting bean
property 'usersEntity'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'usersEntityProxyBean': FactoryBean threw exception on object
creation; nested exception is java.lang.NoClassDefFoundError
	at
org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:106)
	at
org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:103)
	at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:172)
	at
org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:78)
	at
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:137)
	at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:571)
	at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:141)
	at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:318)
	at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:220)
	at
org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:118)
	at
org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:272)
	at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:78)
	at
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:500)
	at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:420)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
	at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
	at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.apache.axis2.deployment.DeploymentException: Error creating
bean with name 'apSecurity' defined in class path resource
[applicationContext.xml]: Cannot resolve reference to bean
'usersEntityProxyBean' while setting bean property 'usersEntity'; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'usersEntityProxyBean': FactoryBean threw exception
on object creation; nested exception is java.lang.NoClassDefFoundError
	at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:389)
	at
org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:101)
	... 39 more
Caused by: org.apache.axis2.deployment.DeploymentException: Error creating
bean with name 'apSecurity' defined in class path resource
[applicationContext.xml]: Cannot resolve reference to bean
'usersEntityProxyBean' while setting bean property 'usersEntity'; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'usersEntityProxyBean': FactoryBean threw exception
on object creation; nested exception is java.lang.NoClassDefFoundError
	at
org.apache.axis2.deployment.ServiceBuilder.loadServiceLifeCycleClass(ServiceBuilder.java:473)
	at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:184)
	... 40 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'apSecurity' defined in class path resource
[applicationContext.xml]: Cannot resolve reference to bean
'usersEntityProxyBean' while setting bean property 'usersEntity'; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'usersEntityProxyBean': FactoryBean threw exception
on object creation; nested exception is java.lang.NoClassDefFoundError
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1095)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
	at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
	at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at com.cvg.ap.util.SpringInit.startUp(SpringInit.java:60)
	at
org.apache.axis2.deployment.ServiceBuilder.loadServiceLifeCycleClass(ServiceBuilder.java:469)
	... 41 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'usersEntityProxyBean': FactoryBean threw exception
on object creation; nested exception is java.lang.NoClassDefFoundError
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1252)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1217)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:206)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)
	... 53 more
Caused by: java.lang.NoClassDefFoundError
	at
org.springframework.aop.framework.Cglib2AopProxy.createEnhancer(Cglib2AopProxy.java:223)
	at
org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:150)
	at
org.springframework.aop.framework.ProxyFactoryBean.getProxy(ProxyFactoryBean.java:347)
	at
org.springframework.aop.framework.ProxyFactoryBean.getSingletonInstance(ProxyFactoryBean.java:302)
	at
org.springframework.aop.framework.ProxyFactoryBean.getObject(ProxyFactoryBean.java:228)
	at
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1246)
	... 57 more

-- 
View this message in context: http://www.nabble.com/Problem-with-Using-Spring-and-Hibernate-with-Axis2-tf4898949.html#a14031519
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message