[JBoss JIRA] (WFLY-10240) WS scripts throws AccessControlException when secmgr is used
by R Searls (JIRA)
[ https://issues.jboss.org/browse/WFLY-10240?page=com.atlassian.jira.plugin... ]
R Searls commented on WFLY-10240:
---------------------------------
This permissions failure when using -secmgr and JDK-8 is a known issue.
I had an email discussion about this with David L. on Feb 20.
David wrote .......
{code:java}
OK it looks like it's the JDK itself which lacks security manager
permissions, which is interesting: we can't really control that
directly.
The CXF "Compiler" class uses
javax.tools.ToolProvider.getSystemJavaCompiler() to get an instance of
Compiler. This instance comes from a URL class loader which is
constructed on the spot by the JDK to load classes from its tools.jar.
The class loader created by the JDK does not grant any static
permssions to the loaded classes, causing the tool to fail.
The workaround is to create a security policy which grants
AllPermission to "file:/usr/java/jdk1.8.0_72/lib/tools.jar". I'm not
sure we can come up with a "proper" fix in the JDK before Java 9
(where the tools are included in the main runtime).
CXF could probably come up with an "improper" fix where the compiler
is located using ServiceLoader (which will work cleanly on Java 9 but
will require support from JBoss Modules in Java 8).
I think we'll have to live with the workaround for now otherwise.
{code}
The workaround is to provide a security.policy file via the -Djava.security.policy option.
I've attached an example security.policy file. You would add it to your JAVA_OPTS
env var
{code:java}
export JAVA_OPTS="-Djava.security.policy=<PATH_TO>/Echo1-security.policy";
{code}
The contents of Echo1-security.policy would be
{code:java}
grant {
permission java.security.AllPermission;
};
{code}
> WS scripts throws AccessControlException when secmgr is used
> ------------------------------------------------------------
>
> Key: WFLY-10240
> URL: https://issues.jboss.org/browse/WFLY-10240
> Project: WildFly
> Issue Type: Bug
> Components: Scripts, Web Services
> Reporter: Marek Kopecký
> Assignee: R Searls
> Priority: Blocker
>
> WS scripts throws AccessControlException when secmgr is used
> {noformat}
> [mkopecky@dhcp-10-40-5-128 bin]$ java -version
> openjdk version "1.8.0_162"
> OpenJDK Runtime Environment (build 1.8.0_162-b12)
> OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
> [mkopecky@dhcp-10-40-5-128 bin]$ ./wsconsume.sh -secmgr https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/test...
> Could not find log4j.properties or log4j.xml configuration, logging to console.
> Loading FrontEnd jaxws ...
> Loading DataBinding jaxb ...
> wsdl2java -compile -exsh false -d /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output/tmp5146068 -verbose -classdir /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output -allowElementReferences https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/test...
> wsdl2java - Apache CXF 3.2.4
> [mkopecky@dhcp-10-40-5-128 bin]$ export SECMGR=true
> [mkopecky@dhcp-10-40-5-128 bin]$ ./wsconsume.sh -secmgr https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/test...
> Could not find log4j.properties or log4j.xml configuration, logging to console.
> Loading FrontEnd jaxws ...
> Loading DataBinding jaxb ...
> wsdl2java -compile -exsh false -d /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output/tmp4759967 -verbose -classdir /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output -allowElementReferences https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/test...
> wsdl2java - Apache CXF 3.2.4
> JBWS024002: Failed to invoke org.apache.cxf.tools.wsdlto.WSDLToJava
> org.apache.cxf.tools.common.ToolException: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.io.FilePermission" "/home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output/tmp4759967/org/openuri/_2004/_04/helloworld/EndpointInterface.java" "read")" in code source "(file:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.162-3.b12.fc26.x86_64/lib/tools.jar <no signer certificates>)" of "java.net.FactoryURLClassLoader@e4d2696")
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:420)
> at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
> at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
> at org.jboss.wsf.stack.cxf.tools.CXFConsumerImpl.consume(CXFConsumerImpl.java:313)
> at org.jboss.ws.tools.cmd.WSConsume.importServices(WSConsume.java:298)
> at org.jboss.ws.tools.cmd.WSConsume.mainInternal(WSConsume.java:108)
> at org.jboss.ws.tools.cmd.WSConsume.main(WSConsume.java:96)
> at org.jboss.modules.Module.runMainMethod(Module.java:348)
> at org.jboss.modules.Module.run(Module.java:328)
> at org.jboss.modules.Main.main(Main.java:557)
> Caused by: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.io.FilePermission" "/home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output/tmp4759967/org/openuri/_2004/_04/helloworld/EndpointInterface.java" "read")" in code source "(file:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.162-3.b12.fc26.x86_64/lib/tools.jar <no signer certificates>)" of "java.net.FactoryURLClassLoader@e4d2696")
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:295)
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:192)
> at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
> at org.wildfly.security.manager.WildFlySecurityManager.checkRead(WildFlySecurityManager.java:360)
> at java.io.File.isDirectory(File.java:844)
> at com.sun.tools.javac.file.RegularFileObject.<init>(RegularFileObject.java:69)
> at com.sun.tools.javac.file.RegularFileObject.<init>(RegularFileObject.java:64)
> at com.sun.tools.javac.file.JavacFileManager.getJavaFileObjectsFromFiles(JavacFileManager.java:785)
> at com.sun.tools.javac.file.JavacFileManager.getJavaFileObjectsFromStrings(JavacFileManager.java:185)
> at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:202)
> at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:141)
> at org.apache.cxf.tools.common.ClassUtils.compile(ClassUtils.java:123)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:303)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:164)
> at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:412)
> ... 9 more
> [mkopecky@dhcp-10-40-5-128 bin]$
> {noformat}
> {noformat}
> [mkopecky@dhcp-10-40-5-128 bin]$ java -version
> openjdk version "1.8.0_162"
> OpenJDK Runtime Environment (build 1.8.0_162-b12)
> OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
> [mkopecky@dhcp-10-40-5-128 bin]$ ./wsprovide.sh -k -c ~/erase13/classes -o out org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> Could not find log4j.properties or log4j.xml configuration, logging to console.
> java2ws -s /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out -classdir /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out -d /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out -verbose -cp /home/mkopecky/erase13/classes/: -wrapperbean -createxsdimports org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> java2ws - Apache CXF 3.2.4
> [mkopecky@dhcp-10-40-5-128 bin]$ export SECMGR=true
> [mkopecky@dhcp-10-40-5-128 bin]$ ./wsprovide.sh -k -c ~/erase13/classes -o out org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> Could not find log4j.properties or log4j.xml configuration, logging to console.
> java2ws -s /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out -classdir /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out -d /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out -verbose -cp /home/mkopecky/erase13/classes/: -wrapperbean -createxsdimports org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> java2ws - Apache CXF 3.2.4
> java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.io.FilePermission" "/home/mkopecky/playground/wf/wfly.23/wfly.23/bin/out/org/jboss/as/testsuite/integration/scripts/test/tools/jaxws/EchoPlus1Response.java" "read")" in code source "(file:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.162-3.b12.fc26.x86_64/lib/tools.jar <no signer certificates>)" of "java.net.FactoryURLClassLoader@29876704")
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:295)
> at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:192)
> at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
> at org.wildfly.security.manager.WildFlySecurityManager.checkRead(WildFlySecurityManager.java:360)
> at java.io.File.isDirectory(File.java:844)
> at com.sun.tools.javac.file.RegularFileObject.<init>(RegularFileObject.java:69)
> at com.sun.tools.javac.file.RegularFileObject.<init>(RegularFileObject.java:64)
> at com.sun.tools.javac.file.JavacFileManager.getJavaFileObjectsFromFiles(JavacFileManager.java:785)
> at com.sun.tools.javac.file.JavacFileManager.getJavaFileObjectsFromStrings(JavacFileManager.java:185)
> at org.apache.cxf.common.util.Compiler.useJava6Compiler(Compiler.java:202)
> at org.apache.cxf.common.util.Compiler.compileFiles(Compiler.java:141)
> at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generateAndCompile(BeanGenerator.java:91)
> at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanGenerator.java:58)
> at org.apache.cxf.tools.java2wsdl.generator.wsdl11.BeanGenerator.generate(BeanGenerator.java:35)
> at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.generate(JavaToWSDLProcessor.java:156)
> at org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToWSDLProcessor.java:118)
> at org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer.java:110)
> at org.apache.cxf.tools.java2ws.JavaToWSContainer.execute(JavaToWSContainer.java:75)
> at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:105)
> at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:45)
> at org.apache.cxf.tools.java2ws.JavaToWS.run(JavaToWS.java:83)
> at org.jboss.wsf.stack.cxf.tools.CXFProviderImpl.provide(CXFProviderImpl.java:200)
> at org.jboss.wsf.stack.cxf.tools.CXFProviderImpl.provide(CXFProviderImpl.java:109)
> at org.jboss.ws.tools.cmd.WSProvide.generate(WSProvide.java:223)
> at org.jboss.ws.tools.cmd.WSProvide.main(WSProvide.java:89)
> at org.jboss.modules.Module.runMainMethod(Module.java:348)
> at org.jboss.modules.Module.run(Module.java:328)
> at org.jboss.modules.Main.main(Main.java:557)
> [mkopecky@dhcp-10-40-5-128 bin]$
> {noformat}
> Second example uses classes from classes.zip file attached in WFLY-10238
> cc: [~jbliznak]
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (WFLY-10238) Wsprovide tool doesn't generate/keep class files on JDK10
by R Searls (JIRA)
[ https://issues.jboss.org/browse/WFLY-10238?page=com.atlassian.jira.plugin... ]
R Searls commented on WFLY-10238:
---------------------------------
To resolve this, an enhancement is required to apache CXF.
https://issues.apache.org/jira/browse/CXF-7711 was filed
Submitted PR: https://github.com/jboss/cxf/pull/19
That PR will need to be back ported to cxf-3.2.4 which is the version wfly-13 and jbossws is using.
A PR will be needed for jbossws to use the change to CXF.
JBWS-4113 was filed. PR is pending CXF merge or a redhat specific cxf archive build.
> Wsprovide tool doesn't generate/keep class files on JDK10
> ---------------------------------------------------------
>
> Key: WFLY-10238
> URL: https://issues.jboss.org/browse/WFLY-10238
> Project: WildFly
> Issue Type: Bug
> Components: Web Services
> Reporter: Marek Kopecký
> Assignee: R Searls
> Priority: Blocker
> Fix For: 13.0.0.Beta1
>
> Attachments: classes.zip
>
>
> Wsprovide tool doesn't keep class files on JDK10
> Example:
> {noformat}
> [mkopecky@localhost bin]$ jdk8
> [mkopecky@localhost bin]$ java -version
> java version "1.8.0_111"
> Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
> Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
> [mkopecky@localhost bin]$ ./wsprovide.sh -k -c ~/erase10/classes -o out org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> Could not find log4j.properties or log4j.xml configuration, logging to console.
> java2ws -s /home/mkopecky/playground/wf/wfly.22/wfly.22/bin/out -classdir /home/mkopecky/playground/wf/wfly.22/wfly.22/bin/out -d /home/mkopecky/playground/wf/wfly.22/wfly.22/bin/out -verbose -cp /home/mkopecky/erase10/classes/: -wrapperbean -createxsdimports org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> java2ws - Apache CXF 3.2.4
> [mkopecky@localhost bin]$ find out/ | grep class
> out/org/jboss/as/testsuite/integration/scripts/test/tools/jaxws/EchoPlus1.class
> out/org/jboss/as/testsuite/integration/scripts/test/tools/jaxws/EchoPlus1Response.class
> [mkopecky@localhost bin]$ jdk10
> [mkopecky@localhost bin]$ rm -rf out
> [mkopecky@localhost bin]$ java -version
> java version "10" 2018-03-20
> Java(TM) SE Runtime Environment 18.3 (build 10+46)
> Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)
> [mkopecky@localhost bin]$ ./wsprovide.sh -k -c ~/erase10/classes -o out org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> Could not find log4j.properties or log4j.xml configuration, logging to console.
> java2ws -s /home/mkopecky/playground/wf/wfly.22/wfly.22/bin/out -classdir /home/mkopecky/playground/wf/wfly.22/wfly.22/bin/out -d /home/mkopecky/playground/wf/wfly.22/wfly.22/bin/out -verbose -cp /home/mkopecky/erase10/classes/: -wrapperbean -createxsdimports org.jboss.as.testsuite.integration.scripts.test.tools.Echo1Impl
> java2ws - Apache CXF 3.2.4
> [mkopecky@localhost bin]$ find out/ | grep class
> [mkopecky@localhost bin]$
> {noformat}
> I attached input class files. I see this issue on WF with latest WS.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (WFLY-10246) Required services that are not installed
by Brian Stansberry (JIRA)
[ https://issues.jboss.org/browse/WFLY-10246?page=com.atlassian.jira.plugin... ]
Brian Stansberry commented on WFLY-10246:
-----------------------------------------
If your application includes a jboss-all.xml with 'dependency name="module2D-3.3.0.ear"' and there is no such ear deployed as part of your uberjar, it definitely wont work. That configuration tells the appserver that there should be another deployment inside the same appserver VM.
> Required services that are not installed
> ----------------------------------------
>
> Key: WFLY-10246
> URL: https://issues.jboss.org/browse/WFLY-10246
> Project: WildFly
> Issue Type: Bug
> Affects Versions: 10.1.0.Final
> Environment: migrating wildfly 10.1.0 to widfly-swarm 2017.11.0
> Reporter: Zakaria mh
> Assignee: Jason Greene
> Labels: Swarm
>
> ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "module1-3.3.0-SNAPSHOT.war")) - failure description: {
> "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"module2D-3.3.0-SNAPSHOT.ear\".deploymentCompleteService"],
> "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"module1-3.3.0-SNAPSHOT.war\".PARSE is missing [jboss.deployment.unit.\"module2D-3.3.0-SNAPSHOT.ear\".deploymentCompleteService]"]
> }
> [0m [31m2018-04-16 12:13:59,010 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "module1-3.3.0-SNAPSHOT.war" was rolled back with the following failure message:
> {
> "WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"module2D-3.3.0-SNAPSHOT.ear\".deploymentCompleteService"],
> "WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"module1-3.3.0-SNAPSHOT.war\".PARSE is missing [jboss.deployment.unit.\"module2D-3.3.0-SNAPSHOT.ear\".deploymentCompleteService]"]
> }
> [0m [0m2018-04-16 12:13:59,789 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment module1-3.3.0-SNAPSHOT.war (runtime-name: module1-3.3.0-SNAPSHOT.war) in 779ms
> [0m [0m2018-04-16 12:13:59,790 INFO [org.jboss.as.controller] (main) WFLYCTL0183: Service status report
> WFLYCTL0184: New missing/unsatisfied dependencies:
> service jboss.deployment.unit."module2D-3.3.0-SNAPSHOT.ear".deploymentCompleteService (missing) dependents: [service jboss.deployment.unit."module1-3.3.0-SNAPSHOT.war".PARSE]
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years
[JBoss JIRA] (ELY-1563) Implement the optional Callbacks for the ServletContainerProfile
by Darran Lofthouse (JIRA)
Darran Lofthouse created ELY-1563:
-------------------------------------
Summary: Implement the optional Callbacks for the ServletContainerProfile
Key: ELY-1563
URL: https://issues.jboss.org/browse/ELY-1563
Project: WildFly Elytron
Issue Type: Task
Components: EE
Reporter: Darran Lofthouse
The following callbacks are options but we should be able to support some / all of them with the Elytron architecture: -
* CertStoreCallback
* PrivateKeyCallback
* SecretKeyCallback
* TrustStoreCallback
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
8 years