LS,
 
Do I understand correctly that Humphrey is usinf rmmci to access ?
 
I did a try on that also after activating rmmci in the config and using the exampes from tyhe documentation. I did start a tomcat with a working mmbase environment.
 
The code looks like this :
----------------------------------------
  user.put("username","admin");
  user.put("password","admin2k");
 
  Cloud cloud = ContextProvider.getCloudContext("rmi://127.0.0.1:1111/remotecontext").getCloud("mmbase","name/password",user);
  
  Node nd = cloud.getNode(123);
-------------------------
 
But the I get the error :
java.lang.RuntimeException: error unmarshalling return; nested exception is:
 java.lang.ClassNotFoundException: org.mmbase.bridge.remote.rmi.RemoteCloudContext_Rmi_Stub (no security manager: RMI class loader disabled)
 at org.mmbase.bridge.RemoteContext.getCloudContext(RemoteContext.java:64)
 at org.mmbase.bridge.ContextProvider.getCloudContext(ContextProvider.java:49)
 at mmba.main(mmba.java:40)
Exception in thread "main"
 
I do have security active in the mmbase config.
 
Do I need to apply addtional security changes ?
 
Kind regards,
 
Herman Reintke
 
 
 
----- Original Message -----
Sent: Monday, January 30, 2006 4:02 PM
Subject: RE: [Developers] Bridge use

I don’t know if I understand you correctly but the cloudcontext should be instantiated first:

 

    /**

     * Perform initializations so the config file is read and the cloud

     * environment is set.

     */

    private void init()

    {

 

      try

      {

        URL locatie = this.getClass().getResource("../../config/config.ini");

        sLocalPath = new File(locatie.getPath()).getCanonicalPath();

        iniFile.loadFile(sLocalPath);

      } catch (IOException ex)

      {

        log.error(ex);

      }

      // connect to didactor

      cloudContext= ContextProvider.getCloudContext(iniFile.getProperty("Options", "rmi", null));

      user.put("username", iniFile.getProperty("Options", "username", null));

      user.put("password", iniFile.getProperty("Options", "password", null));

      cloud = cloudContext.getCloud("mmbase","name/password",user);

    }

 

 

My config file contains the connection information

 

 

 

Kind regards,

 

Humphrey


Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Herman Reintke
Verzonden: maandag 30 januari 2006 15:53
Aan: mmbase developers
Onderwerp: [Developers] Bridge use

 

LS,

 

I am trying to use mmnase using the bridge interface. On mmapps.sf.net I found a cloudprovider utility thatmight be of help but when I use it in the class below :

 

-------------------------------------------------

import org.mmbase.*;
import org.mmbase.bridge.Cloud;
import org.mmbase.bridge.CloudContext;
import org.mmbase.bridge.ContextProvider;
import org.mmbase.bridge.Node;
import net.sf.mmapps.modules.cloudprovider.CloudProvider;
import net.sf.mmapps.modules.cloudprovider.CloudProviderFactory;

 

public class mmba {

 

private static CloudProvider cloudProvider = CloudProviderFactory.getCloudProvider();
 
 public static void main(String[] args) {
    
  Cloud cloud = cloudProvider.getAdminCloud();
     Node nd = cloud.getNode(123);
  System.out.println( nd.getValue("title"));
     System.out.println(nd.getFieldValue("title"));
 }
 
}

--------------------------------------------

 

I get the execption :

 

2006-01-30 15:42:59,069 ERROR MMBase has not been started, and cannot be started by this Class. (org.mmbase.bridge.LocalContext)

 

Question :

 

1/ What is the easiest way of getting the bridge working. I am not focussing on any security yet.

2/ How do I have to start mmbase when I want to use it directly using using the bridge ?

3/ Are there any example programs available which directly access mmbase ?

 

Kind regards,

 

Herman Reintke

 

 


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27-1-2006


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27-1-2006


_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to