Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:49:33+00:00 2026-06-04T09:49:33+00:00

A my SQL database has an Item table. Each item can have many alternate

  • 0

A my SQL database has an “Item” table. Each “item” can have many alternate labels. These are stored in another table called “ItemAltLabel”. The foreign key is “ItemID”.

I am trying to represent this in java as an entity which has a set of string alternate labels.

My property looks like this:

@ElementCollection
@CollectionTable(name="ItemAltLabel", joinColumns=@JoinColumn(name="ItemID"))
@Column(name="Label")
private Set<String> alternateLabels;

Should this be correct?

The error I get is:

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘entityBroker’: Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: protected org.hibernate.SessionFactory
com.porism.dao.BaseBroker.sessionFactory; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘sessionFactory’ defined in ServletContext
resource [/WEB-INF/springmvc-servlet.xml]: Invocation of init method
failed; nested exception is org.hibernate.MappingException: Could not
determine type for: java.util.Set, for columns:
[org.hibernate.mapping.Column(Label)]

I found this post, which suggests it is a bug in the version of hibernate I am using:

http://blog.m1key.me/2010/06/orghibernatemappingexception-could-not.html

“If you are getting this error in a similar situation, the reason is a bug in your Hibernate implementation and you should get a newer one (I recommend 3.5.3-Final or later).”

My pom file refers to 3 hibernate dependencies:

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate</artifactId>
  <version>3.2.5.ga</version>
</dependency>
<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-entitymanager</artifactId>
  <version>3.3.2.GA</version>
</dependency>
<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-core</artifactId>
  <version>3.3.2.GA</version>
</dependency>

I have tried updating these to 3.5.3-Final (as the post suggests).

My repositories look like this:

http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo
eclipselink
default
Repository for library Library[eclipselink]

http://download.java.net/maven/2/
hibernate-support
default
Repository for library Library[hibernate-support]

The error I get when trying to build the project is:

Failed to execute goal on project InformWebServices: Could not resolve
dependencies for project porism:InformWebServices:war:1.0: Could not
transfer artifact org.hibernate:hibernate:jar:3.5.3-Final from/to
eclipselink
(http://ftp.ing.umu.se/mirror/eclipse/rt/eclipselink/maven.repo):
Connection to http://ftp.ing.umu.se refused: Connection timed out:
connect -> [Help 1]

If I remove the dependency on hibernate 3.5.3-Final, the other two dependencies are downloaded successfully. The project builds; but a new error appears:

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘entityBroker’: Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: protected org.hibernate.SessionFactory
com.porism.dao.BaseBroker.sessionFactory; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘sessionFactory’ defined in ServletContext
resource [/WEB-INF/springmvc-servlet.xml]: Invocation of init method
failed; nested exception is java.lang.NoClassDefFoundError: Could not
initialize class org.hibernate.cfg.AnnotationConfiguration

I am using NetBeans 7.1.2 and maven.

As you can probably tell, I have been handed a project, and don’t have a clue what I am doing. Any help would be greatly appreciated.

I have tried upgrading to hibernate 4, but this resulted in a host of problems, and I would prefer to remain as close to the version I was using as possible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:49:36+00:00Added an answer on June 4, 2026 at 9:49 am

    Not sure what the org.hibernate:hibernate dependency is supposed to refer to. But that is certainly not a jar we (the Hibernate team) produce.

    You should be fine specifying just the org.hibernate:hibernate-entitymanager dependency. It will actually pull in org.hibernate:hibernate-core transitively. And these are the ones that should be upgraded to 3.5+

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL database that has a table with a field set to
I have a SQL database that has the following table: Table: PhoneRecords -------------- ID(identity
We have a SQL Server 2008 database that has stored procedures to handle reads/writes/etc.
In our inventory database (SQL Server 2008 std edition) we have a table (called
I have a table in my MySQL database called Sponsors . This table has
I have a SQL Server database which has grown to more than 15GB in
I have a SQL Server 2005 database that has been deleted, and I need
I have an database table called MenuItem (MenuItemID, ParentMenuItemID, MenuItemName). I want to use
I have a database which has an orders table and inventory table. The order-items
I have many items and many users in a database. A user can set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.