ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google

Mail Archive Home | proactive List | July 2004 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [proactive] ProActive & J2ee container

Hi Seb,
what a happy news that you try to integrate ProActive in a J2ee server. We plan to integrate some ProActive features in Jonas (J2ee server in Objectweb) but the project has not yet started.

Your first problem is caused by a bad url given to the method.
ProActive.register(Object obj, String url). In fact when the port is the default one 1099, you can use the method like *ProActive.register( obj, toto)* or ProActive.register( obj, //localhost/toto) or even ProActive.register( obj, //localhost:1099/toto). When you change the port like you did, you must give the url under the form: ProActive.register( obj, *//localhost:2005/ toto*). Indeed, if you do not specifie the port , 1099 is always used by default. This is an implementation choice that we did, and that will probably change in the next version. I mean that for the next release if you use* ProActive.register( obj, toto) *then it will check the property proactive.rmi.port to search the registry. Anyway to solve your pb now, using ProActive.register( obj, *//localhost:2005/ toto*) should be fine.

I guess you can even try to use JBoss RMI registry, since ProActive checks if there is an existing registry on a given port before creating one.

For your seconf pb, it is indeed a Jboss pb, but I don't think it is more serious(I hope). I think that in JBoss a security manager in initialized. But all the permissions are set in a file called .java.policy. One solution, and it is exactly what we do in ProActive is to add the option java.security.policy when launching the VM like
java ........ -Djava.security.policy=mypolicyfile................
If you have a look at ProActive/script/unix/env.sh or ProActive/script/windows.init.bat the java command is

java -Djava.security.policy=proactive.java.policy ......... . In our examples the policy file grants all permission, may be it is too unsecure for what you want. But you should test with our file, then trying to configure that file in order to allow only what you want. You can have a look to http://java.sun.com/j2se/1.4.2/docs/guide/security/PolicyFiles.html for more information.

Hope this will help,
Anyway let us know if we can help you or if you have any questions

seb@xxxxxxxxxxxxxx wrote:

Hello Proactive Team,

I've developed a proactive application and try to integrate a client of this 
application in a J2ee server (here is JBoss).
And so I’ve got few problems and so few Questions:
First is Problem for cohabitation of the JBoss and my proactive app (without 

1.      JBoss create a Jnp server on the port 1099 and a rmi registry on the 
port 1098.
So I’ve tried with the xml configuration file of proactive to launch my 
application and used the port 2005 for the rmi registry with this config file :

                <prop key="proactive.communication.protocol" value="rmi"/>
                <prop key="proactive.rmi.port" value="2005"/>

And when I try to register my object , I’ve got an rmi exception :
Jini enabled
Ibis enabled
Runtime : loading policy file is null
Created a new registry on port 2005
//HAL.mikrosimage.fr:2005/Node-1165647189 successfully bound in registry at 
Generating class : pa.stub.fr.mikrosimage.napoletana.Stub_DirectDispatcher
java.rmi.ConnectException: Connection refused to host:; nested 
exception is:
       java.net.ConnectException: Connection refused: connect
       at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
       at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
       at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
       at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
       at java.rmi.Naming.rebind(Naming.java:160)
       at org.objectweb.proactive.ProActive.register(ProActive.java:641)
       at TestDirectDispatcher.main(TestDirectDispatcher.java:32)
Caused by: java.net.ConnectException: Connection refused: connect
       at java.net.PlainSocketImpl.socketConnect(Native Method)
       at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
       at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
       at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
       at java.net.Socket.connect(Socket.java:452)
       at java.net.Socket.connect(Socket.java:402)
       at java.net.Socket.<init>(Socket.java:309)
       at java.net.Socket.<init>(Socket.java:124)
       at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
       ... 8 more

I’ve configure JBoss to use other port for jnp and leave proactive to use 1099 but I 
didn’t solve it.

2.      The problem of integrating Proactive and Jboss.

This is a more serious problem: I’ve tried to integrate a java client of my proactive app in JBoss. But the client need to access property with System.setProperty(“rmi.server.codebase”) for initializing the ClassServer.
But The securityManager don’t allow the app to set this property.

I think it’s more a jboss problem but I ask if someone have an idea.
What I do with the client is a Proactive lookup:

    try {
               java.net.InetAddress localhost = java.net.InetAddress
               dispatcher = (DirectDispatcher) ProActive.lookupActive(
                       DirectDispatcher.class.getName(), url);
           } catch (UnknownHostException e) {
               throw new NapoletanaException("can't connect to the 
           } catch (ActiveObjectCreationException e) {
              throw new NapoletanaException("can't reference the dispatcher to an 
active Object",e);
           } catch(IOException e){
               throw new NapoletanaException("can't create ActiveObject 

Does the client needs to access rmi server of jboss for a lookup.
Have someone integrate Proactive in other J2ee container with some kind of 

The Proactive server side functions great, Proactive is a well done work.
Thanks for response


<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.