3

When running XACML-PAP-ADMIN and XACML-PAP-REST on Windows 10. Java jdk1.8.0_144. I get next error:

Error scanning entry META-INF/versions/9/module-info.class from jar file:///D:/Projects/XACML/XACML-PAP-ADMIN/target/xacml-pap-admin-2.0.0-SNAPSHOT/WEB-INF/lib/log4j-api-2.11.0.jar
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136

2 Answers2

2

That could be linked to your version of Jetty, considering it fails on log4j 2.11 jar.

See this question:

log4j 2.9 and later are multi-release jars for Java 9.

Make sure to use a Jetty compatible with that, or use slf4j instead.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • currently my jetty version is 9.3.20.I think first I need to update the jetty version may be it works?Can you please guide me how I am able to update to latest jetty version ? Should I need to update Pom.xml file if yes there where? – Ather Abdul Jabbar Aug 25 '18 at 12:10
  • for further details https://stackoverflow.com/questions/52014779/unable-to-reach-local-host-via-terminal-window – Ather Abdul Jabbar Aug 25 '18 at 16:46
  • @VonC But it should also support earlier jdk7 as well right? Is there any option other than upgrading the application server? – Gaurav Jan 02 '19 at 11:45
  • @gaurav the only other option is that you can downgrade your log4j to a version before log4j started producing JEP 238 JAR files. (which forces JEP 238 behavior on MANY other java projects and libraries) – Joakim Erdfelt Jan 02 '19 at 15:03
0

You can create a custom DevMode JettyLauncher:

import com.google.gwt.core.ext.TreeLogger;
import com.google.gwt.dev.shell.jetty.JettyLauncher;
import org.eclipse.jetty.webapp.WebAppContext;

import java.io.File;

public class DevModeJettyLauncher extends JettyLauncher {
    @Override
    protected WebAppContext createWebAppContext(TreeLogger logger, File appRootDir) {
        WebAppContext webAppContext = super.createWebAppContext(logger, appRootDir);
        webAppContext.setAttribute("org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern", "none");//this is just a regex that matches nothing
        return webAppContext;
    }
}

And then configure it when launching.

Dev Mode Parameters: -server <package>.DevModeJettyLauncher

dac2009
  • 3,521
  • 1
  • 22
  • 22