1

I have create a web application in eclipse which I am deploying to Tomcat 7 (through eclipse).

I use NTLM authentication (using waffle 1.5) to log in to the application and I want to supply the necessary jars with the application that I am building (and not in the Tomcat 7 lib directory).

To start using waffle I put the following in my META-INF/context.xml

<Valve className="waffle.apache.NegotiateAuthenticator" />

<Realm className="waffle.apache.WindowsRealm" />

When I start the application from eclipse I get a ClassNotFoundException on the waffle.apache.NegotiateAuthenticator

I have the relevant jars in the deployment assembly settings in eclipse as as well in the Order and Export settings. Nothing seems to help.

Update: When I place the files in Tomcat's lib directory then I have no problems and can use the authentication. However, I want to keep the jar files in the web application.

What is necessary to make sure that context.xml has access to the correct jars?

Jonas
  • 95
  • 2
  • 2
  • 9

1 Answers1

2

I would start by putting those files manually in tomcat's lib and getting your configuration to work. Then you can move them into your application. You need jna.jar, platform.jar and commons-logging-1.1.1.jar as well, maybe you have an error above this one or an error in Tomcat's catalina.log. Depending on what you're using you may need to place those files in the parent classloader (tomcat/lib) anyway. Usually all but waffle-jna.jar go in the parent classloader (Tomcat).

sunysen
  • 2,265
  • 1
  • 12
  • 13
  • Indeed, it works when the files are in Tomcat's lib directory but that's what I try to avoid. I want the web-app to be self-contained. I have seen mentioned that the classloader used differs depending on the situation. Are you saying there is no way to use Waffle without putting the files in the Tomcat/lib directory? – Jonas Sep 21 '13 at 06:45
  • opying waffle-jna.jar to the tomcat/lib folder – sunysen Sep 22 '13 at 00:26
  • I want to avoid using the tomcat lib folder. I want to use the WEB-INF/lib folder for all the jars. Is this not possible? If I reference a class in the META-INF/context.xml of the web application, which classloader is used and how can I make sure that this classloader has access to the WEB-INF/lib jars? – Jonas Sep 22 '13 at 13:44
  • I think it is more difficult, and perhaps there will be another master know, I can not solve your problem – sunysen Sep 23 '13 at 00:30
  • There was a similar question asked here: http://stackoverflow.com/questions/6138396/custom-tomcat-valve-contained-in-web-app-war-file. The response was for a custom Valve with Tomcat 6, but the answer is still relevant to your interests. – Michael Dandini Oct 24 '14 at 12:28