Why Does Hibernate Persist Fail Silently in JUnit Tests on JBoss?

  • Thread starter Borg
  • Start date
  • Tags
    Spring
In summary, I was getting frustrated trying to set up a simple web server (JBoss 7.0.2) with associated JUnit tests for the DAOs using Maven to build the code. I finally got it to work in both environments after months of unsuccessful attempts.
  • #1
Borg
Science Advisor
Gold Member
2,179
4,232
Does anyone have any experience with these? I have been trying to set up a simple web server (JBoss 7.0.2) with associated JUnit tests for the DAOs using Maven to build the code. I can get one or the other to work but not both.

I get frustratingly close but there is always another error that I spend days trying to figure out until I give up and try another way. The last one looked like it was successful. The server worked, I could log in, read and write data to the database without any problems. I wrote a JUnit test and it appeared to work fine as well. Unfortunately I only tested database reads. Later, when I tried to actually write data through the tests, the Hibernate persist just quietly failed. It didn't save the data but it didn't throw an error either! I didn't notice that it wasn't working until days later when I started examining the data that I thought was being saved.

I am ready to just throw out everything and start from the beginning but I have done that several times already.

Update: As it always seems to happen when I make a post looking for help, I finally made a breakthrough. It looks like I finally got it to work in both environments. Months without success and after I post about it, solved a few hours later. Never fails. :rolleyes:
 
Last edited:
Technology news on Phys.org
  • #2
I'm sorry you are not generating any responses at the moment. Is there any additional information you can share with us? Any new findings?
 
  • #3
Greg Bernhardt said:
I'm sorry you are not generating any responses at the moment. Is there any additional information you can share with us? Any new findings?
Thanks Greg. It's not a problem anymore. As I wrote in the update, I solved it shortly after posting.
 

1. How do I configure Spring 3.2.3 with Hibernate 4?

To configure Spring 3.2.3 with Hibernate 4, you will need to create a Spring configuration file that includes the necessary beans for Hibernate. You will also need to add the Hibernate dependencies to your project and configure the database connection properties in the Spring configuration file.

2. What are the advantages of using Spring 3.2.3 with Hibernate 4?

Using Spring 3.2.3 with Hibernate 4 allows for easier integration between the two frameworks, as well as providing features such as dependency injection and transaction management from Spring. It also allows for a more modular and maintainable codebase.

3. Can I use Spring 3.2.3 with Hibernate 4 in a web application?

Yes, Spring 3.2.3 and Hibernate 4 can be used in a web application. You will need to configure the necessary servlet and listener classes in your web.xml file, and make sure to include the Spring and Hibernate dependencies in your project.

4. Are there any common issues when using Spring 3.2.3 with Hibernate 4?

Some common issues when using Spring 3.2.3 with Hibernate 4 include compatibility issues with different versions of the frameworks, configuration errors, and issues with database connections. It is important to carefully follow the documentation and make sure all dependencies are properly configured.

5. Where can I find resources for learning more about Spring 3.2.3 and Hibernate 4?

There are many online resources available for learning about Spring 3.2.3 and Hibernate 4, including official documentation, tutorials, and blogs. You can also consider taking a course or reading books on the subject for a more in-depth understanding.

Similar threads

  • Programming and Computer Science
Replies
12
Views
9K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
1
Views
940
  • Mechanical Engineering
Replies
1
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
Replies
2
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • Programming and Computer Science
Replies
9
Views
3K
  • Computing and Technology
Replies
25
Views
3K
  • Programming and Computer Science
Replies
4
Views
669
Back
Top