Waffle 1.5, waffle-jna.jar

1,517 views
Skip to first unread message

Dan Rollo

unread,
Oct 18, 2012, 11:51:24 AM10/18/12
to waffle...@googlegroups.com
Hi,

I'm testing waffle with jna 3.5.0-rc, and the newest beta I could find (https://github.com/downloads/dblock/waffle/Waffle.1.5.83.beta.zip - is there a newer one?) no longer contains a waffle-jna.jar.
We were using waffle-jna.jar v1.4, so I'm wondering what jar(s) is needed for waffle 1.5 to be equivalent to 1.4 waffle-jna.jar. (Hoping for a drop in replacement...).

Also, I'm trying to build the waffle 1.5 branch, and getting this error:

"C:\oss\java\git\github\waffle\Waffle.proj" (all target) (1) ->
(clean target) ->
  Source\WindowsAuthProviderMergeModule\WindowsAuthProviderMergeModule.wixproj : Solution file warning MSB4122: Scannin
g project dependencies for project "Source\WindowsAuthProviderMergeModule\WindowsAuthProviderMergeModule.wixproj" faile
d. The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\Wix.targets" was not found. Confirm that the
 path in the <Import> declaration is correct, and that the file exists on disk.  C:\oss\java\git\github\waffle\Source\W
indowsAuthProviderMergeModule\WindowsAuthProviderMergeModule.wixproj

I do have a ...\Wix\v3.0\Wix.targets (but not a ...\Wix\v3.x\). Where can I specify this path? Or is there a better solution?

Thanks,
Dan

Daniel Doubrovkine

unread,
Oct 18, 2012, 12:22:03 PM10/18/12
to waffle...@googlegroups.com
I've uploaded https://github.com/downloads/dblock/waffle/Waffle.1.5.1018.0.zip

It has a waffle-jna.jar, there was some refactoring going on earlier, but the renaming was undone, so everything should be the same. If you're using Tomcat valves, you'll also need one of the -tomcat JARs, but if you use a filter, you don't need to change anything.

Piebe de Vries

unread,
Oct 19, 2012, 10:52:45 AM10/19/12
to waffle...@googlegroups.com
I am trying  to get the waffle-spring-filter 1.5 example running but do not succeed with either jna 3.4 or 3.5.

3.4 gives: java.lang.AbstractMethodError: com.sun.jna.Structure.getFieldOrder()Ljava/util/List;
3.5 gives: java.lang.NoSuchMethodError: com.sun.jna.platform.win32.Secur32.AcquireCredentialsHandle(Ljava/lang/String;Ljava/lang/String;ILcom/sun/jna/platform/win32/WinNT$LUID;Lcom/sun/jna/Pointer;Lcom/sun/jna/Pointer;Lcom/sun/jna/Pointer;Lcom/sun/jna/platform/win32/Sspi$CredHandle;Lcom/sun/jna/platform/win32/Sspi$TimeStamp;)

I read something about a private jna build. Which version am I supposed to use? Or where can I find the private build?

Thanks,
 Piebe

Daniel Doubrovkine

unread,
Oct 19, 2012, 2:17:53 PM10/19/12
to waffle...@googlegroups.com
I think that build is toast. Try https://github.com/downloads/dblock/waffle/Waffle.1.5.zip, it has the proper JNA in it. If that works, I'm going to release it Monday Let me know how it goes.

frederik...@googlemail.com

unread,
Jan 11, 2013, 8:00:39 AM1/11/13
to waffle...@googlegroups.com
Hi There,

i also ran into the 'java.lang.NoSuchMethodError: com.sun.jna.platform.win32.Secur32.AcquireCredentialsHandle' with Waffle 1.5. It seems that the calling Class (WindowsCredentialsHandleImpl#initialize() contained in waffle-jna.jar) was compiled against a platform/jna that uses 9 Parameters (including an int one) but the provided jna/platform jars in the Waffle 1.5-package contain a Version of Secur32 that supports only 8 parameters. 

I was able to solve my problems by using platform jna-3.5.1.jar and platform-3.5.1.jar instead. Now it works as expected. Perhaps Waffle 1.5 was compiled against platform-3.5.1 but the release contains 3.5.0?

Some more info on my setup and what i was trying to achieve:
- Usecase: Spring Security Single-SignOn Filter
- Waffle-Version: 1.5
- Jetty-Version: 6.1.26
- servlet-api: 2.5
- spring-version: 3.1.3.RELEASE

Aside from this: i think waffle is great stuff.

Best,
Frederik

Daniel Doubrovkine

unread,
Jan 12, 2013, 3:58:59 PM1/12/13
to waffle...@googlegroups.com
This doesn't make too much sense - the signature of that function hasn't changed in ages. Where are you seeing the difference? I was looking at https://github.com/twall/jna/commits/master/contrib/platform/src/com/sun/jna/platform/win32/Secur32.java.

Now.. I DO want to release Waffle 1.6 so that we can have a proper package in maven & al, soon.

frederik...@googlemail.com

unread,
Jan 14, 2013, 5:25:33 AM1/14/13
to waffle...@googlegroups.com
Well yes, this interface
or an implementation thereof is what im having trouble with.

I looked at the history and found there have been several changes regarding the AcquireCredentialsHandle signature and a the fCredentialUse parameter (NativeLong, long, int). I do not fully understand  what that is about, but in my case this param seems to be missing alltogether (see below).

This is the error i get with platform-3.5.0 (and or jna-3.5.0.jar)
Waffle-Error:
HTTP ERROR 500

Problem accessing /test/app/. Reason:

    com.sun.jna.platform.win32.Secur32.AcquireCredentialsHandle(Ljava/lang/String;Ljava/lang/String;ILcom/sun/jna/platform/win32/WinNT$LUID;Lcom/sun/jna/Pointer;Lcom/sun/jna/Pointer;Lcom/sun/jna/Pointer;Lcom/sun/jna/platform/win32/Sspi$CredHandle;Lcom/sun/jna/platform/win32/Sspi$TimeStamp;)I

Caused by:

java.lang.NoSuchMethodError: com.sun.jna.platform.win32.Secur32.AcquireCredentialsHandle(Ljava/lang/String;Ljava/lang/String;ILcom/sun/jna/platform/win32/WinNT$LUID;Lcom/sun/jna/Pointer;Lcom/sun/jna/Pointer;Lcom/sun/jna/Pointer;Lcom/sun/jna/platform/win32/Sspi$CredHandle;Lcom/sun/jna/platform/win32/Sspi$TimeStamp;)I
at waffle.windows.auth.impl.WindowsCredentialsHandleImpl.initialize(Unknown Source)
at waffle.windows.auth.impl.WindowsAuthProviderImpl.acceptSecurityToken(Unknown Source)
at waffle.servlet.spi.NegotiateSecurityFilterProvider.doFilter(Unknown Source)
at waffle.servlet.spi.SecurityFilterProviderCollection.doFilter(Unknown Source)
at waffle.spring.NegotiateSecurityFilter.doFilter(Unknown Source)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451)

Looking at the Signature of the expected 'AcquireCredentialsHandle':
com.sun.jna.platform.win32.Secur32.AcquireCredentialsHandle(
Ljava/lang/String;
Ljava/lang/String;
ILcom/sun/jna/platform/win32/WinNT$LUID;
Lcom/sun/jna/Pointer;
Lcom/sun/jna/Pointer;
Lcom/sun/jna/Pointer;
Lcom/sun/jna/platform/win32/Sspi$CredHandle;
Lcom/sun/jna/platform/win32/Sspi$TimeStamp;
)I

it has only 8 params and is missing the third int-type parameter '_credentialsType' beeing used in the waffle source (WindowsCredentialsHandleImpl#initialize())
AcquireCredentialsHandle(
java.lang.String arg0, 
java.lang.String arg1, 
int arg2, <-!!! (this is the _credentialsType param)
com.sun.jna.platform.win32.WinNT.LUID arg3, 
com.sun.jna.Pointer arg4, 
com.sun.jna.Pointer arg5, 
com.sun.jna.Pointer arg6, 
com.sun.jna.platform.win32.Sspi.CredHandle arg7, 
com.sun.jna.platform.win32.Sspi.TimeStamp arg8
);

I havent looked at the jna-source code yet, but from what i can see in the .class-Files of Secur32 in platform-3.5.0 and platform-3.5.1 they have the same signature and the signature is correct with 9 params. Where does this 8 params-method-call come from? All i know is, that it works with platform-3.5.1/jna-3.5.1.
Reply all
Reply to author
Forward
0 new messages