Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

NoSuchElementException when counter file is empty => import stopped #40

Open
EHJ-52n opened this issue Jul 9, 2015 · 0 comments
Open
Assignees
Labels
Milestone

Comments

@EHJ-52n
Copy link
Member

EHJ-52n commented Jul 9, 2015

The disk where the counter files are stored was full. This caused a problem because now the counter file is empty. This causes a NoSuchElementException which breaks the current import run.

Exception log:

2015-07-09 08:20:15,157 DEBUG [FeederTimer] [OneTimeFeeder.java:185] Check counter file '/home/user/.SOSImporter/348d8ad8a126fcd2e5a8878a13be
a0de'.
2015-07-09 08:20:15,157 DEBUG [FeederTimer] [OneTimeFeeder.java:188] Read already read lines from file
2015-07-09 08:20:15,158 ERROR [FeederTimer] [RepeatedFeeder.java:121] Exception catched. Switch logging to debug for more details: null
2015-07-09 08:20:15,159 DEBUG [FeederTimer] [RepeatedFeeder.java:122] StackTrace:
java.util.NoSuchElementException: null
        at java.util.Scanner.throwFor(Scanner.java:907) ~[na:1.7.0_45]
        at java.util.Scanner.next(Scanner.java:1530) ~[na:1.7.0_45]
        at java.util.Scanner.nextInt(Scanner.java:2160) ~[na:1.7.0_45]
        at java.util.Scanner.nextInt(Scanner.java:2119) ~[na:1.7.0_45]
        at org.n52.sos.importer.feeder.task.OneTimeFeeder.run(OneTimeFeeder.java:190) ~[52n-sos-importer-feeder-bin_DEBUG.jar:0.4.0-SNAPSHOT]
        at org.n52.sos.importer.feeder.task.RepeatedFeeder.run(RepeatedFeeder.java:93) ~[52n-sos-importer-feeder-bin_DEBUG.jar:0.4.0-SNAPSHOT]
        at java.util.TimerThread.mainLoop(Timer.java:555) [na:1.7.0_45]
        at java.util.TimerThread.run(Timer.java:505) [na:1.7.0_45]

Solution:

Catch this exception, log it and assume "0" or stop this run?

@EHJ-52n EHJ-52n added the bug label Jul 9, 2015
@EHJ-52n EHJ-52n self-assigned this Jul 9, 2015
@EHJ-52n EHJ-52n added this to the 0.5.0 milestone Jul 9, 2015
@EHJ-52n EHJ-52n modified the milestones: 0.5.0, 0.5.1 Jul 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant