Java.lang.NoSuchMethodError when a method definitely exists

I have a Java Spring based web application based on the SpringSource Tool Suite ("STS") and a local copy of Apache Tomcat. We also have an internal production server, again launched by Tomcat.

When I run the application on my development machine and perform a certain action in the web application, everything works correctly. However, when I deploy the web application to Tomcat on the server (via the war file created by maven) and repeat those specific steps above, I get unexpected behavior. When I checked the tomcat server log file, I found this ...

2011-11-16 19:36:45,090 [http-8280-Processor1] ERROR [attachments]  invoke - Servlet.service() for servlet attachments threw exception java.lang.NoSuchMethodError: net.wmfs.coalesce.aa.dao.MediaDao.updateAlfrescoNodeRef(Ljava/lang/Long;Ljava/lang/String;)V
at net.wmfs.coalesce.aa.service.impl.MediaServiceImpl.doFileUpload(MediaServiceImpl.java:102)
at net.wmfs.coalesce.aa.servlet.MediaServlet.doFileUpload(MediaServlet.java:83)
at net.wmfs.coalesce.aa.servlet.MediaServlet.doPost(MediaServlet.java:55)

Now the updateAlfrescoNodeRef method definitely exists in the MediaDao class - otherwise my code will not compile in STS ...

package net.wmfs.coalesce.aa.dao;

public class MediaDao extends JdbcDaoSupport {

    public void updateAlfrescoNodeRef(final Long recordId, final String nodeRef) {
        // java code
    }
}

, .

, , , , maven , . WEB-INF/lib jar, MediaDao, . ...

cat ./MediaDao.class

, , gobledegook. , updateAlfrescoNodeRef, String . , , .

bean XML Spring , , .

Googling , - MediaServlet, MediaServiceImpl, MediaDao - ( WEB-INF). , , .

- , ?

+5
3

. .

, , MediaDao, . - ( , ). , - .

, ( updateAlfrescoNodeRef) STS , Tomcat , . , , , (, , updateAlfrescoNodeRef).

, - : STS CTRL + SHIFT + T, " ", , , .

+7

android, Instant Run. : File β†’ Invalidate Caches/Restart.

+1

Tomcat 6+, ~ tomcat/lib . Tomcat 5 ~ tomcat/common/classes, ~ tomcat/common/lib, ~ tomcat/shared/classes ~ tomcat/shared/lib.

0

All Articles