Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on a single table #13

Open
EnMaster opened this issue Nov 16, 2022 · 1 comment
Open

NullPointerException on a single table #13

EnMaster opened this issue Nov 16, 2022 · 1 comment

Comments

@EnMaster
Copy link

Only on this table, i get a NullPointerException

JAVA Version
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)

ERROR
c.t.crudapi.controller.RecordController : Listing table with name agenda and parameters {} java.lang.NullPointerException at com.tqdev.crudapi.column.reflection.ReflectedTable.findForeignKeyFieldName(ReflectedTable.java:71) at com.tqdev.crudapi.column.reflection.ReflectedTable.<init>(ReflectedTable.java:48) at com.tqdev.crudapi.column.reflection.DatabaseReflection.getTable(DatabaseReflection.java:34) at com.tqdev.crudapi.record.JooqRecordService.list(JooqRecordService.java:108) at com.tqdev.crudapi.controller.RecordController.list(RecordController.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) 2022-11-16 11:34:24.680 INFO 69012 --- [nio-8383-exec-7] c.t.crudapi.controller.RecordController : Listing table with name agenda and parameters {} java.lang.NullPointerException at com.tqdev.crudapi.column.reflection.ReflectedTable.findForeignKeyFieldName(ReflectedTable.java:71) at com.tqdev.crudapi.column.reflection.ReflectedTable.<init>(ReflectedTable.java:48) at com.tqdev.crudapi.column.reflection.DatabaseReflection.getTable(DatabaseReflection.java:34) at com.tqdev.crudapi.record.JooqRecordService.list(JooqRecordService.java:108) at com.tqdev.crudapi.controller.RecordController.list(RecordController.java:43) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

TABLE
CREATE TABLE `agenda` ( `id` int(11) NOT NULL AUTO_INCREMENT, `descrizione` varchar(450) DEFAULT NULL, `datains` varchar(250) DEFAULT NULL, `datacon` varchar(250) DEFAULT NULL, `checker` int(10) DEFAULT '0', `orai` varchar(250) DEFAULT NULL, `oraf` varchar(250) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8

VALUES
INSERT INTO `agenda` VALUES (16,'aggiungere due checkbox per identificare i clienti che sono clienti fornitore od \nentrambi','2017-06-22','2017-06-22',1,'19:27','19:26'),(73,'Inserire l\'ordine di acquisto e vendita di casali','2017-06-23','',1,'20:12','20:11'),(74,'Comprare tastiera ottini','2017-06-23','',1,'20:48',''),(75,'[BUG][CONTATTI] Se si seleziona un contatto, viene riempito il campo numero civico con la via. Il numero civico non appare in nessun box. Creato contatto di esempio di nome NOME','2017-06-24','2017-07-26',1,'06:59','00:00'),(76,'[BUG][AGENDA/TODO] Per note lunghe la finestra si allarga a dismisura senza abilitare la scrollbar orizzontale. sarebbe comodo farlo andare a capo automaticamente.','2017-06-24','2017-06-22',1,'07:12','00:00'),(77,'[BUG][AGENDA/TODO] Le date\n non sono nel formato \ngiusto yyyy-mm-dd ma \nmanca una cifra nei mesi ( questo manda in panico l\'ordinamento dell\'agenda sul sito )','2017-06-24','2017-06-22',1,'07:18','00:00'),(78,'Mandare contratto a Fabrizio cabri','2017-06-26','2017-06-22',1,'13:32','19:26'),(79,'Riempire moduli Eolo di Silvia e di anna','2017-06-26','2017-06-22',1,'13:32','19:26'),(80,'Portare moduli a marco','2017-06-26','2017-06-22',1,'13:33','19:26'),(81,'Controllo camera franco','2017-06-26','2017-06-22',1,'13:33','19:26'),(82,'Fattura a pini Edoardo per software','2017-06-26','',0,'13:34',''),(83,'Telecamere Cristina','2017-06-26','',1,'13:34',''),(84,'Telecamere pin0','2017-06-26','2017-06-22',1,'13:34','19:26'),(85,'Vu parle greco','2017-06-26','2017-06-22',1,'13:36','19:26'),(86,'Telefono susanna','2017-06-26','2017-06-22',1,'13:36','19:26'),(87,'Casali rete','2017-06-26','',0,'13:36',''),(88,'Sito pini','2017-06-26','',0,'13:37',''),(89,'Applicativo Ocelot','2017-06-26','2017-08-07',0,'13:37','13:38'),(90,'Applicativo links','2017-06-26','',0,'13:37',''),(91,'Applicativo legura','2017-06-26','2017-06-29',0,'13:39','13:38'),(92,'Sito safari','2017-06-26','',0,'13:40',''),(93,'Dare accesso a TeamViewer da parte di paradisi','2017-06-26','',1,'13:41',''),(94,'Inserire acquisti','2017-06-26','2017-06-22',1,'14:04','19:26'),(95,'Radio Ludovico','2017-06-26','2017-06-22',1,'14:04','19:26'),(96,'Inserire 50€ madama vetri e carrello','2017-07-03','2017-07-10',1,'20:54','00:00'),(97,'Inserire 30€ walter','2017-07-03','2017-07-10',1,'20:54','00:00'),(98,'Inserire 50€ vetro tablet','2017-07-03','2017-07-10',1,'20:54','00:00'),(99,'Fare preventivo Ludovico e vedere radio migliori','2017-07-03','2017-07-10',1,'20:55','00:00'),(105,'Iphone 5 guerra','2017-07-08','2017-07-10',1,'10:10','00:00'),(106,'Segnare batteria gratis casali','2017-07-08','2017-07-10',1,'10:10','00:00'),(107,'Segnare vendite papà andrea','2017-07-08','2017-07-10',1,'10:10','00:00'),(108,'Inserire acquisti dal distruggi documenti in poi ','2017-07-08','2017-07-10',1,'10:11','00:00'),(109,'Aggiungere pagamento cts iphone 6 baldracca ','2017-07-08','2017-07-10',1,'19:41','00:00'),(110,'[BUG][OPERE/ORDINI] TASTO ANNULLA NON FUNZIONA NELLE OPERE','2017-07-10','2017-07-10',1,'13:13','00:00'),(111,'[TIPS] PRECONFIGURARE LE QTA A 1','2017-07-10','2017-07-10',1,'14:00','00:00'),(112,'[TIPS] SISTEMARE BARRA CERCA CASE SENSITIVE','2017-07-10','2017-07-10',1,'15:00','00:00'),(113,'[TIPS] AGGIUNGERE BARRA CON FRECCIA ROSSA GLI ACQUISTI E FRECCIA VERDE LE VENDITE','2017-07-10','2017-07-10',1,'15:00','00:00'),(114,'[TIPS] GESTIENE MIGLIORE FATTO/NON FATTO NELLE NOTE','2017-07-10','2017-07-10',1,'15:00','00:00'),(115,'Inserire acquisto cassa','2017-07-13','2017-07-13',1,'14:06','14:06'),(116,'Inserire acquisto marco','2017-07-13','2017-07-24',1,'14:07','00:00'),(117,'Inserire acquisto switch','2017-07-13','2017-07-24',1,'14:07','00:00'),(119,'Prima nota','2017-07-26','2017-07-26',1,'00:00','00:00'),(121,'inserire fornitore o cliente o ambedue\nControllare fatture','2017-07-27','2017-07-27',0,'00:00','00:00'),(122,'3 swicht 30€','2017-08-03','',0,'10:35',''),(123,'2 Netgear Amazon 44€','2017-08-03','',1,'10:35',''),(124,'Vario Arduino 30€','2017-08-03','',0,'10:35',''),(125,'Ciao','2017-08-18','',0,'17:46',''),(126,'Vendere carico di cipolle del rimorchio','2017-11-06','2017-11-15',0,'21:49','21:49');

@EnMaster
Copy link
Author

Update.
My user db had two database:
db1 and db2
Each db have tables with the same name, but with different columns.
I think that the java-crud-api, search for each database/table with authorization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant