java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • While using the excellent REST interface to create scheduled tasks, I've noticed that apparently the start date of 01.01.1970 in combination with the time '00:00' causes some trouble (the resulting {{startDate}} should be "0", right?). Assuming I submit the following JSON document via POST to {{<nexus-baseurl>/service/local/schedules}}: {code} {"data":{"name":"Empty Trash","enabled":true,"typeId":"EmptyTrashTask","schedule":"daily","properties":[{"key":"repositoryId","value":"all_repo"},{"key":"EmptyTrashItemsOlderThan","value":""}],"startDate":"0","recurringTime":"00:00"}}{code} The scheduled task to empty the trash once a day is successfully created. Response from the REST interface is OK and the task is visible at the UI as well (see the attached screen shot). All good. Unfortunately not. But as soon as I restart Nexus, it doesn't come back and writes the following exception into the log file: {noformat} 2014-07-23 03:15:16 ERROR [WrapperListener_start_runner] org.sonatype.nexus.bootstrap.jsw.JswLauncher - Failed to start java.lang.IllegalStateException: Could not start Nexus at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:40) ~[na:na] at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) ~[jetty-servlet-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) ~[jetty-servlet-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252) ~[jetty-webapp-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) ~[jetty-webapp-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.Server.doStart(Server.java:282) ~[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) ~[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.sonatype.sisu.jetty.Jetty8$JettyWrapperThread.run(Jetty8.java:145) ~[nexus-jetty8-2.7.2-03.jar:2.7.2-03] Caused by: java.lang.NullPointerException: Starting Date of org.sonatype.scheduling.iterators.DailySchedulerIterator cannot be null! at org.sonatype.scheduling.iterators.AbstractSchedulerIterator.<init>(AbstractSchedulerIterator.java:33) ~[na:na] at org.sonatype.scheduling.iterators.AbstractCalendarBasedSchedulerIterator.<init>(AbstractCalendarBasedSchedulerIterator.java:29) ~[na:na] at org.sonatype.scheduling.iterators.DailySchedulerIterator.<init>(DailySchedulerIterator.java:27) ~[na:na] at org.sonatype.scheduling.schedules.DailySchedule.createIterator(DailySchedule.java:29) ~[na:na] at org.sonatype.scheduling.schedules.AbstractSchedule.getIterator(AbstractSchedule.java:47) ~[na:na] at org.sonatype.scheduling.DefaultTaskConfigManager.translateFrom(DefaultTaskConfigManager.java:343) ~[na:na] at org.sonatype.scheduling.DefaultTaskConfigManager.initializeTasks(DefaultTaskConfigManager.java:124) ~[na:na] at org.sonatype.scheduling.DefaultTaskConfigManager.initializeTasks(DefaultTaskConfigManager.java:102) ~[na:na] at org.sonatype.scheduling.DefaultScheduler.initializeTasks(DefaultScheduler.java:102) ~[na:na] at org.sonatype.nexus.scheduling.DefaultNexusScheduler.initializeTasks(DefaultNexusScheduler.java:47) ~[na:na] at org.sonatype.nexus.NxApplication.doStart(NxApplication.java:132) ~[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70) ~[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255) ~[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57) ~[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129) ~[na:na] at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:37) ~[na:na] ... 16 common frames omitted {noformat} And looking at the {{nexus.xml}} file, the exception is right: {noformat} <tasks> <task> <id>1</id> <name>Empty Trash</name> <enabled>true</enabled> <type>EmptyTrashTask</type> <status>SUBMITTED</status> <nextRun>1406160000000</nextRun> <schedule> <type>daily</type> </schedule> <properties> <property> <key>EmptyTrashItemsOlderThan</key> <value></value> </property> <property> <key>.name</key> <value>Empty Trash</value> </property> <property> <key>repositoryId</key> <value>all_repo</value> </property> </properties> </task> </tasks> {noformat} The scheduled task doesn't have a start date. It should look like {noformat} <schedule> <type>daily</type> <startDate>0</startDate> </schedule> {noformat} It happens for the other reoccurrence types that use a start date as well. Can I ask to fix this issue, please? Thanks
    via by Martin Meinhold [Atlassian],
    • java.lang.IllegalStateException: Could not start Nexus at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:40)[na:na] at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:775)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)[jetty-servlet-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:767)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)[jetty-servlet-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1252)[jetty-webapp-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:710)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)[jetty-webapp-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.server.Server.doStart(Server.java:282)[jetty-server-8.1.11.v20130520.jar:8.1.11.v20130520] at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[jetty-util-8.1.11.v20130520.jar:8.1.11.v20130520] at org.sonatype.sisu.jetty.Jetty8$JettyWrapperThread.run(Jetty8.java:145)[nexus-jetty8-2.7.2-03.jar:2.7.2-03] Caused by: java.lang.NullPointerException: Starting Date of org.sonatype.scheduling.iterators.DailySchedulerIterator cannot be null! at org.sonatype.scheduling.iterators.AbstractSchedulerIterator.<init>(AbstractSchedulerIterator.java:33)[na:na] at org.sonatype.scheduling.iterators.AbstractCalendarBasedSchedulerIterator.<init>(AbstractCalendarBasedSchedulerIterator.java:29)[na:na] at org.sonatype.scheduling.iterators.DailySchedulerIterator.<init>(DailySchedulerIterator.java:27)[na:na] at org.sonatype.scheduling.schedules.DailySchedule.createIterator(DailySchedule.java:29)[na:na] at org.sonatype.scheduling.schedules.AbstractSchedule.getIterator(AbstractSchedule.java:47)[na:na] at org.sonatype.scheduling.DefaultTaskConfigManager.translateFrom(DefaultTaskConfigManager.java:343)[na:na] at org.sonatype.scheduling.DefaultTaskConfigManager.initializeTasks(DefaultTaskConfigManager.java:124)[na:na] at org.sonatype.scheduling.DefaultTaskConfigManager.initializeTasks(DefaultTaskConfigManager.java:102)[na:na] at org.sonatype.scheduling.DefaultScheduler.initializeTasks(DefaultScheduler.java:102)[na:na] at org.sonatype.nexus.scheduling.DefaultNexusScheduler.initializeTasks(DefaultNexusScheduler.java:47)[na:na] at org.sonatype.nexus.NxApplication.doStart(NxApplication.java:132)[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport$Handler.doStart(LifecycleSupport.java:70)[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext$MainMap_Starting.started(LifecycleHandlerContext.java:255)[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleHandlerContext.started(LifecycleHandlerContext.java:57)[na:na] at org.sonatype.sisu.goodies.lifecycle.LifecycleSupport.start(LifecycleSupport.java:129)[na:na] at org.sonatype.nexus.web.NexusBooterListener.contextInitialized(NexusBooterListener.java:37)[na:na] ... 16 more
    No Bugmate found.