Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10241

-secmgr property doesn't work in wsprovide&&wsconsume scripts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • None
    • Scripts, Web Services
    • None

    Description

      standalone&&domain&&appclient scripts support -secmgr command line argument or SECMGR=true env property, see the details here

      wsprovide&&wsconsume scripts should be able to use the same configuration settings.

      But scripts behaviour is different in these two scenarios, so -secmgr command line argument is not handled correctly:

      [mkopecky@dhcp-10-40-5-128 bin]$ java -version
      java version "1.8.0_162"
      Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
      Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
      [mkopecky@dhcp-10-40-5-128 bin]$ export SECMGR=""
      [mkopecky@dhcp-10-40-5-128 bin]$ ./wsconsume.sh -secmgr https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/testsuite/shared-tests/src/test/resources/jaxws/smoke/tools/wsdl/TestServiceSoap12.wsdl
      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/tmp5356716 -verbose -classdir /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output -allowElementReferences https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/testsuite/shared-tests/src/test/resources/jaxws/smoke/tools/wsdl/TestServiceSoap12.wsdl
      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 https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/testsuite/shared-tests/src/test/resources/jaxws/smoke/tools/wsdl/TestServiceSoap12.wsdlCould 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/tmp1569691 -verbose -classdir /home/mkopecky/playground/wf/wfly.23/wfly.23/bin/output -allowElementReferences https://raw.githubusercontent.com/jbossws/jbossws-cxf/master/modules/testsuite/shared-tests/src/test/resources/jaxws/smoke/tools/wsdl/TestServiceSoap12.wsdl
      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/tmp1569691/org/openuri/_2004/_04/helloworld/EndpointInterface.java" "read")" in code source "(file:/home/mkopecky/base/jdk1.8.0_162/lib/tools.jar <no signer certificates>)" of "java.net.FactoryURLClassLoader@6fd5717c")
      	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/tmp1569691/org/openuri/_2004/_04/helloworld/EndpointInterface.java" "read")" in code source "(file:/home/mkopecky/base/jdk1.8.0_162/lib/tools.jar <no signer certificates>)" of "java.net.FactoryURLClassLoader@6fd5717c")
      	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]$ 
      

      In first example, secmgr is not activated (wrong behaviour, that should be fixed by this jira). In second example, secmgr is activated, exception should be handled in WFLY-10240.

      cc: jbliznak@redhat.com

      Attachments

        Issue Links

          Activity

            People

              rsearls r searls
              mkopecky@redhat.com Marek Kopecky
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: