Missing artifact javax.transaction:jta:jar:1.0.1B ( Issue was different as you may see the resolution is different)

Patty picture Patty · Sep 30, 2013 · Viewed 54.4k times · Source

I am trying to learn Hibernate-Spring-Struts using the example here.

But after creating the pom.xml getting this error :

Missing artifact javax.transaction:jta:jar:1.0.1B

I made a progress only up to creating the pom.xml file and made the changes to include most recent libraries. Here is my pom.xml:

<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>S3HMaven</groupId>
<artifactId>S3HMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>S3HMaven</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>1.0.1B</version>
    </dependency>

    <!-- Struts 2 -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.1.8</version>
    </dependency>

    <!-- Struts 2 + Spring plugins -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-spring-plugin</artifactId>
        <version>2.3.15.2</version>
    </dependency>

    <!-- MySQL database driver -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.26</version>
    </dependency>

    <!-- Spring framework -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
        <version>2.5.6</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>2.5.6</version>
    </dependency>

    <!-- Hibernate core -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate</artifactId>
        <version>3.2.7.ga</version>
    </dependency>

    <!-- Hibernate core library dependency start -->
    <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6.1</version>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
    </dependency>

    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.2.1</version>
    </dependency>

    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2</version>
    </dependency>
    <!-- Hibernate core library dependency end -->

    <!-- Hibernate query library dependency start -->
    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.7</version>
    </dependency>
    <!-- Hibernate query library dependency end -->

</dependencies>
</project>

I tried with and without dependency for javax.transation. Did not make difference. Can any one tell me what am I doing wrong ? What should I do to get rid of it?

Answer

shareef picture shareef · Jul 10, 2015

In my case i tried example from mkyong

jsf-2.0 spring hibernate integration example

When i got the exception i searched alot i was using spring sts suit tool , and eclipse MARS with JDK 8 the solution was

I changed pom to 1.1 instead of 1.0.1B

<dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>
</dependency>

And if it could not be downloaded automatically from m2 repo you should download it manualy (you can check this in the repo in folder C:\Users\pc1\.m2\repository\javax\transaction\jta\1.1\jta-1.1.jar )

and check the maven dependency in project properties it should not give you an error in the lib tab.

References : reference 1 reference 2 reference 3 reference 4 reference 5

Related issues might appear after you solve this if you are applying the tutorial:

1-http://www.mkyong.com/web-development/the-web-xml-deployment-descriptor-examples/

2-http://jonathan.lalou.free.fr/?p=2026

3-Error creating bean with name 'sessionFactory' Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] Tomcat error: Not Found in ExternalContext as a Resource