-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Sample Application within Tutorial
PostPosted: Thu Jul 09, 2009 11:45 am 
Newbie

Joined: Thu Jul 09, 2009 4:59 am
Posts: 1
Hi Everyone,

I would like to do the tutorial that is for beginners.
I am stuck with two points.

Where should I put the dependency jar files?
Why does Maven ask for version numbers of jar files? Nothing is mentioned in the tut about this.

Thanks in advance for any help.

Here is my command line:

Quote:
[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:\FirstHibernateTutorial\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:\FirstHibernateTutorial\pom.xml


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Failed to validate POM for project org.hibernate.tutorials:hibernate-tutorial at c:\FirstHibernateTutorial\pom.xml
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:432)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:300)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.InvalidProjectModelException: Failed to validate POM for project org.hibernate.tutorials:hibernate-tutorial at c:\FirstHibernateTutorial\pom.xml

at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:1077)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:880)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:508)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:515)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:419)
... 12 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Thu Jul 09 17:39:01 CEST 2009
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------


Top
 Profile  
 
 Post subject: Re: Sample Application within Tutorial
PostPosted: Thu Jul 09, 2009 2:38 pm 
Newbie

Joined: Mon Jul 06, 2009 10:38 am
Posts: 17
you put your JAR files in '<workspace>\WEB-INF\lib' I believe, with <workspace> being the name that you called your workspace. I am using Eclipse and What I usually will do is right-click on the project in the project explorer window and select Build Path->Add External Archives. I then point to the JAR files on my PC. The other option in Eclipse is to try to compile your code.. and when you see the Red X's (compile errors), right-click on them and try 'quick fix'. There should be an option where you can possibly get the JARs organized that way.


Top
 Profile  
 
 Post subject: Re: Sample Application within Tutorial
PostPosted: Wed Jul 15, 2009 6:18 am 
Newbie

Joined: Wed Jul 15, 2009 4:27 am
Posts: 4
I did faced the same problem.
According to error
Quote:
[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

Version numbers are missing
Dependencies tag should look something as follows
<dependencies>
<dependency>
<groupId><GROUPID></groupId>
<artifactId><ARTIFACTID></artifactId>
<version><VERSION NO></version>
<dependency>
</dependencies>
So go to maven repositotry at http://mvnrepository.com/ and search for version numbers. The pom that i have used is as follows
Code:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.hibernate.tutorials</groupId>
  <artifactId>hibernate-tutorial</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>First hibernate tutorials</name>
  <url>http://maven.apache.org</url>
  <dependencies>
     <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.3.1.GA</version>
     </dependency>
     <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
          <version>[2.4,)</version>       
     </dependency>
     <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.5.6</version>
     </dependency>
     <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>[3.0,)</version>
     </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
     <finalName>${artifactId}</finalName>
  </build>
</project>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.