2015-08-06

X-Session security

从一台windows机器上ssh到一台RHEL上,以root用户能正常启动带X windows界面的程序,可是以普通用户esbadmin却无法启动,报错:

Xlib: connection to "localhost:10.0" refused by server
Xlib: MobaXterm X11 proxy: Unsupported authorisation protocol

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.

执行xhost的结果:
Xlib: connection to "localhost:10.0" refused by server
Xlib: MobaXterm X11 proxy: Unsupported authorisation protocol

xhost:  unable to open display "localhost:10.0"

以为是DISPLAY环境变量设置不对,可是与root用户同样的DISPLAY变量还是会得到同样的错误。

原来是和 X-Session security有关。以root用户执行xauth list得到一个列表:

besb01/unix:15  MIT-MAGIC-COOKIE-1  83aa78de1155733b1cefe4fc63839d1a
besb01/unix:16  MIT-MAGIC-COOKIE-1  5f6da97c370785b55288c31bc29f7b27
besb01/unix:10  MIT-MAGIC-COOKIE-1  e91f2af3747fb0095e085dcd7dd49423
besb01/unix:11  MIT-MAGIC-COOKIE-1  8037d90b9d1bf3503aaaf61c0affe4b5
besb01/unix:12  MIT-MAGIC-COOKIE-1  86667f99f925914907f12d25a6f51bc1
besb01/unix:13  MIT-MAGIC-COOKIE-1  1714acffefffd2988c4c4f1be618d9b4
besb01/unix:14  MIT-MAGIC-COOKIE-1  b16eea1237d2823f3dc9e400f123063e


复制unix:14那一行,然后以esbadmin用户执行下面的命令即可。

xauth add besb01/unix:14  MIT-MAGIC-COOKIE-1  b16eea1237d2823f3dc9e400f123063e

2015-07-26

创建tibco BW domain

创建tibco bw domain本是一件简单的事,运行domainutility程序,图形化界面,向导式的一步步照着做就好了,可是有些坑被我踩到了。

目标机器是远程的一台Red Hat Enterprise Linux Server 5.6,经过一台jump server ssh过去的。本来是要用另外一个用户去运行domainutility来创建domain,可是remote display设置好像不对,X server启动了,可是就是无法启动domainutility,总是报错:

可是以root身份却能启动 domainutility的图形化界面,把root用户的DISPLAY变量复制到另外一个用户仍然报错,不能启动图形化界面。不想在这儿折腾太久了,心想先以root身份创建然后再用chown更改文件所有者好了。创建完毕,文件所有者也更改了,然后以另一个用户的身份去运行,直接报错内存访问错误Speicherzugriffsfehler。换作root用户与运行报告同样的错误。用strace一看:
open("/root/bin", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 EACCES (Permission denied)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

看样子还真是和以root用户运行domainutility有关。

2015-07-09

安装Tibco EMS 8.2.1

在一台Linux machine CentOS 6.6上安装Tibco EMS 8.2.1,安装过程没有报错,不过在安装日志里会发现下面的错误:

(07-09-2015.083025), ::ERROR::, WizardAction exception encountered., class com.tibco.installer.util.TIBCOUniversalInstallerAction
(07-09-2015.083025), ::ERROR::, null, class com.tibco.installer.util.TIBCOUniversalInstallerAction
(07-09-2015.083025), Debug, 
java.lang.reflect.InvocationTargetException
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)
at com.tibco.installer.util.TIBCOUniversalInstallerAction.executeDialogAction(TIBCOUniversalInstallerAction.java:613)
at com.tibco.installer.wizard.action.TIBCORunInstaller._executeDialogAction(TIBCORunInstaller.java:252)
at com.tibco.installer.wizard.action.TIBCORunInstaller._runSequence(TIBCORunInstaller.java:185)
at com.tibco.installer.wizard.action.TIBCORunInstaller._runInstallSequences(TIBCORunInstaller.java:90)
at com.tibco.installer.wizard.action.TIBCORunInstaller.run(TIBCORunInstaller.java:44)
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)
at com.tibco.installer.util.TIBCOUniversalInstallerAction.executeWizardAction(TIBCOUniversalInstallerAction.java:529)
at com.tibco.installer.wizard.action.TIBCORunWizardAction.execute(TIBCORunWizardAction.java:26)
at com.installshield.wizard.StandardWizardListener.execute(Unknown Source)
at com.installshield.wizard.StandardWizardListener.currentBeanChanged(Unknown Source)
at com.installshield.wizard.Wizard$RunThread.run(Wizard.java:1829)
Caused by: java.lang.UnsatisfiedLinkError: /tmp/istemp14304190082624/_bundledJRE_/lib/i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at sun.security.action.LoadLibraryAction.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Unknown Source)
at java.awt.Toolkit.<clinit>(Unknown Source)
at sun.awt.AppContext$2.run(Unknown Source)
at sun.awt.AppContext$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(Unknown Source)
at sun.awt.AppContext.access$400(Unknown Source)
at sun.awt.AppContext$3.run(Unknown Source)
at sun.awt.AppContext$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(Unknown Source)
at javax.swing.text.html.parser.ParserDelegator.getDefaultDTD(Unknown Source)
at javax.swing.text.html.parser.ParserDelegator.setDefaultDTD(Unknown Source)
at javax.swing.text.html.parser.ParserDelegator.<init>(Unknown Source)
at com.tibco.installer.util.TIBCOHtmlToTextConverter.parse(TIBCOHtmlToTextConverter.java:33)
at com.tibco.installer.util.TIBCOHtmlToTextConverter.<init>(TIBCOHtmlToTextConverter.java:21)
at com.tibco.installer.wizard.action.TIBCOPreInstallSummaryPanelWizardAction._doConsole(TIBCOPreInstallSummaryPanelWizardAction.java:64)
at com.tibco.installer.wizard.action.TIBCOPreInstallSummaryPanelWizardAction.run(TIBCOPreInstallSummaryPanelWizardAction.java:26)

... 18 more


Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.SunToolkit
at sun.awt.AppContext$2.run(Unknown Source)
at sun.awt.AppContext$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(Unknown Source)
at sun.awt.AppContext.access$400(Unknown Source)
at sun.awt.AppContext$3.run(Unknown Source)
at sun.awt.AppContext$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(Unknown Source)
at javax.swing.SwingWorker.getDoSubmit(Unknown Source)
at javax.swing.SwingWorker.<init>(Unknown Source)
at com.tibco.installer.util.TIBCOAntTaskRunner.<init>(TIBCOAntTaskRunner.java:20)
at com.tibco.installer.wizard.action.TIBCOExecutePostInstallAntTasks._executeMachineModelAntTask(TIBCOExecutePostInstallAntTasks.java:651)
at com.tibco.installer.wizard.action.TIBCOExecutePostInstallAntTasks._updateMachineModel(TIBCOExecutePostInstallAntTasks.java:562)
at com.tibco.installer.wizard.action.TIBCOExecutePostInstallAntTasks._doConsole(TIBCOExecutePostInstallAntTasks.java:160)
at com.tibco.installer.wizard.action.TIBCOExecutePostInstallAntTasks.run(TIBCOExecutePostInstallAntTasks.java:57)

结果是不能启动tibemsd64,根据提示/opt/tibco/ems/8.2/lib/64目录下symbolic links缺失。看样子是安装时没有被创建,需要在/opt/tibco/ems/8.2/lib/64目录下手动创建下面几个links才能启动tibemsd64。

libcrypto.so -> libcrypto.so.0.9.8
liblber-2.4.so -> liblber-2.4.so.2.5.5
libssl.so -> libssl.so.0.9.8
libxml2.so -> libxml2.so.2.7.6

yum install libXext.i686 安装了
Installing : libXau-1.0.6-4.el6.i686                                                                                                           
Installing : libxcb-1.9.1-2.el6.i686                                                                                                           
Installing : libX11-1.6.0-2.2.el6.i686                                                                                                        
Installing : libXext-1.3.2-2.1.el6.i686

之后重新安装又发现缺少libXrender.so.1
Caused by: java.lang.UnsatisfiedLinkError: /tmp/istemp3030190095829/_bundledJRE_/lib/i386/xawt/libmawt.so: libXrender.so.1: cannot open shared object file: No such file or directory
估计安装完libXrender.so后又会报告缺少另外的库。

安装gtk2.i686(yum install gtk2.i686)会安装一堆和libX相关的依赖包,包括:
libXcomposite 
libXcursor   
libXdamage  
libXfixes  
libXft    
libXi    
libXinerama
libXrandr 
libXrender

安装完gtk2后又报告缺少libXtst,Caused by: java.lang.UnsatisfiedLinkError: /tmp/istemp9782190102622/_bundledJRE_/lib/i386/xawt/libmawt.so: libXtst.so.6:

安装libcanberra-gtk2.i686(yum install libcanberra-gtk2.i686)完后才没有报错。


set64bit:

