溫馨提示:您的每一次轉載,體現了我寫此文的意義!!!煩請您在轉載時注明出處http://www.aygfsteel.com/sxyx2008/謝謝合作!!!

          雪山飛鵠

          溫馨提示:您的每一次轉載,體現了我寫此文的意義!!!煩請您在轉載時注明出處http://www.aygfsteel.com/sxyx2008/謝謝合作!!!

          BlogJava 首頁 新隨筆 聯系 聚合 管理
            215 Posts :: 1 Stories :: 674 Comments :: 0 Trackbacks

          #

          原文:http://news.cnblogs.com/n/74858/
          速查表
          是幫你記住東西的有效工具。Web設計師和開發者經常使用的快捷鍵簡表會使他們在網上的工作效率大大提高。

          事實上,速查表就是來幫助我們把日常中最常用到的信息聚集起來,方便使用,使我們做工作時更有效率。有了它們,免去了你的大腦花額外時間去記憶它們的煩惱——你只需要打開簡表,馬上能查到你想要的信息。

          這篇文章里,你可以看到最實用的HTML,CSS,JavaScript速查表,它們可以當作參考資料,備忘錄,能幫助你以最快的速度找到想要的信息。

          看看這些簡表是不是你想要的,請在文章下面留下你的建議,謝謝!

          HTML

          HTML幫助手冊

          HTML速查手冊

          HTML特殊字符速查表

          Dreamweaver

          Dreamweaver快速參考指導

          CSS

          CSS 3 速查表

          Blueprint CSS

          YUI Grid CSS

          CSS 速記簡表

          CSS速查表(V2)

          CSS速記表

          CSS2參考指導(V2)

          實用CSS速查表

          Javascript

          jQuery 1.4.2 直觀速查表

          JavaScript 速查表

          JavaScript參考單

          JavaScript真經

          常用DOM方法

          JavaScript快速參考單

          Mootools 1.2速查表

          jQuery速查表

          Prototype速查表

          希望你能喜歡我收集到的這些速查表,并請分享給你的做開發工作的朋友們。

          [英文出處]:Most Useful Cheat Sheet For HTML, CSS and Javascript

          posted @ 2010-09-29 16:46 雪山飛鵠 閱讀(2034) | 評論 (3)編輯 收藏

          posted @ 2010-09-29 16:36 雪山飛鵠 閱讀(224) | 評論 (0)編輯 收藏

               摘要: 本文電子版文檔下載 State、Decision 、Task活動詳解: State表示一個等待狀態。當流程實例執行到state節點時會暫停下來(處于等待狀態),流程的執行會在外部觸發器被調用之前一直等待(會暫停) Decision條件判斷節點,表示在多條路徑中選擇一條。一個 decision 活動擁有很多個傳出的轉移。流程的執行到達一個 decision 活動時,會自動進行計算來決定采用哪...  閱讀全文
          posted @ 2010-09-29 13:52 雪山飛鵠 閱讀(4091) | 評論 (0)編輯 收藏

               摘要: 最近開始接觸JBPM4,網上關于JBPM4的資料少之又少。大多是關于JBPM3的。而4跟3的API差異也較大。在學習過程中做了一點關于JBPM4的筆記。強烈期望JBPM4達人能貢獻一些JBPM4方面的學習資料或視頻教程或出版發行JBPM4的書籍之類的。 本文電子版下載 流程定義引擎: ProcessEngine processEngine; 獲取: ...  閱讀全文
          posted @ 2010-09-28 16:44 雪山飛鵠 閱讀(4699) | 評論 (3)編輯 收藏

          因為tomcat6下的el-api.jar與jBPM-4使用的juel.jar產生沖突。

          解決方法一:改用tomcat-5.5。

          解決方法二:將juel.jar, juel-engine.jar, juel-impl.jar三個文件復制到tomcat的lib目錄下,并刪除tomcat6下的el-api.jar即可解決。

          posted @ 2010-09-27 14:56 雪山飛鵠 閱讀(496) | 評論 (0)編輯 收藏

          在運行jbpm4.3中例子時,若數據庫選擇為mysql,應注意修改jbpm.hibernate.cfg.xml中mysql的方言為org.hibernate.dialect.MySQL5InnoDBDialect
          posted @ 2010-09-26 14:53 雪山飛鵠 閱讀(543) | 評論 (0)編輯 收藏

          Oracle、DB2、SQLSERVER、Mysql、Access分頁SQL語句梳理
          溫馨提示:您的每一次轉載,體現了我寫此文的意義!!!煩請您在轉載時注明出處http://www.aygfsteel.com/sxyx2008/謝謝合作!!!
          最近把平時在項目中常用到的數據庫分頁sql總結了下。大家可以貼出分頁更高效的sql語句。
          sqlserver分頁
           第一種分頁方法
           需用到的參數:
           pageSize 每頁顯示多少條數據
           pageNumber 頁數 從客戶端傳來
           totalRecouds 表中的總記錄數 select count (*) from 表名
           totalPages 總頁數
           totalPages=totalRecouds%pageSize==0?totalRecouds/pageSize:totalRecouds/pageSize+1
           pages 計算前pages 條數據
           pages= pageSize*(pageNumber-1)
           SQL語句:
           select top pageSize * from 表名 where id  not in (select top pages id from 表名 order by id) order by id
           第二種分頁方法
           pageSize 每頁顯示多少條數據
           pageNumber 頁數 從客戶端傳來
           pages=pageSize*(pageNumber-1)+1
           select top pageSize * from 表名 where id>=(select max(id) from (select top pages id from 表名 order by id asc ) t )

          mysql分頁
           需用到的參數:
           pageSize 每頁顯示多少條數據
           pageNumber 頁數 從客戶端傳來
           totalRecouds 表中的總記錄數 select count (*) from 表名
           totalPages 總頁數
           totalPages=totalRecouds%pageSize==0?totalRecouds/pageSize:totalRecouds/pageSize+1
           pages 起始位置
           pages= pageSize*(pageNumber-1)
           SQL語句:
           select * from 表名 limit pages, pageSize;
           mysql 分頁依賴于關鍵字 limit 它需兩個參數:起始位置和pageSize
           起始位置=頁大小*(頁數-1)
           起始位置=pageSize*(pageNumber -1)

          oracle分頁
           pageSize 每頁顯示多少條數據
           pageNumber 頁數 從客戶端傳來
           totalRecouds 表中的總記錄數 select count (*) from 表名
           totalPages 總頁數
           totalPages=totalRecouds%pageSize==0?totalRecouds/pageSize:totalRecouds/pageSize+1
           startPage 起始位置
           startPage= pageSize*(pageNumber-1)+1
           endPage=startPage+pageSize
           SQL語句
           select a.* from
           (
             select rownum num ,t.* from  表名 t where 某列=某值 order by id asc
           )a
           where a.num>=startPage and a.num<endPage

          db2分頁
           int startPage=1  //起始頁
           int endPage;     //終止頁
           int pageSize=5;  //頁大小
           int pageNumber=1 //請求頁

           startPage=(pageNumber-1)*pageSize+1
           endPage=(startPage+pageSize);


           SQL語句
           select * from (select 字段1,字段2,字段3,字段4,字段5,rownumber() over(order by 排序字段 asc ) as rowid  from 表名 )as a where a.rowid >= startPage AND a.rowid <endPage

          access分頁
           pageSize 每頁顯示多少條數據
           pageNumber 頁數 從客戶端傳來
           pages=pageSize*(pageNumber-1)+1
           SQL語句
           select top pageSize * from 表名 where id>=(select max(id) from (select top pages id from 表名 order by id asc ) t )


           溫馨提示:您的每一次轉載,體現了我寫此文的意義!!!煩請您在轉載時注明出處http://www.aygfsteel.com/sxyx2008/謝謝合作!!!

          posted @ 2010-09-16 16:12 雪山飛鵠 閱讀(4330) | 評論 (1)編輯 收藏

          依賴的JAR
              cxf-2.2.10.jar
              jetty-6.1.21.jar
              jetty-util-6.1.21.jar
              servlet-2_5-api.jar
              wsdl4j-1.6.2.jar
              XmlSchema-1.4.5.jar
          創建一個普通的Java工程即可

          創建webservice接口
          package com.cxf.interfaces;

          import javax.jws.WebParam;
          import javax.jws.WebService;

          @WebService
          public interface HelloWorldServiceInf {
              
              String sayHello(@WebParam(name
          ="username") String username);
              
          }
          發布和調用webservice
                  方法一
          發布webservice
          package com.cxf.impl;

          import javax.jws.WebService;

          import org.apache.cxf.interceptor.LoggingInInterceptor;
          import org.apache.cxf.interceptor.LoggingOutInterceptor;
          import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

          import com.cxf.interfaces.HelloWorldServiceInf;

          @WebService(endpointInterface
          ="com.cxf.interfaces.HelloWorldServiceInf",serviceName="helloWorldService")
          public class Server implements HelloWorldServiceInf {

              
          public String sayHello(String username) {
                  
          return "Hello,"+username;
              }

              
              
          public static void main(String[] args) {
                  Server impl
          =new Server();
                  JaxWsServerFactoryBean factoryBean
          =new JaxWsServerFactoryBean();
                  factoryBean.setAddress(
          "http://localhost:9000/hello");
                  factoryBean.setServiceClass(HelloWorldServiceInf.
          class);
                  factoryBean.setServiceBean(impl);
                  factoryBean.getInInterceptors().add(
          new LoggingInInterceptor());
                  factoryBean.getOutInterceptors().add(
          new LoggingOutInterceptor());
                  factoryBean.create();
              }
              
          }
          wsdl描述文件
            <?xml version="1.0" ?> 
          <wsdl:definitions name="HelloWorldServiceInfService" targetNamespace="http://interfaces.cxf.com/" xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://interfaces.cxf.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <wsdl:types>
          <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://interfaces.cxf.com/" xmlns:tns="http://interfaces.cxf.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            
          <xsd:element name="sayHello" type="tns:sayHello" /> 
          <xsd:complexType name="sayHello">
          <xsd:sequence>
            
          <xsd:element minOccurs="0" name="username" type="xsd:string" /> 
            
          </xsd:sequence>
            
          </xsd:complexType>
            
          <xsd:element name="sayHelloResponse" type="tns:sayHelloResponse" /> 
          <xsd:complexType name="sayHelloResponse">
          <xsd:sequence>
            
          <xsd:element minOccurs="0" name="return" type="xsd:string" /> 
            
          </xsd:sequence>
            
          </xsd:complexType>
            
          </xsd:schema>
            
          </wsdl:types>
          <wsdl:message name="sayHelloResponse">
            
          <wsdl:part element="tns:sayHelloResponse" name="parameters" /> 
            
          </wsdl:message>
          <wsdl:message name="sayHello">
            
          <wsdl:part element="tns:sayHello" name="parameters" /> 
            
          </wsdl:message>
          <wsdl:portType name="HelloWorldServiceInf">
          <wsdl:operation name="sayHello">
            
          <wsdl:input message="tns:sayHello" name="sayHello" /> 
            
          <wsdl:output message="tns:sayHelloResponse" name="sayHelloResponse" /> 
            
          </wsdl:operation>
            
          </wsdl:portType>
          <wsdl:binding name="HelloWorldServiceInfServiceSoapBinding" type="tns:HelloWorldServiceInf">
            
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
          <wsdl:operation name="sayHello">
            
          <soap:operation soapAction="" style="document" /> 
          <wsdl:input name="sayHello">
            
          <soap:body use="literal" /> 
            
          </wsdl:input>
          <wsdl:output name="sayHelloResponse">
            
          <soap:body use="literal" /> 
            
          </wsdl:output>
            
          </wsdl:operation>
            
          </wsdl:binding>
          <wsdl:service name="HelloWorldServiceInfService">
          <wsdl:port binding="tns:HelloWorldServiceInfServiceSoapBinding" name="HelloWorldServiceInfPort">
            
          <soap:address location="http://localhost:9000/hello" /> 
            
          </wsdl:port>
            
          </wsdl:service>
            
          </wsdl:definitions>
          客戶端調用
          package com.cxf.client;

          import org.apache.cxf.interceptor.LoggingInInterceptor;
          import org.apache.cxf.interceptor.LoggingOutInterceptor;
          import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
          import com.cxf.interfaces.HelloWorldServiceInf;

          public class Client {
              
          public static void main(String[] args) {
                  JaxWsProxyFactoryBean  factoryBean
          =new JaxWsProxyFactoryBean();
                  factoryBean.getInInterceptors().add(
          new LoggingInInterceptor());
                  factoryBean.getOutInterceptors().add(
          new LoggingOutInterceptor());
                  factoryBean.setServiceClass(HelloWorldServiceInf.
          class);
                  factoryBean.setAddress(
          "http://localhost:9000/hello");
                  HelloWorldServiceInf impl
          =(HelloWorldServiceInf) factoryBean.create();
                  System.out.println(impl.sayHello(
          "張三"));
              }
          }
                  方法二
          發布webservice
          package com.cxf.impl;

          import javax.jws.WebService;
          import javax.xml.ws.Endpoint;

          import com.cxf.interfaces.HelloWorldServiceInf;

          @WebService(endpointInterface
          ="com.cxf.interfaces.HelloWorldServiceInf",serviceName="helloWorldService")
          public class Server implements HelloWorldServiceInf {

              
          public String sayHello(String username) {
                  
          return "Hello,"+username;
              }
              
          public static void main(String[] args) {
                  Server impl
          =new Server();
                  String address
          ="http://localhost:9000/hello";
                  Endpoint.publish(address, impl);
              }
          }
          wsdl文件
            <?xml version="1.0" ?> 
          <wsdl:definitions name="helloWorldService" targetNamespace="http://impl.cxf.com/" xmlns:ns1="http://interfaces.cxf.com/" xmlns:ns2="http://schemas.xmlsoap.org/wsdl/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.cxf.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            
          <wsdl:import location="http://localhost:9000/hello?wsdl=HelloWorldServiceInf.wsdl" namespace="http://interfaces.cxf.com/" /> 
          <wsdl:binding name="helloWorldServiceSoapBinding" type="ns1:HelloWorldServiceInf">
            
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
          <wsdl:operation name="sayHello">
            
          <soap:operation soapAction="" style="document" /> 
          <wsdl:input name="sayHello">
            
          <soap:body use="literal" /> 
            
          </wsdl:input>
          <wsdl:output name="sayHelloResponse">
            
          <soap:body use="literal" /> 
            
          </wsdl:output>
            
          </wsdl:operation>
            
          </wsdl:binding>
          <wsdl:service name="helloWorldService">
          <wsdl:port binding="tns:helloWorldServiceSoapBinding" name="ServerPort">
            
          <soap:address location="http://localhost:9000/hello" /> 
            
          </wsdl:port>
            
          </wsdl:service>
            
          </wsdl:definitions>
          客戶端調用
          package com.cxf.client;

          import javax.xml.namespace.QName;
          import javax.xml.ws.Service;
          import javax.xml.ws.soap.SOAPBinding;

          import com.cxf.interfaces.HelloWorldServiceInf;

          public class Client {
              
          //注意:此處http://interfaces.cxf.com/  來源于wsdl文件中namespace   <wsdl:import location="http://localhost:9000/hello?wsdl=HelloWorldServiceInf.wsdl" namespace="http://interfaces.cxf.com/" /> 

              
          private static final QName SERVICE_NAME=new QName("http://interfaces.cxf.com/","HelloWorldServiceInf");//HelloWorldServiceInf接口類的名稱
              private static final QName PORT_NAME=new QName("http://interfaces.cxf.com/""HelloWorldServiceInfPort");//HelloWorldServiceInfPort 接口類的名稱+Port
              public static void main(String[] args) {
                  String endPointAddress
          ="http://localhost:9000/hello";
                  Service service
          =Service.create(SERVICE_NAME);
                  service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING, endPointAddress);
                  HelloWorldServiceInf inf
          =service.getPort(HelloWorldServiceInf.class);
                  System.out.println(inf.sayHello(
          "張三"));
              }
          }
          CXF根據wsdl文件動態調用WebService
          package com.cxf.client;

          import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

          public class ClientFromWsdl {
              
              
          public static void main(String[] args) throws Exception{
                  JaxWsDynamicClientFactory dcf 
          = JaxWsDynamicClientFactory.newInstance();
                  org.apache.cxf.endpoint.Client client 
          = dcf.createClient("http://localhost:9000/hello?wsdl");
                  
          //sayHello 為接口中定義的方法名稱   張三為傳遞的參數   返回一個Object數組
                  Object[] objects=client.invoke("sayHello""張三"); 
                  
          //輸出調用結果
                  System.out.println(objects[0].toString());
              }
          }
          下載工程代碼
          posted @ 2010-09-15 11:18 雪山飛鵠 閱讀(36285) | 評論 (12)編輯 收藏

                  最近由于項目需要,一直在學習OSGI,在學習OSGI的這段時間內,不斷的接觸到apache的一些優秀的開源項目,比如說FelixCXF等。Felix是Apache對OSGI R4規范的一個輕量級實現。你使用eclipse創建的plugin(插件)工程都是可以正常運行在Felix中的。前提是你創建bundle的時候選擇標準選項這一欄。好了本篇文章主要是用來介紹CXF的,關于Felix就不再深入討論了,有興趣的可以自行去研究下。
                  關于CXF,不做過多的解釋。官方的解釋已經夠清楚了。相信大家之前在Java環境下創建webservice程序大多數選擇的是xfire這個框架吧。后來好多專家不再推薦這個東東。都建議使用CXF。在未接觸到CXF之前,本人一向喜歡用xfire這個框架來創建自己的webservice。還了,廢話不多說,先來看個HelloWorld的程序,教大家快速上手。
                  首先去Apache網站下載CXF所需要的jar,我本人下載是apache-cxf-2.2.10.zip這個包。這里為了方便期間創建一個java工程。啊?java工程,這有點不可思議了,不是要創建webservice嗎?怎么是java工程?呵呵,這里就是CXF的神奇之處!
                  添加必須的jar到你的classpath路徑下。
                  cxf-2.2.10.jar 核心jar
                  jetty-6.1.21.jar 用來啟動jetty服務器
                  jetty-util-6.1.21.jar jetty輔助工具
                  wsdl4j-1.6.2.jar wsdl支持工具
                  XmlSchema-1.4.5.jar 
                  這就是CXF的最小配置,以上jar包缺一不可
                  創建一個接口
          package com.cxf.service;

          public interface HelloWorldCxfService {
              
              String sayHello(String username);
          }
                  創建該接口的實現類
          package com.cxf.service;

          public class HelloWorldCxfServiceImpl implements HelloWorldCxfService {

              
          public String sayHello(String username) {
                  
          return "Hello,"+username;
              }
          }
                  發布webservice
          package com.cxf.server;

          import org.apache.cxf.frontend.ServerFactoryBean;

          import com.cxf.service.HelloWorldCxfService;
          import com.cxf.service.HelloWorldCxfServiceImpl;

          public class Server {
              
              
          public static void main(String[] args){
                  HelloWorldCxfServiceImpl worldCxfServiceImpl
          =new HelloWorldCxfServiceImpl();
                  ServerFactoryBean factoryBean
          =new ServerFactoryBean();
                  factoryBean.setAddress(
          "http://localhost:8080/hello");
                  factoryBean.setServiceClass(HelloWorldCxfService.
          class);
                  factoryBean.setServiceBean(worldCxfServiceImpl);
                  factoryBean.create();
              }
          }
                  運行Server,注意不要關閉,在控制臺會打印如下信息:
          2010-9-10 9:44:16 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
          信息: Creating Service {http://service.cxf.com/}HelloWorldCxfService from class com.cxf.service.HelloWorldCxfService
          2010-9-10 9:44:16 org.apache.cxf.endpoint.ServerImpl initDestination
          信息: Setting the server's publish address to be http://localhost:8080/hello
          2010-09-10 09:44:16.296::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
          2010-09-10 09:44:16.296::INFO:  jetty-6.1.21
          2010-09-10 09:44:16.390::INFO:  Started SelectChannelConnector@localhost:8080
                  客戶端調用
          package com.cxf.server;

          import org.apache.cxf.frontend.ClientProxyFactoryBean;

          import com.cxf.service.HelloWorldCxfService;

          public class Client {
              
              
          public static void main(String[] args) {
                  ClientProxyFactoryBean factoryBean
          =new ClientProxyFactoryBean();
                  factoryBean.setAddress(
          "http://localhost:8080/hello");
                  factoryBean.setServiceClass(HelloWorldCxfService.
          class);
                  HelloWorldCxfService worldCxfService
          =(HelloWorldCxfService) factoryBean.create();
                  System.out.println(worldCxfService.sayHello(
          "張三"));
              }
          }
                  運行Client代碼,控制臺打印如下信息:
          2010-9-10 9:46:58 org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
          信息: Creating Service {http://service.cxf.com/}HelloWorldCxfService from class com.cxf.service.HelloWorldCxfService
          Hello,張三
                  到此,我們的webservice,已經成功調用了。大家是不是迫不及待的想看下wsdl文件是啥樣的呢?
          在瀏覽器中輸入http://localhost:8080/hello?wsdl,即可看到wsdl文件了。其中http://localhost:8080/hello部分為代碼里指定的Address。
                  wsdl文件信息:
            <?xml version="1.0" ?> 
          <wsdl:definitions name="HelloWorldCxfService" targetNamespace="http://service.cxf.com/" xmlns:ns1="http://schemas.xmlsoap.org/wsdl/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.cxf.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <wsdl:types>
          <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://service.cxf.com/" xmlns:tns="http://service.cxf.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            
          <xsd:element name="sayHello" type="tns:sayHello" /> 
          <xsd:complexType name="sayHello">
          <xsd:sequence>
            
          <xsd:element minOccurs="0" name="arg0" type="xsd:string" /> 
            
          </xsd:sequence>
            
          </xsd:complexType>
            
          <xsd:element name="sayHelloResponse" type="tns:sayHelloResponse" /> 
          <xsd:complexType name="sayHelloResponse">
          <xsd:sequence>
            
          <xsd:element minOccurs="0" name="return" type="xsd:string" /> 
            
          </xsd:sequence>
            
          </xsd:complexType>
            
          </xsd:schema>
            
          </wsdl:types>
          <wsdl:message name="sayHelloResponse">
            
          <wsdl:part element="tns:sayHelloResponse" name="parameters" /> 
            
          </wsdl:message>
          <wsdl:message name="sayHello">
            
          <wsdl:part element="tns:sayHello" name="parameters" /> 
            
          </wsdl:message>
          <wsdl:portType name="HelloWorldCxfServicePortType">
          <wsdl:operation name="sayHello">
            
          <wsdl:input message="tns:sayHello" name="sayHello" /> 
            
          <wsdl:output message="tns:sayHelloResponse" name="sayHelloResponse" /> 
            
          </wsdl:operation>
            
          </wsdl:portType>
          <wsdl:binding name="HelloWorldCxfServiceSoapBinding" type="tns:HelloWorldCxfServicePortType">
            
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
          <wsdl:operation name="sayHello">
            
          <soap:operation soapAction="" style="document" /> 
          <wsdl:input name="sayHello">
            
          <soap:body use="literal" /> 
            
          </wsdl:input>
          <wsdl:output name="sayHelloResponse">
            
          <soap:body use="literal" /> 
            
          </wsdl:output>
            
          </wsdl:operation>
            
          </wsdl:binding>
          <wsdl:service name="HelloWorldCxfService">
          <wsdl:port binding="tns:HelloWorldCxfServiceSoapBinding" name="HelloWorldCxfServicePort">
            
          <soap:address location="http://localhost:8080/hello" /> 
            
          </wsdl:port>
            
          </wsdl:service>
            
          </wsdl:definitions>
                          
          posted @ 2010-09-10 09:51 雪山飛鵠 閱讀(5966) | 評論 (7)編輯 收藏

                  環境:
                          jboss-4.2.3.GA
                          spring2.5.6
                  去jboss官方下載jboss服務器,http://www.jboss.org/jbossas/downloads/。建議下載jboss-4.2.3.GA這個版本的jboss,個人感覺還是這個版本的jboss比較穩定
                  解壓下載下來的jboss壓縮文件,筆者解壓到D:\jboss-4.2.3.GA
                  筆者以oracle數據庫來說明如何在jboss下配置jndi 以及整合spring
                  拷貝oracle-ds文件
                  去D:\jboss-4.2.3.GA\docs\examples\jca目錄下拷貝oracle-ds文件到D:\jboss-4.2.3.GA\server\default\deploy目錄下改名即可
                  大致內容如下:
          <?xml version="1.0" encoding="UTF-8"?>
          <datasources>
            
          <local-tx-datasource>
              
          <jndi-name>KBSDS</jndi-name>
              
          <connection-url>jdbc:oracle:thin:@192.168.4.243:1521:future</connection-url>
              
          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
              
          <use-java-context>false</use-java-context>
              
          <user-name>knowledge</user-name>
              
          <password>knowledge</password>
              
          <min-pool-size>5</min-pool-size>
              
          <max-pool-size>20</max-pool-size>
              
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
                
          <metadata>
                   
          <type-mapping>Oracle9i</type-mapping>
                
          </metadata>
            
          </local-tx-datasource>
          </datasources>
          jndi-name:不用多說了,當然是為該jndi取一名稱這里使用KBSDS
          其他幾個屬性不做過多解釋
          use-java-context:屬性默認為true,如未配置該屬性或該屬性配置為true,那么jboss在啟動的時候jndi的名稱前會加上java:   這里我們jndi的名稱為KBSDS,那么未配置該屬性或該屬性為true的話,你在spring中使用jndi時指定的jndiName就應該為java:KBSDS,若配置為false,那么jboss服務器不會為你加上java: 你在spring中jndiName應當配置為KBSDS,即與jndi-name屬性值等同。這里為了方便期間設置該屬性為false
                  拷貝oracle驅動
                  拷貝oracle驅動 class12.jar到jboss的如下目錄
                  D:\jboss-4.2.3.GA\lib
                  D:\jboss-4.2.3.GA\server\default\lib
                  切記數據庫驅動拷貝到D:\jboss-4.2.3.GA\server\default\lib目錄下,否則即使你jndi配置的再怎么正確都會報如下錯誤,該錯誤在jboss啟動的時候并不會報出,只有在正式遇數據庫進行交互的時候才會報此錯誤,大概錯誤是這樣的。此處花了好長時間才解決。
          org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:thin:@192.168.4.243:1521:future); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: oracle.jdbc.driver.OracleDriver, url: jdbc:oracle:thin:@192.168.4.243:1521:future))
              org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:
          238)
              org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:
          374)
              org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:
          263)
              org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:
          101)
              org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
          171)
              org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:
          89)
              org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
          171)
              org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:
          204)
              $Proxy67.managerLogin(Unknown Source)
              com.future.knowledges.action.ManagerAction.execute(ManagerAction.java:
          62)
              sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
          39)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
          25)
                  配置spring配置文件
          在applicationContext.xml中配置如下信息:
          <bean name="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> 
                  
          <property name="jndiName">
                      
          <value>KBSDS</value>
                  
          </property>
              
          </bean>
          此種方式指定jndiName為KBSDS并未java:前綴,需要你手動在jboss的jndi配置文件中設置use-java-context屬性為fasle,若未設置該屬性或設置為true那么此處應該是這樣子的
          <bean name="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> 
                  
          <property name="jndiName">
                      
          <value>java:KBSDS</value>
                  
          </property>
              
          </bean>
          需要你手動加上java:前綴后面跟jboss下配置的jndi的名稱
          其實這里的配置主要是根據jboss服務器啟動時控制臺給出的信息來配置的
          設置use-java-context為false時控制臺給出的jndi信息
          11:13:34,250 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
          11:13:34,359 INFO  [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=KBSDS' to JNDI name 'KBSDS'
          11:13:34,406 INFO  [TomcatDeployer] deploy, ctxPath=/KBS, warUrl=/deploy/KBS.war/
          11:13:34,781 INFO  [[/KBS]] Initializing Spring root WebApplicationContext
          設置use-java-context為true或不設置時控制臺給出的jndi信息
          11:25:15,921 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
          11:25:15,984 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=KBSDS' to JNDI name 'java:KBSDS'
          11:25:16,031 INFO  [TomcatDeployer] deploy, ctxPath=/KBS, warUrl=/deploy/KBS.war/

          注意對比兩次控制臺分別打印的信息,從中很容易發現,其實就是use-java-context屬性的作用。關于該屬性,大家可以去參看jboss的官方文檔。這里就不細說了。
          到此jboss下配置jndi 以及整合spring已經成功配置起來了,接下來就是一些細化了,大家可以去查詢jboss的關于jndi配置的文檔。
          其實在jboss下配置jndi遠遠比在tomcat下配置jndi簡單的多。
          總結下來就這幾步
          拷貝jndi模板到server\default\deploy目錄下,并做修改,這里面模板文件均是以數據庫類型-ds.xml命名的。
          拷貝數據庫驅動到\server\default\lib目錄和jboss安裝目錄\lib下即可。
          posted @ 2010-09-08 11:33 雪山飛鵠 閱讀(6390) | 評論 (0)編輯 收藏

          僅列出標題
          共22頁: First 上一頁 9 10 11 12 13 14 15 16 17 下一頁 Last 
          主站蜘蛛池模板: 武宁县| 霸州市| 通海县| 阿尔山市| 鸡东县| 社旗县| 白河县| 玛纳斯县| 留坝县| 罗山县| 长沙市| 策勒县| 库伦旗| 安陆市| 海丰县| 莎车县| 桦甸市| 和林格尔县| 静安区| 莲花县| 桐城市| 巨野县| 余江县| 乾安县| 江源县| 平潭县| 平顺县| 沙雅县| 三门峡市| 睢宁县| 高雄市| 桃源县| 邢台县| 宁陵县| 阿荣旗| 洪泽县| 乐山市| 巴林左旗| 古蔺县| 客服| 郁南县|