0 Replies Latest reply: Aug 6, 2007 6:18 AM by 487616 RSS

    NULLPOINTEREXCEPTION AT ORACLEDBPOOL.JAVA:751

    487616
      Hi,

      I installed OCS 10.1.2.2, created an account and emailed a few messages to this account. Now I would like to connect to OCS and retrieve a list of messages of this user. Unfortunately I couldn't find any complete example of how to do that. Here is my attempt:

      Properties props = System.getProperties();
      props.setProperty("oracle.mail.ldap.admin_dn", "cn=orcladmin");
      props.setProperty("oracle.mail.ldap.admin_password", "password");
      props.setProperty("oracle.mail.sdk.esmail.driver_type", "thin");
      props.setProperty("oracle.mail.sdk.esmail.encryption", "false");
      props.setProperty("mail.debug", "true");
      Session session = Session.getDefaultInstance(props, null);
      session.setDebug(true);
      Store store = null;
      store = session.getStore("esmail");
      store.connect("app1", 389, "j.test@company.com", "jtest1");
      store.close();

      It causes NullPointerException in SDK:

      java.lang.NullPointerException
           at oracle.mail.sdk.esmail.OracleDBPool.getDBConn(OracleDBPool.java:751)
           at oracle.mail.sdk.esmail.OracleStore.dbConnect(OracleStore.java:287)
           at oracle.mail.sdk.esmail.OracleStore.connect(OracleStore.java:766)
           at pl.ufg.sif.externalmessage.email.OCSEmailMessageProvider.countBy(OCSEmailMessageProvider.java:31)
           at pl.ufg.sif.externalmessage.email.OCSEmailMessageProviderTest.testCountByEmailSearchConditions(OCSEmailMessageProviderTest.java:18)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
           at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
           at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
           at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
           at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
           at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
           at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
           at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
           at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
           at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
           at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
           at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
           at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

      Is it a bug in my code or is it a bug in Email SDK? I can't use standard IMAP API since I need IMAP Annotate extension provided by OJMA. Any hints on what is wrong? Maybe someone can provide a working example of connecting to the store and retrieving something. Thanks a lot!