java.lang.ClassNotFoundException: com.jacob.com.Dispatch

Dec 21, 2011 at 7:17 PM

I'm able to run the sample waffle-spring-filter (v 1.4) demo app in tomcat 6.0.33 with spring 3.0.5 jars. ActiveDirectory authentication works fine in my corporate network.

However, when I included the same code (bean config and jars) in my existing spring app, I get the following error on deployment:

Caused by: java.lang.NoClassDefFoundError: com/jacob/com/Dispatch
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242)

The following jars are present in both the apps:
guava-r07.jar
jna.jar
platform.jar
waffle-jacob.jar
waffle-jna.jar

As usual. there are several other common spring dependencies in my application.

What am I missing? Is there a known issue with other jars?

Thanks

Dec 21, 2011 at 9:19 PM

I downloaded Jacob and placed the jar in web-inf/lib.

The x86 dll was placed in windows/system32. I get the following:

Caused by: com.jacob.com.ComFailException: Can't find moniker
    at com.jacob.com.Dispatch.createInstanceNative(Native Method)
    at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
    at com.waffle.auth.IWindowsAuthProvider.<init>(IWindowsAuthProvider.java:31)
    at com.waffle.auth.WindowsAuthProviderImpl.<init>(WindowsAuthProviderImpl.java:14)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
  

Again, how is the sample spring filter app working and my webapp failing?

Coordinator
Dec 21, 2011 at 9:43 PM

You probably having something loading waffle-jacob.jar, it's not needed. It's the COM interface alternative to JNA. Delete that file - does it fix the problem?

Dec 22, 2011 at 2:41 PM

Removed the waffle-jacob.jar and it worked => Thanks.