锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
榪欐槸寮傚父鐨勭涓琛岋紝鎸変互寰鐨勭粡楠岋紝絎竴琛屽簲璇ュ氨鏄棶棰樻墍鍦紝浣嗘槸瀹為檯涓婏紝浠庤繖琛屾潵鐪嬩綘鏍規(guī)湰涓嶇煡閬撻敊鍦ㄥ摢閲屻?br />
鍚庨潰鎺ヤ笅鏉ョ殑鏄細(xì)
Error creating bean with name 'basicProcessingFilter'
Cannot resolve reference to bean 'authenticationManager'
while setting bean property 'authenticationManager';
nested exception is Error creating bean with name 'authenticationManager'
Cannot resolve reference to bean 'casAuthenticationProvider'
while setting bean property 'providers' with key [0];
nested exception is : Error creating bean with name 'casAuthenticationProvider'
Cannot resolve reference to bean 'statelessTicketCache'
while setting bean property 'statelessTicketCache';
nested exception is: Error creating bean with name 'statelessTicketCache'
Error setting property values;
nested exception is
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1:
TypeMismatchException:
Failed to convert property value of type [net.sf.ehcache.Cache]
to required type [net.sf.ehcache.Ehcache] for property 'cache'
Error creating bean with name 'authenticationManager'
Cannot resolve reference to bean 'casAuthenticationProvider'
while setting bean property 'providers' with key [0];
nested exception is
Error creating bean with name 'casAuthenticationProvider'
Cannot resolve reference to bean 'statelessTicketCache' while setting bean property 'statelessTicketCache';
nested exception is
Error creating bean with name 'statelessTicketCache'
Error setting property values;
nested exception is
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [net.sf.ehcache.Cache]
to required type [net.sf.ehcache.Ehcache] for property 'cache'
Error creating bean with name 'casAuthenticationProvider'
Cannot resolve reference to bean 'statelessTicketCache'
while setting bean property 'statelessTicketCache';
nested exception is
Error creating bean with name 'statelessTicketCache'
Error setting property values;
nested exception is PropertyAccessExceptionsException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1:TypeMismatchException:
Failed to convert property value of type [net.sf.ehcache.Cache]
to required type [net.sf.ehcache.Ehcache] for property 'cache'
Error creating bean with name 'statelessTicketCache'
Error setting property values;
nested exception is PropertyAccessExceptionsException;
nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [net.sf.ehcache.Cache]
to required type [net.sf.ehcache.Ehcache] for property 'cache'
PropertyAccessExceptionsException;
nested PropertyAccessException details (1) are:
PropertyAccessException 1:
ypeMismatchException:
Failed to convert property value of type [net.sf.ehcache.Cache]
to required type [net.sf.ehcache.Ehcache] for property 'cache'
涓婇潰鐨勫唴瀹規(guī)槸鎴戝皢閲嶅淇℃伅鍘繪帀錛屽茍鍒嗗潡鍚庣殑緇撴灉銆?br />
浠庢姤閿欐満鍒跺彲浠ョ湅鍑烘潵錛宻pring鍑虹幇寮傚父涓嶅悓浜庢櫘閫氱殑java寮傚父錛屾垜浠煡寮傚父鐨勪範(fàn)鎯竴鑸槸鍏蟲敞絎竴琛岋紝浣嗘槸sping鎭版伆鐩稿弽錛岃鍦╯ping涓煡閿欙紝浣犲繀欏誨垎瑙d粬錛屽洜涓簊pring鐨勫祵濂楀眰嬈℃瘮杈冨錛屽畠鎶ラ敊鏄粠鏈楂樺眰鎶ヨ搗錛岀劧鍚庨愬眰寰涓嬶紝姣忎釜灞傛閮戒細(xì)瑕佹姤閿欙紝鐩村埌鏈緇堝嚭閿欑殑鍦版柟錛屽洜姝ゆ煡sping鐨勯敊蹇呴』閫愬眰鍒嗚В鍒版渶搴曞眰錛岄偅閲屾墠鏄湡姝e嚭閿欑殑鍦版柟銆?br />
OK錛岀幇鍦ㄧ湅鍑烘潵浜嗭紝鐪熸閿欒鐨勫師鍥犳槸錛?br />
Failed to convert property value of type [net.sf.ehcache.Cache]
to required type [net.sf.ehcache.Ehcache] for property 'cache'
鎴戝嚭鐜拌繖涓敊璇殑鍘熷洜鏄嬌鐢ㄤ簡Acegi 1.0.5錛屽畠鏈韓鑷甫浜唀hcache 1.2.4.jar
浣嗘槸鎴戝悓鏃惰繕浣跨敤浜唄ibernate3.1,浠嶦clipse瀵煎叆hibernate3.1鏃訛紝灝嗕細(xì)瀵煎叆ehcache 1.1.jar錛屽洜涓篽ibernate鏈韓涔熻浣跨敤EHCache錛屼絾鏄増鏈笉鍚屻?/p>
import java.io.*;
import java.util.regex.*;
public class Ip
{
private static void fileIO(File f)
{
String strLine;
// 璋冪敤鎵ц鏈▼搴忕殑鎿嶄綔緋葷粺鐨勬爣鍑嗘崲琛岀錛屾剰鍛崇潃璺ㄥ鉤鍙?br> String line = System.getProperty("line.separator");
try
{
// 杈撳叆嫻?br> FileInputStream fis = new FileInputStream(f);
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
// 杈撳嚭嫻?br> FileOutputStream fos = new FileOutputStream("c://b.txt");
OutputStreamWriter osw = new OutputStreamWriter(fos);
BufferedWriter bw = new BufferedWriter(osw);
/*
* 鍒涘緩涓涓ā寮忓璞★紝 妯″紡涓紪杈戠殑姝e垯琛ㄨ揪寮忓尮閰嶅垎鍒槸(200-249|250-255|001-199) 浠ュ尮閰嶄竴涓狪P鍦板潃
*/
Pattern pattern = Pattern
.compile("((2[0-4]d|25[0-5]|[01]?dd?).){3}(2[0-4]d|25[0-5]|[01]?dd?)");
// 澹版槑妯″紡閫傞厤鍣?br> Matcher matcher;
// 寰幆璇誨彇鏂囦歡涓殑姣忎竴琛?br> while ((strLine = br.readLine()) != null)
{
/*
* String璋冪敤replaceAll鏂規(guī)硶鍖歸厤涓涓鍒欒〃杈懼紡鎵懼埌涓涓綅緗紝鐒跺悗鏇挎崲鎴愰楀彿
*/
strLine = strLine.replaceAll("(?<=d)s+", ",");
// 鐢ㄩ傞厤鍣ㄥ姞杞戒竴琛屽瓧絎︿覆錛屽茍鍖歸厤妯″紡
matcher = pattern.matcher(strLine);
// 濡傛灉鍦ㄤ竴琛屼腑鑳芥壘鍒板尮閰嶇殑瀛楃涓插垯寰幆
while (matcher.find())
{
// 鍙栦竴琛屼腑絎竴涓兘鍖歸厤鐨勫瓙瀛楃涓?br> String buf = matcher.group();
// 浠?."鍒嗗壊鎴愭暟瀛楋紝鐒跺悗鍒嗗埆琛ラ浂錛屽啀鍚堝茍
strLine = matcher.replaceAll(change(buf));
// 杈撳叆涓琛屽埌鏂囦歡錛屼絾涓嶅寘鎷崲琛岀
bw.write(strLine);
// 杈撳叆琛屽垎鍓茬錛屽嵆鎹㈣絎?br> bw.write(line);
}
}
// 鍏抽棴杈撳叆嫻?br> br.close();
// 鍏抽棴杈撳嚭嫻?br> bw.close();
}
// 鎹曡幏鍘熷鏂囦歡鏈壘鍒板紓甯?br> catch (FileNotFoundException e)
{
System.out.println("鍘熷鏂囦歡鏈壘鍒?);
}
// 鎹曡幏IO寮傚父
catch (IOException e)
{
e.printStackTrace();
}
}
// 姝ゆ柟娉曠敤鏉ユ帴鏀朵竴涓垎鍓插嚭鏉ョ殑涓涓暟瀛楋紝灝嗕笉瓚?浣嶇殑琛ラ浂鍚庤繑鍥?br> private static String fill(String str)
{
// 涓嶈凍3浣嶇殑琛ラ浂
while (str.length() < 3)
{
str = '0' + str;
}
// 榪斿洖琛ラ浂鍚庣殑瀛楃涓?br> return str;
}
private static String change(String buf)
{
// 緙撳啿瀛楃涓?br> String temp;
// 緇撴灉榪斿洖瀛楃涓?br> String ret;
// 浠?."鍒嗗壊錛屽瓨鍏ュ瓧絎︿覆鏁扮粍
String[] str = buf.split(".");
// 絎竴涓暟瀛椾笉闇瑕佸湪鍓嶉潰鍔?."
ret = fill(str[0]);
// 浠庣2涓暟瀛楀紑濮嬶紝緇欐瘡涓暟瀛楀墠闈㈠垎鍒啀鍔犱笂"."錛屽茍涓斾笉瓚崇殑琛ラ浂
for (int i = 1; i < str.length; i++)
{
// 璋冪敤fill鏂規(guī)硶緇欎笉瓚?浣嶇殑鏁板瓧琛ラ浂
temp = fill(str[i]);
// 姣忎釜鏁板瓧鍔犵偣鍚庝粠鏂扮粍瑁呮垚涓涓?br> ret = ret + "." + temp;
}
// 榪斿洖緇撴灉瀛楃涓?br> return ret;
}
// 紼嬪簭鍏ュ彛
public static void main(String[] args)
{
// 璇誨師濮嬫枃浠?br> File f = new File("c://a.txt");
// 灝嗗師濮嬫枃浠朵紶鍏ileIO鏂規(guī)硶錛屾寜瑕佹眰鍔犲伐
fileIO(f);
}
}