The addition of CATALINA_OPTS doesn't help export CATALINA_OPTS="--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED"
catalina.out confirms the setting:
catalina.2017-01-25.log:25-Jan-2017 06:04:42.911 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED catalina.2017-01-25.log:25-Jan-2017 06:04:42.912 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED catalina.2017-01-25.log:25-Jan-2017 06:04:42.912 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED catalina.out:25-Jan-2017 06:04:42.911 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED catalina.out:25-Jan-2017 06:04:42.912 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED catalina.out:25-Jan-2017 06:04:42.912 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Hi Matej, the test case is following: a Java library, in its own jar file, provides the Interceptor annotation classes and the servlet @Inject MyBean class which has methods annotated by the defined Interceptor annotation. The Interceptor class is listed in beans.xml. The servlet is mvn built after the following steps: 1)adding the weld-servlet dependency (see early comment) 2)add context.xml, which contains following, in src/main/webapp/META-INF <Context> <Resource name="BeanManager" auth="Container" type="javax.enterprise.inject.spi.BeanManager" factory="org.jboss.weld.resources.ManagerObjectFactory"/> </Context> 3)add beans.xml which lists the fully-qualified Interceptor class name within <interceptors></interceptors> in src/main/webapp/WEB-INF The servlet app maven pom.xml uses maven-war-plugin version 3.0.0: <build> <sourceDirectory>src/main/java</sourceDirectory> <finalName>servlet5</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.0.0</version> <configuration> <warSourceDirectory>src/main/webapp</warSourceDirectory> <packagingExcludes>WEB-INF/classes/*Client.class,WEB-INF/classes/URL*.class</packagingExcludes> </configuration> </plugin> </plugins> </build> |
|