No row with the given argument - Hibernate, Java - java

I am using hibernate in my java dynamic project and since last week I am getting one exception called "No row with the given identifier exist[#entity(0)]. I found same problem asked earlier and I did same as suggested but problem persisted. I tried using "not-found=ignore" case as well but it doesn't work. Even the project is working fine # Production but here # development is quite disturbing. Please help me.

Maybe this can help explain it.
Just a suggestion: whenever I get an error message of any kind, I immediately cut & paste it into a Google search to see what comes back. It's highly unlikely that I'm the first person to encounter a problem.

Related

How to find errors in large Eclipse program

I've got a rather large program that interacts with a MySQL database. I recently changed the structure of the database considerably, but I thought I had made all of the necessary changes to my program to compensate for those database changes, but clearly I haven't.
I just recently several error messages, the first of which is this:
java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp
Strangely, though, it doesn't give tell me in which file this error came from (as a typical stacktrace would), let alone on which line number. How can I figure out from where this is coming?
I have a lot of calls to the database in this program, most of which deal with a Timestamp column. And I'm afraid that, while I have been using Eclipse for months now, I still have yet to use its Debug perspective. How can I use that?

GWT- SDK upgrade issue

I recently came across a bug with an unresolved issue in SDK 2.2 and, as its fixed in 2.5, decided to explore a switch.
Now I am new to GWT and I have no idea of the effects of doing such a switch, but figured it couldn't hurt to mess around locally. I went ahead and successfully updated to 2.5 locally to test and can run with no errors. However many of the text boxes have changed appearance and my navigation bar disappeared, etc...
Is this type of behavior normal after an update? If so I cant imagine why anyone would be in a hurry to do so, as spending enormous amounts of time to modify all pages is pretty unrealistic. Is there maybe some type of quick fix or an error i may have made to cause this?
If you want to put a lot of resources into a GWT project it is always a good idea to check regularly how the project is going on. On the release-note page you can check what's new and what has been deprecated. This way you can make an informed and rational decision whenever you want to update. This is very important since going from an old version (say 1.0) to a new one (i.e 2.5.1) might give some headaches to the programmers. Spendind half-an-hour checking what's going on every month will make your life easier.
GWT has an issue tracker where you can see the open issues and what has been resolved. Many issues have never been fixed, but I read the GWT team intend to solve the 100 most important issues for the next release. GWT is now open-source and you can contribute to its development whenever you know of to fix one of those issues.
Last but not least: many people say a lot of things, which are not always correct (including on Stack Overflow). Always dubble check before making important decisions.
Giving this advice is all I can do for you so far...
Yet, if you give me some info about that bug you expected to be fixed and the exact name of that "navigation bar" widget you might find out information on the sites above to check their status. But I can't search that for you if I don't know what the bug was and the name of the widget that is broken. Also, when you say "many of the textboxes" I understand it's not every textbox that's broken but some variant your are using in some particular places. More information would also be needed...

Strange Error in Eclipse Indigo

Has anyone ever seen this kinf of error in Eclipse Indigo?
An internal error occurred during: "Label Job".
Illegal class name "com/sun+jdi/DoubleType" in class file com/sun/jdi/DoubleType
Version: Indigo Service Release 1
Build id: 20110916-0149
I've added a new Schreenshot.
Labebl Job is shown when i click on next step (F6, F8..)
JDI thread evaluation is shown when i drag the mouse on a variable for have informations.
I've never seen this strange error.
Since someone asked me to set an answer in order to mark this question as solved even if someone will probably still have this problem unsolved, but as you can see nobody solved it in different ways (since for the majority there are at least two solutions for problems), so i would mark this answer as best answer:
[My Solution] Delete your Eclipse "installation" and reinstall it to be clean from every errors. Re-install it until the problem is gone (and so there are no installation errors)
If someone is opposed to this answer as best answer, please write it down a real best answer, or make yourself agree with #Drumnbass (that "suggested" me to write the answer) to understand what is right and what is wrong.
I just faced the same issue. I was able to solve the issue by removing all the breakpoints by clicking the double cross button and then restarting the eclipse.

IE-7 Error with GWT Project

I recently took over a GWT project and began making necessary changes. Everything was fine until one day someone viewed the project in IE-7. There is an error msg that persists in two of the GWT panels or screens. Also the final results after using the tool do now show properly, however they are emailed correctly.
Because I took over the project I am unsure as to what code is exactly causing this error. I'm hoping someone else has some knowledge on what may be causing it or possible solutions so that I know where I should be looking.
From what I've read so far, the error can be caused by height or widths being defined with a negative amount of pixels, however I haven't seen this in the project.
Thanks for the help. Error message below.
(Error): Invalid argument. number: -2147024809 description: Invalid argument.
Did you set the "user.agent" property in your *.gwt.xml file to include IE??

Database record reverting after manual change

Problem solved: Thanks guys, see my answer below.
I have a website running in Tomcat 5.5 hooked up to a MySQL5 database using Hibernate3.
One record simply refuses to keep any changes performed on it. If I change the record programmatically, the values revert back to what they were previously.
If I manually modify the record in the database, the values will revert (seemingly once the webapp accesses them).
I have tried stopping Tomcat and changing the values manually then starting Tomcat again. Checking the database, the values remain changed after Tomcat has started the webapp but will revert back again once I load the site.
I have also tried deleting the Tomcat work folder for the webapp and the .ser cache file.
I have also checked the code for the values that are being reverted to and cannot find them.
I have only noticed it on this one particular record.
Edit: I've just had a look at the SQL output from Hibernate using hibernate.show_sql=true. There is an update query logged for the table my row is in. Does anyone know how to resolve the ? for the columns to actual values?
You could temporarily enable the mysql query logging and see exactly what sql statement altered the value. Since you say it changes immediately after the server starts you should be able to figure out the statement pretty quickly.
http://dev.mysql.com/doc/refman/5.0/en/query-log.html
To answer your question:
Does anyone know how to resolve the ?
for the columns to actual values?
You can do this with p6spy. Instructions for how to set this up in a Spring app are available here.
However, I think there's a mistake in these instructions, the file they refer to as p6spy.log should actually be name p6spy.properties.
It's getting close to halloween, so you have to expect this sort of thing (plus it was just a full moon), but I'd keep looking for the culprit in the web application ... it HAS to be there. A couple values I'd immediately search for in the webapp source code:
The id of the record being changed.
The value that's being written into
the record.
Good luck ... these can be real bears to find!
This smells a little like a test-case firing on start up that modifies the row to what it expects it to be before testing.
Add a trigger BEFORE UPDATE, check row id, raise an SQL error if it matches your magic row.
Then check the generated stacktrace, walk the code and locate the piece that updates the row.
Thanks to everyone for the help. All of the suggestions came in handy for tracking it down.
I've managed to find out what was causing it. Bad database design, multiple data models and Hibernate makes for some nasty stuff. Another table had the value stored and that class was extending a base class with the same value.
Time to look at doing some normalisation.

Categories