java.lang.NumberFormatException: adding to/creating database with attribute that might be a number (?)

Tuesday, 26 October 2021 · 3 messages · last reply 27 Oct 2021
JB
James Ball26 Oct 2021 12:40 #
Hello, I’m seeing a lot of exceptions written to the console when I add a document that has an attribute value that is a date. I can’t quite work out exactly what format causes BaseX to think it might be a number. It appears that the index is still created/updated correctly so the exception might be cosmetic. But I thought I’d report it. Below, I’ve given a command that I run through /dba and repeats the issue every time, also the full console output. Many thanks, James -------- Basex: 9.6.3 OS: macos Running: basexhttp Command: db:create("test", <Element Date="2021-10-06"/>, "/j”) using /dba Console logs: java.lang.NumberFormatException: For input string: "2021-10-06” twice
Creating Database...
 0.03 ms (20 MB)
Indexing Text...
 0.0 M operations, 0.5 ms (20 MB).
Indexing Attribute Values...
 0.0 M operations, 0.46 ms (21 MB).
java.lang.NumberFormatException: For input string: "2021-10-06"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.base/java.lang.Double.parseDouble(Double.java:543)
	at org.basex.util.Token.toDouble(Token.java:568)
	at org.basex.util.Token.toDouble(Token.java:552)
	at org.basex.index.stats.Stats.add(Stats.java:127)
	at org.basex.index.name.Names.index(Names.java:80)
	at org.basex.core.cmd.Optimize.optimize(Optimize.java:142)
	at org.basex.core.cmd.Optimize.optimize(Optimize.java:92)
	at org.basex.query.up.primitives.name.DBCreate.apply(DBCreate.java:73)
	at org.basex.query.up.NameUpdates.apply(NameUpdates.java:58)
	at org.basex.query.up.ContextModifier.apply(ContextModifier.java:133)
	at org.basex.query.up.Updates.apply(Updates.java:177)
	at org.basex.query.QueryContext.update(QueryContext.java:679)
	at org.basex.query.QueryContext.iter(QueryContext.java:326)
	at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:84)
	at org.basex.http.web.WebResponse.create(WebResponse.java:64)
	at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:73)
	at org.basex.http.BaseXServlet.service(BaseXServlet.java:69)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.base/java.lang.Thread.run(Thread.java:829)
java.lang.NumberFormatException: For input string: "2021-10-06"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.base/java.lang.Double.parseDouble(Double.java:543)
	at org.basex.util.Token.toDouble(Token.java:568)
	at org.basex.util.Token.toDouble(Token.java:552)
	at org.basex.index.stats.Stats.add(Stats.java:127)
	at org.basex.index.path.PathNode.index(PathNode.java:120)
	at org.basex.index.path.PathNode.index(PathNode.java:95)
	at org.basex.index.path.PathIndex.index(PathIndex.java:121)
	at org.basex.core.cmd.Optimize.optimize(Optimize.java:143)
	at org.basex.core.cmd.Optimize.optimize(Optimize.java:92)
	at org.basex.query.up.primitives.name.DBCreate.apply(DBCreate.java:73)
	at org.basex.query.up.NameUpdates.apply(NameUpdates.java:58)
	at org.basex.query.up.ContextModifier.apply(ContextModifier.java:133)
	at org.basex.query.up.Updates.apply(Updates.java:177)
	at org.basex.query.QueryContext.update(QueryContext.java:679)
	at org.basex.query.QueryContext.iter(QueryContext.java:326)
	at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:84)
	at org.basex.http.web.WebResponse.create(WebResponse.java:64)
	at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:73)
	at org.basex.http.BaseXServlet.service(BaseXServlet.java:69)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
	at java.base/java.lang.Thread.run(Thread.java:829)
Indexing Text...
. 0.0 M operations, 0.93 ms (21 MB).
Indexing Attribute Values...
. 0.0 M operations, 0.48 ms (21 MB).
Request: POST http://localhost:8984/dba/query-update <http://localhost:8984/dba/query-update>
* Origin: http://localhost:8984 <http://localhost:8984/>
* Cookie: _oklv=1635162426055%2CnGrbLqcgXQ1ERP5h3m39N0OFFAp5opEB; JSESSIONID=node014oxevsnpg4ed1fc7endksu7bq0.node0; _okbk=cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1635151053278%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; hblid=dw7iYc8RR2o0BXfK3m39N0OFAyop5Bfp; olfsk=olfsk36471732056245176; wcsid=nGrbLqcgXQ1ERP5h3m39N0OFFAp5opEB; _ok=1700-237-10-3483; _okdetect=%7B%22token%22%3A%2216351510530120%22%2C%22proto%22%3A%22about%3A%22%2C%22host%22%3A%22%22%7D; csrftoken=nPdSonQBFhoIXPWrc5yyHWtYcTKULHPt49rsNrKJx0abtv4pu71xdLR3Ax4QYFcr; sessionid=96psloqjf4kcej3r0ecyoizs6nccs4me
* Accept: */*
* Connection: keep-alive
* User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15
* Referer: http://localhost:8984/dba/queries <http://localhost:8984/dba/queries>
* Host: localhost:8984
* Accept-Encoding: gzip, deflate
* Accept-Language: en-gb
* Content-Length: 53
* Content-Type: text/plain
Response: 200
* Server-Timing: parse;dur=0.17 ms,compile;dur=4.11 ms,evaluate;dur=115.93 ms,serialize;dur=0.14 ms
* Date: Mon, 25 Oct 2021 11:47:33 GMT
* Content-Type: text/plain;charset=utf-8
CG
Christian Grün26 Oct 2021 12:55 #
Hi James, It looks as if you’re running BaseX with debugging enabled. In this mode, numerous exceptions may be raised that don’t necessarily affect the stability of BaseX. Do the errors disappears if you turn debugging off? Best, Christian
Quoted text · James Ball · 161 lines
On Tue, Oct 26, 2021 at 12:41 PM James Ball <basex-talk at jamesball.co.uk> wrote: > > Hello, > > I’m seeing a lot of exceptions written to the console when I add a document that has an attribute value that is a date. I can’t quite work out exactly what format causes BaseX to think it might be a number. > > It appears that the index is still created/updated correctly so the exception might be cosmetic. But I thought I’d report it. > > Below, I’ve given a command that I run through /dba and repeats the issue every time, also the full console output. > > Many thanks, James > > -------- > > Basex: 9.6.3 > > OS: macos > > Running: basexhttp > > Command: db:create("test", <Element Date="2021-10-06"/>, "/j”) using /dba > > Console logs: java.lang.NumberFormatException: For input string: "2021-10-06” twice > > Creating Database... > 0.03 ms (20 MB) > Indexing Text... > 0.0 M operations, 0.5 ms (20 MB). > Indexing Attribute Values... > 0.0 M operations, 0.46 ms (21 MB). > java.lang.NumberFormatException: For input string: "2021-10-06" > at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) > at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) > at java.base/java.lang.Double.parseDouble(Double.java:543) > at org.basex.util.Token.toDouble(Token.java:568) > at org.basex.util.Token.toDouble(Token.java:552) > at org.basex.index.stats.Stats.add(Stats.java:127) > at org.basex.index.name.Names.index(Names.java:80) > at org.basex.core.cmd.Optimize.optimize(Optimize.java:142) > at org.basex.core.cmd.Optimize.optimize(Optimize.java:92) > at org.basex.query.up.primitives.name.DBCreate.apply(DBCreate.java:73) > at org.basex.query.up.NameUpdates.apply(NameUpdates.java:58) > at org.basex.query.up.ContextModifier.apply(ContextModifier.java:133) > at org.basex.query.up.Updates.apply(Updates.java:177) > at org.basex.query.QueryContext.update(QueryContext.java:679) > at org.basex.query.QueryContext.iter(QueryContext.java:326) > at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:84) > at org.basex.http.web.WebResponse.create(WebResponse.java:64) > at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:73) > at org.basex.http.BaseXServlet.service(BaseXServlet.java:69) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) > at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450) > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) > at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) > at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) > at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) > at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) > at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) > at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) > at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) > at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) > at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) > at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > at org.eclipse.jetty.server.Server.handle(Server.java:516) > at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400) > at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645) > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392) > at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) > at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) > at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) > at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) > at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) > at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) > at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) > at java.base/java.lang.Thread.run(Thread.java:829) > java.lang.NumberFormatException: For input string: "2021-10-06" > at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) > at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) > at java.base/java.lang.Double.parseDouble(Double.java:543) > at org.basex.util.Token.toDouble(Token.java:568) > at org.basex.util.Token.toDouble(Token.java:552) > at org.basex.index.stats.Stats.add(Stats.java:127) > at org.basex.index.path.PathNode.index(PathNode.java:120) > at org.basex.index.path.PathNode.index(PathNode.java:95) > at org.basex.index.path.PathIndex.index(PathIndex.java:121) > at org.basex.core.cmd.Optimize.optimize(Optimize.java:143) > at org.basex.core.cmd.Optimize.optimize(Optimize.java:92) > at org.basex.query.up.primitives.name.DBCreate.apply(DBCreate.java:73) > at org.basex.query.up.NameUpdates.apply(NameUpdates.java:58) > at org.basex.query.up.ContextModifier.apply(ContextModifier.java:133) > at org.basex.query.up.Updates.apply(Updates.java:177) > at org.basex.query.QueryContext.update(QueryContext.java:679) > at org.basex.query.QueryContext.iter(QueryContext.java:326) > at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:84) > at org.basex.http.web.WebResponse.create(WebResponse.java:64) > at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:73) > at org.basex.http.BaseXServlet.service(BaseXServlet.java:69) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) > at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450) > at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) > at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) > at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) > at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) > at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) > at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) > at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) > at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) > at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) > at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) > at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) > at org.eclipse.jetty.server.Server.handle(Server.java:516) > at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400) > at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645) > at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392) > at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) > at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) > at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) > at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) > at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) > at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) > at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) > at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) > at java.base/java.lang.Thread.run(Thread.java:829) > Indexing Text... > . 0.0 M operations, 0.93 ms (21 MB). > Indexing Attribute Values... > . 0.0 M operations, 0.48 ms (21 MB). > Request: POST http://localhost:8984/dba/query-update > * Origin: http://localhost:8984 > * Cookie: _oklv=1635162426055%2CnGrbLqcgXQ1ERP5h3m39N0OFFAp5opEB; JSESSIONID=node014oxevsnpg4ed1fc7endksu7bq0.node0; _okbk=cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1635151053278%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; hblid=dw7iYc8RR2o0BXfK3m39N0OFAyop5Bfp; olfsk=olfsk36471732056245176; wcsid=nGrbLqcgXQ1ERP5h3m39N0OFFAp5opEB; _ok=1700-237-10-3483; _okdetect=%7B%22token%22%3A%2216351510530120%22%2C%22proto%22%3A%22about%3A%22%2C%22host%22%3A%22%22%7D; csrftoken=nPdSonQBFhoIXPWrc5yyHWtYcTKULHPt49rsNrKJx0abtv4pu71xdLR3Ax4QYFcr; sessionid=96psloqjf4kcej3r0ecyoizs6nccs4me > * Accept: */* > * Connection: keep-alive > * User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 > * Referer: http://localhost:8984/dba/queries > * Host: localhost:8984 > * Accept-Encoding: gzip, deflate > * Accept-Language: en-gb > * Content-Length: 53 > * Content-Type: text/plain > Response: 200 > * Server-Timing: parse;dur=0.17 ms,compile;dur=4.11 ms,evaluate;dur=115.93 ms,serialize;dur=0.14 ms > * Date: Mon, 25 Oct 2021 11:47:33 GMT > * Content-Type: text/plain;charset=utf-8 >
JB
James Ball27 Oct 2021 14:08 #
Ah ha! Yes - I was running with debug on so that I could see all the calls to the server scrolling past on the console. Errors do indeed go away without debug. I didn’t realise that it’s possible to get exceptions listed on the console that, in reality, don’t cause any issues - very useful to know. I shall just ignore them. Thank you for your help! James
Quoted text · Christian Grün · 176 lines
> On 26 Oct 2021, at 11:55, Christian Grün <christian.gruen at gmail.com> wrote: > > Hi James, > > It looks as if you’re running BaseX with debugging enabled. In this > mode, numerous exceptions may be raised that don’t necessarily affect > the stability of BaseX. > > Do the errors disappears if you turn debugging off? > > Best, > Christian > > > > On Tue, Oct 26, 2021 at 12:41 PM James Ball <basex-talk at jamesball.co.uk> wrote: >> >> Hello, >> >> I’m seeing a lot of exceptions written to the console when I add a document that has an attribute value that is a date. I can’t quite work out exactly what format causes BaseX to think it might be a number. >> >> It appears that the index is still created/updated correctly so the exception might be cosmetic. But I thought I’d report it. >> >> Below, I’ve given a command that I run through /dba and repeats the issue every time, also the full console output. >> >> Many thanks, James >> >> -------- >> >> Basex: 9.6.3 >> >> OS: macos >> >> Running: basexhttp >> >> Command: db:create("test", <Element Date="2021-10-06"/>, "/j”) using /dba >> >> Console logs: java.lang.NumberFormatException: For input string: "2021-10-06” twice >> >> Creating Database... >> 0.03 ms (20 MB) >> Indexing Text... >> 0.0 M operations, 0.5 ms (20 MB). >> Indexing Attribute Values... >> 0.0 M operations, 0.46 ms (21 MB). >> java.lang.NumberFormatException: For input string: "2021-10-06" >> at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) >> at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) >> at java.base/java.lang.Double.parseDouble(Double.java:543) >> at org.basex.util.Token.toDouble(Token.java:568) >> at org.basex.util.Token.toDouble(Token.java:552) >> at org.basex.index.stats.Stats.add(Stats.java:127) >> at org.basex.index.name.Names.index(Names.java:80) >> at org.basex.core.cmd.Optimize.optimize(Optimize.java:142) >> at org.basex.core.cmd.Optimize.optimize(Optimize.java:92) >> at org.basex.query.up.primitives.name.DBCreate.apply(DBCreate.java:73) >> at org.basex.query.up.NameUpdates.apply(NameUpdates.java:58) >> at org.basex.query.up.ContextModifier.apply(ContextModifier.java:133) >> at org.basex.query.up.Updates.apply(Updates.java:177) >> at org.basex.query.QueryContext.update(QueryContext.java:679) >> at org.basex.query.QueryContext.iter(QueryContext.java:326) >> at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:84) >> at org.basex.http.web.WebResponse.create(WebResponse.java:64) >> at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:73) >> at org.basex.http.BaseXServlet.service(BaseXServlet.java:69) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) >> at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450) >> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) >> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) >> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) >> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) >> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) >> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) >> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) >> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) >> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) >> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) >> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) >> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) >> at org.eclipse.jetty.server.Server.handle(Server.java:516) >> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400) >> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645) >> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392) >> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) >> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) >> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) >> at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) >> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) >> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) >> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) >> at java.base/java.lang.Thread.run(Thread.java:829) >> java.lang.NumberFormatException: For input string: "2021-10-06" >> at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) >> at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) >> at java.base/java.lang.Double.parseDouble(Double.java:543) >> at org.basex.util.Token.toDouble(Token.java:568) >> at org.basex.util.Token.toDouble(Token.java:552) >> at org.basex.index.stats.Stats.add(Stats.java:127) >> at org.basex.index.path.PathNode.index(PathNode.java:120) >> at org.basex.index.path.PathNode.index(PathNode.java:95) >> at org.basex.index.path.PathIndex.index(PathIndex.java:121) >> at org.basex.core.cmd.Optimize.optimize(Optimize.java:143) >> at org.basex.core.cmd.Optimize.optimize(Optimize.java:92) >> at org.basex.query.up.primitives.name.DBCreate.apply(DBCreate.java:73) >> at org.basex.query.up.NameUpdates.apply(NameUpdates.java:58) >> at org.basex.query.up.ContextModifier.apply(ContextModifier.java:133) >> at org.basex.query.up.Updates.apply(Updates.java:177) >> at org.basex.query.QueryContext.update(QueryContext.java:679) >> at org.basex.query.QueryContext.iter(QueryContext.java:326) >> at org.basex.http.restxq.RestXqResponse.serialize(RestXqResponse.java:84) >> at org.basex.http.web.WebResponse.create(WebResponse.java:64) >> at org.basex.http.restxq.RestXqServlet.run(RestXqServlet.java:73) >> at org.basex.http.BaseXServlet.service(BaseXServlet.java:69) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) >> at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450) >> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) >> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) >> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) >> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) >> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) >> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) >> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) >> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) >> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) >> at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) >> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) >> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) >> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) >> at org.eclipse.jetty.server.Server.handle(Server.java:516) >> at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:400) >> at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:645) >> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:392) >> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) >> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) >> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) >> at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) >> at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) >> at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) >> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) >> at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) >> at java.base/java.lang.Thread.run(Thread.java:829) >> Indexing Text... >> . 0.0 M operations, 0.93 ms (21 MB). >> Indexing Attribute Values... >> . 0.0 M operations, 0.48 ms (21 MB). >> Request: POST http://localhost:8984/dba/query-update >> * Origin: http://localhost:8984 >> * Cookie: _oklv=1635162426055%2CnGrbLqcgXQ1ERP5h3m39N0OFFAp5opEB; JSESSIONID=node014oxevsnpg4ed1fc7endksu7bq0.node0; _okbk=cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1635151053278%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C; hblid=dw7iYc8RR2o0BXfK3m39N0OFAyop5Bfp; olfsk=olfsk36471732056245176; wcsid=nGrbLqcgXQ1ERP5h3m39N0OFFAp5opEB; _ok=1700-237-10-3483; _okdetect=%7B%22token%22%3A%2216351510530120%22%2C%22proto%22%3A%22about%3A%22%2C%22host%22%3A%22%22%7D; csrftoken=nPdSonQBFhoIXPWrc5yyHWtYcTKULHPt49rsNrKJx0abtv4pu71xdLR3Ax4QYFcr; sessionid=96psloqjf4kcej3r0ecyoizs6nccs4me >> * Accept: */* >> * Connection: keep-alive >> * User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15 >> * Referer: http://localhost:8984/dba/queries >> * Host: localhost:8984 >> * Accept-Encoding: gzip, deflate >> * Accept-Language: en-gb >> * Content-Length: 53 >> * Content-Type: text/plain >> Response: 200 >> * Server-Timing: parse;dur=0.17 ms,compile;dur=4.11 ms,evaluate;dur=115.93 ms,serialize;dur=0.14 ms >> * Date: Mon, 25 Oct 2021 11:47:33 GMT >> * Content-Type: text/plain;charset=utf-8 >>

⚡Generated with XQuery