Using Rio Services

12 views
Skip to first unread message

Lion

unread,
Sep 12, 2017, 4:52:03 AM9/12/17
to Rio Users Group
I deployed the Rio Calculator example and I can see it in the rio:ui. But now I wonder how to access this service? I am not from the java world and I am not familiar with apache river. I would expect to have a simple example java code that uses the example services. The code should discover, register and be able to use the calc remote methods. I found a tutorial here: https://jan.newmarch.name/java/jini/tutorial/LookupDiscovery.html but I am not sure whether this will work.

The best I could imagine would be a downloadable virtual machine that has a running rio system with examples.

Thanks for developing rio and hopefully you can help me.

Best,
Lion

Dennis Reedy

unread,
Sep 12, 2017, 10:06:04 AM9/12/17
to rio-...@googlegroups.com
Hi Lion,

The simple example Java code for interacting with the Calculator can be found in the test cases. The one that may interest you the most might be the ITCalculatorClientTest. Navigate down through the project:

examples->calculator->calculator-service->src->test->java->org->rioproject->examples->calculator

You'll see it there.

If you want to run the test cases (you'll need Maven), go to the calculator-service directory and run "mvn test" or to run the referenced test case run "mvn test -Dtest=ITCalculatorClientTest"

Also checkout the documentation on Associations (the referenced test case uses them) here 

HTH

Regards

Dennis

--
You received this message because you are subscribed to the Google Groups "Rio Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rio-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lion

unread,
Sep 21, 2017, 9:57:18 AM9/21/17
to Rio Users Group
Hey,

thanks for the fast answer! This helps a lot. But I still have a lot of hassle with installing and running.

I needed to install Rio on an other Machine. For me, it did not work with idk 9 because it has a problem with lower source and target configurations than 1.5. I added:
            <plugin>    
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
But in the end it did not work anyway. So I downgraded to idk 8, which works now. Does anyone had the same issue?


No I can install, deploy and see the ui without errors. But I am not able to run mvn test -Dtest=ITCalculatorClientTest. I tried with rio-5.0 and rio-5.6.
So, when I run mvn test -Dtest=ITCalculatorClientTest from the calculation-service directory I get the Error message:
java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkSetFactory(SecurityManager.java:1664)
at java.net.URL.setURLStreamHandlerFactory(URL.java:1116)
at org.rioproject.test.RioTestRunner.<clinit>(RioTestRunner.java:72)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[..]

I looked into RioTestRunner, but I have no clue how to fix or search for other solutions.
When I run the following command: "sudo -E mvn -Dtest=ITCalculatorClientTest test". It this outputs the same error.

When I run: "mvn test" from the calculator-service directory, it does not produce any error. 
When I run: "mvn install" from the calculator-service directory, it seems to actually does some calculations. See the output here: https://pastebin.com/BmumsNPb


When trying to fix it, I have the problems to run into big javastack traces which relate to maven files I have no clue about.
I am pretty sure that the cybernode etc. does run properly since in the ui everything is green and fine.
(can't I test the client in the ui? It would be perfect to just click on the calc service and say add(5,3).)

So yes, hopefully you have enough information to help me. Or post a setup where this works. Right now I am using the following:

Linux ubuntu 4.10.0-35-generic #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)

Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-35-generic", arch: "amd64", family: "unix"

Rio 5.0 / Rio 5.6




To unsubscribe from this group and stop receiving emails from it, send an email to rio-users+...@googlegroups.com.

Dennis Reedy

unread,
Sep 25, 2017, 11:04:55 AM9/25/17
to rio-...@googlegroups.com
Hi Lion,

A couple of items for you here:

1. First, I was remiss in telling you to run man test ... Since the test case is considered an integration test, you should instead run:

man verify -Dit.test=ITCalculatorClientTest

2. In looking at the calculator-service project's setup (that uses maven-failsafe-plugin), the test requires that you set the RIO_HOME environment variable to the location where you have installed Rio. The reason this is done is to provide guidance on how you may create your project, and your project's test cases that rely on a Rio distribution.

HTH

Dennis

To unsubscribe from this group and stop receiving emails from it, send an email to rio-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages