Rectangle 27 11

If you are using Jboss 7.1.1, jboss already has hibernate-jpa-2.0 in its classpath, so during runtime it uses the one in its classpath, not the one you've deployed with your app , to point jboss to the hibernate-jpa-2.1 do the following:

eclipse - java.lang.NoSuchMethodError: javax.persistence.Table.indexes...

java eclipse hibernate maven jpa
Rectangle 27 11

If you are using Jboss 7.1.1, jboss already has hibernate-jpa-2.0 in its classpath, so during runtime it uses the one in its classpath, not the one you've deployed with your app , to point jboss to the hibernate-jpa-2.1 do the following:

eclipse - java.lang.NoSuchMethodError: javax.persistence.Table.indexes...

java eclipse hibernate maven jpa
Rectangle 27 7

In my case the culprit was javaee-api and glassfish libs that didn't support JPA 2.1

Wish I'd seen this earlier! Yes, Glassfish 3 does not support JPA 2.1: stackoverflow.com/q/18447541/2083907

eclipse - java.lang.NoSuchMethodError: javax.persistence.Table.indexes...

java eclipse hibernate maven jpa
Rectangle 27 7

In my case the culprit was javaee-api and glassfish libs that didn't support JPA 2.1

Wish I'd seen this earlier! Yes, Glassfish 3 does not support JPA 2.1: stackoverflow.com/q/18447541/2083907

eclipse - java.lang.NoSuchMethodError: javax.persistence.Table.indexes...

java eclipse hibernate maven jpa
Rectangle 27 2

buildSessionFactory() in your code is deprecated for the Hibernate version you are using. You will have to fix your code. This question explains more about the deprecated session factory.

hibernate - java.lang.NoSuchMethodError: javax.persistence.Table.index...

java hibernate maven
Rectangle 27 2

buildSessionFactory() in your code is deprecated for the Hibernate version you are using. You will have to fix your code. This question explains more about the deprecated session factory.

hibernate - java.lang.NoSuchMethodError: javax.persistence.Table.index...

java hibernate maven
Rectangle 27 1

javax.persistence:persistence-api:jar:1.0.2:compile
javax.persistence.JoinTable

Probably, servers have various class loader's strategies to load jars. In one situation jars are loaded in the right order.

To check @JoinTable annotation. You can do something like this before Hibernate configuration

Class<?> joinTable = Thread.currentThread().getContextClassLoader()
        .loadClass(JoinTable.class.getName());

System.out.println(Arrays.asList(joinTable.getDeclaredMethods()));
javax.persistence.JoinTable.indexes()

So shall i consider that you are asking me to remove 'javax.persistence:persistence-api:jar:1.0.2:compile' and then check. Right?

@AhsanIqbal Yes. You need to exclude it in the pom.xml.

Thanks for your prompt response. Let me do the same, and will get back to you if issue still persist.

I did the same but issue still persist.

hibernate - java.lang.NoSuchMethodError: javax.persistence.JoinTable.i...

java hibernate maven tomcat jpa
Rectangle 27 1

In case of JBoss7, you should replace the api jar in jboss7/modules/javax/persistence/api with updating module.xml file with the updated jar file.

eclipse - java.lang.NoSuchMethodError: javax.persistence.Table.indexes...

java eclipse hibernate maven jpa
Rectangle 27 1

In case of JBoss7, you should replace the api jar in jboss7/modules/javax/persistence/api with updating module.xml file with the updated jar file.

eclipse - java.lang.NoSuchMethodError: javax.persistence.Table.indexes...

java eclipse hibernate maven jpa
Rectangle 27 19

The problem is that you are mixing different versions of Spring, you are mixing (2.0.8, 3.1.4 and 4.0.2) in your project. That is trouble waiting to happen.

To prevent these kind of things there is now a so called "bill of materials" POM which you can import.

You need to add a dependencyManagement section to import the bom.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>4.0.5.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Now in your dependencies you can remove the version and replace spring-dao with spring-orm. Added benefit is that all your spring-* dependencies will now be managed to the latest release and you only have a single location for your version number.

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
</dependency>

