I don't know if this is the appropriate place for this topic, but here I go:
I've been trying to make things a little more OO, so I used an abstract class to define a few default attributes and methods(getters/setters) for the subclasses, but I'm not used to work with inheritance on a JPA context and couldn't access/persist the fields belonging to the super class.
I've tried many things to solve my problem, but none of them worked out properly. This code I'm posting here is my current version of my workaround trials.
PRODUTO.class
LIVRO.class
formulario-novo-livro.xhtml = this one is to register a new Livro(book) to the DB.
lista-de-livros = this one is to display all the books on the web page.
Thanks in advance to all who wish to help!
James Sutherland
Ranch Hand
Joined: Oct 01, 2007
Posts: 550
posted
0
What error/issue do you get?
Ensure the Produto class is listed in your persistence.xml.
Well, most of the times were Servlet Exceptions. Now the h:commandbutton simply won't work.
There was a time when I annotated the PRODUTO.class with @MappedSuperclass and I got a Conversion Exception at the Calendar field.
I'm pretty much lost, so I don't know if I can provide more useful info. What is the "enabling logging on finest"?
Emanuel Kadziela
Ranch Hand
Joined: Mar 24, 2005
Posts: 186
posted
0
Set your log level to "all" or "trace" or at least "debug" so you can capture everything that is happening.
Who is your JPA vendor (Hibernate)? What does your persistence.xml file look like? What's the rest of the application configuration look like?
Cesar Sportore
Greenhorn
Joined: Sep 18, 2012
Posts: 6
posted
0
I've checked my log level and it's at FINEST level.
Yes, I use Hibernate. Here is an image of one thing that caught my attention.
And here are the files you asked for:
LivroRepository.class
According to the Debugger, those are my classes that trigger the error. I'm pretty new to Java, so I don't know anything about debugging and stuff. If you guys have suggestions regarding literature that could help me I'd be very pleased!
Here is the persistence.xml:
Thanks for all the help!
Emanuel Kadziela
Ranch Hand
Joined: Mar 24, 2005
Posts: 186
posted
0
You say "according to the Debugger" - what Debugger?
Are there any log files? Log output where the errors are printed? Those would be on the app server side, java logs with java errors. What is your application server (Tomcat)? You need to find, copy and paste the entire stack traces of your exceptions if you want someone to be able to help you. Just telling us "I'm getting exceptions" or "my stuff is not working" is not enough.