Hi Jim,

I found ServletHost under org.apache.tuscany.spi.host and thought it to be a
good place to add RMIHost.

I have added the interface RMIHost which is the interface the bindings will
use to register and look up RMI services.  With some initial thoughts I also
put in a RMIHostAdmin interface which I imagined might be required for say
an admin console sometime in the future.  Then there is an Exception class
that is used by the RMIHost interface.  That is it.

I believe the security must be enabled when SCA components are accessing RMI
Services thro references.  This is required to safeguard against malicious
dynamic stubs.  The policy file that I have used specifies a 'grant all'
which we might have to fix to have more practical settings.

Thanks

- Venkat

On 8/15/06, Jim Marino <[EMAIL PROTECTED]> wrote:


On Aug 15, 2006, at 8:53 AM, Venkatakrishnan (JIRA) wrote:

>      [ http://issues.apache.org/jira/browse/TUSCANY-611?page=all ]
>
> Venkatakrishnan updated TUSCANY-611:
> ------------------------------------
>
>     Attachment: Tuscany-RMI-Binding-Updated-Aug-15-2.diff
>                 Tuscany-SCA-SPI-Aug-15.diff
>
> Hi
>
> Here is an update to the RMI Binding.  This patch addresses the
> following: -
> - Generates Remote interfaces dynamically  for components whose
> interfaces do not extend from Remote
> - Implements a RMIHost system component that encapsulates starting
> of RMI registries and registering services against them.
> - Implements a test case that tests the RMI Service and Reference
>
> Note:
> - For implementing the RMIHost I have added interfaces to the SPI
> package.  Not sure if this is the right place.
> - The testcase requires the following JVM arguments to be set :
>     i) -Dtuscany.installDir=<tuscany standalone disb. installation
> dir>
>    ii) -Djava.security.policy=<location of the java.policy file>.
> I have only tested with the following policy statement in the
> java.policy file
> grant {
>         permission java.security.AllPermission;
>  };

Could you describe what changes were made to SPI? Also, what is
requiring the security setting - the dynamic generation of classes?

Jim

>    Is there any other better way of setting the policy say as an
> attribute of the bindng itself?
> - The testcase runs only from within eclipse.  I am not able to
> solve the following exception that I get when running it as part of
> mvn build.  The expceptions must be to do with the setting of the
> java security policy.  How can this be set at the maven level so
> that it is communicated to the JVM?
>
> Could somebody kindly take a look at these patches and apply if ok?
>
> Thanks
>
> - Venkat
>
> ------- Exception Stack
> --------------------------------------------------
> Running org.apache.tuscany.binding.rmi.BindingTestCase
> org.apache.maven.surefire.booter.SurefireExecutionException:
> org.apache.tuscany.
> binding.rmi.BindingTestCase; nested exception is
> java.security.AccessControlExce
> ption: access denied (java.lang.RuntimePermission setIO); nested
> exception is or
> g.apache.maven.surefire.testset.TestSetFailedException:
> org.apache.tuscany.bindi
> ng.rmi.BindingTestCase; nested exception is
> java.security.AccessControlException
> : access denied (java.lang.RuntimePermission setIO)
> org.apache.maven.surefire.testset.TestSetFailedException:
> org.apache.tuscany.bin
> ding.rmi.BindingTestCase; nested exception is
> java.security.AccessControlExcepti
> on: access denied (java.lang.RuntimePermission setIO)
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission
>  setIO)
>         at java.security.AccessControlContext.checkPermission
> (Unknown Source)
>         at java.security.AccessController.checkPermission(Unknown
> Source)
>         at java.lang.SecurityManager.checkPermission(Unknown Source)
>         at java.lang.System.checkIO(Unknown Source)
>         at java.lang.System.setOut(Unknown Source)
>         at
> org.apache.maven.surefire.report.ReporterManager.resetStreams(Reporte
> rManager.java:313)
>         at
> org.apache.maven.surefire.report.ReporterManager.testFailed(ReporterM
> anager.java:291)
>         at
> org.apache.maven.surefire.report.ReporterManager.testError(ReporterMa
> nager.java:276)
>         at
> org.apache.maven.surefire.junit.TestListenerInvocationHandler.handleA
> ddError(TestListenerInvocationHandler.java:163)
>         at
> org.apache.maven.surefire.junit.TestListenerInvocationHandler.invoke(
> TestListenerInvocationHandler.java:134)
>         at $Proxy0.addError(Unknown Source)
>         at junit.framework.TestResult.addError(TestResult.java:36)
>         at junit.framework.TestResult.runProtected(TestResult.java:
> 133)
>         at junit.framework.TestResult.run(TestResult.java:109)
>         at junit.framework.TestCase.run(TestCase.java:118)
>         at junit.framework.TestSuite.runTest(TestSuite.java:208)
>         at junit.framework.TestSuite.run(TestSuite.java:203)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at org.apache.maven.surefire.junit.JUnitTestSet.execute
> (JUnitTestSet.jav
> a:210)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
> tSet(AbstractDirectoryTestSuite.java:135)
>         at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
> stractDirectoryTestSuite.java:122)
>         at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
> refireBooter.java:225)
>         at org.apache.maven.surefire.booter.SurefireBooter.main
> (SurefireBooter.j
> ava:747)
> [INFO]
> ----------------------------------------------------------------------
> --
> [ERROR] BUILD FAILURE
> [INFO]
> ----------------------------------------------------------------------
> --
>
>
>> RMI Binding
>> -----------
>>
>>                 Key: TUSCANY-611
>>                 URL: http://issues.apache.org/jira/browse/TUSCANY-611
>>             Project: Tuscany
>>          Issue Type: Bug
>>            Reporter: Venkatakrishnan
>>         Assigned To: ant elder
>>         Attachments: Tuscany-RMI-Binding-Aug-10-Updated.diff,
>> Tuscany-RMI-Binding-Aug-10.diff, Tuscany-RMI-Binding-Formatted-
>> Aug-15-1.diff, Tuscany-RMI-Binding-Reference-Sample-Aug-10.diff,
>> Tuscany-RMI-Binding-Service-Sample-Aug-10.diff, Tuscany-RMI-
>> Binding-Updated-Aug-15-2.diff, Tuscany-SCA-SPI-Aug-15.diff
>>
>>
>> SCA RMI Binding with samples for SCA Reference and SCA Service
>> using RMI Binding.
>> Here is a first cut implementation for this.  Could somebody
>> please review and apply?  Also I have had the following issues un-
>> resolved: -
>> - The samples can be tested thro the Testcases in them.  These
>> testcases work from eclipse as long as I have added the RMI-
>> Binding Eclipse project to the classpath.  Otherwise the binding
>> does get picked up.  The same is the issue when trying to execute
>> the testcases from maven.  Could somebody please help in fixing
>> this?  Thanks.
>> Note :-
>> --------
>> I shall be working further with this binding to address the
>> following : -
>> - there is single attribute called 'uri' for the binding.  I shall
>> be splitting this to host, port and service name with defaults to
>> each when not specified.
>> - it is now required the that SCA Service require a component to
>> implement the interface Remote.  I imagine this to be intrusive.
>> All that a developer should do is pick up an existing component
>> with a 'non remote' interface and simply deploy it exposing the
>> service as RMI.  The binding should dynamically be able to
>> generate a remote interface and a proxy and host it as a facade to
>> this implementation.
>> -  will be glad to take forward any other inputs from the
>> community as well.
>> Thanks
>> - Venkat
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the
> administrators: http://issues.apache.org/jira/secure/
> Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/
> software/jira
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to