2010年3月17日

                    
           SQL類型  方法
           BIGINT  getLong()
           BINARY  getBytes()
           BIT  getBoolean()
          CHAR getString()
          DATE getDate()
          DECIMAL getBigDecimal()
          DOUBLE getDouble()
          FLOAT getDouble()
          INTEGER getInt()
          LONGVARBINARY getBytes()
          LONGVARCHAR getString()
          OTHER getObject()
          REAL getFloat()
          SMALLINT getShort()
          TIME getTime()
          TIMESTAMP getTimestamp()
          TINYINT getByte()
          VARBINARY getBytes()
          VARCHAR getString()
          NUMERIC getBigDecimal()
           

          posted @ 2010-04-01 15:38 lhn070 閱讀(255) | 評論 (0)編輯 收藏

          應用使用struts2+spring2.5+hibernat+xfire,在tomcat5.5上能正常運行,移植到jboss時,出現若干問題:

          1.啟動時出現異常提示:

          org.springframework.context.ApplicationContextException: Custom context class [org.jboss.spring.vfs.context.VFSXmlWebApplicationContext] is not of type [org.springframework.web.context.ConfigurableWebApplicationContext]
              at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:
          245)
              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:
          199)
              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:
          45)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
          3910)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:
          4393)
              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:
          310)
              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:
          142)
              at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:
          461)
              at org.jboss.web.deployers.WebModule.startModule(WebModule.java:
          118)
              at org.jboss.web.deployers.WebModule.start(WebModule.java:
          97)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
             spring.jar以及spring-webmvc.jar包放在jboss的default/lib下,注意在應用的WEB-INF/lib下面不能有這兩個包

          2.在tomcat下能正常顯示的包含struts2的部分的標簽在頁面上不能正常顯示,有時候在jboss下沒有任何錯誤日志或提示,或是莫名其妙的錯誤,如:
          17:02:06,434 ERROR [STDERR] Caused by: tag 'select', field 'list', name 'searchI
          ndex[4].defaultValue': The requested list key '#request[#a.name]' could not be r
          esolved as a collection/array/map/enumeration/iterator type. Example: people or
          苦苦折騰了幾天,以為是程序哪里有問題,后來發現其實非也,主要是編譯的時候,沒有指定編譯的編碼所致,有兩種辦法避免,一種是
          在build.xml中的javac中間加上encoding,如下,加上"<compilerarg    line="-encoding GBK "/>"
              <javac srcdir="${build.src}" destdir="${buildwar.dest}/WEB-INF/classes" debug="${debug}" optimize="${optimize}">
                     
          <compilerarg    line="-encoding GBK "/>   
                      
          <classpath refid="library.classpath" />
                  
          </javac>

            或是在編譯的時候,指定編碼,在eclipse上,在build.xml點右鍵Run AS,打開配置面板,在common選項卡中的consol encoding中,選
          other,使用gbk編碼。

          3.在jboss中,程序運行時,中文輸出的是亂碼,解決的方法同2,也是編譯時編碼的問題。呵呵。

          4.移值時,有些莫名其妙的問題,可以找找是否是jar包沖突引起的,或是jar的位置的問題,沒有總結,一點點自己慢慢試吧;
               例如以下錯誤:
            
          Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQLDialect cannot be cast to org.hibernate.dialect.Dialect
           
           把應用的lib下的hibernate.jar包去掉就行了,這是和jboss自帶的hibernate包有沖突導致

          posted @ 2010-03-17 17:22 lhn070 閱讀(3049) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 饶平县| 璧山县| 定州市| 泌阳县| 郎溪县| 莎车县| 余江县| 龙陵县| 乡宁县| 渝北区| 屏东市| 沙雅县| 吉木萨尔县| 定南县| 清水县| 景谷| 渭南市| 南充市| 封开县| 昌乐县| 密云县| 陵水| 汕头市| 独山县| 洪江市| 屏边| 阳新县| 绥中县| 那曲县| 如东县| 鄯善县| 海林市| 砚山县| 太保市| 漳州市| 永川市| 哈密市| 依兰县| 锡林浩特市| 祥云县| 册亨县|