You could apply the same trick for Spring Data as that also has a bom.

Agree! Caused by having different versions of Spring.

spring - java.lang.NoSuchMethodError: org.springframework.core.annotat...

java spring maven junit
Rectangle 27 9

That method appeared in that commit, which seems to be 4.0.3+. Just update spring dependencies to the latest version.

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

spring - java.lang.NoSuchMethodError: org.springframework.core.annotat...

java spring maven junit
Rectangle 27 6

In version 1.3.2 the class FileUtilsdoesn't have a method copyInputStreamToFile you need at least version 2.0

Please see the javadoc for the current version 2.5. There you will find the method and a Sincetag.

thanks for help, but it didn't worked out. Still displaying same error

Have you changed your dependency to mvn:commons-io:commons-io:2.5. Be aware that the group id has changed, too.

@MadhaviMokkapati Also I just checked the current pom of the web driver github.com/bonigarcia/webdrivermanager/blob/master/pom.xml and they are using version 2.5 of commons-io.

@christan, yes i changed whole dependency tag, please find the updated tag in description.

@MadhaviMokkapati does this error occur during debugging? And / or running the your program itself? Is your classpath correct?

maven - java.lang.NoSuchMethodError: org.apache.commons.io.FileUtils.c...

java maven selenium-webdriver nosuchmethoderror
Rectangle 27 57

I was getting the exactly same issue. I was using Maven for dependency management and had added dependency for jackson-databind module only like this

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>${jackson.version}</version>
</dependency>

and then I resolved it by doing this.. I added its transitive dependencies explicitly with the same jackson.version mentioned for each of them in the pom.xml file, as guided here

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-annotations</artifactId>
    <version>${jackson.version}</version>
</dependency>
<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-core</artifactId>
    <version>${jackson.version}</version>
</dependency>

This worked for me, but note this jar should then occur in the classpath before the jars with the earlier version of jackson.

Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml....

java jackson
Rectangle 27 1

I upgraded to WebLogic Server Version: 12.1.3.0.0 but the issue is not resolved.

did you enable jpa 2.1 ? it is not by default.

Thank you for your help..Its Working fine when i updated to WebLogic Server Version: 12.1.3.0.0 and added dependacies mentioned in the link you provided..Thank you once again.

How to Solve Caused By: java.lang.NoSuchMethodError: javax.persistence...

spring maven jpa
Rectangle 27 4

getHeaders()Ljavax/ws/rs/core/MultivaluedMap;
resteasy-jaxrs.jar
org.jboss.resteasy.specimpl.BuiltResponse

@ThilinaSampath See the second paragraph

I try that way my total project not working. how to I solve it.

@ThilinaSampath have you added the dependency to your pom.xml?

maven - java.lang.NoSuchMethodError: org.jboss.resteasy.specimpl.Built...

maven tomcat servlets jax-rs
Rectangle 27 2

java.lang.NoSuchMethodError: org.springframework.jdbc.datasource.DataSourceUtils.doCloseConnection(Ljava/sql/Connection;Ljavax/sql/DataSource;)

This is generally an indication that you have either a class loading problem or are mixing spring versions. The latter is more likely.

Another thing on your configuration is that you are duplicating all your beans! Both your DispathcerServlet and ContextLoaderListener are loading the same configuration which can lead to strange problems. If you don't need a root context just remove the ContextLoaderListener. If you really need it split your configuration.

Next to that your bean configuration is flawed you are duplicating all beans in a single context as well. You are scanning for beans and as well add them as xml configuration (leading to 2 instances of a bean). Don't do that. Also the <context:property-placeholder /> is the same as PropertyPlaceholderConfigurer.

<tx:annotation-driven />
<context:annotation-config />
<context:component-scan />

All in all your configuration also needs some cleanup/love.

Wow! Thanx. I was suspecting that I have duplicate beans, but was afraid to remove anything. Also, I realise that my configuration is quite messed up due to little experience, so your advice will help me a lot.

java - org.springframework.beans.factory.BeanCreationException in Spri...

java spring maven spring-mvc tomcat
Rectangle 27 11

