主题 : IndexStaticJob
级别: 秀才
UID: 81774
积分:68 加为好友
威望: 11 精华: 0
主题:15 回复:24
注册时间:2015-11-03
在线时长:0
1#   发表于:2015-11-20 10:55:48  IP:1.213.*.*
IndexStaticJob这个类的作用是什么?
我首页中有取配置项的地方,刚启动的时候是正常的,但是过段时间(20分钟)他就自动报错,说配置项为空或丢失
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
2#   发表于:2015-11-20 10:56:56  IP:117.84.*.*
哪个版本的系统,这个是首页静态化的类
1
级别: 秀才
UID: 81774
积分:68 加为好友
威望: 11 精华: 0
主题:15 回复:24
注册时间:2015-11-03
在线时长:0
3#   发表于:2015-11-20 11:08:17  IP:1.213.*.*
回复第2楼    我用的v6

      这个方法会刷新页面么?
     @Transactional(readOnly = true)
public void index(CmsSite site) throws IOException, TemplateException {
Map<String, Object> data = new HashMap<String, Object>();
FrontUtils.frontData(data, site, null, site.getUrlStatic(), null);
/*
String tpl = FrontUtils.getTplPath(tplMessageSource, site
.getLocaleAdmin(), site.getSolutionPath(), TPLDIR_INDEX,
TPL_INDEX);
*/
String tpl=site.getTplIndexOrDef();
index(site, tpl, data);
}

级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
4#   发表于:2015-11-20 11:09:15  IP:117.84.*.*
不会
1
级别: 秀才
UID: 81774
积分:68 加为好友
威望: 11 精华: 0
主题:15 回复:24
注册时间:2015-11-03
在线时长:0
5#   发表于:2015-11-20 11:12:21  IP:1.213.*.*
回复第4楼FreeMarker template error: The following has evaluated to null or missing: ==> copyright [in template "WEB-INF/t/cms/www/default/index/index.html" at line 434, column 16] Tip: If the failing expression is known to be legally null/missing, either specify a default value with myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthessis: (myOptionVar.foo)!myDefault, (myOptionVar.foo)?? The failing instruction (FTL stack trace): ---------- ==> ${copyright} [in template "WEB-INF/t/cms/www/default/index/index.html" at line 434, column 14] ---------- Java stack trace (for programmers): ---------- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:98) at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:382) at freemarker.core.Expression.evalAndCoerceToString(Expression.java:115) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:265) at freemarker.core.MixedContent.accept(MixedContent.java:93) at freemarker.core.Environment.visit(Environment.java:265) at freemarker.core.Environment.process(Environment.java:243) at freemarker.template.Template.process(Template.java:277) at com.jeecms.cms.staticpage.StaticPageSvcImpl.index(StaticPageSvcImpl.java:172) at com.jeecms.cms.staticpage.StaticPageSvcImpl.index(StaticPageSvcImpl.java:155) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy50.index(Unknown Source) at com.jeecms.cms.task.job.IndexStaticJob.staticIndex(IndexStaticJob.java:55) at com.jeecms.cms.task.job.IndexStaticJob.executeInternal(IndexStaticJob.java:45) at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529) 
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
6#   发表于:2015-11-20 11:14:01  IP:117.84.*.*
copyright 
这个是哪来的
1
级别: 秀才
UID: 81774
积分:68 加为好友
威望: 11 精华: 0
主题:15 回复:24
注册时间:2015-11-03
在线时长:0
7#   发表于:2015-11-20 11:17:01  IP:1.213.*.*
回复第6楼
进入首页时从配置项取的。在DynamicPageAct里边
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(HttpServletRequest request,HttpServletResponse response, ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
model.put("copyright", ConfigureFileHelper.copyright);
model.put("footerAddess", ConfigureFileHelper.footerAddess);
model.put("postCode", ConfigureFileHelper.postCode);
FrontUtils.frontData(request, model, site);
//带有其他路径则是非法请求
String uri=URLHelper.getURI(request);
if(StringUtils.isNotBlank(uri)&&!uri.equals("/")){
return FrontUtils.pageNotFound(request, response, model);
}
//使用静态首页而且静态首页存在
if(site.getStaticIndex()&&new File(realPathResolver.get(site.getStaticDir()+INDEX)).exists()){
return FrontUtils.getTplPath("", site.getStaticDir(), INDEX);
}else{
return site.getTplIndexOrDef();
}
}

刚开始是正常的,保持tomcat启动多段时间就会自动报错,刚刚的就是报错信息
级别: 秀才
UID: 81774
积分:68 加为好友
威望: 11 精华: 0
主题:15 回复:24
注册时间:2015-11-03
在线时长:0
8#   发表于:2015-11-20 11:18:37  IP:1.213.*.*
回复第6楼是不是那里定义了定时任务啊
级别: 版主
UID: 70293
积分:78391 加为好友
威望: 1 精华: 0
主题:7 回复:68397
注册时间:2014-12-03
在线时长:0
9#   发表于:2015-11-20 11:18:44  IP:117.84.*.*
抱歉,二次开发的内容请自己研究
1
级别: 贡士
UID: 17063
积分:772 加为好友
威望: 0 精华: 0
主题:0 回复:651
注册时间:2011-03-18
在线时长:0
10#   发表于:2015-11-20 14:40:29  IP:61.227.*.*
二次开发还是要麻烦些
FreeCMS功能强大、开源、代码通俗易懂、注释详细、面向二次开发友好!
1 2 > >| 共2页