0 Replies Latest reply: Mar 21, 2007 2:47 PM by 556498 RSS

    CAN´T CONNECT TO CALENDAR SERVICES USING CSDK.JAR

    556498
      Hi,
      I'm trying to develop a web application using Jdeveloper 10.1.3.0.4 (SU5) to
      connect to calendar services on the server (linux). I create a java class to
      connect to the server and when i
      execute the method i get this error:

      500 Internal Server Error
      javax.servlet.jsp.JspException: oracle.classloader.util.AnnotatedNoClassDefFoundError: Classe em falta:
      oracle.calendar.sdk.Api Classe dependente:
      extranet.view.backing.tarefas.AdicionarTarefa Carregador:
      current-workspace-app.web.Extranet_10130_novo-ViewController-webapp:0.0.0
      Code-Source: /C:/Extranet_10130/ViewController/classes/ Configuração:
      <classpath> in C:\Extranet_10130\ViewController\public_htmlA classe em falta
      está disponível a partir das seguintes localizações: 1. Code-Source:
      /c:/libJava/csdk.jar (from system property java.library.path) Esta
      code-source está disponível no carregador jre.bootstrap:1.5.0_05. at
      com.sun.faces.taglib.html_basic.FormTag.doStartTag(FormTag.java:355)

      The java code that i'm using to connect:
      public AdicionarTarefa(){

      try
      {
      Api.init("calendar.ini", "calendar.log");
      }
      catch(Api.StatusException e)
      {
      System.out.println("init returned status'" + e.getMessage() + "'");
      System.exit (1);
      }


      // create session object:
      Session mySession = null;
      try
      {
      mySession = new Session();
      }
      catch(Api.StatusException e)
      {
      System.out.println("Session constructor returned status'" + e.getMessage() + "'");
      System.exit (1);
      }
      // ----------------------------------------------------------------------
      // Connect to calendar server
      // ----------------------------------------------------------------------
      String cal_host = new String("sis-ard.indra.pt:7778");

      // open connection to calendar server:
      try
      {
      mySession.connect(Api.CSDK_FLAG_NONE,
      cal_host);
      }
      catch(Api.StatusException e)
      {
      System.out.println("connect returned status'" + e.getMessage() + "'");
      System.exit (1);
      }
      // ----------------------------------------------------------------------
      // Authentication
      // ----------------------------------------------------------------------
      String cal_user = new String("portal");
      String cal_password = new String("oracle123");

      // authenticate:
      try
      {
      mySession.authenticate(Api.CSDK_FLAG_NONE,cal_user,cal_password);
      }
      catch(Api.StatusException e)
      {
      System.out.println("authenticate returned status'" + e.getMessage() + "'");
      System.exit (1);
      }
      Handle agendas[] = {new Handle()};

      try
      {
      agendas[0] = mySession.getHandle(Api.CSDK_FLAG_NONE,
      null);
      }
      catch(Api.StatusException e)
      {
      System.out.println("getHandle returned status'" + e.getMessage() + "'");
      System.exit (1);
      }


      // ----------------------------------------------------------------------
      // Read agenda for current yesterday and today
      // ----------------------------------------------------------------------
      String properties[] = new String[0];
      RequestResult results = new RequestResult();
      String iCalendar = new String();

      try
      {
      iCalendar = mySession.fetchEventsByRange(Api.CSDK_FLAG_STREAM_NOT_MIME,
      agendas, // search agenda of current user
      "-P1D",
      "+P2D",
      properties, // request all properties
      results);

      System.out.println(iCalendar);
      }
      catch(Api.StatusException e)
      {
      System.out.println("fetchEventsByRange returned status'" + e.getMessage() + "'");
      System.exit (1);
      }
      // ----------------------------------------------------------------------
      // Cleanup
      // ----------------------------------------------------------------------

      // deauthenticate:
      try
      {
      mySession.deauthenticate(Api.CSDK_FLAG_NONE);
      }
      catch(Api.StatusException e)
      {
      System.out.println("deauthenticate returned status'" + e.getMessage() + "'");
      System.exit (1);
      }

      // disconnect:
      try
      {
      mySession.disconnect(Api.CSDK_FLAG_NONE);
      }
      catch(Api.StatusException e)
      {
      System.out.println("disconnect returned status'" + e.getMessage() + "'");
      System.exit (1);
      }
      }


      Thank's for the help.