0

I'm currently updating a legacy code, and below is the error occured.

SEVERE: Servlet.service() for servlet [RequestController] in context with path [/ngsf] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: com.hierynomus.mssmb2.SMBApiException

Now, MyProject.jar is the one im upgrading to use SMBJ due to limitation to SMB1 from jcifs. Built the jar via eclipse [ right-click project -> export -> JAR File]. After i exported the jar, i delete the old MyProject.jar in WebProject and pasted the new MyProject.jar (basically i've ovewritten the old for the new jar) and ran tomcat via eclipse run server. However, the exception occurred. com.hierynomus.mssmb2.SMBApiException can be found inside smbj-0.9.1.jar.

I did a comparison, using the old jar (using jcifs). everything was good. but when i used the new jar, above exception occured. Basically, i just updated the MyProject.jar. there is no modification on WebProject.

enter image description here

Anyone knows how to fix this?

lemoncodes
  • 2,371
  • 11
  • 40
  • 66
  • First check jar file exported from eclipse has all the classes . – Sambit May 19 '19 at 09:41
  • `SMBApiException.class` i located inside `smbj-0.9.1.jar`. does it have to be outside `lib/` and inside `com`? because both old and new `MyProject.jar` contains the same structure inside `MyProject.jar` (jcifs.jar is located inside lib/ for the old jar, smbj is also located inside lib/ for the new jar) – lemoncodes May 19 '19 at 10:00
  • If there is a package, it should be inside the package. That is how jar file is created. All the jar files should be inside lib directory. – Sambit May 19 '19 at 10:02
  • i see, yes `SMBApiException.class` does exist – lemoncodes May 19 '19 at 10:32

0 Answers0