Problem of JTango with Hibernate

Hi Team,

We are using Hibernate in our test application for database transactions. Some jars related to hibernate needs to be added in build path along with the JTango jar.
Problem : When the above application is run, following error is observed:
java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I

Probable cause: Antlr.jar is one of the jar required for Hibernate application. While running the application antlr class is loaded from JTango jar. There is conflict in antlr class of JTango jar and antlr jar included in application or JTango jar does not have the required method, results in throwing the error.

Troubleshooting at our end: To overcome this problem we have replaced the antlr class in JTango jar by antlr class from antlr jar. This resolves the problem.

Because of above error, we have to modify the JTango jar which is not recommended.
It will be good if JTango jar is updated with the latest antlr class with the known version.
Or let us know for some other solution.
Regards,
TCS_GMRT
You can use maven to resolve dependency, for instance in your pom.xml:


…
<dependency>
  <groupId>org.tango-controls</groupId>
  <artifactId>JTango</artifactId>
  <version>9.3.2</version>
  <exclusions>
    <exclusion>
      <artifactId>antlr</artifactId>
    </exclusion>
  </exclusions>
</dependency>
…

Corresponding link: https://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

OR

you can directly specify the required version in your dependencies - this will override all others dependencies added transitively.

Hope this helps.

Cheers,
 
Register or login to create to post a reply.