I am using the hibernate annotation in my application but when i m trying to build my project using maven then I am getting the following error
I am using mvn -o install
D:\workspace\bluetropics-model\src\main\java\net\hoike\bluetropics\datacatalog\objects\types\ViolationCodeType.java:[6,25] package javax.persistence does not exist
D:\workspace\bluetropics-model\src\main\java\net\hoike\bluetropics\datacatalog\objects\types\ViolationCodeType.java:[7,25] package javax.persistence does not exist
D:\workspace\bluetropics-model\src\main\java\net\hoike\bluetropics\datacatalog\objects\types\ApplicationStatusType.java:[7,25] package javax.persistence does not exist
D:\workspace\bluetropics-model\src\main\java\net\hoike\bluetropics\datacatalog\objects\types\CareRenderedType.java:[4,25] package javax.persistence does not exist
D:\workspace\bluetropics-model\src\main\java\net\hoike\bluetropics\datacatalog\objects\PolicyId.java:[5,25] package javax.persistence does not exist
Here is my POM file entries
<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
<dependencies>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.0-alpha-2</version>
<configuration>
<components>
<component>
<name>hbm2hbmxml</name>
<outputDirectory>src/main/resources</outputDirectory>
<implementation>annotationconfiguration</implementation>
</component>
<component>
<name>hbm2cfgxml</name>
<outputDirectory>target/classes</outputDirectory>
<implementation>annotationconfiguration</implementation>
</component>
</components>
<componentProperties>
<drop>false</drop>
<create>false</create>
<jdk5>true</jdk5>
<configurationfile>/src/main/resources/hibernate.cfg.xml</configurationfile>
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle</artifactId>
<version>9201</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.1.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.2.0.ga</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>ejb</artifactId>
<version>3.0-public_review</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<properties>
<copyright.year>2007</copyright.year>
<spring.version>2.0.5</spring.version>
<jmock.version>1.1.0</jmock.version>
<jsp.version>1.0.6</jsp.version>
<junit.version>3.8.2</junit.version>
<servlet.version>2.4</servlet.version>
<wiser.version>1.0.3</wiser.version>
<log4j.version>1.2.13</log4j.version>
<hibernate.version>3.2.0.ga</hibernate.version>
<commons.lang.version>2.3</commons.lang.version>
<jpa.version>1.0</jpa.version>
<aspectj.version>1.5.3</aspectj.version>
<commons.beanutils.version>1.7.0</commons.beanutils.version>
<javamail.version>1.4</javamail.version>
<jmock.version>1.1.0</jmock.version>
<velocity.version>1.4</velocity.version>
<wiser.version>1.0.3</wiser.version>
<!-- Database settings -->
<dbunit.dataTypeFactoryName>org.dbunit.dataset.datatype.DefaultDataTypeFactory</dbunit.dataTypeFactoryName>
<dbunit.operation.type>CLEAN_INSERT</dbunit.operation.type>
<hibernate.dialect>org.hibernate.dialect.MySQLInnoDBDialect</hibernate.dialect>
<jdbc.groupId>mysql</jdbc.groupId>
<jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
<jdbc.version>5.0.5</jdbc.version>
<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
<jdbc.url><![CDATA[jdbc:mysql://localhost/complexx?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf-8]]></jdbc.url>
<jdbc.username>root</jdbc.username>
<jdbc.password>p0k3rpr0</jdbc.password>
</properties>
I tried with persistence-api1.0.jar also instead of ejb_public_review.jar but the result was same.
Amit Verma
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html