Hello Herman,
MMBase should be up and running Before you can retrieve a cloud from
MMBase through the ContextProvider or the mmapps CloudProvider.
Or you start MMBase inside a servlet container and access it through rmi
Or your main method should first call a method like this to start MMBase
standalone inside the JVM
static public void startMMBase(boolean startDatabase) throws Exception {
MMBaseContext.init();
mmb = MMBase.getMMBase();
MMAdmin mmadmin = (MMAdmin) Module.getModule("mmadmin", true);
while (! mmadmin.getState()) {
Thread.sleep(1000);
}
}
you have to provide a path to the mmbase configuration files
java -Dmmbase.config=<PATH_TO_CONFIG>
Regards,
Nico
Herman Reintke wrote:
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
------------------------------------------------------------------------
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers