axis2+spring+hibernate(webservice工程)
来源:互联网 发布:淘宝网二度春肾宝 编辑:程序博客网 时间:2024/05/29 12:54
使用axis2+spring+hibernate三大框架整合构建webservice工程,一遍遍的修改配置文件,一遍遍的调试,费了好一番功夫终于成功了,可以实现对数据库的操作了,任务还要求使用事务,添加上事务:
@Transactional
public class UserService {
private UserDAO userDAO;
public void setUserDAO(UserDAO userDAO) {
this.userDAO = userDAO;
}
public int addOneUser(String name,int age){
return userDAO.addUser(name, age);
}
@Transactional
public int saveOneUser(String name, int age){
System.out.println("@@@@@@@@"+name+":"+age);
User user = new User();
user.setName(name);
user.setAge(age);
return userDAO.saveUser(user);
}
}
在applicationContext.xml中添加:
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 支持 @Transactional 标记 -->
<tx:annotation-driven transaction-manager="transactionManager" />
重新启动tomcat,出现了一系列的错误:
org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Unable to load bytecode for class service.UserService$$EnhancerByCGLIB$$a88ea6ef
[ERROR] The user.aar service, which is not valid, caused The following error occurred during schema generation: Unable to load bytecode for class service.UserService$$EnhancerByCGLIB$$a88ea6ef
Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Unable to load bytecode for class service.UserService$$EnhancerByCGLIB$$a88ea6ef
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:394)
... 39 more
Caused by: java.io.IOException: Unable to load bytecode for class service.UserService$$EnhancerByCGLIB$$a88ea6ef
at org.apache.axis2.description.java2wsdl.bytecode.ClassReader.getBytes(ClassReader.java:84)
at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.<init>(ParamReader.java:57)
at org.apache.axis2.description.java2wsdl.bytecode.ChainedParamReader.<init>(ChainedParamReader.java:52)
at org.apache.axis2.description.java2wsdl.bytecode.MethodTable.<init>(MethodTable.java:31)
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.<init>(DefaultSchemaGenerator.java:137)
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:499)
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:386)
看到网上有说是公布的web service不能直接参与事务, 而是需要把事务"代理"给其他的类处理!!!
- axis2+spring+hibernate(webservice工程)
- axis2+spring+Hibernate webservice 非aar方式
- axis2+spring+Hibernate webservice 非aar方式
- axis2发布WebService工程
- Hibernate Axis2 Webservice
- Spring + axis2 开发 webservice
- Spring + axis2 开发 webservice
- Spring axis2 webService 支持
- Spring axis2 webservice
- webservice axis2+spring整合
- Axis2+Spring构建WebService
- webservice+axis2+spring+http/https
- Web工程集成Axis2发布WebService
- spring+webservice工程示例
- WebService之Axis2系列教程Axis2与Spring集成发布
- Axis2与spring结合创建webService
- webservice框架(cxf, axis2, spring-ws)
- axis2+spring集成发布webservice服务
- 精华贴子整理
- 如何在ListBox中添加控件后让ListBox滚动到最底部
- 正则表达式
- Flex 在线API
- zoj 1879 || poj 2575 Jolly Jumpers(水~)
- axis2+spring+hibernate(webservice工程)
- System.Web.Caching.Cache详解
- bada学习笔记2
- JS级联菜单
- 检索数据库中无效的视图
- ASP.NET2.0服务器控件之自定义状态管理
- C陷阱与缺陷:经典的 (* (void (*)( )) 0) ( ) 表达式
- ClearCase完全攻略(十二) CCRC客户端安装和插件安装
- BackgroundWorker使用总结