简体   繁体   English

“org.quartz.scheduler.instanceId”没有价值

[英]No value for 'org.quartz.scheduler.instanceId'

I have a problem with an application war, the application was not made by me, the application works, but when import to eclipse and export with attaching tomcat and java libraries 1.8.0_321, it does not work, I do not change anything in the application, such as import, export, the error is the following:我有一个应用程序战争的问题,应用程序不是我制作的,应用程序可以工作,但是当导入到 eclipse 并使用附加的 tomcat 和 java 库 1.8.0_321 导出时,它不起作用,我没有更改任何内容应用,如import,export,报错如下:

INFO main org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor ERROR main org.quartz.impl.StdSchedulerFactory - Couldn't generate instance Id. INFO main org.quartz.impl.StdSchedulerFactory - 使用 ThreadExecutor 的默认实现 ERROR main org.quartz.impl.StdSchedulerFactory - 无法生成实例 ID。 org.quartz:SchedulerException. org.quartz:SchedulerException。 No value for 'org.quartz.scheduler,instanceId' system property found, please configure your environment accordingly!未找到“org.quartz.scheduler,instanceId”系统属性的值,请相应地配置您的环境!

attached systemprops.jsp:附件 systemprops.jsp:

<div id="page" style="float:left;position:relative;left:60px; top:10px;font-size:1.0em;font-weight: 300; font-family:Helvetica, Arial, sans-serif;">
    <div id="javasys">

        <%
            out.println("<table width=600 border=0>");
            out.println("<tr>");
            out.println("<td width=150><b>PROPERTY</b></td>");
            out.println("<td width=450><b>VALUE</b></td>");
            out.println("</tr>");
            out.println("<tr>");
            Properties props = System.getProperties();
            Enumeration as = props.propertyNames();
            while (as.hasMoreElements()) {
                Object o = as.nextElement();
                String key = (String) o;
                out.println("<td width=150><b>" + key + "</b></td>");
                String val = props.getProperty(key);
                StringTokenizer st = new StringTokenizer(val, ":");
                out.println("<td width=450>");
                while (st.hasMoreTokens()) {
                    String valind = st.nextToken();
                    out.println(valind + "<BR>");
                }
                out.println("</td>");
                out.println("</tr>");
            }
            out.println("</table>");
        %>

    </div>

I'm not a programmer, but I think it can come from here: Enumeration as = props.propertyNames();我不是程序员,但我认为它可以来自这里:Enumeration as = props.propertyNames();

in eclipse it has a warning in Enumeration as = props.propertyNames();在 eclipse 中,它在枚举中有一个警告 as = props.propertyNames(); with Enumeration is a raw type, References to generic type Enumeration should be parameterized, It is not the only part of the code that I have this error枚举是原始类型,对泛型枚举的引用应该被参数化,这不是我有这个错误的唯一代码部分

As the documentation says:正如文档所说:

org.quartz.scheduler.instanceId org.quartz.scheduler.instanceId

Can be any string, but must be unique for all schedulers working as if they are the same 'logical' Scheduler within a cluster.可以是任何字符串,但对于所有工作的调度程序必须是唯一的,就好像它们是集群中的相同“逻辑”调度程序一样。 You may use the value “AUTO” as the instanceId if you wish the Id to be generated for you.如果您希望为您生成 ID,您可以使用值“AUTO”作为 instanceId。 Or the value “SYS_PROP” if you want the value to come from the system property “org.quartz.scheduler.instanceId”.或者如果您希望值来自系统属性“org.quartz.scheduler.instanceId”,则值“SYS_PROP”。

The problem is that in quartz.properties org.quartz.scheduler.instanceId is set to SYS_PROP , but you haven't defined this setting as a system property .问题是在 quartz.properties 中org.quartz.scheduler.instanceId被设置为SYS_PROP ,但是你还没有将这个设置定义为系统属性 This is obvious from the error message you show in your post:从您在帖子中显示的错误消息中可以明显看出这一点:

No value for 'org.quartz.scheduler.instanceId' system property found, please configure your environment accordingly!未找到“org.quartz.scheduler.instanceId”系统属性的值,请相应地配置您的环境!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM