部落客廣告聯播

2009年5月21日 星期四

用Java壓縮/解壓縮Zip檔案

相當實用的文章:
[JAVA] zip壓縮 與 解壓縮

jBPM 3.2.6安裝後問題

jBPM 3.2.6安裝後登入web-console後發現,
所有資料表內的資料都被清空了,
要解決這個問題要修改 hibernate.cfg.xml 內的
<property name="hibernate.hbm2ddl.auto">create</property>
改為
<property name="hibernate.hbm2ddl.auto">update</property>

2009年5月19日 星期二

jBPM 3.2.6安裝於Tomcat 6 由eclipse啟動

1. 依
http://www.javaworld.com.tw/jute/post/view?bid=43&id=255869
安裝,並記得將build path 的output目錄設到/WEB-INF/classes並將hibernate.cfg.xml放到其中。

2. 接著參考
http://linliangyi2007.javaeye.com/blog/176339
step5的sql指令將user資料插入mysql
或使用下列sql指令:

INSERT INTO JBPM_ID_GROUP VALUES(2,'G','admin','security-role',NULL);
INSERT INTO JBPM_ID_GROUP VALUES(3,'G','user','security-role',NULL);
INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);

INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');
INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');
INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,2,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,3,3);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,2);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,2);
INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,5);


3. 另外若在jbpm_id_group裡面若有另外新增security-role,便須修改web.xml,如下範例:

....略....
<security-role>
<role-name>admin</role-name>
</security-role>
<security-role>
<role-name>user</role-name>
</security-role>
<security-role>
<role-name>participant</role-name>
</security-role>
....略....
<security-constraint>
<web-resource-collection>
<web-resource-name>Secure Area</web-resource-name>
<url-pattern>/app/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>user</role-name>
<role-name>admin</role-name>
<role-name>participant</role-name>
</auth-constraint>
</security-constraint>
....略....

上列的role-name對應到jbpm_id_group的name_

4.
ok ~