首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

常见升级过程可能遇到的有关问题以及解决方法

2012-10-15 
常见升级过程可能遇到的问题以及解决办法?? web-app xmlnshttp://java.sun.com/xml/ns/javaee????????

常见升级过程可能遇到的问题以及解决办法
?? <web-app xmlns="http://java.sun.com/xml/ns/javaee"
??????????? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
??????????? xsi:schemaLocation="http://java.sun.com/xml/ns/javaee? http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
??????????? version="2.5">

?? 并在web.xml <web-app>元素下添加配置信息,如下所示(其中gbk就是指定的编码):
?? <!-- 注:该声明从Servlet2.4才支持,故需先升级web.xml声明 -->
?? <jsp-config>
??????? <jsp-property-group>
??????????????? <display-name>JSPConfiguration</display-name>
??????????????? <url-pattern>*.jsp</url-pattern>
??????????????? <url-pattern>*.html</url-pattern>
??????????????? <url-pattern>*.htm</url-pattern>
??????????????? <el-ignored>true</el-ignored>
??????????????? <page-encoding>gbk</page-encoding>
??????????????? <scripting-invalid>false</scripting-invalid>
??????? </jsp-property-group>
?? </jsp-config>

5. 日志提示
?? 严重: Parse error in application web.xml file at jndi:/adf.netmovie.com.cn//WEB-INF/web.xml
?? 部分原因: Servlet规范中 web.xml 中 init-param 元素是没有storePath等属性的, 故报错
?? 解决办法:
?? 将? <init-param storePath="/data/jsp/adf.netmovie.com.cn/skin/ROOT/WEB-INF/xml/" />
?? 改成
??? <init-param>
<param-name>storePath</param-name>
<param-value>/data/jsp/adf.netmovie.com.cn/skin/ROOT/WEB-INF/xml/</param-value>
</init-param>
?? 即可
?? 参考:? web.xml 声明文件? http://java.sun.com/dtd/web-app_2_3.dtd 相关内容


6. 目前用到的Tomcat版本: apache-tomcat-6.0.20
?? tomcat 已经包含的库文件清单 :
?? annotations-api.jar
?? catalina-ant.jar
?? catalina-ha.jar
?? catalina.jar
?? catalina-tribes.jar
?? el-api.jar
?? jasper-el.jar
?? jasper.jar
?? jasper-jdt.jar
?? jsp-api.jar
?? jta-1.1.jar
?? mysql-connector-java-3.1.14-bin.jar
?? ojdbc6.jar
?? orai18n.jar
?? servlet-api.jar
?? tomcat-coyote.jar
?? tomcat-dbcp.jar
?? tomcat-i18n-es.jar
?? tomcat-i18n-fr.jar
?? tomcat-i18n-ja.jar

7. 数据源配置在web.xml 中的问题, 如下所示:
?????????? <resource-ref>
??????????????? <res-ref-name>jdbc/proxy</res-ref-name>
??????????????? <res-type>javax.sql.DataSource</res-type>
??????????????? <init-param driver-name="oracle.jdbc.driver.OracleDriver"/>
??????????????? <init-param url="jdbc:oracle:thin:@oracleserver:1521:orcl"/>
??????????????? <init-param user="username"/>
??????????????? <init-param password="xyz"/>
??????????????? <init-param max-connections="100"/>
??????????????? <init-param max-idle-time="120s"/>
??????????????? <init-param connection-wait-time="180s"/>
??????????????? <init-param max-active-time="120s"/>
??????? </resource-ref>
?? 该类配置是resin数据源的配置方法之一(和配置在resin.conf中类似),但是tomcat将不认这种配置方法,故系统将提示无法连接数据库之类的错误,如下所示:
?? net.sf.hibernate.util.JDBCExceptionReporter 58 2009-12-17 11:28:04104 Cannot create JDBC driver of class '' for connect URL 'null'
?? net.sf.hibernate.util.JDBCExceptionReporter 57 2009-12-17 11:28:04105 SQL Error: 0, SQLState: null
?? 解决办法: 在tomcat server.xml 中配置该数据源
?? 建议:???? 除非有特别要求,所有数据源配置,均在server.xml中进行, 方便统一管理

?

?

注:server.xml 的配置:

[resin@gzjspsf1 logs]$ cat /opt/jsites/korea.sx.netfilm.cn/conf/server.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XML Spy v4.2 U (http://www.xmlspy.com) by ttdown.com (ttdown.com) -->
<Server port="10008" shutdown="SHUTDOWN">
??????? <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>
??????? <Listener className="org.apache.catalina.core.JasperListener"/>
??????? <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
??????? <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
??????? <GlobalNamingResources/>
??????? <Service name="Catalina">
??????? <Connector port="8008" protocol="AJP/1.3" redirectPort="8443" maxThreads='300' useBodyEncodingForURI="true"/>
??????????????? <Engine name="Catalina" defaultHost="korea.sx.netfilm.cn">
??????????????????????? <Host name="korea.sx.netfilm.cn">
????????????????????????????? <Context path="/"
?????????????????????????????????????? docBase="/data/jsp/korea.sx.netfilm.cn/skin/ROOT"
?????????????????????????????????????? workDir="/data/jsp/korea.sx.netfilm.cn/skin/ROOT/WEB-INF/work"
?????????????????????????????????????? reloadable="true">

?

<Resource name="jdbc/coonetmovie" auth="Container" type="javax.sql.DataSource"
?????? maxActive="100" maxIdle="30" maxWait="600000"
?????? username="coonetmovie" password="GVL6IqeN8iDEf" driverClassName="com.mysql.jdbc.Driver"
?????? url="jdbc:mysql://121.14.2.202:3306/coonetmovie?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>
??????
<Resource name="jdbc/cpdb" auth="Container" type="javax.sql.DataSource"
?????? maxActive="100" maxIdle="30" maxWait="600000"
?????? username="resin_adm" password="48bpejg63KD" driverClassName="com.mysql.jdbc.Driver"
?????? url="jdbc:mysql://cpmmysql:3306/cpdb?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>????
??????
<Resource name="jdbc/cpdb_ro" auth="Container" type="javax.sql.DataSource"
????? maxActive="100" maxIdle="30" maxWait="600000"
????? username="resin" password="ZGuM218HrLt" driverClassName="com.mysql.jdbc.Driver"
????? url="jdbc:mysql://cpsmysql:3306/cpdb?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>????
?????
?
<Resource name="jdbc/netmovie3" auth="Container" type="javax.sql.DataSource"
???? maxActive="100" maxIdle="30" maxWait="600000"
???? username="resin" password="47182388" driverClassName="com.mysql.jdbc.Driver"
???? url="jdbc:mysql://mmysql:3306/netmovie3?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>????
?
<Resource name="jdbc/netmovie3_ro" auth="Container" type="javax.sql.DataSource"
???? maxActive="100" maxIdle="30" maxWait="600000"
???? username="resin_ro" password="47182388" driverClassName="com.mysql.jdbc.Driver"
???? url="jdbc:mysql://smysql:3306/netmovie3?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>????

<Resource name="jdbc/union_movie" auth="Container" type="javax.sql.DataSource"
???? maxActive="100" maxIdle="30" maxWait="600000"
???? username="union_movie" password="1qazxdr56yhn" driverClassName="com.mysql.jdbc.Driver"
???? url="jdbc:mysql://uniondb:3306/union_movie?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>????

<Resource name="jdbc/netmovie_news" auth="Container" type="javax.sql.DataSource"
???? maxActive="100" maxIdle="30" maxWait="600000"
???? username="resin_news" password="62768851286n" driverClassName="com.mysql.jdbc.Driver"
???? url="jdbc:mysql://mysql-netmovie:3306/netmovie_newse?useUnicode=true&amp;characterEncoding=utf-8&amp;jdbcCompliantTruncation=false&amp;autoReconnect=true"/>????


?????

?

?

????????????????????????????? </Context>
????????????????????????????? <Valve className="org.apache.catalina.valves.AccessLogValve"
???????????????????????????????????? directory="/data/jsp/korea.sx.netfilm.cn/logs"
???????????????????????????????????? prefix="access.log."
???????????????????????????????????? suffix=".txt"
???????????????????????????????????? pattern="common"
???????????????????????????????????? resolveHosts="false"/>
??????????????????????? </Host>
??????????????? </Engine>
??????? </Service>
</Server>

?

热点排行