Archive

Archive for May, 2009

Weblogic 81Sp3

May 14th, 2009 西坪 No comments

Weblogic 81Sp3 发布时遇到如下错误:

<2009-5-14 下午05时2920秒 CST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating Deploy task for application receive.>
<2009-5-14 下午05时2920秒 CST> <Error> <Deployer> <BEA-149201> <Failed to complete the deployment task with ID 0 for the application receive.
weblogic.management.ApplicationException:
Exception:weblogic.management.ApplicationException: prepare failed for receive
Module: receive Error: Could not load receive: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
 
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2398)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2310)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.management.ManagementException:  - with nested exception:
[weblogic.management.ApplicationException:
Exception:weblogic.management.ApplicationException: prepare failed for receive
Module: receive Error: Could not load receive: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
]
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2327)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

错误原因是Spring 2.5.5 与Weblogic 81之间不兼容造成的。
详细看这里

Doc: Deployment error on Weblogic 8.1 SP1/SP2 due to manifest issues – upgrade to SP6 required

Categories: server & system Tags:

Vim 快捷键

May 10th, 2009 西坪 No comments

All these stuff can be found in the manual. Put them here together to give me random review chance.

Some best resource about vim usage:
General tips
  • Ctrl-N: auto completion
  • Position the cursor on the name of the function in your file and type [I: Vim will show a list of all matches for the function name in included files.
Search & Replace

这里有篇介绍文章:VIM下,在文件及目录中查找字符串的方法 。例如: vimgrep /登录/g **/*.html

查找的结果会显示在 QuickList 列表中。对于Quicklist 的操纵,参考下面的文章 打造自己的VIM: QuickFix 編譯視窗 。 这篇文章还介绍了打造快捷键,因为我的Vim使用的版本比较多,而且直接切换到Qucik List然后使用行移动也很方便的,所以就不配置这些快捷键。 更详细的参考见官方手册 Quickfix 或者 :help quickfix

替换 

可以在 vim 中查看帮助 :help argdo

示例:

:args **/*.htm

:argdo %s/旧/新/ge  |  update

Move around quickly
  • Use % to jump from an open brace to its matching closing brace. Or from a "#if" to the matching "#endif". Actually, % can jump to many different matching items. It is very useful to check if () and {} constructs are balanced properly.
  • Use [{ to jump back to the "{" at the start of the current code block.
  • Use gd to jump from the use of a variable to its local declaration.
  • * command to search for other places
  • CTRL-], CTRL-t with ctags/cscope

整页翻页 ctrl-f ctrl-b
f就是forword b就是backward

翻半页
ctrl-d ctlr-u
d=down u=up

滚一行
ctrl-e ctrl-y

zz 让光标所杂的行居屏幕中央
zt 让光标所杂的行居屏幕最上一行 t=top
zb 让光标所杂的行居屏幕最下一行 b=bottom

Highlight and increment search set:
set hls is

Block Operation (Delete a column):
  • start mode with Ctrl-v
  • specify a motion, e.g. G (to the end of the file), or use up / down keys
  • for the selected block specify an action, e.g. ‘d’ for delete
Split Window

set splitright “put the new split window in the right)

(some content cited from The Vim/Cscope tutorial)

  • move between windows via ‘CTRL-W w’ (or CTRL-W arrow key, or CTRL-W h/j/k/l for left/up/down/right),
  • close a window via ‘CTRL-W c’ (or good old ‘:q’),
  • make the current window the only one via ‘CTRL-W o’,
  • split a window into two via ‘CTRL-W s’ (or ‘CTRL-W v’ for a vertical split),
  • open a file in a new window via ‘:spl[it] filename’,
  • close a window ‘CTRL-W c’
cscope & ctags

The most completed tutorial I got from Internet:
The Vim/Cscope tutorial

We can use ctags to navigate the java code by placing the cursor on a class or method and hitting CTRL-]. To jump back and forwards just use CTRL-O and CTRL-I. Type :jumps command to view the jump lists.

Cscope also can works well with other languages likes Java and C++. All we need to do is explicit specify the special file lists in the cscope.files or the command line.

Categories: Tools & Tips Tags: