Environment
Websphere 8.5.5.11
JDK 1.8
DWR
SpringMVC
Oracle DBMS
We recently upgraded our project, and make updates from
spring.jar,
spring-web.jar,
spring-webmvc.jar
dwr.jar
upgraded to
spring version 5.1.7
dwr version 3.0.2
We started facing multiple issues
1. DWR servlet didn't get initialized properly; and complains about Duplicate name found while loading the context, and another problem
our web.xml trying to inialize both servlets i.e. DispacterServlet and DwrSpringServlet
2. After removing spring, spring-web and spring-webmvc and upgrading to latest versions;
web project during compilation and loading complains about missing classes;
spcially one of the .forName methods called during DWR inialization i.e.
java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.forName(Ljava.......
3. engine.js not found where it supposed to be i.e. this error being thrown
'You must include DWR engine before including this file'.
You can find the answers to above in answers section.
Environment
Duplicate name not found problem was happening due to spring-servlet.xml getting loaded twice; this post https://www.conqtech.com/blog/?p=85 help to resolve the problem.
You have to include all the jars below.
They (DWR) team; made a change so that engine.js file should be declared/imported before your remoting referenced .js files in your jsp/html pages. This post help to resolve the problem; https://readthefuckingmanual.net/error/4678/Error-You-must-include-DWR-engine-before-including-this-file.
In addition to all the coding tips above; you must have to define SimpleUrlHandlerMapping as below even you have one already defined.
And we followed below examples to fix the above problems;
http://www.butterdev.com/category/dwr/
We did faced some other compilation issues; but they are common to understand and resolve.
Happy coding!