67,511
社区成员
发帖
与我相关
我的任务
分享
public void run() {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("获取新闻任务开始时间:"
+ df.format(Calendar.getInstance().getTime()));
ThreadPoolExecutor threadpool = new ThreadPoolExecutor(
corePoolSize, maximumPoolSize, consumeTaskSleepTime,
TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(
ArrayBlockingQueueSize));
try {
List<NewsRule> rules = newsRuleService.getNewsRule();
if(rules!=null&&rules.size()>0){
threadpool.execute(new CrawlNewsThreadNew(rules));
}
} catch (Exception e) {
log.error(e.getMessage(),e);
}finally{
System.out.println("获取新闻任务结束时间:"
+ df.format(Calendar.getInstance().getTime()));
}
}
<Host name="localhost" appBase=""
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
<Context path="" docBase="webapps/你的项目名" />
</Host>
改成这样就好了