After changing maven snapshot version ,NoSuchmethod error getting.

Answered

Hello All,

I made one maven jar called Utility for the sake of using it into another project .earlier version of that jar was 1.0.0 SNAPSHOT and It was working fine.

I made changes to it and did mvn clean install .Now version is 1.0.1 SNAPSHOT.

I changed version  in the destination projects POM.

I am able to see the latest changes with snapshot 1.0.1 in .m2 repo. also under intelijj External module option it is there.

Am getting below error at runtime of servlet.

java.lang.NoSuchMethodError: com.logger.LogFileCreator.getPrintStream()Ljava/io/PrintStream;

 

Below is snippet of pom xml of destination project

<dependency>
<groupId>com.Utillity</groupId>
<artifactId>Utillity</artifactId>
<version>1.0.1-SNAPSHOT</version>
</dependency>

Below is the snippet of pom of Utility project 

<groupId>com.Utillity</groupId>
<artifactId>Utillity</artifactId>
<version>1.0.1-SNAPSHOT</version>

In dependency dropdown it is showing.
also I am able to see the method inside a class which maven added in destination project as below.

 

I tried invalidating caches,restarting PC,Intelij Idea .
Also tried clean and build maven project(both),deleting repos from .m2 and rebuilding project.

Kindly help if anyone faced same issue before.
Thank you.

0
1 comment

Have you re-deployed the artifact with the updated dependency to a Glassfish server? Make sure the 

1. artifact that you deploy has the updated dependency version. You can check it it the a) Artifact settings and also b) in the artifact output directory for this library.

2. you deployed to the Glassfish server the artifact with the updated dependency. Double check that this dependency has the compile scope (and not provided).

0

Please sign in to leave a comment.