You are mixing Spring 3.1.1 with Spring 2.5.6. Add explicit dependencies or dependency management entries for those Spring dependencies that are still on 2.5.6 to upgrade them to 3.1.1 or downgrade your project.

Hi Rec Thanks for the response ,Which one are you refering to as 2.5.6 .Can you point out that .

Well, look at what you posted yourself: org.springframework:spring-context:jar:2.5.6, org.springframework:spring-beans:jar:2.5.6, etc. There is even a 3.1.0.RC2 in there. All Spring dependencies should have the same version. Just add explicit dependencies on the 3.1.1 version for all of these artifacts to your pom instead of relying on transitive inclusion.

Yes Rec i understand i am missing out something here , spring-context:jar:2.5.6 or spring-beans:jar:2.5.6 is in the dependency tree , but i did not add them explicitly,I am finding trouble in removing them as i need to use 3..1.1 .could you please suggest

Maven uses the principle of the "closest version". "Close" means, how many dependency steps away from your project. So if you do not explicitly include these dependencies in the correct version yet, then start doing it. Nothing is "closer" than the dependency defined in the pom itself. Excluding them can lead to problems as other dependency may need them. Otherwise, refer to this post for an example of how to exclude a dependency. I wouldn't recommend it in your situation though.

spring - java.lang.NoSuchMethodError: org.springframework.web.context....

java spring maven spring-batch
Rectangle 27 10

As mentioned in the comments, there is a difference between the version of the Maven Ant tasks used in Eclipse versus the one used on the command line. Eclipse seems to be using a newer version of this library in which the method DependenciesTask.setPathType(String) exists whereas the command line is relying on an older version.

You may be able to get more information on which version of the Ant tasks Eclipse is using by checking the preferences page. Try navigating to Window -> Preferences -> Ant -> Runtime and see Classpath tab for external libraries.

On the other hand, from the output of the Ant build:

[echo] Executing maven build on Developer machine (other machine)
parsing buildfile jar:file:/C:/Apps/ANT/apache-ant-1.9.5/lib/maven-artifact-ant-2.0.4-dep.jar!/org/apache/maven/artifact/ant/antlib.xml with URI = jar:file:/C:/Apps/ANT/apache-ant-1.9.5/lib/maven-artifact-ant-2.0.4-dep.jar!/org/apache/maven/artifact/ant/antlib.xml from a zip file

the command line is obviously using version 2.0.4 which is located in the lib folder of the Ant home directory. Checking this page, the latest version is 2.1.3 which does contain the missing method. So it would make sense to update the version in the Ant lib directory to be the latest one (check the download link on the project page).

This definitely helps point me in the right direction of a fix, but something is still missing. Something that the command line is doing that eclipse isn't is trying to call both the artifact file and the ant-tasks file assigned to the project in consecutive order: parsing buildfile jar:file:/C:/.../apache-ant-1.9.5/lib/maven-artifact-ant-2.0.4-dep.jar!/org/... with URI = jar:file:/C:.. parsing buildfile jar:file:/C:.../ant/lib/maven-ant-tasks-2.1.3.jar!/org/... with URI = jar:file:/C:...

oddly, I can actually see all the classes needed loading when that maven-arifact jar is not called.

@JustinGrant I think maven-ant-tasks-2.1.3.jar and maven-artifact-ant-2.0.4-dep.jar are the same library. They're just two different versions. Are you saying that the command line is parsing these two Jars at the same time? If yes it means both are referenced on the classpath -- you should only use one, preferrably the newest.

That is what I'm saying yes. It's parsing both, and the second one last. I think we're on the same page.

eclipse - java.lang.NoSuchMethodError Ant/Maven failing via command li...

java eclipse maven ant
Rectangle 27 5

You seem to have the org.jboss.logging.Logger class in two libraries:

jboss:jboss-common:jar:4.2.2.GA and org.jboss.logging:jboss-logging:jar:3.1.3.GA

the second one is used by hibernate and I would thing it is the correct one. I think you need to use the correct jboss-common version to not run into this issue.

eclipse - java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMes...

java eclipse maven tomcat dependencies