AnsweredAssumed Answered

AVMRemote is null, if used outside ServletContext

Question asked by on Feb 23, 2008
Latest reply on Feb 28, 2008 by rivetlogic
How do I write a standalone (outside servlet context) client java program, that can list the avm repo directory map?

I used the repoDirMap.jsp from RivetLogic as a starting point? The JSP works fine (from within the servlet context), but when i try to write a standaline Java program I get AVMRemote as null (e.g. on calling: List list = avmRemote.getStores());

public class AVMDemo {
   public static void main(String[] args) throws Exception {
      String avmPath = "v:\\alfrescowww–admin\\VERSION\\v-1\\DATA\\www\\avm_webapps\\ROOT\\";

      String mountPoint = "v:\\";
       final JNDIPath jndiPath = new JNDIPath(mountPoint, avmPath);
       avmPath = jndiPath.getAvmPath();
       System.out.println("avmPath: " + avmPath);


      List list = avmRemote.getStores();  // avmRemot is Null here
      Map<String, AVMNodeDescriptor> nodes = avmRemote.getDirectoryListing(-1, avmPath);
         for (Map.Entry<String, AVMNodeDescriptor> node : nodes.entrySet()) {
            String nodeKey = node.getKey();

            AVMNodeDescriptor nodeValue = node.getValue();
            if (nodeValue.isDirectory() ) {
               System.out.println("Directory: ");
               System.out.println("/" + nodeKey + "<br>");

//               repoDirMap(path + "/" + nodeKey, "", pageContext, out);

avmPath: alfrescowww–admin:/www/avm_webapps/ROOT/
Exception in thread "main" java.lang.NullPointerException

I think the issue is in getting AVMRemote initialized correctly.
Please advise how to go about this.