Skip to content

Glassfish 5.1 EE 8 (not Jakarta) problem with jna library #1728

@mkorkus

Description

@mkorkus

I have problem with jna. I spent many hours trying to solve this problem but without any result. Asking AI etc.
When I type username and password in Google Chrome pop-up I get an exception:

java.lang.AbstractMethodError: com.sun.jna.Structure.getFieldOrder()Ljava/util/List;
	at com.sun.jna.Structure.fieldOrder(Structure.java:952)
	at com.sun.jna.Structure.getFields(Structure.java:1006)
	at com.sun.jna.Structure.deriveLayout(Structure.java:1172)
	at com.sun.jna.Structure.calculateSize(Structure.java:1097)
	at com.sun.jna.Structure.calculateSize(Structure.java:1049)
	at com.sun.jna.Structure.allocateMemory(Structure.java:403)
	at com.sun.jna.Structure.<init>(Structure.java:194)
	at com.sun.jna.Structure.<init>(Structure.java:182)
	at com.sun.jna.Structure.<init>(Structure.java:169)
	at com.sun.jna.Structure.<init>(Structure.java:161)
	at com.sun.jna.platform.win32.Sspi$SecHandle.<init>(Sspi.java:496)
	at com.sun.jna.platform.win32.Sspi$CredHandle.<init>(Sspi.java:536)
	at waffle.windows.auth.impl.WindowsCredentialsHandleImpl.initialize(WindowsCredentialsHandleImpl.java:92)
	at waffle.windows.auth.impl.WindowsAuthProviderImpl.acceptSecurityToken(WindowsAuthProviderImpl.java:125)

My configuration:

Windows 10 Pro Version 22H2 OS Build 19045.6466

  1. Glassfish 5.1

  2. jdk-8.0.482.8-hotspot

  3. Configuration in NetBeans 8.2:

Image Image

I tried downgrading to Glassfish 5.0 and different versions of jna, waffle but always got the same error. Different versions I mean waffle library every version to 3.3.0. When you look into the maven repository mvnrepository.com/artifact/com.github.waffle/waffle-jna then you can see this version and dependencies. When you use a higher version 3.4.0 then you will get an exception that java version is wrong.

  1. index3.jsp

<jsp:forward page="index.jsf"/>

  1. index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
    <head>
    </head>
</html>
  1. faces-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
      xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="[http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_2.xsd](http://xmlns.jcp.org/xml/ns/javaee%20http:/java.sun.com/xml/ns/javaee/web-facesconfig_2_2.xsd)"
      version="2.2">
</faces-config>
  1. web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app 
    version="3.1" 
    xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>
            /WEB-INF/faces-config.xml
        </param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index3.jsp</welcome-file>
    </welcome-file-list>
    <!-- Waffle Negotiate Filter -->
    <filter>
        <filter-name>SecurityFilter</filter-name>
        <filter-class>waffle.servlet.NegotiateSecurityFilter</filter-class>
        <init-param>
            <param-name>securityFilterProviders</param-name>
            <param-value>
                waffle.servlet.spi.BasicSecurityFilterProvider
                waffle.servlet.spi.NegotiateSecurityFilterProvider
            </param-value>
        </init-param>
        <init-param>
            <param-name>principalFormat</param-name>
            <param-value>fqn</param-value>           <!-- or "both", "sid", "none" -->
        </init-param>
        <init-param>
            <param-name>roleFormat</param-name>
            <param-value>both</param-value>          <!-- groups as roles -->
        </init-param>
        <init-param>
            <param-name>allowGuestLogin</param-name>
            <param-value>false</param-value>
        </init-param>
        <!-- Optional: disable fallback to Basic if you want pure Negotiate -->
        <!--<init-param>
            <param-name>disableSSO</param-name>
            <param-value>false</param-value>
        </init-param>-->
    </filter>
    <filter-mapping>
        <filter-name>SecurityFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions