java - Error invoking SecurityManager getting access to rmi server from webservice -


i have webservice , works fine, i've tested using wsdl file soapui. when add code in order access rmi server wich contains funcionality need use, goes bad

if(system.getsecuritymanager()==null){     system.setproperty("java.security.policy", "file:/c:/users/usuario/workspace/interface/cliente.policy");     system.setsecuritymanager(new securitymanager()); }  registro = locateregistry.getregistry(serveraddress,(new integer(serverport)).intvalue()); rmiservidor = (peticionesinterface) (registro.lookup(servername)); 

debugging code, @ moment new securitymanager executed following error

14:00:10,762 error [org.jboss.as.controller.management-operation] (deploymentscanner-threads - 1) jbas014612: operation ("read-children-names") failed - address: (undefined): java.security.accesscontrolexception: access denied ("java.lang.runtimepermission" "getclassloader")     @ java.security.accesscontrolcontext.checkpermission(unknown source) [:1.7.0_05]     @ java.security.accesscontroller.checkpermission(unknown source) [:1.7.0_05]     @ java.lang.securitymanager.checkpermission(unknown source) [:1.7.0_05]     @ java.lang.thread.getcontextclassloader(unknown source) [:1.7.0_05]     @ org.jboss.as.controller.securityactions$setthreadcontextclassloaderaction$2$1.run(securityactions.java:105)     @ org.jboss.as.controller.securityactions$setthreadcontextclassloaderaction$2$1.run(securityactions.java:103)     @ java.security.accesscontroller.doprivileged(native method) [:1.7.0_05]     @ org.jboss.as.controller.securityactions$setthreadcontextclassloaderaction$2.setthreadcontextclassloader(securityactions.java:103)     @ org.jboss.as.controller.securityactions.setthreadcontextclassloader(securityactions.java:68)     @ org.jboss.as.controller.abstractoperationcontext.executestep(abstractoperationcontext.java:383)     @ org.jboss.as.controller.abstractoperationcontext.docompletestep(abstractoperationcontext.java:272)     @ org.jboss.as.controller.abstractoperationcontext.completestep(abstractoperationcontext.java:200)     @ org.jboss.as.controller.modelcontrollerimpl.execute(modelcontrollerimpl.java:121)     @ org.jboss.as.controller.modelcontrollerimpl$1.execute(modelcontrollerimpl.java:304)     @ org.jboss.as.controller.modelcontrollerimpl$1.execute(modelcontrollerimpl.java:294)     @ org.jboss.as.server.deployment.scanner.filesystemdeploymentservice.getdeploymentnames(filesystemdeploymentservice.java:843)     @ org.jboss.as.server.deployment.scanner.filesystemdeploymentservice.access$3300(filesystemdeploymentservice.java:88)     @ org.jboss.as.server.deployment.scanner.filesystemdeploymentservice$scancontext.<init>(filesystemdeploymentservice.java:1177)     @ org.jboss.as.server.deployment.scanner.filesystemdeploymentservice$scancontext.<init>(filesystemdeploymentservice.java:1173)     @ org.jboss.as.server.deployment.scanner.filesystemdeploymentservice.scan(filesystemdeploymentservice.java:335)     @ org.jboss.as.server.deployment.scanner.filesystemdeploymentservice$deploymentscanrunnable.run(filesystemdeploymentservice.java:149)     @ java.util.concurrent.executors$runnableadapter.call(unknown source) [:1.7.0_05]     @ java.util.concurrent.futuretask$sync.innerrunandreset(unknown source) [:1.7.0_05]     @ java.util.concurrent.futuretask.runandreset(unknown source) [:1.7.0_05]     @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$301(unknown source) [:1.7.0_05]     @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(unknown source) [:1.7.0_05]     @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) [:1.7.0_05]     @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) [:1.7.0_05]     @ java.lang.thread.run(unknown source) [:1.7.0_05]     @ org.jboss.threads.jbossthread.run(jbossthread.java:122) 

i have security files server , client. file on client

grant {     permission java.security.allpermission;     permission java.net.socketpermission "*", "resolve,connect,listen,accept";     permission java.lang.runtimepermission "getclassloader";     permission java.lang.runtimepermission "setsecuritymanager";     permission java.lang.runtimepermission "createsecuritymanager";     permission java.lang.runtimepermission "usepolicy";      permission java.lang.runtimepermission "*";     permission java.util.propertypermission "*", "read";     permission java.io.filepermission "*","read"; }; 

this file on server

grant {     permission java.security.allpermission;     permission java.net.socketpermission "*", "resolve,connect,listen,accept";     permission java.lang.runtimepermission "getclassloader";     permission java.lang.runtimepermission "*";     permission java.util.propertypermission "*", "read"; }; 

i know both .policy files not correct, i've been adding permission obteined errors.

i've tried use rmisecuritymanager i've got same behaviour.

i don't know how solve error, me?

thanks in advance.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -