Re: kafka-client throwing IllegalStateException on calling wait
If possible please share a bit more detail so that other people can learn from the experience. Original message From: Debraj Manna Date: 12/28/17 6:23 AM (GMT-07:00) To: users@kafka.apache.org Subject: Re: kafka-client throwing IllegalStateException on calling wait Thanks Ted for the link. I got my issue there was an synchronization issue. On Thu, Dec 28, 2017 at 8:57 AM, Ted Yu wrote: > Have you seen > https://examples.javacodegeeks.com/java-basics/exceptions/java-lang- > illegalmonitorstateexception-how-to-solve-illegalmonitorstateexception/ > ? > > You didn't include the whole code w.r.t. shadowKafkaProducer > If you need more help, please consider including more of your code. > > Cheers > > On Wed, Dec 27, 2017 at 5:32 AM, Debraj Manna > wrote: > > > Cross-posting from stackoverflow > > <https://stackoverflow.com/questions/47992916/kafka-client-throwing- > > illegalstateexception-on-calling-wait> > > > > Kafka Client 0.10.0.0 is throwing the below IllegalStateException > whenever > > I am calling wait() > > > > ERROR [2017-12-27 09:55:48] c.v.g.u.UploadHandler:[?:?:?] - [dw-199 - > > POST /collectortosaasservlet] - InterruptedException in producer.wait. > > for cloning > > java.lang.IllegalMonitorStateException: null > > at java.lang.Object.wait(Native Method) > > at java.lang.Object.wait(Object.java:502) > > at com.van.grid.uploadHandler.UploadHandler.stopCloning( > > UploadHandler.java:481) > > > > The relevant code looks like below > > > > shadowKafkaProducer = new > > KafkaProducer<>(kafkaShadowProdConf);...public void stopCloning() { > > logger.info("Going to stop cloning"); > > if(shadowKafkaProducer != null) { > > try { > > shadowKafkaProducer.wait(); > > } catch (Exception e) { > > logger.error("InterruptedException in producer.wait. > > for cloning", e); > > } > > shadowKafkaProducer.close(); > > shadowKafkaProducer = null; > > } > > logger.info("Stopped cloning"); > > } > > > > shadowKafkaProducer.wait() is line number 481 in the above stacktrace. > > > > Can someone let me know why is this exception thrown & can I ignore this? > > >
Re: kafka-client throwing IllegalStateException on calling wait
Thanks Ted for the link. I got my issue there was an synchronization issue. On Thu, Dec 28, 2017 at 8:57 AM, Ted Yu wrote: > Have you seen > https://examples.javacodegeeks.com/java-basics/exceptions/java-lang- > illegalmonitorstateexception-how-to-solve-illegalmonitorstateexception/ > ? > > You didn't include the whole code w.r.t. shadowKafkaProducer > If you need more help, please consider including more of your code. > > Cheers > > On Wed, Dec 27, 2017 at 5:32 AM, Debraj Manna > wrote: > > > Cross-posting from stackoverflow > > <https://stackoverflow.com/questions/47992916/kafka-client-throwing- > > illegalstateexception-on-calling-wait> > > > > Kafka Client 0.10.0.0 is throwing the below IllegalStateException > whenever > > I am calling wait() > > > > ERROR [2017-12-27 09:55:48] c.v.g.u.UploadHandler:[?:?:?] - [dw-199 - > > POST /collectortosaasservlet] - InterruptedException in producer.wait. > > for cloning > > java.lang.IllegalMonitorStateException: null > > at java.lang.Object.wait(Native Method) > > at java.lang.Object.wait(Object.java:502) > > at com.van.grid.uploadHandler.UploadHandler.stopCloning( > > UploadHandler.java:481) > > > > The relevant code looks like below > > > > shadowKafkaProducer = new > > KafkaProducer<>(kafkaShadowProdConf);...public void stopCloning() { > > logger.info("Going to stop cloning"); > > if(shadowKafkaProducer != null) { > > try { > > shadowKafkaProducer.wait(); > > } catch (Exception e) { > > logger.error("InterruptedException in producer.wait. > > for cloning", e); > > } > > shadowKafkaProducer.close(); > > shadowKafkaProducer = null; > > } > > logger.info("Stopped cloning"); > > } > > > > shadowKafkaProducer.wait() is line number 481 in the above stacktrace. > > > > Can someone let me know why is this exception thrown & can I ignore this? > > >
Re: kafka-client throwing IllegalStateException on calling wait
Have you seen https://examples.javacodegeeks.com/java-basics/exceptions/java-lang-illegalmonitorstateexception-how-to-solve-illegalmonitorstateexception/ ? You didn't include the whole code w.r.t. shadowKafkaProducer If you need more help, please consider including more of your code. Cheers On Wed, Dec 27, 2017 at 5:32 AM, Debraj Manna wrote: > Cross-posting from stackoverflow > <https://stackoverflow.com/questions/47992916/kafka-client-throwing- > illegalstateexception-on-calling-wait> > > Kafka Client 0.10.0.0 is throwing the below IllegalStateException whenever > I am calling wait() > > ERROR [2017-12-27 09:55:48] c.v.g.u.UploadHandler:[?:?:?] - [dw-199 - > POST /collectortosaasservlet] - InterruptedException in producer.wait. > for cloning > java.lang.IllegalMonitorStateException: null > at java.lang.Object.wait(Native Method) > at java.lang.Object.wait(Object.java:502) > at com.van.grid.uploadHandler.UploadHandler.stopCloning( > UploadHandler.java:481) > > The relevant code looks like below > > shadowKafkaProducer = new > KafkaProducer<>(kafkaShadowProdConf);...public void stopCloning() { > logger.info("Going to stop cloning"); > if(shadowKafkaProducer != null) { > try { > shadowKafkaProducer.wait(); > } catch (Exception e) { > logger.error("InterruptedException in producer.wait. > for cloning", e); > } > shadowKafkaProducer.close(); > shadowKafkaProducer = null; > } > logger.info("Stopped cloning"); > } > > shadowKafkaProducer.wait() is line number 481 in the above stacktrace. > > Can someone let me know why is this exception thrown & can I ignore this? >
Re: kafka-client throwing IllegalStateException on calling wait
Anyone any thoughts? On Wed, Dec 27, 2017 at 7:02 PM, Debraj Manna wrote: > Cross-posting from stackoverflow > <https://stackoverflow.com/questions/47992916/kafka-client-throwing-illegalstateexception-on-calling-wait> > > Kafka Client 0.10.0.0 is throwing the below IllegalStateException whenever > I am calling wait() > > ERROR [2017-12-27 09:55:48] c.v.g.u.UploadHandler:[?:?:?] - [dw-199 - POST > /collectortosaasservlet] - InterruptedException in producer.wait. for cloning > java.lang.IllegalMonitorStateException: null > at java.lang.Object.wait(Native Method) > at java.lang.Object.wait(Object.java:502) > at > com.van.grid.uploadHandler.UploadHandler.stopCloning(UploadHandler.java:481) > > The relevant code looks like below > > shadowKafkaProducer = new KafkaProducer<>(kafkaShadowProdConf);...public void > stopCloning() { > logger.info("Going to stop cloning"); > if(shadowKafkaProducer != null) { > try { > shadowKafkaProducer.wait(); > } catch (Exception e) { > logger.error("InterruptedException in producer.wait. for > cloning", e); > } > shadowKafkaProducer.close(); > shadowKafkaProducer = null; > } > logger.info("Stopped cloning"); > } > > shadowKafkaProducer.wait() is line number 481 in the above stacktrace. > > Can someone let me know why is this exception thrown & can I ignore this? >
kafka-client throwing IllegalStateException on calling wait
Cross-posting from stackoverflow <https://stackoverflow.com/questions/47992916/kafka-client-throwing-illegalstateexception-on-calling-wait> Kafka Client 0.10.0.0 is throwing the below IllegalStateException whenever I am calling wait() ERROR [2017-12-27 09:55:48] c.v.g.u.UploadHandler:[?:?:?] - [dw-199 - POST /collectortosaasservlet] - InterruptedException in producer.wait. for cloning java.lang.IllegalMonitorStateException: null at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:502) at com.van.grid.uploadHandler.UploadHandler.stopCloning(UploadHandler.java:481) The relevant code looks like below shadowKafkaProducer = new KafkaProducer<>(kafkaShadowProdConf);...public void stopCloning() { logger.info("Going to stop cloning"); if(shadowKafkaProducer != null) { try { shadowKafkaProducer.wait(); } catch (Exception e) { logger.error("InterruptedException in producer.wait. for cloning", e); } shadowKafkaProducer.close(); shadowKafkaProducer = null; } logger.info("Stopped cloning"); } shadowKafkaProducer.wait() is line number 481 in the above stacktrace. Can someone let me know why is this exception thrown & can I ignore this?