# Set root logger level to error
log4j.rootLogger=INFO, Console, File
###### Console appender definition #######
# All outputs currently set to be a ConsoleAppender.
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{3}] %m%n
#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
###### File appender definition #######
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=spring.log
log4j.appender.File.Append=false
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n
TestAspect.java 基于XML配置的切面
package com.sheng.example.springaop.aspect;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
/**
* Created by Dell on 2017/1/20.
*/
public class TestAspect {
public void doAfter(JoinPoint jp) {
System.out.println("log Ending method: " + jp.getTarget().getClass().getName() + "." + jp.getSignature().getName());
}
public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
long time = System.currentTimeMillis();
Object retVal = pjp.proceed();
time = System.currentTimeMillis() - time;
System.out.println("process time: " + time + " ms");
return retVal;
}
public void doBefore(JoinPoint jp) {
System.out.println("log Begining method: " + jp.getTarget().getClass().getName() + "." + jp.getSignature().getName());
}
public void doThrowing(JoinPoint jp, Throwable ex) {
System.out.println("method " + jp.getTarget().getClass().getName() + "." + jp.getSignature().getName() + " throw exception");
System.out.println(ex.getMessage());
}
}
TestAnnotationAspect.java 基于注解的切面
package com.sheng.example.springaop.aspect;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
/**
* Created by Dell on 2017/1/20.
*/
@Aspect
public class TestAnnotationAspect {
@Pointcut("execution(* com.sheng.example.springaop.service.*.*(..))")
private void pointCutMethod() {
}
//声明前置通知
@Before("pointCutMethod()")
public void doBefore() {
System.out.println("前置通知");
}
//声明后置通知
@AfterReturning(pointcut = "pointCutMethod()", returning = "result")
public void doAfterReturning(String result) {
System.out.println("后置通知");
System.out.println("---" + result + "---");
}
//声明例外通知
@AfterThrowing(pointcut = "pointCutMethod()", throwing = "e")
public void doAfterThrowing(Exception e) {
System.out.println("例外通知");
System.out.println(e.getMessage());
}
//声明最终通知
@After("pointCutMethod()")
public void doAfter() {
System.out.println("最终通知");
}
//声明环绕通知
@Around("pointCutMethod()")
public Object doAround(ProceedingJoinPoint pjp) throws Throwable {
System.out.println("进入方法---环绕通知");
Object o = pjp.proceed();
System.out.println("退出方法---环绕通知");
return o;
}
}
AOPService.java
package com.sheng.example.springaop.service;
/**
* Created by Dell on 2017/1/20.
*/
public interface AOPService {
String aoptest();
}
AOPServiceImpl.java
package com.sheng.example.springaop.service.impl;
import com.sheng.example.springaop.service.AOPService;
import org.springframework.stereotype.Service;
/**
* Created by Dell on 2017/1/20.
*/
@Service
public class AOPServiceImpl implements AOPService {
@Override
public String aoptest() {
return "aoptest";
}
}
MyController.java:
package com.sheng.example.springaop.controller;
import com.sheng.example.springaop.service.AOPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by Dell on 2017/1/20.
*/
@RestController
public class MyController {
@Autowired
private AOPService aopService;
@RequestMapping("/springaop")
public String springAop(){
return aopService.aoptest();
}
}
转:http://stackoverflow.com/questions/18145774/eclipse-an-error-occurred-while-filtering-resources
maven报错:
maven An error occurred while filtering resources
Maven -> Update Proje
在SVN服务控制台打开资源库“SVN无法读取current” ---摘自网络 写道 SVN无法读取current修复方法 Can't read file : End of file found
文件:repository/db/txn_current、repository/db/current
其中current记录当前最新版本号,txn_current记录版本库中版本