Win a copy of Hands On Software Engineering with Python this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Does Data Source Explorer in Eclipse reflect insertion of data ?  RSS feed

 
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ever since I changed MYSQL version to 8.0.12 and now the latest 8.0.13, I'm not able to get the insertion into the database.

The code was the same old code.

I have put in the necessary logger etc.

At first, there is no ping due to wrong SQL connection URL.

After spending a few days fixing things, the ping is finally successful but I am puzzled why the data never get inserted.

So, I would like to know if the Data Source Explorer in Eclipse will show the inserted data ?

I am using Eclipse Oxygen.

There was no SQL exception or any errors occurred.

Hope someone can tell me.

Tks.
 
Marshal
Posts: 5629
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the late reply.

Eclipse Oxygen is fairly old.  Have you considered upgrading?

I don't have MySQL on my PC so I can't really test this.

You say you put in a logger message.  Was it just before and just after the SQL insert?  Did the insert execute without an error?  What did the logger information tell you?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll do my best to answer you questions below, but might have to refer
some to other channels.

> I just started looking into DTP, primarily for use with Apache Derby, and am
> quite pleased with what I've seen so far. I have just a few nagging
> questions, which I can't seem to find much information on - probably just
> because this area is still relatively new?

Thanks for the enthusiastism. Yes, DTP is relatively new, and we are just
getting to a stage (the 0.9 release) where the "core" areas are defined.
We do have a number of documents posted on the DTP web site
 
Knute Snortum
Marshal
Posts: 5629
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi nate liv, and Welcome to the Ranch!

Did you post this is the correct forum?  I don't see your quoted text anywhere in this thread.
 
tangara goh
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Sorry for the late reply.

Eclipse Oxygen is fairly old.  Have you considered upgrading?

I don't have MySQL on my PC so I can't really test this.

You say you put in a logger message.  Was it just before and just after the SQL insert?  Did the insert execute without an error?  What did the logger information tell you?



Well, I have used Eclipse Photon and then switched back to Eclipse Oxygen..as I thought the system in Oxygen is already upgraded once Photon is 'activated' cos I remember vaguely when I opened Oxygen, it said something like the system is upgraded....

Could you let me know what would be a good Java EE Eclipse version to use?

OK.  Now, I am getting some error after putting Logger at the Controller but I can't understand what it meant.

Could you kindly let me know what's the problem ?


21:03:37.488 [http-nio-8013-exec-6] ERROR Controller.tutorController - Exception
java.lang.NullPointerException: null
at Controller.tutorController.doPost(tutorController.java:67) [classes/:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [servlet-api.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [servlet-api.jar:?]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:8.5.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.24]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-websocket.jar:8.5.24]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:8.5.24]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:8.5.24]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [catalina.jar:8.5.24]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:8.5.24]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) [catalina.jar:8.5.24]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [catalina.jar:8.5.24]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [catalina.jar:8.5.24]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) [catalina.jar:8.5.24]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:8.5.24]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [catalina.jar:8.5.24]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-coyote.jar:8.5.24]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:8.5.24]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-coyote.jar:8.5.24]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-coyote.jar:8.5.24]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:8.5.24]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:8.5.24]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]



Tks.
 
Knute Snortum
Marshal
Posts: 5629
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the important information:

java.lang.NullPointerException: null
at Controller.tutorController.doPost(tutorController.java:67)


This is saying that a NullPointerException (NPE) occurred in the class tutorController at line 67.  An NPE usually means that you are trying to call a method on a variable that points to null.  This often happens when a variable is not initialized.  It can also happen when a method returns null.
 
Knute Snortum
Marshal
Posts: 5629
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The latest Eclipse IDE release can always be found here:

https://www.eclipse.org/downloads/

The latest is brand, spanking new, release this month.  But figure out the NPE before installing a new version.
 
tangara goh
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:This is the important information:

java.lang.NullPointerException: null
at Controller.tutorController.doPost(tutorController.java:67)


This is saying that a NullPointerException (NPE) occurred in the class tutorController at line 67.  An NPE usually means that you are trying to call a method on a variable that points to null.  This often happens when a variable is not initialized.  It can also happen when a method returns null.



Wow.  You have my respect in able to point out mistake like this.

I was trying to play with Weld CDI so I try to use @EJB annotation on a class and then I try to use that class over without using new instance.

Apparently, there was something wrong with the way I used the annotation that caused the error.

Can I know if it is good to use WELD CDI with java EE? cos I know that Java EE itself also contains CDI.

Here's my pom.xml which contains WELD CDI dependencies.  


<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>

<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
           <exclusions>
               <exclusion>
                   <groupId>javax.enterprise</groupId>
                   <artifactId>cdi-api</artifactId>
               </exclusion>
           </exclusions>
</dependency>



Tks.

 
Knute Snortum
Marshal
Posts: 5629
147
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what "WELD CDI" is, but maybe this is a question better suited for the EJB, Java EE forum.
 
Saloon Keeper
Posts: 2257
289
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

tangara goh wrote:.. Can I know if it is good to use WELD CDI with java EE? cos I know that Java EE itself also contains CDI.


I believe that Weld is the reference implementation for CDI 1.0 and CDI 2.0, so it should be a good choice.

What are you trying to inject, and how are you annotating the field?  You example code doesn't show any annotation.
 
tangara goh
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

tangara goh wrote:.. Can I know if it is good to use WELD CDI with java EE? cos I know that Java EE itself also contains CDI.


I believe that Weld is the reference implementation for CDI 1.0 and CDI 2.0, so it should be a good choice.

What are you trying to inject, and how are you annotating the field?  You example code doesn't show any annotation.



I was trying to inject the tutor class.

So at my Tutor class I put annotation :


However, I think there is something wrong but I can't put my fingers on it.

I googled and I saw that many just put the annotation on interface and not on calling the 'Entity class'

I hope you could point out my mistakes.

Tks.
 
Ron McLeod
Saloon Keeper
Posts: 2257
289
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have an (empty) WEB-INF/beans.xml file?

Is this for Tomcat?  If it is, you probably also need to have the following in the META-INF/context.xml file:
 
Ron McLeod
Saloon Keeper
Posts: 2257
289
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Related thread: Do I install javaee-api or javaee-web-api ?
 
Rancher
Posts: 3794
40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you trying to inject what looks like a model class?
 
tangara goh
Ranch Hand
Posts: 468
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Why are you trying to inject what looks like a model class?



Hi Dave,

This is because I wanted to try out dependency injection.

Is injecting a model class not allowed in dependency injection?

(PS. I have also asked you how the IN clause work but havn't heard from you.  Could you let me know.  Million thanks!)
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!