client fails under java2 security policy in spi.Provider.provider using 
FactoryFinder
-------------------------------------------------------------------------------------

                 Key: CXF-2683
                 URL: https://issues.apache.org/jira/browse/CXF-2683
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.2.6
         Environment: AIX JDK > java -fullversion
java full version "J2RE 1.5.0 IBM AIX build pap32dev-20070201 (SR4)"

            Reporter: craig bordelon


i run the jaxws_async sample just fine out of the box.
but i get various unhelpful errors below when I make adjustment to the ant 
cxfrun to add a java2 security setup.   The errors dont help me with what 
permissions i need in the security policy.
First i change the build.xml to:

        <!--<cxfrun classname="demo.hw.client.Client" param1="${basedir}/wsdl/he
llo_world_async.wsdl" param2="${op}" param3="${param}"/>-->
        <cxfrun classname="demo.hw.client.Client" jvmarg1="-Djava.security.manag
er" jvmarg2="-Djava.security.policy==my.policy" param1="${basedir}/wsdl/hello_wo
rld_async.wsdl" param2="${op}" param3="${param}"/>

and then if the my.policy file in the directory with build.xml has just
grant {
    permission java.security.AllPermission;
}
I again have no problem running the "ant client" (while the "ant server" is 
running)
I again have no problem if i have this policy (note the 
/common/bord/java/cxf/apache-cxf-2.2.6 is my $CXF_HOME)
grant codeBase "file:/common/bord/java/cxf/apache-cxf-2.2.6/samples/jaxws_async/
-" {
  permission java.security.AllPermission;
}
grant codeBase "file:/common/bord/java/cxf/apache-cxf-2.2.6/lib/-" {
    permission java.security.AllPermission;
};

Now, i cannot grant all permissions like this in my production container, so I 
need to determine the fine-grain permissions that will allow me to use CXF, so
I comment out the first permission...AllPermission that i had under the 
file:...jaxws_async and when i run the ant client i get this unhelpful issue:

client:
     [java] Exception in thread "main" java.lang.NullPointerException
     [java]     at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFa
ctory.java:91)
     [java]     at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.
java:205)
     [java]     at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:148)

     [java]     at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(P
roviderImpl.java:65)
     [java]     at javax.xml.ws.Service.<init>(Service.java:36)
     [java]     at org.apache.hello_world_async_soap_http.SOAPService.<init>(SOA
PService.java:48)
     [java]     at demo.hw.client.Client.main(Client.java:53)
     [java] Java Result: 1


Next, i put back the AllPermission for the jaxws_async and then comment out the 
permission ...AllPermission for the file:.../lib (the CXF_HOME/lib) and when i 
run the ant client i get this unhelpful issue


client:
     [java] Exception in thread "main" javax.xml.ws.spi.FactoryFinder$Configurat
ionError: Provider org.apache.axis2.jaxws.spi.Provider not found
     [java]     at javax.xml.ws.spi.FactoryFinder$2.run(FactoryFinder.java:135)
     [java]     at java.security.AccessController.doPrivileged(AccessController.
java:193)
     [java]     at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.jav
a:266)
     [java]     at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java
:122)
     [java]     at javax.xml.ws.spi.FactoryFinder.access$200(FactoryFinder.java:
42)
     [java]     at javax.xml.ws.spi.FactoryFinder$3.run(FactoryFinder.java:255)
     [java]     at java.security.AccessController.doPrivileged(AccessController.
java:193)
     [java]     at javax.xml.ws.spi.FactoryFinder.doPrivileged(FactoryFinder.jav
a:266)
     [java]     at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:165)
     [java]     at javax.xml.ws.spi.Provider.provider(Provider.java:39)
     [java]     at javax.xml.ws.Service.<init>(Service.java:36)
     [java]     at org.apache.hello_world_async_soap_http.SOAPService.<init>(SOA
PService.java:48)
     [java]     at demo.hw.client.Client.main(Client.java:53)
     [java] Java Result: 1

So, I am really lost as to how to set up the java2 security permissions to 
grant just what i need to use CXF.... and there obviously seem to be bugs in 
the code as normally when a permission is missing one gets a clear Permission 
exception explaining the missing permission.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to