工作流下載地址http://sourceforge.net/project/downloading.php?group_id=70542&use_mirror=jaist&filename=jbpm-jpdl-suite-3.2.1.zip&5744684
sh在eclipse里面啟動tomcat+db2項(xiàng)目,報錯:不能找到db2包
解決方法:在eclipse 中配置tomcat中加入如下語句
-Djava.library.path=D:"Java"IBM"SQLLIB"BIN
Linux命令
查看文本
Vi
退出vi編輯
Esc -> :q
動態(tài)查看日志文件
Tail –f 文件名
Linux下命令啟動ldap
[root@sl /]# cd /etc/init.d/
[root@sl init.d]# pwd
/etc/init.d
[root@sl init.d]# ./ldap stop
停止 slapd: [ 確定 ]
[root@sl init.d]# ./ldap start
檢查 的配置文件:config file testing succeeded
啟動 slapd: [ 確定 ]
[root@sl init.d]# ./ldap restart
停止 slapd: [ 確定 ]
檢查 slapd 的配置文件:config file testing succeeded
啟動 slapd: [ 確定 ]
[root@sl init.d]# pwd
/etc/init.d
[root@sl init.d]#
方法二:
如果ldap服務(wù)器配置好了,用下面命令可以啟動
Service ldap restart
Service ldap start
Service ldap stop
在linux下查看ldap的調(diào)用方法
[root@sl init.d]# ./ldap help
用法:./ldap {start|stop|restart|status|condrestart}
org/hibernate/cfg/HbmBinder$SecondPass 錯誤
在練習(xí)SSH框架的時候出現(xiàn)如下錯誤:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryId' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
java.lang.NoClassDefFoundError: org/hibernate/cfg/HbmBinder$SecondPass
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at
原因是項(xiàng)目中hibernate.jar 和 hibernate-annotations.jar兩個包的版本低
解決方法:1、直接刪除hibernate-annotations.jar
2、將這兩個包替換為最新的
Windows下啟動ldap
Slapd –d 1
-ivf
-ivh
在linux下啟動ssh
/etc/init.d/./sshd restart
配置root用戶可否訪問
/etc/ssh/
Vi sshd_config
在linux下配置weblogic用戶域
[root@sl bin]# pwd
/bea/weblogic92/common/bin
[root@sl bin]# ls
commEnv.sh quickstart.sh stopPointBase.sh wlsifconfig.sh
config_builder.sh startManagedWebLogic.sh unpack.sh wlst.sh
config.sh startPointBaseConsole.sh upgrade.sh
pack.sh startPointBase.sh wlscontrol.sh
[root@sl bin]# ./config.sh
啟動監(jiān)聽 在oracle用戶下執(zhí)行
lsnrctl start
>192.168.1.242
現(xiàn)在好了。
[oracle@localhost ~]$ lsnrctl start
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 31-1月 -2007 15:12:34
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Starting /opt/oracle/9.2.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0.4.0 - Production
System parameter file is /opt/oracle/9.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/9.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date 31-1月 -2007 15:12:35
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /opt/oracle/9.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "futuredb" has 1 instance(s).
Instance "futuredb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
查看linux正在使用的端口命令 netstat -an
動態(tài)查看日志文件 tail -f 文件名
解壓tar文件 tar -xvf 文件名.tar
打包tar文件 tar -cvf 文件名.tar
解壓gz文件 gunzip 文件名.gz
解壓縮gz文件 gzip 文件名
解壓cpio文件 cpio -idmv < *.cpio
在Struts中使用Spring代理找不到其他Spring配置文件中的定義,是因?yàn)橄到y(tǒng)在啟動時候首先加載Struts對應(yīng)的Config文件,通知加載該Config配置的插件Spring配置文件,如果Struts中只配置了本模塊對應(yīng)的Spring配置文件,而本Spring配置文件中又用到了其他的Spring配置文件的話,就發(fā)生找不到其他Spring配置文件中定義的bean,這時要將所有用到的Spring配置文件都配置在該Struts對應(yīng)的Config文件中,在系統(tǒng)啟動時候同時加載。
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="/WEB-INF/classes/conf/hibernate-context.xml,/WEB-INF/classes/conf/governmentinfo-context.xml"/>
</plug-in>
在Struts中使用Spring代理,在Spring中配置Action的時候名稱應(yīng)該加上Struts的模塊名,例如:Kt 刊頭Action 在struts-config-governmentinfo.xml中定義的path名稱為 kt,將他配置到Spring配置文件中時候應(yīng)該加上Struts模塊名稱governmentinfo
<bean name="/governmentinfo/kt"
class="com.futuresoftware.oa.governmentinfo.web.action.KtAction">
<property name="kt_service">
<ref local="ktManager"/>
</property>
</bean>
Linux 下掛載移動硬盤
Mount –o iocharset=cp936 /dev/sdb1 /mnt/usb1
Umount /mnt/usb1
在myeclipse+struts+tomcat下啟動tomcat出現(xiàn)以下錯誤:
- Parsing error processing resource path
java.net.UnknownHostException: struts.apache.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
這是由于struts-config.xml中的dtd校驗(yàn)中的地址為http://struts.apache.org/dtds/struts-config_1_2.dtd,按照這個地址將struts-config_1_2.dtd下載后放到和struts-config.xml同一文件夾下,然后將struts-config.xml中替換為struts-config_1_2.dtd就可以了
解決方法1、將struts-config.xml文件中的命名空間<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_1.dtd">
中的1.2該為1.1就可以(這里項(xiàng)目用的是struts1.1)
Could not initialize proxy - the owning Session was closed
是因?yàn)?/span>hibernate session關(guān)閉了,由于lazy=true,action 中調(diào)用session.load()得到的對象是游離態(tài)的,不能修改,該方法要放在dao中
關(guān)于hibernate的lazy問題詳解(經(jīng)典)
Could not initialize proxy - the owning Session was closed (篇幅一)
2007-05-11 09:52
其實(shí)這個異常寫的非常之清楚,就是會話關(guān)閉,無法對Hibernate實(shí)體進(jìn)行操作。造成這樣的情況有很多,什么書寫錯誤啊,邏輯錯誤啊。 但就此說一下關(guān)于lazy機(jī)制: 延遲初始化錯誤是運(yùn)用Hibernate開發(fā)項(xiàng)目時最常見的錯誤。如果對一個類或者集合配置了延遲檢索策略,那么必須當(dāng)代理類實(shí)例或代理集合處于持久化狀態(tài)(即處于Session范圍內(nèi))時,才能初始化它。如果在游離狀態(tài)時才初始化它,就會產(chǎn)生延遲初始化錯誤。 ERROR LazyInitializer:63 - Exception initializing proxy 解決方法: 由于hibernate采用了lazy=true,這樣當(dāng)你用hibernate查詢時,返回實(shí)際為利用cglib增強(qiáng)的代理類,但其并沒有實(shí)際填充;當(dāng)你在前端,利用它來取值(getXXX)時,這時Hibernate才會到數(shù)據(jù)庫執(zhí)行查詢,并填充對象,但此時如果和這個代理類相關(guān)的session已關(guān)閉掉,就會產(chǎn)生種錯誤. failed to lazily initialize a collection of role: XXXXXXXX, no session or session was closed 此異常解決方案請察看本人博客(http://hi.baidu.com/kekemao1)的Hibernate異常中的《failed to lazily initialize a collection of role異常》 參考了: Hibernate對象關(guān)系映射提供延遲的與非延遲的對象初始化。非延遲加載在讀取一個對象的時候會將與這個對象所有相關(guān)的其他對象一起讀取出來。這有時會導(dǎo)致成百的(如果不是成千的話)select語句在讀取對象的時候執(zhí)行。這個問題有時出現(xiàn)在使用雙向關(guān)系的時候,經(jīng)常會導(dǎo)致整個數(shù)據(jù)庫都在初始化的階段被讀出來了。當(dāng)然,你可以不厭其煩地檢查每一個對象與其他對象的關(guān)系,并把那些最昂貴的刪除,但是到最后,我們可能會因此失去了本想在ORM工具中獲得的便利。
在Web層進(jìn)行延遲加載 幸運(yùn)的是,Spring框架為Hibernate延遲加載與DAO模式的整合提供了一種方便的解決方法。對那些不熟悉Spring與Hibernate集成使用的人,我不會在這里討論過多的細(xì)節(jié),但是我建議你去了解Hibernate與Spring集成的數(shù)據(jù)訪問。以一個Web應(yīng)用為例,Spring提供了OpenSessionInViewFilter和OpenSessionInViewInterceptor。我們可以隨意選擇一個類來實(shí)現(xiàn)相同的功能。兩種方法唯一的不同就在于interceptor在Spring容器中運(yùn)行并被配置在web應(yīng)用的上下文中,而Filter在Spring之前運(yùn)行并被配置在web.xml中。不管用哪個,他們都在請求將當(dāng)前會話與當(dāng)前(數(shù)據(jù)庫)線程綁定時打開Hibernate會話。一旦已綁定到線程,這個打開了的Hibernate會話可以在DAO實(shí)現(xiàn)類中透明地使用。這個會話會為延遲加載數(shù)據(jù)庫中值對象的視圖保持打開狀態(tài)。一旦這個邏輯視圖完成了,Hibernate會話會在Filter的doFilter方法或者Interceptor的postHandle方法中被關(guān)閉。下面是每個組件的配置示例:
<beans> Filter的配置 <web-app>
public Product getProduct(Integer productId) { public Integer saveProduct(Product product) { public void updateProduct(Product product) { 在業(yè)務(wù)邏輯層中使用延遲加載 即使在視圖外面,Spring框架也通過使用AOP 攔截器 HibernateInterceptor來使得延遲加載變得很容易實(shí)現(xiàn)。這個Hibernate 攔截器透明地將調(diào)用配置在Spring應(yīng)用程序上下文中的業(yè)務(wù)對象中方法的請求攔截下來,在調(diào)用方法之前打開一個Hibernate會話,然后在方法執(zhí)行完之后將會話關(guān)閉。讓我們來看一個簡單的例子,假設(shè)我們有一個接口BussinessObject:
public class BusinessObjectImpl implements BusinessObject {
當(dāng)businessObject被調(diào)用的時候,HibernateInterceptor打開一個Hibernate會話,并將調(diào)用請求傳遞給BusinessObjectImpl對象。當(dāng)BusinessObjectImpl執(zhí)行完成后,HibernateInterceptor透明地關(guān)閉了會話。應(yīng)用層的代碼不用了解任何持久層邏輯,還是實(shí)現(xiàn)了延遲加載。
最后,我們需要用J-Unit來測試我們的延遲加載程序。我們可以輕易地通過重寫TestCase類中的setUp和tearDown方法來實(shí)現(xiàn)這個要求。我比較喜歡用這個方便的抽象類作為我所有測試類的基類。
private SessionFactory sessionFactory; public void setUp() throws Exception { } protected Object getBean(String beanName) { public void tearDown() throws Exception { |
Html 屏蔽鼠標(biāo)右鍵:
<body oncontextmenu="self.event.returnValue=false">
啟動監(jiān)聽 在oracle用戶下執(zhí)行
lsnrctl start
>192.168.1.242
現(xiàn)在好了。
[oracle@localhost ~]$ lsnrctl start
LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 31-1月 -2007 15:12:34
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Starting /opt/oracle/9.2.0/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 9.2.0.4.0 - Production
System parameter file is /opt/oracle/9.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/9.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date 31-1月 -2007 15:12:35
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /opt/oracle/9.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/9.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "futuredb" has 1 instance(s).
Instance "futuredb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
查看linux正在使用的端口命令 netstat -an
動態(tài)查看日志文件 tail -f 文件名
解壓tar文件 tar -xvf 文件名.tar
打包tar文件 tar -cvf 文件名.tar
解壓gz文件 gunzip 文件名.gz
解壓縮gz文件 gzip 文件名
解壓cpio文件 cpio -idmv < *.cpio
1、 安全拷貝
Scp 文件名 IP:/目錄
注意:SSH必須啟動 SSH 端口22
2、 移動
Mv 文件名 路徑 將某個文件移動到某個路徑下
3、 刪除
Rm –rf /文件名 刪除文件或者文件夾 用-rf 命令將不提示徹底刪除
4、 oracle 狀態(tài)進(jìn)程
ps –eflgrep ora
5、 啟動oralce監(jiān)聽
lsnrctl start
6、查看oralce監(jiān)聽
Lsnrctl status
7、啟動oracle服務(wù)
進(jìn)入oralce 用戶
Sqlplus ‘/as sysdba’
Startup
Exit
8、查看所有IP
Ifconfig –a
9、查看oracle端口正常不
Netstat –an|grep 1521
10、登錄oracle sqlplus
在oracle目錄下
Sqlplus neme/password@sid_IP
11、查看命令
命令 –help
Man 命令
Info 命令
12、查看歷史
History |more
History 5
Html 禁止鼠標(biāo)右鍵
oncontextmenu="self.event.returnValue=false"
在Linux下安裝配置Oralce 安裝好Oracle 后在Oracle用戶下/home/Oracle目錄下用 vi .bash_profile 命令,在里面配置環(huán)境變量 # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH export ORACLE_BASE=/backup/oracle export ORACLE_HOME=/backup/oracle/product/10.2.0 export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/Apache/bin:$PATH export ORACLE_OWNER=oracle export ORACLE_SID=futureoa #export ORACLE_SID export ORACLE_TERM=xterm #export ORACLE_TERM export LD_ASSUME_KERNEL=2.6.9 #export THREADS_FLAG=native LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib export LD_LIBRARY_PATH export PATH=$PATH:$ORACLE_HOME/bin export NLS_LANG=AMERICAN_AMERICA.UTF8 #export LANG=en_US export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib export CLASSPATH unset USERNAME # Oracle Settings # Oracle Settings ~ ".bash_profile" 36L, 954C |
在啟動WebSphere應(yīng)用服務(wù)器的時候報告端口沖突。 使用命令建立“概要文件管理工具”中的“應(yīng)用服務(wù)器”即單元節(jié)點(diǎn) 命令D:"Java"IBM"WebSphere"AppServer"bin"ProfileManagement>pmt.bat可以打開建立“概要文件管理工具”的窗口 |
在Windows下刪除Websphere的服務(wù) 在注冊表中 運(yùn)行-regedit HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services HKEY_LOCAL_MACHINE/SYSTEM/ControlSet003/Services 下面找到IBMWAS61Service - DBF01A8E0E0F455Node03 Websphere的服務(wù)刪除就可以了 |
>啟動Oracle的命令是啥丫 啟動監(jiān)聽: lsnrctl start sqlplus '/as sysdba' startup
動態(tài)瀏覽vi 內(nèi)容 tail -f filename.txt |
linux 時間 顯示當(dāng)前時間 date 設(shè)置時間 date -s "2007-6-25 15:14:00" clock -w |
WebSphere 日志跟蹤${SERVER_LOG_ROOT}/SystemOut.log
在linux下設(shè)置ldap隨系統(tǒng)自動啟動 在終端命令行輸入 Ntsysv 在出現(xiàn)對界面中選中ldap就可以了 |