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 9000673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:20:24+00:00 2026-06-16T00:20:24+00:00

I am trying to follow this Hibernate tutorial: http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html which seems pretty easy &

  • 0

I am trying to follow this Hibernate tutorial:

http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html

which seems pretty easy & straightforward, but I got stuck on the very 1st decision point: When selecting File > New Project to use the tutorial’s suggested pom.xml, which of the many type of projects should I select?

Intuitively, I thought of creating a new Maven project:

  1. Maven > Maven Project [Next]
  2. [v] Create a simple project (skip archtype selection) [Next]

But at step #3 it prompts me for the very same information provided by the tutorial’s pom.xml. So I am thinking the tutorial was aiming at creating a “blank project” and then manually adding the suggested pom.xml to it?

But what type of “blank project” would that be?

  • Java?
  • Java EE?
  • EJB?
  • JAXB?
  • JPA?
  • Maven?
  • Does it matter?

(sorry, don’t have much experience (yet) with this new jargon, will get there eventually)

UPDATE 1: Actually, the proposed method of selecting a Maven project (regardless whether starting with bogus or correct info) doesn’t work:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.hibernate.tutorials:hibernate-tutorial
POM Location: C:\Users\Daniel\Workspace\First Hibernate Tutorial\pom.xml
Validation Messages:

    [0]  'dependencies.dependency.version' is missing for org.hibernate:hibernate-core:jar
    [1]  'dependencies.dependency.version' is missing for javax.servlet:servlet-api:jar
    [2]  'dependencies.dependency.version' is missing for org.slf4j:slf4j-simple:jar
    [3]  'dependencies.dependency.version' is missing for javassist:javassist:jar


Reason: Failed to validate POM for project org.hibernate.tutorials:hibernate-tutorial at C:\Users\Daniel\Workspace\First Hibernate Tutorial\pom.xml

I am going to check now whether creating a plain Java project, then converting it to a Maven (after copying that tutorial’s pom.xml) will do the trick.

UPDATE 2: Creating a plain Java project, then converting it to a Maven (after copying that tutorial’s pom.xml) produces the same errors.

What am I missing?

UPDATE 3: Thanks to @cowls tip below I found that “I” was missing were the version numbers for the Maven dependencies. “I” because it’s the tutorial that was missing them (what kind of a tutorial is this?)

Once I used some known version numbers, e.g.:

<dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
         <version>3.5.6-Final</version>
     </dependency>

    <!-- Because this is a web app, we also have a dependency on the servlet api. -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>1.2_02</version>
    </dependency>

    <!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.5.10</version>
    </dependency>

    <!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->
    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.8.0.GA</version>
    </dependency>
</dependencies>

I have been able to get rid of that scary FATAL ERROR message. That error message’s “tip” BTW was counter-productive as it was pointing to the wrong direction:

[INFO] Error building POM (may not be this project's POM).

Now… I am still getting a build error, albeit much less scary:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building First Hibernate Tutorial
[INFO]    task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Users\dben\ws-study\First Hibernate Tutorial\src\main\resources
Downloading: http://repo1.maven.org/maven2/javax/servlet/servlet-api/1.2_02/servlet-api-1.2_02.pom
[INFO] Unable to find resource 'javax.servlet:servlet-api:pom:1.2_02' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/javax/servlet/servlet-api/1.2_02/servlet-api-1.2_02.jar
[INFO] Unable to find resource 'javax.servlet:servlet-api:jar:1.2_02' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) javax.servlet:servlet-api:jar:1.2_02

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=javax.servlet -DartifactId=servlet-api -Dversion=1.2_02 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=javax.servlet -DartifactId=servlet-api -Dversion=1.2_02 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.hibernate.tutorials:hibernate-tutorial:jar:1.0.0-SNAPSHOT
    2) javax.servlet:servlet-api:jar:1.2_02

----------
1 required artifact is missing.

for artifact: 
  org.hibernate.tutorials:hibernate-tutorial:jar:1.0.0-SNAPSHOT

from the specified remote repositories:
  central (http://repo1.maven.org/maven2)

Interesting tutorial: I was expecting to learn some Hibernate but instead I am finding myself learning Maven. 🙂

UPDATE 4: I corrected the javax.servlet version to 2.4 and all is well now.

LESSONS LEARNED:

  1. Maven’s pom.xml requires a <version> for each & every dependency.
  2. That <version>‘s value must be valid.
  3. Creating a new Maven project, then replacing its pom.xml entirely would work, but it still creates it with the incorrect subdirectory under Workspace because there is no way to define the <name> in the wizard-based creation process.
  4. Creating a plain Java Project, then adding the pom.xml to its directory, then refreshing the Package Explorer view is the recommended way to go (no subdirectory renaming necessary).
  5. That tutorial recommends Maven’s “standard layout” but then breaks it by using the declared package “org.hibernate.tutorial.domain” which does not match the expected package “main.java.org.hibernate.tutorial.domain”… Do take Eclipse’s fix suggestion to rename the package to “main.java.org.hibernate.tutorial.domain”. (and move Event.java to the newly renamed package!)
  6. The Hibernate configuration command (mvn exec:java -Dexec.mainClass="org.hsqldb.Server" etc.) must be run from the directory where pom.xml resides.
  • 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-16T00:20:24+00:00Added an answer on June 16, 2026 at 12:20 am

    Easiest is to create a new maven project and use the maven-archetype-quickstart archetype.

    This will create a basic maven project and you should be able to go from there.

    Note that a maven project is just a Java project that uses Maven to build it, hence you will see a pom.xml file in your project.

    Using this pom file you can build the project, include external dependencies and much more. I would suggest using the m2e plugin if you are developing with eclipse to help you manage the maven projects better: http://eclipse.org/m2e/

    Each dependency you specify should have a version number associated with it.

    e.g.

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.5.6-Final</version>
        </dependency>   
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
    

    To get the correct version number, just google artifactid maven dependency. E.g. hibernate-core maven dependency.

    Look for the link for the maven central repository – i.e. http://mvnrepository.com. If you cant find it on Google you can search directly on the site, however I find its search feature quite poor.

    Put your Java code in src/main/java and your resources in src/main/resources (e.g. xml files etc).

    You can then build the project using mvn clean install

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

Sidebar

Related Questions

Im trying to follow this guide: http://www.castleproject.org/others/nvelocity/usingit.html Can you tell me what dlls I
I have been trying to follow this tutorial: http://viralpatel.net/blogs/2010/11/spring3-mvc-hibernate-maven-tutorial-eclipse-example.html I did not ran into
I'm trying to follow this tutorial using StructureMap : http://iridescence.no/post/Constructor-Injection-for-ASPNET-MVC-Action-Filters.aspx What I'm trying to
I'm trying to follow this documentation on Symfony : http://symfony.com/doc/current/book/forms.html ok so here is
trying to follow this tutorial http://www.codeguru.com/csharp/csharp/net30/article.php/c15489 I'm not able to select the sql server
I am trying to follow this tutorial http://damianm.com/tech/nhibernate-mvc-and-ninject/ but I am running into some
I'm trying to follow this tutorial on Seesaw Window Building . During the step
I am trying to follow this tutorial ( Using-core-plot-in-an-iphone-application ). When I try to
I am trying to follow this tutorial on how to connect to a database
I'm a newbie to sql and am trying to follow this example here: http://net.tutsplus.com/tutorials/php/a-better-login-system/

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.