pre-assembly-ref-ems_64bit_client_runtime:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2 liblber-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/liblber.so 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/liblber.so liblber-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2 libldap-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/libldap.so 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libldap.so libldap-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.so.2.7.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.so.2 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libxml2.so.2 libxml2.so.2.7.6 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.so.2.7.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.so 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libxml2.so libxml2.so.2.7.6 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libcrypto.0.9.8.dylib and /opt/tibco2/ems/8.2/lib/64/libcrypto.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libssl.0.9.8.dylib and /opt/tibco2/ems/8.2/lib/64/libssl.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.2.5.5.dylib and /opt/tibco2/ems/8.2/lib/64/liblber-2.4.2.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.2.5.5.dylib and /opt/tibco2/ems/8.2/lib/64/liblber.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.2.5.5.dylib and /opt/tibco2/ems/8.2/lib/64/libldap-2.4.2.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.2.5.5.dylib and /opt/tibco2/ems/8.2/lib/64/libldap.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libz.1.2.3.dylib and /opt/tibco2/ems/8.2/lib/64/libz.dylib 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libcrypto.sl.0.9.8 and /opt/tibco2/ems/8.2/lib/64/libcrypto.sl 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libssl.sl.0.9.8 and /opt/tibco2/ems/8.2/lib/64/libssl.sl 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.sl.9.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.sl 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.sl.9.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.sl.9 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.sl.7.5 and /opt/tibco2/ems/8.2/lib/64/liblber-2.4.sl.7 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.sl.7.5 and /opt/tibco2/ems/8.2/lib/64/liblber.sl 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.sl.7.5 and /opt/tibco2/ems/8.2/lib/64/libldap-2.4.sl.7 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.sl.7.5 and /opt/tibco2/ems/8.2/lib/64/libldap.sl 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.7.5 and /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.7 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.7.5 and /opt/tibco2/ems/8.2/lib/64/liblber.so 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.7.5 and /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.7 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.7.5 and /opt/tibco2/ems/8.2/lib/64/libldap.so 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.so.9.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.so 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.so.9.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.so.9 

deletesymlink:

link:

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libcrypto.so.0.9.8 and /opt/tibco2/ems/8.2/lib/64/libcrypto.so 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libcrypto.so libcrypto.so.0.9.8 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libssl.so.0.9.8 and /opt/tibco2/ems/8.2/lib/64/libssl.so 

deletesymlink:

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libssl.so libssl.so.0.9.8 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/liblber.so 

deletesymlink:
     [echo]  deleting /opt/tibco2/ems/8.2/lib/64/liblber.so 
  [symlink] Removing symlink: /opt/tibco2/ems/8.2/lib/64/liblber.so

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/liblber.so liblber-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2 

deletesymlink:
     [echo]  deleting /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2 
  [symlink] Removing symlink: /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/liblber-2.4.so.2 liblber-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/libldap.so 

deletesymlink:
     [echo]  deleting /opt/tibco2/ems/8.2/lib/64/libldap.so 
  [symlink] Removing symlink: /opt/tibco2/ems/8.2/lib/64/libldap.so

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libldap.so libldap-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2.5.5 and /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2 

deletesymlink:
     [echo]  deleting /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2 
  [symlink] Removing symlink: /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libldap-2.4.so.2 libldap-2.4.so.2.5.5 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.so.2.7.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.so 

deletesymlink:
     [echo]  deleting /opt/tibco2/ems/8.2/lib/64/libxml2.so 
  [symlink] Removing symlink: /opt/tibco2/ems/8.2/lib/64/libxml2.so

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libxml2.so libxml2.so.2.7.6 

checksymlinkexists:
     [echo]  checking existence of /opt/tibco2/ems/8.2/lib/64/libxml2.so.2.7.6 and /opt/tibco2/ems/8.2/lib/64/libxml2.so.2 

deletesymlink:
     [echo]  deleting /opt/tibco2/ems/8.2/lib/64/libxml2.so.2 
  [symlink] Removing symlink: /opt/tibco2/ems/8.2/lib/64/libxml2.so.2

link:
     [echo]  symlink /opt/tibco2/ems/8.2/lib/64/libxml2.so.2 libxml2.so.2.7.6 

BUILD SUCCESSFUL
Total time: 6 seconds

解决办法:安装EMS 8.2.1之前,先安装:
yum install glibc.i686 
yum install gtk2.i686 
yum install libcanberra-gtk2.i686

都可以使用silent安装模式,为什么installer还需要一堆libX的东西,那不是和图形界面有关的吗?

2015-04-23

putty 小技巧

需要测试一台远程机器的某个端口是否可访问时常用telnet工具。不过在windows 7上有时这个工具默认没有安装。这时可借助putty来完成,格式为:
putty.exe [-ssh | -telnet | -rlogin | -raw] [user@]host

例子:
测试一个端口
putty.exe -telnet 192.177.71.132 1521

命令行建立一个连接
使用密码登录
putty.exe -ssh d.jia@10.35.204.253 -P 2211 -pw mypassword
putty.exe -ssh d.jia@10.35.204.253 2211 -pw mypassword

使用private key登录
putty.exe -ssh d.jia@10.35.204.253 2211 -i path/to/privateKey.ppk


端口转发,forward local port to remote destination
putty.exe -ssh d.jia@10.35.204.253 2211 -i path/to/privateKey.ppk  -L 6389:remoteServer:3389

命令行加载一个保存的连接
putty.exe -load "session name"


2015-01-06

设置Sigma Komforttelefon 890D拨号方式为音频

家里有一部很老的有线电话机,是当学生时一个德国朋友送的。底部标记为Sigma Komforttelefon 890D,自带自动应答机。这部电话机做工是非常的好,是早期产品不不节省材料的代表作,非常耐摔。

这部电话机默认的拨号方式是脉冲拨号,可见其有多老了。要把它设置成音频拨号不是拨动一个小开关,而是需要输入一串值。没有说明书的话几乎就不可能完成。没想到网上也有人问这个问题,看来德国人真是爱用”古董“。
设置方法为:拿起听筒,输入键组合 PROG * 3 PROG即可。

2014-01-10

SAP netweaver problem analysis guide

SAP netweaver problem analysis guide是个不错文档,只是SAP的帮助文档的URL总是这么不友好,没有搜索引擎,没有收藏夹里的链接,你要凭记忆是绝不可能在地址栏里正确输入这个URL的。

http://help.sap.com/saphelp_nw70ehp3/helpdata/en/6c/7ffb3f6c78ee28e10000000a1550b0/content.htm

这个是给Netweaver 7.0的,对7.3估计变化不大,SAP没有发布,或是我没有找到。

2013-11-03

用robocopy复制数据到映射的网络盘

公司的电脑应用了组策略,复制数据到连接到本地的USB设备时要求USB必须是加密过的设备,否则拒绝复制数据。这给备份数据时带来了点麻烦。我把一个外接硬盘(文件系统为NTFS)挂载到了一个Android设备上,用samba共享出来供备份数据,没想到用robocopy复制数据时总是得到错误:
"ERROR 5 (0x00000005) Changing File Attributes ... Access is denied".

For the error (ERROR 5), you need to turn off the attribute copying. Robocopy uses the /COPY:DAT by default, which means to copy data, attributes and timestamp. You should turn off attribute copying by explicit setting /COPY:DT.

使用/COPY:DT仅仅复制D(data)和T(timestamp)

robocopy source target /MIR /COPY:DT /UNICODE

当复制一个文件失败时,默认的重试次数是一万次。这个对于我来说基本是浪费时间,所以还是加上一个retry的参数吧。

robocopy source target /MIR /COPY:DT /UNICODE /R:3 

2013-07-23

save message version in PI 7.31

xiadapter.stage.conf

This property defines the persistence mode for the XI protocol handler.
Its value is given as a comma-separated list of persistence mode configurations at specific stages.
Stages:
 BI - Before inbound processing
 VI - After inbound schema validation
 MS - Between receiver determination and mapping step
 AM - Between mapping and schema validation
 VO - After outbound schema validation
 Modes:
 1 - Store on error
 2 - Store and continue
 3 - Store and return (to queue)
 Example:
 BI=1,MS=3

xiadapter.logger.conf 

This property defines the logging mode for the XI protocol handler.
Its value is given as a comma-separated list of logging mode configurations at specific stages.
Stages:
 BI - Before inbound processing
 MS - Between receiver determination and mapping step
 AM - Between mapping and schema validation
 Modes:
 2 - Synchronous messages are logged
 6  - Only synchronous error messages are logged
 10 - As mode 2, with the business content hidden
 14 - As mode 6, with the business content hidden
 Example:
 BI=6,AM=2

2013-06-13

SAP PI 7.31 SOAP receiver adapter不能正常发送数据

在SAP PI 7.31 AEX (SP4)下一个简单的IDoc ->SOAP 的应用场景,其中SOAP receiver adapter使用HTTPS,验证使用用户名和密码的方式。在测试环境中运行正常,但是移到生产环境就不能发送数据到接收方了。

在没有部署接收方的SSL证书之前,得到错误:
Peer certificate rejected by ChainVerifier。
在导入SSL证书链(一共三个)并重启SSL provider之后,这个错误没有了,不过却得到另一个错误:

Failed to call the endpoint: Error in call over HTTP: HTTP 400 Bad Request
SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
SOAP: error occured: com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request
MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: java.io.IOException: invalid content type for SOAP: TEXT/HTML; HTTP 400 Bad Request

尝试修改SOAP adapter指向测试环境的接收方和相应的用户名+密码,一切正常。在SAP PI的测试环境下发送数据到接收方的生产环境,得到的错误与上面一样。可是用SOAP UI 4.51却能正常发送同样payload的数据到接收方。

正常工作:
SAP PI QA   -->  Receiver QA
SAP PI Prod --> Receiver QA
SOAP UI       --> 
Receiver Prod

不能工作:
SAP PI QA   -->  Receiver Prod
SAP PI Prod --> Receiver Prod


查看了SOAP FAQ note 856597,里面提到:
For SOAP adapter initialization problem, component com.sap.aii.af.mp.soap must be set to DEBUG. For runtime problem, additionally component com.sap.aii.messaging must be set to DEBUG.
可是找半天却不知如何设置com.sap.aii.af.mp.soap和com.sap.aii.messaging成DEBUG模式。网上提到的多是使用visual adaministrator,适用于低一点版本的PI。

自己无法设置tcp gateway去查看SOAP请求,请求接收方安装了一个程序来查看SOAP adapter发出的请求,发现了问题的原因。接收方返回的应答是:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html>
<head>
    <title>400 Bad Request</title>
</head>
<body>
    <h1>Bad Request</h1>
    <p>
        Your browser sent a request that this server could not understand.
        <br />
        Request header field is missing ':' separator.
        <br />
        <pre>OA==</pre>
    </p>
    <hr>
    <address>Apache/2.2.16 (Debian) Server at hostname Port 443</address>
</body>
</html> 


查看HTTP的头:
    User-Agent: SAP-Messaging-com.sap.aii.af.sdk.xi/1.0505
    CallingType: SJM
    Authorization: Basic c3RuX2FwL3N0bl9hcF9pbnRlZ3JhdGlvbjo1Zjg1MTljNzk4NjQ0YjI0OGZiOTFkY2ZkY2VjNDBk
    OA==

在Authorization这个字段,值因为太长被错误地截断了,变成了两行,导致请求无法被接收方服务器接受。
SAP note 1153210提到了类似的问题:
The base64 encoding was implemented according to rfc2045, where there is a
limitation on line length. So the encoded user:password string has been
separated by a CRLF chars and this breaks the request

2013-06-04

vim下选择文本

有人在superuser问,如何在vim下实现sublime text的Expand selection to scope功能,http://superuser.com/questions/586076/vi-vim-alternative-to-sublimetexts-expand-selection-to-scope。运用vim下的text objects可以很轻松地实现这种功能。不过在这个帖子的回复中学了一招,如何选择当前文字所在的标签文本及其父标签。vat会选择光标所在文字和标签,v2at则会选择包括父标签在内的文本,依此类推。

vaw means a word
vas means a sentence
vap means a paragraph
va< means a <> block
va' means a single-quoted string
va" means a double-quoted string
vat means a tag

2013-05-21

SAP PI post installation steps

After a PI installation you have to configure your system. This is a mandatory post installation step called "Running the Configuration Wizard".

Before running the Wizard, it is recommended to update the following Java Software Components (SCs) to the highest available Support Package and Patch Level:

Life Cycle Management:

    LM CONFIGURATION (LMCFG)

    LM CONFIGURATION WIZARD (LMCTC)


Process Integration:

    MESSAGING SYSTEM SERVICE (MESSAGING)

    XI ADAPTER FRAMEWORK (SAPXIAF)

    XI TOOLS (SAPXITOOL)

    PI GUI (SAPXIGUI, only 7.11)

    PI GUILIB (SAPXIGUILIB, since 7.30)

    ESR (SAPXIESR)


The ABAP stack must have the same Support Package level as Java.

This Wizard Template is available since Release 7.10.

A prerequisite to run the Wizard is that the system was installed with the PI Installer (SAPInst). All PI services must be up and running.

For further information about the Configuration Wizard, see the following collective notes:

    SAP note 0923359 - Collective Note: Configuration Wizard (Release 7.0x)

    SAP note 1107808 - Collective Note: Configuration Wizard (Release 7.1x)

    SAP note 1362909 - Collective Note: Configuration Wizard (Release 7.3x)

    SAP note 1286428 - Configuration Wizard: PI Wizard Templates overview (Releases 7.1 and higher).

Solution

To run the CTC Wizard, start the SAP NetWeaver Administrator and navigate to "Configuration Management --> Scenarios --> Configuration Wizard". Depending on your release do the following:
Releases 7.10 / 7.11:

Select in the drop down list "Initial Configuration" or "All Configuration tasks -> NetWeaver initial setup".
Releases 7.30 / 7.31 and higher:

Click on link "Functional Unit Configuration UI". Select Functional Unit "SAP NetWeaver Process Integration (PI)". All required Functional Units are selected automatically. Press button "Enable automatically" to start the CTC Wizard. Pay attention to FAQ 1e and 1f.

FAQs:



Questions and Answers


Question 1: It is a prerequisite that 'all PI services must be up and running'. How can I check this?

Answer: Log on to NetWeaver Administrator and navigate to "Operation Management -> Systems -> Start and Stop" and select "Java JEE Services". Filter for Services with name "XPI". All of them must be started.


Question 1a: How can I check whether installation and configuration was successful?

Answer: With 7.10 SP7 and higher you can execute the "PI Self Test for NetWeaver" CTC Wizard template. See note 1286149 how to do that.


Question 1b: Can I execute the configuration steps manually? Where is this described?

Answer: Yes. This is described in the online documentation. For <your release> select "PI/Mobile/IdM 7.1" or "7.0(2004s)" or "2004".

http://help.sap.com/
-> SAP NetWeaver
-> SAP NetWeaver <your release>
-> <your language>
-> SAP NetWeaver Process Integration Library
-> Administrator's Guide
-> Configuration of SAP NetWeaver
-> Configuration Wizard
-> Wizard-Based Configuration
-> Usage Type Process Integration (PI)

For Release 7.3:
http://help.sap.com/saphelp_nw73/helpdata/en/57/f47fd4fe534a1a948476afb65dd983/content.htm

Question 1c: Where do I find the log files?

Answer: Start the NetWeaver Administrator and navigate to "Configuration Management --> Scenarios --> Configuration Wizard" and select in the drop down list "History of executed configuration tasks". You can download the protocol there. Attach this zip file an OSS ticket in case of deeper problems.


Question 1d: Is it mandatory to apply the highest available Support Package after a new installation (before running the CTC Wizard)?

Answer: Yes. Typically the installation is shipped with SP0. Before running any CTC configuration task, you have to update to the latest (currently) available Support Package. Especially in Release 7.3 this can lead to problems.


Question 1e: How can I restart the CTC Setup from the Functional Unit UI?

Answer: Select Functional Unit "SAP NetWeaver Process Integration (PI)" and press "Disable". Refresh the screen after that. Select the Functional Unit again and press "Enable automatically". Pay attention to FAQ 3.

Question 1f: Functional Unit "SAP NetWeaver Process Integration (PI)" has status "Running" and cannot be changed. What can I do?

Answer: Select in the drop-down menu of the Configuration Wizard UI (NWA --> Configuration Management --> Scenarios --> Configuration Wizard) entry 'Running Configuration Tasks'. Check whether another session is already running. Cancel or take over this session. If there is no entry, disable Function Unit "SAP NetWeaver Process Integration (PI)" directly in the Function Unit UI by pressing the "Disable" button. Restart from there.


Question 2: Does CTC support the usage of a remote SLD?

Answer: Yes, a remote SLD is supported. See note 954820 regarding the supported release dependencies. Pay attention to questions (2a)-(2d).


Question 2a: Do I have to execute any manual steps to run my PI system against a remote (central) SLD?

Answer: Yes. You have to create the PI Service users PIAFUSER, PIRWBUSER, PIISUSER, PIDIRUSER, PIREPUSER and PIAPPLUSER on the remote SLD manually and assign role/group SAP_SLD_CONFIGURATOR to them. To make the names unique, it is recommended to add the SID of the system, which connects, to the user name, e.g. PIAFUSER<SID>. Note that length of user names is restricted to 12 characters for an ABAP UME. Therefore you may also use the following short user names (which are also used as default names since 7.30):

    PIAF<SID>, PIRWB<SID>, PIIS<SID>, PIDIR<SID>, PIREP<SID> and PIAPPL<SID>


See notes 768148 and 939592 for further information (e.g. LDAP) and question (2b). For security reasons remote SLD user creation is on purpose not automated via the PI CTC Wizard.


Question 2b: I want to connect several PI systems to a central SLD. Must all PI service users have same name/password?

Answer: No. It is recommended to change the usernames of the PI service users in a way that they are unique in the landscape, e.g. by adding the SAP system ID (SID). See note 999962 how to do that.


Question 2c: During setup of the remote SLD I am asked for the password of users SLD_DS_<SID> and SLD_CL_<SID>, where SID is my local SID and not the one of the remote system. What do I have to enter here?

Answer: You have to change the user name into SLD_DS_<SID_remoteSLD> and SLD_CL_<SID_remoteSLD>. The input screen displays the local SID as default value, which is not correct in this context. You have to enter the SID of the remote SLD. The Wizard checks the user credentials when you press 'next'. Pay attention that for SLD Host and Port also the remote SLD's values have to be entered. See question (2d) regarding the Gateway configuration.


Question 2d: During setup of the remote SLD I am asked for the "Bridge Gateway Instance ID". What do I have to enter here?

Answer: You have to enter the 2-digit instance number of the gateway instance. It is assumed that it runs on the remote SLD host. The Gateway is used by the SLD Data Supplier Configuration (RZ70). Pay attention to note 1172161 how your SLD Gateway must be configured, especially if your SLD runs on WebAS Java (without ABAP stack). On plain AS Java systems the Gateway runs on the SCS instance whereas on double stack systems usually the central instance (CI) is used.

Example: SLD on double stack C11 with CI on 00 and SCS on 01

        SLD HTTP Host = <hostname>

        SLD HTTP Host = 50000

        Bridge Gateway InstanceID = 00

        Data Supplier User = SLD_DS_C11

        SLD Client User = SLD_CL_C11



Example: SLD on WebAS Java C11 with CI on 00 and SCS instance on 01.

        SLD HTTP Host = <hostname>

        SLD HTTP Host = 50000

        Bridge Gateway InstanceID = 01

        Data Supplier User = SLD_DS_C11

        SLD Client User = SLD_CL_C11



Question 2e: How can I check whether the SLD Self Registration of the PI components was successful?

Answer: Start the SLD, navigate to "Technical Systems" and select in the drop down list "Process Integration". There must be 6 entries for your new PI system. On a central SLD you may filter for the DB Host name:

    Adapter Engine on <db_host>

    Domain <db_host>

    Integration Directory on <db_host>

    Integration Repository on <db_host>

    Integration Server on <db_host>

    RWB on <db_host>



Question 2f: I am running NetWeaver PI 7.1. Can I connect it to a SLD with Release 7.0?

Answer: Yes. See SAP note 954820 regarding SLD compatibility and known incompatibilities. Note that you have to update your SLD "Component Repository Content" (CR Content), which is release independent. See SAP note 669669 for details.


Question 2g: My local SLD is not using the default HTTP port. The initial setup fails. What can I do?

Answer: Select "remote" SLD during the initial setup of the functional unit SLD and enter the respective port.


Question 3: Can I re-execute the "NetWeaver initial setup" template?

Answer: Yes. Pay attention that not all configuration steps are really re-executed in this case, for example the SLD and ESR Content import. If you have already done manual configuration changes, be aware that they might be overwritten.


Question 3a: I cannot execute the "NetWeaver initial setup" template on a Business by Design (ByD) system. When I select the drop down list 'All configuration tasks', a task "NetWeaver initial setup" is not displayed. Is this correct?

Answer: Yes. The "NetWeaver initial setup" template is only executed on NetWeaver systems. ByD systems have own configuration templates, which call the PI initial configuration on their own.


Question 4: I want to run my Integration Server not in the default client 001, but in a different one. Is this automated?

Answer: Yes. Since Release / Support Package

    SAP NetWeaver 7.10 SP08

    SAP NetWeaver 7.11 SP01, Patch Level 02 of Software Component "LM CONFIGURATION" (LMCFG01P Patch 02)

    SAP NetWeaver 7.30


this is fully automated. Prerequisite is that you have manually performed a client copy and changed the ABAP UME to the new client. This must have been done before (!) the CTC Wizard is executed. See questions (4a) and (4b) how to do that. For lower Support Packages this is different: There you have to execute first the CTC Wizard on default client 001 and after that the client copy. Further manual steps are required. See note 1115280 how to proceed in that case.


Question 4a: How can I change the UME Client in a 7.1 System?

Answer: Please refer to the online documentation:
http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03e11edc6a6e99e10000000a11466f/frameset.htm


Question 4b: Which source client and profile do I have to use for a client copy?

Answer: You have two options:

    copy client 001 (transaction SCCL) and use profile "SAP_UCUS"

    copy client 000 with profile "SAP_UCUS" and after that client 001 with profile "SAP_USER". The later is required to insure that j2ee_admin and SAPJSF user have correct role assignment in the new client.


Further details about the copy process are described in the installation guide (post installation step "Performing the Client Copy").


Question 4c: Can I change the Integration Server client for a PI system that already runs on client 001?

Answer: For already running, productive systems this is not supported. On freshly installed systems you can change the default client. This is also possible if you have already executed the PI initial setup Wizards accidentally on client 001. To do so the following steps have to be executed:

    Make a client copy (see FAQ 4b).

    Change the UME client (see FAQ 4a).

    On the old client (001): Start transaction 'SXMB_ADM --> Integration Engine Configuration' and change the 'Role of Business System' back to 'Application System' or 'Not Yet Configured'.

    Logon to the SLD (can be remote or local). Navigate to 'Technical Systems --> Technical System Types' and delete the respective 'AS Java' and 'AS ABAP' entities.

           Navigate to 'Technical Systems --> Process Integration' and delete the respective XI domain.

           Navigate from the SLD start page to 'Business Systems' and delete Business System INTEGRATION_SERVER_<SID>.

    Reboot the double stack system.

    Execute the Initial Setup again.

Question 5: Are there additional steps required to configure a "High Availability" setup?

Answer: Yes. See note 1052984 how to do that.

Question 6: Are there Demo Scenarios available for PI?

Answer: Yes, there are "Simple Use Case" and "Demo Example" scenarios for PI available in SDN:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/
b030691f-8b8b-2a10-5d94-8dd064dc2aa7
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/
00de46da-8b8b-2a10-a1a0-c328b2034b5e

Question 7: Do you provide a "Trouble Shooting Guide" for PI?

Answer: Yes. See note 1060264 how to find this guide.

Question 8: The Configuration steps

    'Configures the Product of the Technical System in the SLD' (sub step 'Configure product and component SAP_BASIS')

    'Configures the Integration Server in the SLD'

fail with error message:
"Error: ABAP technical system '<SID> on <DB host>\<SID>' not found."
This happens on a Microsoft SQL Server.

Answer: This problem is described in note 1237816. Please adjust the "j2ee/dbhost" profile parameter as described there and restart the CTC Wizard.

Question 9: I want to connect a Business Suite system with an XI/PI system. Are there any configuration templates available?

Answer: Yes, please refer to note 1178800.

Question 10: On "Business By Design" (ByD) Systems the PI CTC Wizard creates a Logical Web Service Port. How can I check whether the creation was successful?

Answer: Logon to clients 001 and 002 and start transaction SRT_TOOLS. Select "Display Web Service Runtime Configuration in Current Client" and mark the radio button "Web Service Consumer". In section "Search by Proxy Name and Logical Port" search with input field "Proxy Name" for "CO_THIRDPARTY_INT_SCNRIO_OUT".

Question 11: After the initial setup I receive the error message "Unable to log on to system xxx in language yyy with user PIRWBUSER" in the Runtime Workbench (RWB). Why this?

Answer: The logon language yyy is not activated in the ABAP system. Start transaction I18N and activate the language. Language activation is a separate post installation task that should have been executed before the CTC initial setup.

Question 12: I execute the "PI initial setup" CTC Wizard and get an error in step "Create Company Address in client 000". What to do?

Answer: See SAP note 1476425. Very likely your ABAP Administrator doesn't exist in client 000, has a different password or is locked.


Question 13: Why does the PI Initial Setup not set fully qualified host names (FQHN) by default?

Answer: This is implemented with Release 7.30 SP1 and higher. See SAP note 1476359 for further information. For lower Releases you can use the PI Full Qualified Host Name CTC Wizard (see SAP note 1320707) to set FQHN afterwards.


Question 14: Does the PI Initial Setup configure SSO?

Answer: It configures "Java --> Java" SSO, but not "Java --> ABAP" and "ABAP --> Java" SSO. The latter is required if you e.g. call ABAP transaction SXMB_IFR. To configure these directions between the stacks you have to execute Configuration Task "PI SSO Configuration". See SAP note 1473556 for details about this CTC Template.


Question 15: I install my PI system in a federated landscape. Are there any release dependencies?

Answer: Yes. The general rule is that your PI hub should have the highest release. See SAP note 1043047 for details.


Question 16: Does the PI NetWeaver Initial Setup configure SSL/HTTPS?


Answer: No. Your AS Java system must first be configured to support HTTPS/SSL. After that Exchange Profile property

    com.sap.aii.connect.secure_connections = messaging


has to be set. For further information access the SAP Library:

Release 7.10:
http://help.sap.com/saphelp_nwpi71/helpdata/en/e8/1f1041a0f6f16fe10000000a1550b0/frameset.htm

Release 7.11:
http://help.sap.com/saphelp_nwpi711/helpdata/en/48/a9bb457e28674be10000000a421937/frameset.htm

Release 7.30
http://help.sap.com/saphelp_nw73/helpdata/en/48/a9bb457e28674be10000000a421937/frameset.htm


Question 17: Step "Executing BAPI SWF_XI_BPM_AUTO_CUSTOMIZE" fails with message: "Error: BAPIRET2 SWF_XI_ADAPTER Error 203 Error  in BPM-Autocustomizing". What can I do?

Answer: See SAP note 1580460.

Question 18: Step "Imports the master XML" fails with message "Error: Profile locked by another local session, please retry later". What can I do?

Answer: See SAP note 1602945. You have to to deploy the latest available Patches of the Software Components:

    J2EE ENGINE LM-CORE (LM-CORE)

    MESSAGING SYSTEM SERVICE (MESSAGING)

    XI TOOLS (SAPXITOOL)

    XI ADAPTER FRAMEWORK (SAPXIAF)

    ESR (SAPXIESR)

Question 19: Can I execute the "PI Initial Setup" after a System Copy?

Answer: Yes. If you work with Release 7.3 you have to use the "Functional Unit UI" (http://<host>:<port>/sld/fun). Pay in that case attention to 'disable' the following FUNs before enabling "SAP NetWeaver Process Integration (PI)" again:

    "System Landscape Directory"

    "Java Foundation"

    "SAP NetWeaver Process Integration (PI)"

All three Functional Units have to be enabled from scratch.