`
wangzi6hao
  • 浏览: 208450 次
  • 性别: Icon_minigender_1
  • 来自: sdf
社区版块
存档分类
最新评论

resin2.16升级到resin3.21 mssql2000升级到mssql2008 win2000升级到win2008 jdk1.42升级到jdk1.6_u

阅读更多

公司的crm运行的虽然比较稳定,但是版本也比较老了。
很多新的功能都用不上去。所以公司也希望能把所有的版本升一下级。
我接下这个任务,打一下前站,看看有多少东西有改的,是否改的功能很多,虽然现在还没有查完,不管怎么样,把过程记录下来,免得忘记吧。

公司crm现有环境:
操作系统:win2000server
数据库:sql2000
jdk版本:1.4.2
java服务器:resin2.16

希望升级后的版本:
操作系统:win2008server
数据库:sql2008
jdk版本:1.6_u12
java服务器:resin3.21

看到这个东东,有点头疼啊。
操作系统:
基本没什么感觉,新安装一个系统就可以了,好在用java开发基于jdk运行。所以感觉不大。

sql:
sql2000升级到sql2008,这里可苦大了。
因为sql2000里写了很多存储过程,有一比较重要的部分还涉及到了业务流程。在以以前的测试里,就发现转移到sql2005下执行时,就出错。现在在sql2008下执行,肯定也会出错的。暂时放开这个问题吧。

jdk升级:
最大问题,jdk1.4下编译的class文件,不能完美的在jdk1.6(1.5)下运行,因为生成的class文件有所差异,需要完全在jdk1.6下重新编译。重新编译完后,基本不报错了。

resin:
没很大感觉,先安装一个resin3.21再说。
因为和resin2.16的配置有一些不一要,对resin的配置也不是很了解,所以花了一点时间
由于现在只是测试是否可以跑通,所以没做优化配置。只是简单做了一下本地主目录配置。
如下:

    <host-default>


      <!--


         - With another web server, like Apache, this can be commented out


         - because the web server will log this information.


        -->


      <access-log path="log/access.log"


            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'


            rollover-period="1W"/>





      <!-- creates the webapps directory for .war expansion -->


      <web-app-deploy path="webapps"/>


    </host-default>

  改为了

    <host-default>


      <!--


         - With another web server, like Apache, this can be commented out


         - because the web server will log this information.


        -->


      <access-log path="log/access.log"


            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'


            rollover-period="1W"/>





      <!-- creates the webapps directory for .war expansion -->


      <web-app-deploy path="webapps"/>


    <web-app id="/" root-directory="F:\crmsys\webapps"><!--默认本地目录-->


        <jsp fast-jstl="false"/>


    </web-app>


    </host-default>

 同时改了

    <host id="" root-directory=".">


      <!--


         - configures an explicit root web-app matching the


         - webapp's ROOT -->


      


      <web-app id="/" root-directory="webapps/ROOT"/>





      <web-app id="/resin-admin" root-directory="${resin.root}/doc/admin">


        <!--


           - Administration application /resin-admin


          -->


        <prologue>


          <resin:set var="resin_admin_external" value="false"/>


          <resin:set var="resin_admin_insecure" value="true"/>


        </prologue>


      </web-app>





      <!--


      <web-app id="/resin-config" root-directory="${resin.root}/doc/config"/>


      -->


     


      <web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>


    </host>

 为:

    <host id="" root-directory=".">


      <!--


         - configures an explicit root web-app matching the


         - webapp's ROOT


      


      <web-app id="/" root-directory="webapps/ROOT"/> -->





      <web-app id="/resin-admin" root-directory="${resin.root}/doc/admin">


        <!--


           - Administration application /resin-admin


          -->


        <prologue>


          <resin:set var="resin_admin_external" value="false"/>


          <resin:set var="resin_admin_insecure" value="true"/>


        </prologue>


      </web-app>





      <!--


      <web-app id="/resin-config" root-directory="${resin.root}/doc/config"/>


      -->


     


      <web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>


    </host>

 crm就可以运行起来了。
接下来,就是乱七八糟的问题了。虽然都是小问题,可是要查到原因,改起来,还是很麻烦的。
1.resin3.2启动时,报xml解析错误,根据日志,应该是struts的配置文件 /crm/webapps/WEB-INF/fin/validation.xml 出错。找到验证设置的xml里<formset>标签,发现没有任何配置,删除后再重启resin3.2正常了。

2.resin解析<%@ page contentType="text/html;charset=UTF-8" %>出现的问题 。把页面全面用UltraEdit另存为无BOM格式的utf-8。具体参考http://cnxiaowei.iteye.com/blog /262766 这个是让我很郁闷的。不过百度和google也不是盖的。只是查了好久都没有发现更好的办法,只能一个一个文件的去转,这是很麻烦的。实在不行,就只能自 己写个java程序去转了,怎么转就自己去查资料,这里就不讨论了。

3.升级el表达式支持问题 更新web.xml配置文件2.3版本到2.4版本

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
 


升级到

<web-app id="union" version="2.4"


xmlns="http://java.sun.com/xml/ns/j2ee"


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"


xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  由于2.4不支持<tablib>标签。解决方法是 把<taglib></taglib>用<jsp-config></jsp-config>包括起来

     <jsp-config>
        <taglib>
               <taglib-uri>ad.tld</taglib-uri>
               <taglib-location>/WEB-INF/ad.tld</taglib-location>
       </taglib>
       <taglib>
               <taglib-uri>inv.tld</taglib-uri>
               <taglib-location>/WEB-INF/inv.tld</taglib-location>
       </taglib>
        <taglib>
            <taglib-uri>/FCKeditor</taglib-uri>
            <taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>
        </taglib>
        <jsp-property-group>
        <url-pattern>*.jsp</url-pattern>
        <el-ignored>false</el-ignored> <!--这里是为了支持el表达式的设置-->
        <page-encoding>utf-8</page-encoding>
        </jsp-property-group>
    </jsp-config>

 这一步里,查了很多资料,了解了一下jsp1.2 2.0 servlet2.3 2.4 el表达式之间的支持与联系。还有配置文件对应的关系。因为考虑到以后el表达式可能会用到,所以也升级上来了。
当然,这里有也jstl的一些东西:具体看http://blog.163.com/new_liu.popo/blog/static/4387092120081031331762/这篇日志更详细

4.对struts等标签格式要求严格,对<html:text property="userPhoneE" maxlength=4 style="width:59%" />不支持,后面参数必须用单引号或者双引号括起来。如:<html:text property="userPhoneE" maxlength=" 4" style="width:59%" />所有的html都要改。。。这下很惨。平时书写不注意。。。。后果很严重啊。。。。

整个下来以后,东西基本上可以查询出来了。。。。
页面都可以正常看了,但是接下来还要解决数据库连接写入问题:
对于 传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 1 (""): 数据类型 0x38 未知。
这个问题,已经发现了。是因为用Sprinta2000.jar驱动,不支持mssql2005 和 mssql2008的原因。改成最新的版本后,就解决了。提一句的是最新的Sprinta.jar(7.40版)是收费的,默认只开了二个数据连接池。呵 呵,准备自己把它破解了的,虽然查到了他控制连接池数量的代码,可惜反编译Sprinta.jar 的class文件并不完美。又准备用javassist来直接用暴力修改class,终归功底太差。时间又急,就没动那心思。换成jtds- 1.2.2.jar(支持mssql2000 和 mssql2005)虽然官网上并没说支持mssql2008,从我使用的情况上来看。很正常,没有什么不方便的地方。所以就用jtds了。问题也解决 了。
查了一下,应该是连接类的问题,正在解决,好了更新上来,同时看到这篇文章的朋友,如果有这方面的经验的请,也请给我留言啊。谢谢了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics