lizongbo at 618119.com 工作,生活,Android,前端,Linode,Ubuntu,nginx,java,apache,tomcat,Resin,mina,Hessian,XMPP,RPC

2007年12月7日

在Tomcat 6.0.14中安装配置awstats

Filed under: Apache,DNS,IP,Tomcat — 标签:, , , , — lizongbo @ 18:30

在Tomcat 6.0.x中配置awstats
需要下载的文件有:

perl : http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.822-MSWin32-x86-280952.msi
来源: http://www.activestate.com/store/activeperl/download/

http://update.cz88.net/soft/qqwry.rar
http://awstats.sourceforge.net/files/awstats-6.8.tar.gz

geoip插件相关:
http://www.maxmind.com/download/geoip/api/pureperl/Geo-IP-PurePerl-1.18.tar.gz
http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz
http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz

安装过程可参考

参考: http://blog.zhangjianfeng.com/article/317
PurePerl.pm的安装可参考:
http://topic.csdn.net/u/20070323/11/903dd121-10d8-42d2-b4eb-a6cb60a22e8a.html

其它配置可参考:
http://www.chedong.com/blog/archives/000410.html

http://blogger.org.cn/blog/more.asp?name=chenjiejacky&id=20464

安装perl之后,确认环境变量里PATH有perl的bin目录
Path=E:\oracle\product\10.2.0\client_1\bin;D:\Perl\bin;
D:\Java\jdk1.6.0_03\bin;E:\oracle\product\10.2.0\db_1\bin;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;
C:\Program Files\Microsoft SQL Server\80\Tools\BINN

1.为了控制查看awstats的权限,我在
E:\apache-tomcat-6.0.14\conf\tomcat-users.xml的内容配置为:

<?xml version=’1.0′ encoding=’utf-8′?>
<tomcat-users>
<role rolename=”awstats”/>
<user username=”awstats” password=”awstats” roles=”awstats”/>
</tomcat-users>

2.由于权限限制

E:\apache-tomcat-6.0.14\webapps\awstats\META-INF\context.xml,内容为:

<!– tomcat 6.0 need privileged is true for CGIServlet –>
<Context reloadable=”true” privileged=”true” >

</Context>

(注意目录是META-INF,不是WEB-INF)否则启动的时候会出下面的错误信息:

[ERROR]main-org.apache.catalina.startup.HostConfig-Error deploying web application directory awstats
java.lang.SecurityException: Servlet of class org.apache.catalina.servlets.CGIServlet is privileged and cannot be loaded by this web application
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1134)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
3.配置web.xml,增加权限控制
web.xml的内容为:

<?xml version=”1.0″ encoding=”UTF-8″?>
<web-app xmlns=”http://java.sun.com/xml/ns/j2ee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd” version=”2.4″>
<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>clientInputTimeout</param-name>
<param-value>100</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi-bin</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
<!– Define reference to the user database for looking up roles –>
<resource-env-ref>
<description>
Link to the UserDatabase instance from which we request lists of
defined role names. Typically, this will be connected to the global
user database with a ResourceLink element in server.xml or the context
configuration file for the Manager web application.
</description>
<resource-env-ref-name>users</resource-env-ref-name>
<resource-env-ref-type>org.apache.catalina.UserDatabase</resource-env-ref-type>
</resource-env-ref>
<!– Define a Security Constraint on this Application –>
<security-constraint>
<web-resource-collection>
<web-resource-name>awstats status</web-resource-name>
<url-pattern>/cgi-bin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>awstats</role-name>
</auth-constraint>
</security-constraint>
<!– Define the Login Configuration for this Application –>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Awstats status,username: awstats,password: awstats</realm-name>
</login-config>
<!– Security roles referenced by this web application –>
<security-role>
<description>
The role that is required to log in to the Manager Application
</description>
<role-name>awstats</role-name>
</security-role>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
</web-app>

4.调整文件夹目录

E:\APACHE~1.14\webapps\awstats 的目录

007-12-07 18:14 <DIR> .
007-12-07 18:14 <DIR> ..
007-12-07 08:48 <DIR> classes
007-12-07 08:48 <DIR> css
007-12-07 08:48 <DIR> docs
007-12-07 08:48 <DIR> icon
007-12-07 08:49 211 index.jsp
007-12-07 08:48 <DIR> js
007-12-07 08:56 <DIR> logs
007-12-07 08:48 <DIR> META-INF
007-11-24 22:05 6,721 README.TXT
007-12-07 08:47 <DIR> WEB-INF

E:\APACHE~1.14\webapps\awstats\WEB-INF 的目录

2007-12-07 08:47 <DIR> .
2007-12-07 08:47 <DIR> ..
2007-12-07 08:56 <DIR> cgi-bin
2007-12-07 08:47 <DIR> tools
2007-12-07 08:42 2,389 web.xml

E:\APACHE~1.14\webapps\awstats\WEB-INF\cgi-bin 的目录

007-12-07 08:56 <DIR> .
007-12-07 08:56 <DIR> ..
006-02-09 06:26 5,407 awredir.pl
007-12-07 08:56 2,343 awstats.localhost.conf
007-12-07 08:55 2,340 awstats.localhost.conf.bak
007-11-24 03:18 60,544 awstats.model.conf
007-11-24 03:18 556,625 awstats.pl
007-12-07 08:56 13,569 awstats122007.localhost.txt
006-07-27 09:37 1,847 awstatsext.conf
007-12-07 08:56 678 dnscachelastupdate.localhost.hash
007-12-03 12:18 1,079,842 GeoIP.dat
007-09-13 04:08 2,020,543 GeoIPASNum.dat
007-12-03 16:25 25,914,398 GeoLiteCity.dat
007-12-07 08:48 <DIR> lang
007-12-07 08:48 <DIR> lib
007-03-15 14:35 184 perl插件安装说明.txt
007-12-07 08:54 <DIR> plugins
007-12-05 17:58 6,812,739 QQWry.Dat

E:\APACHE~1.14\webapps\awstats\WEB-INF\cgi-bin\plugins 的目录

2007-12-07 08:54 <DIR> .
2007-12-07 08:54 <DIR> ..
2006-02-09 06:26 3,682 clusterinfo.pm
2006-02-09 06:26 2,960 decodeutfkeys.pm
2007-12-07 08:48 <DIR> example
2007-12-07 08:54 <DIR> geo
2006-05-06 11:51 7,203 geoip.pm
2006-02-09 06:26 3,736 geoipfree.pm
2006-09-04 15:04 112,953 geoip_city_maxmind.pm
2006-05-06 11:54 16,885 geoip_isp_maxmind.pm
2006-05-06 11:54 16,919 geoip_org_maxmind.pm
2006-05-06 11:54 22,283 geoip_region_maxmind.pm
2004-01-01 05:41 5,074 graphapplet.pm
2006-02-09 06:26 5,206 hashfiles.pm
2005-02-19 21:50 7,169 hostinfo.pm
2006-02-09 06:26 2,439 ipv6.pm
2005-04-11 05:08 2,501 qqhostinfo.pm
2005-03-28 11:29 7,603 qqwry.pl
2006-02-09 06:26 4,689 rawlog.pm
2006-02-09 06:26 1,890 timehires.pm
2006-02-09 06:26 2,954 timezone.pm
2006-07-30 03:20 8,212 tooltips.pm
2006-02-09 06:26 4,799 urlalias.pm
2006-02-09 06:26 3,616 userinfo.pm

我的awstats.localhost.conf配置如下:

Include=”common.conf”
PageCode=”GB2312″ # UTF-8
LogFile=”E:/apache-tomcat-6.0.14/logs/access.log”
SiteDomain=”618119.com”
LoadPlugin=”decodeutfkeys”
LoadPlugin=”hashfiles”
LoadPlugin=”geoip”
LoadPlugin=”tooltips”
LoadPlugin=”qqhostinfo”
LoadPlugin=”geoip_city_maxmind GEOIP_STANDARD GeoLiteCity.dat”
LoadPlugin=”geoip_org_maxmind GEOIP_STANDARD GeoIPASNum.dat”
LogFormat=1
HostAliases=”localhost 618119.com www.618119.com
DirIcons=”/awstats/icon”
DNSLookup=1
DirData=”.”
DirCgi=”/cgi-bin”
AllowToUpdateStatsFromBrowser=1

Include=”awstatsext.conf”

一个非常有用的参考地址: http://www.antezeta.com/awstats.html

扩展设置:
# form http://www.antezeta.com/awstats.html

ExtraSectionName1=”Google Searches – Top 50″
ExtraSectionCodeFilter1=”200 304″
ExtraSectionCondition1=”REFERER,(.*www\.google.*)”
ExtraSectionFirstColumnTitle1=”Search”
ExtraSectionFirstColumnValues1=”REFERER,p=([^&]+)||REFERER,q=([^&]+)||REFERER,as_p=([^&]+)||REFERER,as_q=([^&]+)”
ExtraSectionFirstColumnFormat1=”<a href=’http://www.google.cn/search?q=%s’ title=’Click to execute search’>%s</a>”
ExtraSectionStatTypes1=PHBL
ExtraSectionAddAverageRow1=0
ExtraSectionAddSumRow1=1
MaxNbOfExtra1=50
MinHitExtra1=1

ExtraSectionName2=”Google crawls – Top 50″
ExtraSectionCodeFilter2=”200 304″
ExtraSectionCondition2=”UA,(.*Googlebot.*)”
ExtraSectionFirstColumnValues2=”URL,(.*)”
ExtraSectionFirstColumnFormat2=”<a href=’http://618119.com%s’ title=’Item Crawled’>%s</a>”
ExtraSectionStatTypes2=PHBL
ExtraSectionAddAverageRow2=0
ExtraSectionAddSumRow2=1
MaxNbOfExtra2=50
MinHitExtra2=1

ExtraSectionName3=”sitemap.xml.gz downloads by Useragent”
ExtraSectionCodeFilter3=”200 304″
ExtraSectionCondition3=”URL,(^\/sitemap\.xml\.gz)”
ExtraSectionFirstColumnTitle3=”UA”
ExtraSectionFirstColumnValues3=”UA,(.*)”
ExtraSectionStatTypes3=HBL
ExtraSectionAddAverageRow3=0
ExtraSectionAddSumRow3=1
MaxNbOfExtra3=10
MinHitExtra3=1

ExtraSectionName4=”Referring Sites by domain – Top 25″
ExtraSectionCodeFilter4=”200 304″
# Filter on ANY REFERER except “mysite”. Change mysite to your domain name.
ExtraSectionCondition4=”REFERER,^(?!http:\/\/www\.618119\.com)”
ExtraSectionFirstColumnTitle4=”Site”
ExtraSectionFirstColumnValues4=”REFERER,^[hH][tT][tT][pP]:\/\/([^\/]+)\/”
ExtraSectionFirstColumnFormat4=”<a href=’http://%s/’ rel=’nofollow’ title=’http://%s/ [new window]’>%s</a>”
ExtraSectionStatTypes4=PHL
ExtraSectionAddAverageRow4=1
ExtraSectionAddSumRow4=1
MaxNbOfExtra4=25
MinHitExtra4=1

ExtraSectionName5=”Top 30 RSS Readers/Spiders”
ExtraSectionCodeFilter5=”200 304″
ExtraSectionCondition5=”URL,\.xml|\.rdf|\.rss|\/feed”
ExtraSectionFirstColumnTitle5=”RSS Reader/Spider”
ExtraSectionFirstColumnValues5=”UA,(.*)”
ExtraSectionStatTypes5=HBL
ExtraSectionAddAverageRow5=1
ExtraSectionAddSumRow5=1
MaxNbOfExtra5=30
MinHitExtra5=1

ExtraSectionName6=”Downloads (diff,doc,pdf,rtf,sh,tgz,zip) – Top 10″
ExtraSectionCodeFilter6=”200 304″
ExtraSectionCondition6=”URL,(.*((\.diff)|(\.doc)|(\.pdf)|(\.rtf)|(\.sh)|(\.tgz)|(\.zip)))”
ExtraSectionFirstColumnTitle6=”Download”
ExtraSectionFirstColumnValues6=”URL,(.*)”
ExtraSectionFirstColumnFormat6=”%s”
ExtraSectionStatTypes6=HBL
ExtraSectionAddAverageRow6=0
ExtraSectionAddSumRow6=1
MaxNbOfExtra6=10
MinHitExtra6=1

2007年12月6日

给wordpress加上记录Combined格式日志的功能

Filed under: Apache,Web Server — 标签:, , , , — lizongbo @ 18:23

由于我是合租的web主机,因此开通的ftp里没权限看到站点的access.log,

由于wordpress是通过.htaccess中配置的urlrewrite将http请求重定向到index.php 这个入口,

因此只要在index.php里加上记录日志的操作,基本上大部分请求都可以记录下来,

查了下资料,没看见现成的代码,于是对照着 Combined各式的日志,

自己写了一段代码来实现这个功能.

代码如下:

[code]

<?php
/* Short and sweet */
define(‘WP_USE_THEMES’, true);
/**
为我的wordpress增加记录web日志的功能
author: lizongbo
site: http://618119.com
*/

$webaccesslog=”webaccess”.gmdate(“Y-m-d”).”.log”;
$accesslog=$_SERVER[‘REMOTE_ADDR’].” – – “.gmdate(“[d/M/Y:H:i:s +0800] “);
$accesslog=$accesslog.”\””.$_SERVER[“REQUEST_METHOD”].” “.$_SERVER[“REQUEST_URI”].” “;
$accesslog=$accesslog.$_SERVER[“SERVER_PROTOCOL”].”\””;
$accesslog=$accesslog.” 200 2007 \””;
if(!empty($_SERVER[“HTTP_REFERER”])){
$accesslog=$accesslog.$_SERVER[“HTTP_REFERER”];
}else{
$accesslog=$accesslog.”-“;
}
$accesslog=$accesslog.”\” \””.$_SERVER[“HTTP_USER_AGENT”].”\””.”\r\n”;
$webaccess=fopen($webaccesslog,”a”);
fwrite($webaccess,$accesslog);
/*下面的写法 io 操作太多,被废弃了
fwrite($webaccess,$_SERVER[‘REMOTE_ADDR’]);
fwrite($webaccess,” – – “);
fwrite($webaccess,gmdate (“[d/M/Y:H:i:s +0800] “));//不知道怎么加时区,于是写死了
fwrite($webaccess,”\””);
fwrite($webaccess,$_SERVER[“REQUEST_METHOD”]);
fwrite($webaccess,” “);
fwrite($webaccess,$_SERVER[“REQUEST_URI”]);
fwrite($webaccess,” “);
fwrite($webaccess,$_SERVER[“SERVER_PROTOCOL”]);
fwrite($webaccess,”\””);
fwrite($webaccess,” 200 2007 \””);//强行写死了状态码和内容长度
if(!empty($_SERVER[“HTTP_REFERER”])){
fwrite($webaccess,$_SERVER[“HTTP_REFERER”]);
}else{
fwrite($webaccess,”-“);
}
fwrite($webaccess,”\” \””);
fwrite($webaccess,$_SERVER[“HTTP_USER_AGENT”]);
fwrite($webaccess,”\””);
fwrite($webaccess,”\r\n”);
*/

fclose($webaccess);
require(‘./wp-blog-header.php’);
?>

[/code]

这样,记录下来的日志就可以通过ftp下载到本地,然后再用 awstats 进行分析了.

2007年11月20日

用JDBC连接Oracle 10g RAC遇到的问题

Filed under: DbVisualizer,Oracle,数据库 — 标签:, , , , , , , , , — lizongbo @ 08:56

数据库升级为Oracle 10g RAC,原有的连接方式下,出现如下错误:

出错信息:
– Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: “o
rg.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFacto
ry (Io 异常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERR=12505)(
ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))))”
at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnect
ion(QueryTagSupport.java:276)
at org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag
(QueryTagSupport.java:159)

于是根据网上的资料修改了JDBC的URL,正确jdbc的url为:

jdbc:oracle:thin:@(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.103)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.104)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = mydb.618119.com) ) )

或者:

jdbc:oracle:thin:@(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)
(HOST = db01.618119.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)
(HOST = db02.618119.com)(PORT = 1521))
(LOAD_BALANCE = yes)
(failover = yes)
(CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = mydb.618119.com) ) )

结果过依然存在问题:

偶尔会出现错误:

An error occurred while establishing the connection:
Type: java.sql.SQLException Error Code: 17002
Message:
Io 异常: Connection refused(DESCRIPTION=(ERR=1153)(VSNNUM=169869568)(ERROR_STACK=(ERROR=(CODE=1153)(EMFI=4)(ARGS='(ADDRESS=(PROTOCOL=TCP)(HOST=RAC02)(PORT=1521))’))(ERROR=(CODE=305)(EMFI=1))))

试了将驱动替换为10g的ojdbc14.jar.

然后再在DbVisualizer中试了很多次断开连接和重新链接,都还没出错.
但是在web页面中测试,还是经常出现获取不到数据库连接的情况.

在网上查询了很多资料,仍未能解决这个问题, 不得已,只好换成oci方式连接.
在jdbc客户端所在地服务器中,将TNSNAMES.ORA里本地服务名配置为
mydb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.103)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.104)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb.618119.com)
)
)

oci方式的jdbc url=”jdbc:oracle:oci:@mydb”;

获取数据库连接正常.

主要参考了以下资料 : http://www.ixdba.net/hbcms/article/97/244.html

http://dev2dev.bea.com.cn/bbs/thread.jspa?forumID=123&threadID=44660&messageID=264712

http://article.51edu.com/computer/shujuku/Oracle/200512/42391.html

http://www.dba-oracle.com/art_oramag_rac_taf.htm

http://www.koorka.com/download/free/Oracle_RAC_For_Windows_install.pdf

http://www.koorka.com/download/free/Oracle_RAC_For_Linux_install.pdf

update:

在使用oci模式进行连接时,整个虚拟机内只能有一份oracle的jdbc 驱动,并且所在的机器必须安装了oracle 的client,oracle client必须与驱动版本一致,即,如果是使用10g的jdbc驱动,则必须安装10g的 oracle client,需要Orace client的bin目录需要添加到环境变量的path中,例如:

Path=d:\oracle\product\10.2.0\client_1\bin;D:\Java\apache-ant-1.7.0\bin;D:\J ava\
jdk1.6.0_03\bin;D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32\Wbem;D:\Progr
am Files\Microsoft Network Monitor 3\;D:\PROGRA~1\F-Secure\Ssh;

因此在web应用中Oracle jdbc的驱动不能放在WEB-INF/lib目录下,而是要放到 server的lib目录下(例如Tomcat6的D:\Java\apache-tomcat-6.0.14\lib ,Tomcat5的D:\Java\apache-tomcat-5.5.25\common\lib) .

如果出现重复的oracle jdbc驱动文件(或者是多个不同版本的oracle jdbc驱动在一起) ,

则可能出现以下错误信息:

[code]

java.lang.UnsatisfiedLinkError: make_c_state
java.lang.UnsatisfiedLinkError: make_c_state
at oracle.jdbc.oci8.OCIDBAccess.make_c_state(Native Method)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:309)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:307)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:442)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)

[/code]

[code]

java.lang.UnsatisfiedLinkError: Native Library D:\oracle\ora92\bin\ocijdbc9.dll
already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1716)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
at java.lang.Runtime.loadLibrary0(Runtime.java:822)
at java.lang.System.loadLibrary(System.java:992)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:294)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:307)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:442)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:321)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)

[/code]

udate:

http://lhylj2.spaces.live.com/Blog/cns!7E417A90C3FE44A9!229.entry
这里提到换成 Oracle 9.0.2.4的jdbc驱动可以解决时而连不上的问题,我没有测试过 .

Older Posts »

Powered by WordPress