模板书写注意事项:
1.填写的内容统一使用Arial字体,不可以使用【粗体】【斜体】等特殊式样
2.使用标签时,标签前后不可以有【空格】等特殊字符。
3.所有写入模板的内容,大小写敏感。
示例下载地址如下:
/Files/xggc63/JXISDemo.zip
posted @
2012-09-25 14:29 鲍国钰 阅读(406) |
评论 (0) |
编辑 收藏
摘要: 环境描述:F5负载均衡环境,两台win2003,64位操作系统web服务器,由于项目需求要求两台服务器某文件夹文件需要同步。①文件增量同步,即两个文件夹比较,取并集。②同名文件获取修改时间更新的文件作为母本进行覆盖同步。需要使用jcifs-1.3.16.jar官网下载地址如下:http://jcifs.samba.org参考实例代码自己写了个程序。
Code highl...
阅读全文
posted @
2011-09-22 16:52 鲍国钰 阅读(648) |
评论 (0) |
编辑 收藏
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
-- 建立存储过程
CREATE OR REPLACE PROCEDURE SQL_TO_CSV
![](/Images/OutliningIndicators/None.gif)
(
![](/Images/OutliningIndicators/None.gif)
P_QUERY IN VARCHAR2, -- PLSQL文
![](/Images/OutliningIndicators/None.gif)
P_DIR IN VARCHAR2, -- 导出的文件放置目录
![](/Images/OutliningIndicators/None.gif)
P_FILENAME IN VARCHAR2 -- CSV名
![](/Images/OutliningIndicators/None.gif)
)
![](/Images/OutliningIndicators/None.gif)
IS
![](/Images/OutliningIndicators/None.gif)
L_OUTPUT UTL_FILE.FILE_TYPE;
![](/Images/OutliningIndicators/None.gif)
L_THECURSOR INTEGER DEFAULT DBMS_SQL.OPEN_CURSOR;
![](/Images/OutliningIndicators/None.gif)
L_COLUMNVALUE VARCHAR2(4000);
![](/Images/OutliningIndicators/None.gif)
L_STATUS INTEGER;
![](/Images/OutliningIndicators/None.gif)
L_COLCNT NUMBER := 0;
![](/Images/OutliningIndicators/None.gif)
L_SEPARATOR VARCHAR2(1);
![](/Images/OutliningIndicators/None.gif)
L_DESCTBL DBMS_SQL.DESC_TAB;
![](/Images/OutliningIndicators/None.gif)
P_MAX_LINESIZE NUMBER := 32000;
![](/Images/OutliningIndicators/None.gif)
BEGIN
![](/Images/OutliningIndicators/None.gif)
--OPEN FILE
![](/Images/OutliningIndicators/None.gif)
L_OUTPUT := UTL_FILE.FOPEN(P_DIR, P_FILENAME, 'W', P_MAX_LINESIZE);
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--DEFINE DATE FORMAT
![](/Images/OutliningIndicators/None.gif)
EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_DATE_FORMAT=''YYYY-MM-DD HH24:MI:SS''';
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--OPEN CURSOR
![](/Images/OutliningIndicators/None.gif)
DBMS_SQL.PARSE( L_THECURSOR, P_QUERY, DBMS_SQL.NATIVE );
![](/Images/OutliningIndicators/None.gif)
DBMS_SQL.DESCRIBE_COLUMNS( L_THECURSOR, L_COLCNT, L_DESCTBL );
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--DUMP TABLE COLUMN NAME
![](/Images/OutliningIndicators/None.gif)
FOR I IN 1 .. L_COLCNT LOOP
![](/Images/OutliningIndicators/None.gif)
UTL_FILE.PUT( L_OUTPUT, L_SEPARATOR || '”' || L_DESCTBL(I).COL_NAME || '”' );
![](/Images/OutliningIndicators/None.gif)
DBMS_SQL.DEFINE_COLUMN( L_THECURSOR, I, L_COLUMNVALUE, 4000 );
![](/Images/OutliningIndicators/None.gif)
L_SEPARATOR := ',';
![](/Images/OutliningIndicators/None.gif)
END LOOP;
![](/Images/OutliningIndicators/None.gif)
UTL_FILE.NEW_LINE( L_OUTPUT );
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--EXECUTE THE QUERY STATEMENT
![](/Images/OutliningIndicators/None.gif)
L_STATUS := DBMS_SQL.EXECUTE(L_THECURSOR);
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--DUMP TABLE COLUMN VALUE
![](/Images/OutliningIndicators/None.gif)
WHILE ( DBMS_SQL.FETCH_ROWS(L_THECURSOR) > 0 ) LOOP
![](/Images/OutliningIndicators/None.gif)
L_SEPARATOR := '';
![](/Images/OutliningIndicators/None.gif)
FOR I IN 1 .. L_COLCNT LOOP
![](/Images/OutliningIndicators/None.gif)
DBMS_SQL.COLUMN_VALUE( L_THECURSOR, I, L_COLUMNVALUE );
![](/Images/OutliningIndicators/None.gif)
UTL_FILE.PUT( L_OUTPUT, L_SEPARATOR || '”' ||
![](/Images/OutliningIndicators/None.gif)
TRIM(BOTH ' ' FROM REPLACE(L_COLUMNVALUE,'”','””')) || '”');
![](/Images/OutliningIndicators/None.gif)
L_SEPARATOR := ',';
![](/Images/OutliningIndicators/None.gif)
END LOOP;
![](/Images/OutliningIndicators/None.gif)
UTL_FILE.NEW_LINE( L_OUTPUT );
![](/Images/OutliningIndicators/None.gif)
END LOOP;
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--CLOSE CURSOR
![](/Images/OutliningIndicators/None.gif)
DBMS_SQL.CLOSE_CURSOR(L_THECURSOR);
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
--CLOSE FILE
![](/Images/OutliningIndicators/None.gif)
UTL_FILE.FCLOSE( L_OUTPUT );
![](/Images/OutliningIndicators/None.gif)
EXCEPTION
![](/Images/OutliningIndicators/None.gif)
WHEN OTHERS THEN
![](/Images/OutliningIndicators/None.gif)
RAISE;
![](/Images/OutliningIndicators/None.gif)
END;
/
![](/Images/OutliningIndicators/None.gif)
-- 创建存放文件的目录
CREATE OR REPLACE DIRECTORY MYDIR AS 'C:\';
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
-- 执行块
begin
![](/Images/OutliningIndicators/None.gif)
sql_to_csv('select * from au_jxs ','MYDIR','EXAMPLE.CSV');
![](/Images/OutliningIndicators/None.gif)
end;
/
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
注意:生成的文件名,定义的directory名字要字母大写。
posted @
2011-09-13 17:07 鲍国钰 阅读(6518) |
评论 (0) |
编辑 收藏
默认weblogic中控制台启动之后会在命令行中标准输出一些信息,在没有使用log4j的情况下,想要获取在控制台输出的信息需要进行一些设置
打开C:\bea\user_projects\domains\域名\startWebLogic.cmd文件
set DOMAIN_HOME=C:\bea\user_projects\domains\base_domain_second
call "%DOMAIN_HOME%\bin\startWebLogic.cmd" %*
修改call这行为如下代码
call "%DOMAIN_HOME%\bin\startWebLogic.cmd" 1> stdout.log 2> stderr.log%*
也可以这样写
call "%DOMAIN_HOME%\bin\startWebLogic.cmd" 1> c:\stdout.log 2> c:\stderr.log%*
重启服务,控制台信息就被转移到你指定的文件中了。希望对大家有所帮助。
使用过程中发现重启服务会出现日志覆盖的情况
解决思路如下:
在startWebLogic.cmd文件中增加时间相关的字符串,拼接成文件名,保证每次重启的时候文件不会重名
具体代码如下:
// 设置 yyyy_mm_dd 格式的日期
set sbtmpdate=%date:~0,4%_%date:~5,2%_%date:~8,2%
// 设置 HHmmss 格式的时间
set sbtmptime=%time:~0,2%%time:~3,2%%time:~6,2%
// 随机数
set randomtmp=%random%
set r=%sbtmpdate%_%sbtmptime%.%randomtmp%
// 将变量赋值到文件名中
call "%DOMAIN_HOME%\bin\startWebLogic.cmd" 1>stdMsg-%r%.log 2>stdErr-%r%.log%*
posted @
2011-01-21 13:28 鲍国钰 阅读(1792) |
评论 (0) |
编辑 收藏
环境
JDK1.5.0_06、Weblogic9.2、Shark2.4-8-25、Windows2008
项目在使用的时候,登录正常,但是走工作流程的时候就抛出异常,
java.lang.NoSuchMethodError: org.mozilla.javascript.Context.toType(Ljava/lang/Ob
ject;Ljava/lang/Class;)Ljava/lang/Object;
at org.enhydra.shark.scripting.JavaScriptEvaluator.evaluateExpression(Ja
vaScriptEvaluator.java:84)
at org.enhydra.shark.scripting.JavaScriptEvaluator.evaluateCondition(Jav
aScriptEvaluator.java:44)
at org.enhydra.shark.WfProcessImpl.getTransFrom(WfProcessImpl.java:1334)
![](/Images/OutliningIndicators/None.gif)
at org.enhydra.shark.WfProcessImpl.queueNext(WfProcessImpl.java:1057)
at org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:751)
at org.enhydra.shark.WfProcessImpl.activity_complete(WfProcessImpl.java:
972)
at org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:443)
at org.enhydra.shark.WfActivityImpl.complete(WfActivityImpl.java:368)
at org.enhydra.shark.SharkUtilities.changeActivityState(SharkUtilities.j
ava:1979)
at org.enhydra.shark.WfActivityWrapper.change_state(WfActivityWrapper.ja
va:384)
at com.code.SharkWfUtils.setActivity(SharkWfUtils.java:430)
at com.servlet.wfServlet.doGet(wfServlet.java:459)
at com.servlet.wfServlet.doPost(wfServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3214)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
org.enhydra.shark.api.RootException: Result cannot be evaluated
at org.enhydra.shark.scripting.JavaScriptEvaluator.evaluateExpression(Ja
vaScriptEvaluator.java:107)
at org.enhydra.shark.scripting.JavaScriptEvaluator.evaluateCondition(Jav
aScriptEvaluator.java:44)
at org.enhydra.shark.WfProcessImpl.getTransFrom(WfProcessImpl.java:1334)
![](/Images/OutliningIndicators/None.gif)
at org.enhydra.shark.WfProcessImpl.queueNext(WfProcessImpl.java:1057)
at org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:751)
at org.enhydra.shark.WfProcessImpl.activity_complete(WfProcessImpl.java:
972)
at org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:443)
at org.enhydra.shark.WfActivityImpl.complete(WfActivityImpl.java:368)
at org.enhydra.shark.SharkUtilities.changeActivityState(SharkUtilities.j
ava:1979)
at org.enhydra.shark.WfActivityWrapper.change_state(WfActivityWrapper.ja
va:384)
at com.code.SharkWfUtils.setActivity(SharkWfUtils.java:430)
at com.servlet.wfServlet.doGet(wfServlet.java:459)
at com.servlet.wfServlet.doPost(wfServlet.java:521)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
tyHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:283)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
a:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:3214)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
ervletContext.java:1983)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
ontext.java:1890)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
ava:1344)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.NoSuchMethodError: org.mozilla.javascript.Context.toType(Lj
ava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;
at org.enhydra.shark.scripting.JavaScriptEvaluator.evaluateExpression(Ja
vaScriptEvaluator.java:84)
26 more
解压缩C:\bea\weblogic92\server\lib目录下的weblogic.jar发现项目中使用的js.jar包名与weblogic.jar下的包名冲突,比较其中的class文件发现数量不同,
经过反编译比较发现,具体的方法和变量也多少有所不同。
解决方式,将js.jar下的class文件覆盖到weblogic.jar下的对应包下面,然后再次打包成jar包,放到C:\bea\weblogic92\server\lib目录下,重新启动weblogic对应的域。
问题解决了。
欢迎交流。
posted @
2011-01-14 16:15 鲍国钰 阅读(2761) |
评论 (0) |
编辑 收藏
最近需要部署一个Web应用,由于使用了较多的JS文件和XML文件,所以在加载的时候就会产生加载文件数量和体积过于庞大的问题
如果是部署在Tomcat下可以轻松解决,在Tomcat安装目录下的conf文件夹下的server.xml文件中找到节点
1
<Connector port="8080" protocol="HTTP/1.1" maxHttpHeaderSize="8192"
2
maxThreads="150" connectionTimeout="20000"
3
redirectPort="8443" disableUploadTimeout="true" URIEncoding="utf-8"
4
compression="on"
5
compressionMinSize="500"
6
noCompressionUserAgents="gozilla, traviata"
7
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" /> compression属性为on时表示启用gzip压缩
compressionMinSize属性表示文件大小达到多少字节时进行gzip压缩,如compressionMinSize="500" 表示大于500字节的文件进行gzip压缩
noCompressionUserAgents表示不支持gzip压缩
compressableMimeType进行gzip压缩的文件类型
Weblogic没有找到支持gzip压缩的相关配置,所以决定采用过滤器
在web.xml文件中做如下配置
1
<!-- GZIPFilter Definition -->
2
<filter>
3
<filter-name>GZIPFilter</filter-name>
4
<filter-class>
5
com.tacitknowledge.filters.gzipfilter.GZIPFilter
6
</filter-class>
7
</filter>
8
<filter-mapping>
9
<filter-name>GZIPFilter</filter-name>
10
<url-pattern>*.js</url-pattern>
11
</filter-mapping>
12
<filter-mapping>
13
<filter-name>GZIPFilter</filter-name>
14
<url-pattern>*.xml</url-pattern>
15
</filter-mapping> 稍后会给出gzipfilter示例工程
将工程下classes文件夹下的文件拷贝到自己的工程下
将工程下的tk-filters.properties文件拷贝到classes根目录下 修改GZIPFilter.Enabled和GZIPFilter.LogStats的值为true表示启用gzip压缩
做如上的配置,如果需要压缩的更多类型的文件,可以增加<filter-mapping>节点进行相应的设置就可以了
然后采用IE浏览器采用httpwatch软件进行访问网站速度和下载数量大小的检测,FireFox加载httpfox插件,谷歌浏览器使用Speed Tracer插件
一般都可以压缩至原来大小的1/3.
示例工程下载地址
http://public.bay.livefilestore.com/y1p3-WBg1MuLT4pREa8b0maeFpmyKRMWVtu7_ymXPW0Q2YLdIf-uNl1npPNAtqlmvnTg0t4xcm9PZbMeHTVnGa-5w/gzipfilter.rar?download&psid=1
IE用httpwatch下载地址
http://public.bay.livefilestore.com/y1p3-WBg1MuLT7FmmmU5RUryPPrskGbFI3gOybJaapZSMKAV8ztlsxg81OyzXytfUecdfpTWRcGGGZl7dT0VemoGQ/HttpWatchPro-v6.014.rar?download&psid=1谷歌用Speed Tracer插件下载地址
http://public.bay.livefilestore.com/y1p3-WBg1MuLT7FmmmU5RUryPPrskGbFI3gOybJaapZSMKAV8ztlsxg81OyzXytfUecdfpTWRcGGGZl7dT0VemoGQ/HttpWatchPro-v6.014.rar?download&psid=1有什么好的建议请给我留言,十分感谢。
posted @
2011-01-14 14:12 鲍国钰 阅读(5896) |
评论 (3) |
编辑 收藏
项目环境:
Weblogic9.2 、JDK1.5.0_06、SQLServer2005、shark2.4工作流引擎
两种方式:1.将项目打包成war文件;2。直接部署。
本文主要介绍第二种方式。
进入对应域的目录下,双击startWebLogic.cmd启动服务。
如: C:\bea\user_projects\domains\base_domain_second
![](/images/blogjava_net/xggc63/QQ.jpg)
下一步=>下一步=>下一步=>完成=>激活更改
这个时候出现如下的异常:
怀疑是字符集的问题,尝试将web.xml文件改成UTF-8字符集,未成功
再次尝试改成ANSI,通过,部署成功。
posted @
2011-01-14 11:32 鲍国钰 阅读(5446) |
评论 (2) |
编辑 收藏
摘要:
阅读全文
posted @
2011-01-14 09:46 鲍国钰 阅读(219) |
评论 (1) |
编辑 收藏