Chinaunix首页 | 论坛 | 博客
  • 博客访问: 131748
  • 博文数量: 47
  • 博客积分: 1220
  • 博客等级: 中尉
  • 技术积分: 565
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-09 10:07
个人简介

unix/linux shell、c/c++、java、oracle pl/sql、db2 sql pl、informatica

文章分类

全部博文(47)

文章存档

2012年(11)

2011年(3)

2010年(8)

2009年(20)

2008年(5)

我的朋友

分类:

2010-12-08 23:15:00

 
 
 
 
spring2.5框架中的jpetstore(demo)的布署
    jpetstore demo 是从petstore发展过来的,bea及sun都曾为自已的中间件提供过petstore的demo(这两个公司都已并入oracle),spring也自带了jpetstore这个demo(struts+spring+ibatis)!
    工作过几年的技术人员都知道,最好的学习材料不是教科书,而是文档及demo,下面是对jpetstore这个spring自带demo布署的步骤:
   
一、环境准备
1、jdk (虽然sun被oracle收购过去了,但jdk是不会收费的,所以还是下个最新版吧)
2、tomcat(同上,可以在apache官网下载) 
3、spring框架(我前面的博文也提供过下载地址 )
4、数据库及数据库驱动包,我这里用的是mysql,当然此demo还支持诸如oracle等数据库
5、ant(因spring里面已经提供了ant1.7,所以我们不用再去下载了)
(最低版本的要求可见spring解压后的目录 spring-framework-2.5.6-with-dependencies\spring-framework-2.5.6\samples\jpetstore 下的readme.txt文件)

二、布署准备
 
1、解压spring框架(spring-framework-2.5.6-with-dependencies.zip),然后进入目录spring-framework-2.5.6-with-dependencies\spring-framework-2.5.6\samples\jpetstore 点击 warfile.bat 则会产生两个文件夹.classes及dist
 
2、解压新产生的dist目录下的jpetstore.war文件,在解压后的jpetstore目录下的WEB-INF目录下新建classes目录,然后将新产生的.classes目录下的文件全部copy过来
 
3、将数据库驱动包扔到解压后的 jpetstore\WEB-INF\lib 目录下(我的是mysql驱动包 mysql-connector-java-5.1.7-bin.jar),在mysql中依次运行目录spring-framework-2.5.6-with-
dependencies\spring-framework-2.5.6\samples\jpetstore\db\mysql 下的 jpetstore-mysql-schema.sql 及 jpetstore-mysql-dataload.sql (我提供的下载里面对jpetstore-mysql-schema.sql 进行了一定的修正 http://blogimg.chinaunix.net/blog/upfile2/101208231414.rar )
 
4、修改新产生dist目录下解压后的jpetstore目录即dist\jpetstore\WEB-INF下的 jdbc.properties文件:
# Properties file with JDBC-related settings.
# Applied by PropertyPlaceholderConfigurer from "dataAccessContext-local.xml".
# Targeted at system administrators, to avoid touching the context XML files.
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/jpetstore
jdbc.username=root
jdbc.password=Flyman123
 
三、布署
 
直接将dist目录下整理好的jpetstore连目录全部copy到 tomcat6.0\webapps 目录下,当然笔者更倾向于此篇的布署方式: http://blog.chinaunix.net/u2/81691/showart_1967638.html

结束!
 
 
阅读(1480) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~