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()));
}

}
求解释这是什么情况!!!

解决方案 »

  1.   

    最终问题解决了~是tomcat初始化的时候的问题因为设置了虚拟路径
    <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>改成这样就好了