9910

          單飛

             :: 首頁 :: 聯系 :: 聚合  :: 管理

          #

               摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><script type="text/javascript">/**  * 時間對象的格式化;  */  Dat...  閱讀全文
          posted @ 2012-12-06 11:36 單飛 閱讀(8556) | 評論 (2)編輯 收藏

          /db/flare/flare/bin/flared --daemonize --data-dir /db/flare/data/proxy/ --index-server-name 127.0.0.1 --index-server-port 12120 --server-name 127.0.0.1 --server-port 11211
          /db/flare/flare/bin/flared --daemonize --data-dir /db/flare/data/master1/ --index-server-name 127.0.0.1 --index-server-port 12120 --server-name 127.0.0.1 --server-port 11212  
          /db/flare/flare/bin/flared --daemonize -f /db/flare/flare/etc/flare-proxy.conf
           
          data-dir = /db/flare/data/proxy
          index-server-name = localhost
          index-server-port = 12120
          log-facility = local1
          server-name = localhost
          server-port = 11211
           
          1.查看flare日志:
          [flare@server logs]# vi /etc/syslog.conf

          # falre logs
          local0.*                                                /opt/logs/flare-index.log
          local2.*                                               /opt/logs/flare-master.log
          local1.*                                               /opt/logs/flare-proxy.log
           
           
          [flare@server flare]$ cd /opt/logs/
          [flare@server logs]$ ll
          總計 15836
          -rw------- 1 flare flare 11889779 09-10 10:16 flare-index.log
          -rw------- 1 flare flare    23490 09-04 17:15 flare-master.log
          -rw------- 1 flare flare  4270801 09-10 09:55 flare-proxy.log
           
           
          分析日志查詢為啥起不起來。

          [flare@server logs]# tail -f flare-proxy.log
           
          2.查看端口是否被占用
          [flare@server logs]# lsof -i:11212
          [flare@server logs]# lsof -i:11211
          [flare@server logs]# lsof -i:11210

          3.查看tmp臨時目錄文件是否正常
          vi /db/flare/tmp/flare.xml
          發現改文件損壞,從備份程序拷貝
          cp /opt/flare/tmp/flare.xml /db/flare/tmp/


          啟動成功
          posted @ 2012-11-21 10:40 單飛 閱讀(429) | 評論 (0)編輯 收藏

          cccccccccccccccccccccccccccccccccccccc
          posted @ 2012-11-20 13:52 單飛 閱讀(718) | 評論 (0)編輯 收藏

          《蔡康永的說話之道》
          《內向者的無敵》
          《餐巾紙的背面》
          《筆仙》
          《尋人啟事》
          《你的知識需要管理》
          《內向者的優勢》
          《把時間當做朋友》
          《氣場》
          《如何消除內心的恐懼》
          《哪來的天才》
          《一萬小時理論》
          《番茄工作法》
          《淡定的力量》
          《Your money brother》
          《思考的技術》
          《暗時間》
          posted @ 2012-11-20 09:15 單飛 閱讀(369) | 評論 (0)編輯 收藏

          1 private static String getMethodName(String fildeName){
          2 byte[] items = fildeName.getBytes();
          3 items[0= (byte)((char)items[0]-'a'+'A');;
          4 return new String(items);
          5 }


          效率是最高的.
          posted @ 2012-03-20 17:15 單飛 閱讀(2896) | 評論 (1)編輯 收藏

          在開發環境,只能用localhost (本機機器名) 來訪問站點,因為在DotNet環境下,
          域名的設置不能單單通過設置hosts文件實現,必須在IIS里面配置。
          另外:
           <casClientConfig
                  casServerLoginUrl="https://××××.net:8443/cas/login"
                  casServerUrlPrefix="https://××××.net:8443/cas/"
                  serverName="http://localhost:1054/CasTest"

          如果serverName 配置不當也會導致循環重定向。
          在確定

          <sessionState mode="StateServer" cookieless="UseCookies" timeout="36000"></sessionState>

          配置沒有問題的時候,可能因為serverName 的配置問題導致循環重定向。
          CasAuthentication.cs
             internal static void ProcessRequestAuthentication()
                  {
                      HttpContext context = HttpContext.Current;

                      // Look for a valid FormsAuthenticationTicket encrypted in a cookie.
                      CasAuthenticationTicket casTicket = null;
                      FormsAuthenticationTicket formsAuthenticationTicket = GetFormsAuthenticationTicket();
                      if (formsAuthenticationTicket != null)
                      {
                          ICasPrincipal principal;
                          if (ServiceTicketManager != null)
                          {
                              string serviceTicket = formsAuthenticationTicket.UserData;
                              casTicket = ServiceTicketManager.GetTicket(serviceTicket);
                              if (casTicket != null)
                              {
                                  IAssertion assertion = casTicket.Assertion;

                                  if (!ServiceTicketManager.VerifyClientTicket(casTicket))
                                  {
                                      Trace.WriteLine(String.Format("{0}:Ticket failed verification." + Environment.NewLine, CommonUtils.MethodName));

          這里是調試的斷點設置。
          posted @ 2012-03-13 14:26 單飛 閱讀(3248) | 評論 (1)編輯 收藏

          catalina.sh

          JAVA_OPTS="$JAVA_OPTS
          -server -Xverify:none -XX:+UseParallelGC -XX:PermSize=20M -Xms2200m
          -Djava.rmi.server.hostname=172.16.4.200
          -Dcom.sun.management.jmxremote
          -Dcom.sun.management.jmxremote.port=9004
          -Dcom.sun.management.jmxremote.authenticate=false
          -Dcom.sun.management.jmxremote.ssl=false"

          增加一行配置.
          可以使用jconsole 來遠程連接,查看內存使用.服務器端,應用所需的內存,最好一次申請到位,即使不用也要占著
          posted @ 2012-02-23 12:52 單飛 閱讀(368) | 評論 (0)編輯 收藏

          參考
          http://gwt-ext.com/forum/viewtopic.php?t=1682


          import com.google.gwt.user.client.rpc.RemoteService;
          import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

          @RemoteServiceRelativePath("sessout")
          public interface MyService extends RemoteService {
              public Integer getUserSessionTimeoutMillis();
          }


          import com.google.gwt.user.client.rpc.AsyncCallback;

          public interface MyServiceAsync {
              void getUserSessionTimeoutMillis(AsyncCallback async);
          }



          import com.google.gwt.user.server.rpc.RemoteServiceServlet;

          @SuppressWarnings("serial")
          public class MyServiceImpl extends RemoteServiceServlet implements MyService {

              public Object getLoggedInUser() {
                  return getThreadLocalRequest().getSession().getAttribute(EConstants.USER);
              }

              /**
               * Should be the first RPC call from all UIDef*.onModuleLoad()
               *
               * @return java.lang.Integer (-1 if the user session has already timed out,
               *         otherwise, the number of milliseconds)
               */
              public Integer getUserSessionTimeoutMillis() {
                  Integer returnObj = null;
                  if (getLoggedInUser() != null) {
                      returnObj = new Integer(EduConstants.SESSION_TIMEOUT_MILLIS); // milliseconds
                  } else {
                      returnObj = new Integer(-1);
                  }
                  return returnObj;
              }
          }

          public class EConstants {

              public static final String USER = "sessuser";

              public static final int SESSION_TIMEOUT_MILLIS = 1800; // 30 minute
          }


          web.xml

            <servlet>
              <servlet-name>sessServlet</servlet-name>
              <servlet-class>com.chinaedu.edupass.server.MyServiceImpl</servlet-class>
            </servlet>
           
            <servlet-mapping>
              <servlet-name>sessServlet</servlet-name>
              <url-pattern>/ldapmanager/sessout</url-pattern>
            </servlet-mapping>


          public class LManager implements EntryPoint {


              private Timer sessionTimeoutTimer = null;
          private MyServiceAsync service;
          public void onModuleLoad() {

          service = (MyServiceAsync) GWT.create(MyService.class);

                  showLogin();
          }

          private void showLogin() {
                  final LoginDialog dialog = new LoginDialog() {
                      protected void showMainView() {
                          super.showMainView();
                          doShowMainView();
                          // 登錄后開始計時
                          initSessionTimers();
                      }

                  };
                  dialog.setAutoCenter(true);
                  dialog.setIsModal(true);
                  dialog.setShowHeader(false);
                  dialog.setShowToolbar(false);
                  dialog.setEdgeSize(10);
                  dialog.setWidth(300);
                  dialog.setHeight(180);

                  dialog.show();
              }


              private void doShowMainView() {


          /**
               * 客戶端在超時后執行跳轉登錄
               *
               * @sessionTimeInMillis Integer
               */
              private void initSessionTimers() {
                  // Allow 30 seconds to get the RPC call constructed and called.
                  sessionTimeoutTimer = new Timer() {
                      public void run() {
                          service.getUserSessionTimeoutMillis(new AsyncCallback() {
                              public void onSuccess(Object result) {
                                  int sessionTimeMillis = ((Integer) result).intValue();
                                  if (sessionTimeMillis == -1) {
                                      // 超時后執行跳轉到登錄窗口
                                      displaySessionTimedOut();
                                  } else {
                                      sessionTimeoutTimer.cancel();
                                      initSessionTimers();
                                  }
                              }

                              public void onFailure(final Throwable caught) {
                                  SC.say(LdapI18N.ldapMessages().failed());
                              }
                          });
                      }
                  };
                  // 31 minutes 服務器端設置為30分鐘超時,如果30分鐘沒有操作
                  // 就會返回超時,如果期間有操作,則在等31分鐘后再輪詢
                  sessionTimeoutTimer.schedule(31*60*1000);

              }

              private void displaySessionTimedOut() {
                  SC.say(LI18N.ldapMessages().sessionTimeOut(), new BooleanCallback() {
                      public void execute(Boolean value) {
                          showLogin();
                      }
                  });
              }
          posted @ 2011-08-03 18:18 單飛 閱讀(698) | 評論 (0)編輯 收藏

          GWT SmartGWT
          1.發布到Tomcat/Jetty.
              在發布之前需要使用Eclipse中的GWT-Compile
              選中工程->右鍵菜單-Google-GWT Comile
              編譯后的文件在/war 目錄下面,拷貝此文件到Tomcat的Webapp下面就可以訪問了。


          2.SmartGWT的可用性和GXT相比,差別巨大。
              GXT前端展示非常成熟,具體表現:a.Grid 控件、表單。而SmartGWT 的GridList控件非常簡單,甚至不支持分頁,要自己DIY。
              不推薦使用SmartGWT做項目。

          3.開發上可以只用GWT做前端,使用Hessian來調用另外一個工程的Service,Hessian調用servlet已經封裝的很好。
              在開發上要分為兩個工程:Project-webapp Project-GWT.


          4.編譯后的文件體積有點龐大,至少50M。

          5.具體開發細節可以參<<GWT揭秘>>,里面有很多最佳實踐,另外不要吝嗇銀子,最好使用GXT。
          posted @ 2011-07-27 10:48 單飛 閱讀(790) | 評論 (0)編輯 收藏

          安裝Maven后每次啟動出現警告信息:

          Eclipse is running in a JRE, but a JDK is required
          Some Maven plugins may not work when importing projects or updating source folders.



          直接創建一個快捷方式,加入啟動參數
          -vm D:\server\jdk1.6.0_21\bin\javaw

          修改eclipse.ini好多次都不成功。

          參考幫助文檔:
          eclipse -vm c:\jdk1.4.2\jre\bin\javaw

          終于解決問題了。
          posted @ 2011-07-05 10:12 單飛 閱讀(1218) | 評論 (0)編輯 收藏

          僅列出標題
          共12頁: 上一頁 1 2 3 4 5 6 7 8 9 下一頁 Last 
          主站蜘蛛池模板: 温州市| 宜宾县| 东山县| 扎鲁特旗| 巫溪县| 健康| 万荣县| 邯郸县| 丰原市| 丁青县| 双城市| 日土县| 广水市| 柳河县| 紫阳县| 诏安县| 大竹县| 伊金霍洛旗| 文成县| 尼木县| 娄烦县| 淮滨县| 巴青县| 湟源县| 柯坪县| 屏东县| 涞水县| 广宗县| 东辽县| 临邑县| 项城市| 鹤岗市| 湘潭县| 邵阳市| 张家界市| 会泽县| 郑州市| 寿阳县| 石屏县| 长沙市| 台中市|