简体   繁体   中英

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:

INFO main org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor ERROR main org.quartz.impl.StdSchedulerFactory - Couldn't generate instance Id. org.quartz:SchedulerException. No value for 'org.quartz.scheduler,instanceId' system property found, please configure your environment accordingly!

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

in eclipse it has a warning in Enumeration 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

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. Or the value “SYS_PROP” if you want the value to come from the system property “org.quartz.scheduler.instanceId”.

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 . 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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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