NutzCN Logo
问答 Nutz quartz 不理解的地方
发布于 3292天前 作者 javanan 3525 次浏览 复制 上一个帖子 下一个帖子
标签: quartz

org.quartz.scheduler.instanceName = NutzbookScheduler
org.quartz.threadPool.threadCount = 3
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true

这里的 threadCount = 3 是指线程 最大3个吗? 超出3个就能用了? 我测试了可以,那么这是什么意思?

25 回复

@wendal 那么 如果我的job 执行以后,怎么清理他的使用资源 线程呢?

@javanan 那不是你需要关心的东西,明显写的是 threadpool,线程池

来自炫酷的 NutzCN

恩,我的应用 放在那里没动,,,过了一段时间 访问 服务就出现。。java.lang.OutOfMemoryError: PermGen space

java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space at org.nutz.lang.Lang.wrapThrow(Lang.java:148) at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:48) at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64) at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2462) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2451) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
什么鬼,,查看 服务内存曲线图 ,,,一直在30%,,@wendal

java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
at org.nutz.lang.Lang.wrapThrow(Lang.java:148)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:48)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:64)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:182)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2462)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2451)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
@wendal

是PermGen space

网上说 手动 改 内存, 尽量用公共jar,,,都不行啊! 这是我应用出现 内存一直耗着?@wendal

-XX:MaxPermSize=256M

@wendal 已经设置为这样了
set JAVA_OPTS="-server -Xms1024m -Xmx1024m -XX:PermSize=256M -XX:MaxNewSize=512m -XX:MaxPermSize=512m -Djava.awt.headless=true -Ddruid.registerToSysProperty=true"

你加了几百个jar??

@wendal 怎么看出来的,,? 4个 应用, 他们有共同的jar 每个有 35个 其中 28个左右是 相同的!

这么多应用, 这么点内存?

JDK版本估计也够低的, 换jdk8

我的 应用都是 在jdk7上开发的, 直接把服务器的换成8 不会有影响吧?
服务器是windows的 一个4g内存。
这些共同的jar有必要 公用起来吗? 那么打包war的时候 ftp上传到服务器,还得把lib的jar删除?@wendal

换成 jdk8+tomcat8
出现
org.nutz.mvc.LoadingException: org.nutz.lang.born.BorningException: Fail to born 'org.nutz.ioc.loader.json.JsonLoader'
by args: [
@(ioc/)] becasue:
java.lang.RuntimeException: folder or file like '^(.+[.])(js|json)$' no found in ioc/
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:931)
at org.nutz.lang.Lang.wrapThrow(Lang.java:164)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:78)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4640)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5247)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1703)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)@wendal

@javanan 这明显不是因为jdk8导致的, 自己的把错了呗

打包错了,没把配置文件打包到war里面

@wendal 打包了, 没有修改war内容,仅仅是换成 jdk8 tomcat也从7 改为8

肯定没,你打开war包看呗

@wendal war包里面 \WEB-INF\classes\custom 有我的配置文件的 但是 服务器提示
INFO org.nutz.mvc.impl.NutLoading - Nutz Version : 1.b.52
2015-11-06 12:02:03,047 [yunshenkeji1509-startStop-1] INFO org.nutz.mvc.impl.NutLoading - Nutz.Mvc[nutz] is initializing ...
2015-11-06 12:02:03,047 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - Web Container Information:
2015-11-06 12:02:03,083 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Default Charset : GBK
2015-11-06 12:02:03,083 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Current . path : C:\websoft\tomcat\Tomcat8_site.
2015-11-06 12:02:03,083 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Java Version : 1.8.0_25
2015-11-06 12:02:03,083 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - File separator : \
2015-11-06 12:02:03,083 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Timezone : Asia/Shanghai
2015-11-06 12:02:03,084 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - OS : Windows Server 2012 amd64
2015-11-06 12:02:03,084 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - ServerInfo : Apache Tomcat/8.0.14
2015-11-06 12:02:03,084 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - Servlet API : 3.1
2015-11-06 12:02:03,085 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - - ContextPath : /BusinessMG
2015-11-06 12:02:03,117 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.config.AbstractNutConfig - MainModule: <com.xy.businessmg.MainModule>
2015-11-06 12:02:03,117 [yunshenkeji1509-startStop-1] INFO org.nutz.mvc.config.AbstractNutConfig - /WEB-INF/ not Found?!
2015-11-06 12:02:03,117 [yunshenkeji1509-startStop-1] DEBUG org.nutz.mvc.impl.NutLoading - >> app.root =
2015-11-06 12:02:04,785 [yunshenkeji1509-startStop-1] DEBUG org.nutz.castor.Castors - Using 91 castor for Castors

war没有解压开来

@wendal 尝试了好多次 unpackWARs="false" autoDeploy="true" tomcat 也设置成这样 了。还是不行

错了
unpackWARs="true" autoDeploy="true" tomcat 已经设置成这样了@wendal

如果解压了,不会找不到/WEB-INF的

@wendal 看到解压的是一个 空文件,,里面没有东西 是什么问题?

添加回复
请先登陆
回到顶部