Author Topic: Problem with the initial connection with OnDemand  (Read 20139 times)

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Problem with the initial connection with OnDemand
« on: September 28, 2010, 04:46:17 AM »
Hi

I had installed the ODWEK today.
I have developed a small login code to connect to CMOD.

Here's the error I get :

Exception in thread "main" java.lang.UnsatisfiedLinkError: no ars3wapi32 in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at com.ibm.edms.od.ArsWWWInterface.<clinit>(ArsWWWInterface.java:15)
   at com.ibm.edms.od.ODServer.<init>(ODServer.java:45)
   at com.ibm.edms.od.ODServer.<init>(ODServer.java:61)
   at Search.main(Search.java:54)

Any suggestions?

Cheers
Pankaj.

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #1 on: September 28, 2010, 04:50:49 AM »
One more thing.
I have already added the following to the System path variable :

D:\Program Files\IBM\OnDemand Web Enablement Kit\icudt36.dll
D:\Program Files\IBM\OnDemand Web Enablement Kit\icuin36.dll
D:\Program Files\IBM\OnDemand Web Enablement Kit\icuuc36.dll
D:\Program Files\IBM\OnDemand Web Enablement Kit\arssck32.dll
D:\Program Files\IBM\OnDemand Web Enablement Kit\ars3wapi32.dll
D:\Program Files\IBM\OnDemand Web Enablement Kit\arswwwsl32.dll
D:\Program Files\IBM\OnDemand Web Enablement Kit\odwa\arsxapi.dll

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2138
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Problem with the initial connection with OnDemand
« Reply #2 on: September 28, 2010, 06:56:01 AM »
Please read Chapter 5 of the Web Enablement Kit (ODWEK) Implementation Guide.  It talks about the 'CLASSPATH' environment variable.

http://publib.boulder.ibm.com/infocenter/cmod/v8r4m1/index.jsp?topic=/com.ibm.ondemand.odwekmp.doc/ars1y371.htm

-JD.

IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #3 on: September 28, 2010, 11:32:24 PM »
Hi JD

I had done this already but gor the same error.

This time the error is different.

The next thing I did is the following :

System.setProperty("java.library.path", "d:\\IBM\\DLLS;D:\\Program Files\\IBM\\OnDemand Web Enablement Kit");


System.load("d:\\IBM\\DLLS\\icudt36.dll");
System.load("d:\\IBM\\DLLS\\icuuc36.dll");
System.load("d:\\IBM\\DLLS\\arssck32.dll");
System.load("d:\\IBM\\DLLS\\arsxapi.dll");
System.load("d:\\IBM\\DLLS\\ars3wapi32.dll");
System.load("d:\\IBM\\DLLS\\icuin36.dll");
System.load("d:\\IBM\\DLLS\\arswwwsl32.dll");

It doesn't complain about any other DLL.
It complains for ars3wapi32 and arswwwsl32 only.

Here's the error :

Exception in thread "main" java.lang.UnsatisfiedLinkError: D:\IBM\DLLS\ars3wapi32.dll: Can't find dependent libraries   at java.lang.ClassLoader$NativeLibrary.load(Native Method)
   at java.lang.ClassLoader.loadLibrary0(Unknown Source)
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.load0(Unknown Source)
   at java.lang.System.load(Unknown Source)
   at Search.main(Search.java:45)

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1001
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #4 on: September 29, 2010, 01:06:04 AM »
Hello Pankaj,

you might look at this link:

http://www-01.ibm.com/support/docview.wss?rs=0&q1=1244564&uid=swg21244564&loc=en_US&cs=utf-8&cc=us&lang=en

It is for z/OS, but maybe you might find some valuable tips from it to solve your problem.

Cheers,
Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #5 on: September 29, 2010, 03:17:08 AM »

Looks like there was a problem with the was I was constructing the ODConfig object.
Now I have a new error which I am posting as a new topic.

Thanks for your suggestions.

Cheers
Pankaj.

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #6 on: September 29, 2010, 03:50:01 AM »

And one more thing.
I had to add "ctreestd.dll" to the library.

Thanks
Pankaj.

Alessandro Perucchi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1001
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #7 on: September 29, 2010, 04:57:27 AM »

And one more thing.
I had to add "ctreestd.dll" to the library.

Thanks
Pankaj.

Strange, maybe the documentation was not updated... because in the official IBM documentation it is describe nowhere.
But I have found this link

https://www-304.ibm.com/jct01003c/support/docview.wss?rs=3247&context=SSCVQSF&uid=swg21281852&loc=en_US&cs=utf-8&lang=en

which describe this problem...

And at the same time for ODWEK version 8.4.1.x, you have that in the release notes

ftp://public.dhe.ibm.com/software/ondemand/fixes/v841/8.4.1.5/readwek.txt

<...>
- This release includes the following files:

       README
         - This file.
       arswww.cgi
         - This is the Web Enablement Kit CGI program. This file is now a
           64-bit executable. This file should be placed into a directory
           within your Web server directory space which has been designated
           as executable and can contain CGI applications.
       arssck32.dll    (Windows)
       ctreestd.dll    (Windows) - No longer needed
         - This file should be left in the installation directory.

<...>

So maybe there are something strange happenning here.

Alessandro
Alessandro Perucchi

#Install #Migrations #Conversion #Educate #Repair #Upgrade #Migrate #Enhance #Optimize #AIX #Linux #Multiplatforms #DB2 #Windows #Oracle #TSM #Tivoli #Performance #Audits #Customizing #Availability #HA #DR #JavaApi #ContentNavigator #ICN #WEBi #ODWEK #Services #PDF #AFP #XML

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #8 on: September 29, 2010, 10:59:19 PM »
Hi All

Please ignore all the previous replies by me.
Now I am able to connect to CMOD and here is what all i have done.

System variables :

CLASSPATH - .;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLLIB\java\db2jcc.jar;C:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip;C:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\PROGRA~1\IBM\SQLLIB\bin;C:\PROGRA~1\IBM\SQLLIB\java\common.jar;D:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;D:\PROGRA~1\IBM\SQLLIB\java\db2jcc.jar;D:\PROGRA~1\IBM\SQLLIB\java\sqlj.zip;D:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cu.jar;D:\PROGRA~1\IBM\SQLLIB\bin;D:\PROGRA~1\IBM\SQLLIB\java\common.jar;D:\Program Files\IBM\OnDemand Web Enablement Kit\api\ODApi.jar

DB2INSTANCE - DB2

LIB - C:\PROGRA~1\IBM\SQLLIB\LIB;D:\PROGRA~1\IBM\SQLLIB\LIB

Path - %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Windows Imaging\;C:\Program Files\MySQL\MySQL Server 5.0\bin;D:\113239\live\Apache-ant-1.6.5\bin;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;D:\PROGRA~1\IBM\SQLLIB\BIN;D:\PROGRA~1\IBM\SQLLIB\FUNCTION;D:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;D:\IBM\DLLS;

Note that you have to only edit the Path and the CLASSPATH variables.
I have included the others just for your information.

_________________________________________________________________________________

This code has comments embedded about the errors I was getting previously and their solutions.
Please read through.

Java code :

import java.util.*;
import java.io.*;

import com.ibm.edms.od.*;
public class Test
{
public static void main (String argv[])
{
int rc;
int numFolders;
byte[] data;
String[] displayList;
FileOutputStream file;
ODServer odServer;
ODConfig odConfig;
ODFolder odFolder;
ODCriteria odCrit;
Vector hits;
ODHit odHit;
Vector notes;
Date before, after;
Date program_start, program_end;
String path = "D:/Program Files/IBM/OnDemand Web Enablement Kit/arswww.ini";


 
/*System.setProperty("java.library.path", "d:\\IBM\\DLLS;");

System.load("d:\\IBM\\DLLS\\icudt36.dll");
System.load("d:\\IBM\\DLLS\\icuuc36.dll");
System.load("d:\\IBM\\DLLS\\arssck32.dll");
System.load("d:\\IBM\\DLLS\\arsxapi.dll");
System.load("d:\\IBM\\DLLS\\icuin36.dll");
System.load("d:\\IBM\\DLLS\\ctreestd.dll");
System.load("d:\\IBM\\DLLS\\ars3wapi32.dll");
System.load("d:\\IBM\\DLLS\\arswwwsl32.dll");*/

System.out.println("init....");
int portNumber;
Properties ODWEKProperties = new Properties();

try {
   
   ODWEKProperties.load(new FileInputStream("ODWEK.properties"));
     System.out.println(ODWEKProperties.getProperty("Afp2PdfConfigFile"));
      String appletDir = ODWEKProperties.getProperty("AppletDir");
      String tempDir = ODWEKProperties.getProperty("TempDir");
      String traceDir = ODWEKProperties.getProperty("TraceDir");

      String serverName = ODWEKProperties.getProperty("server");
      String userId = ODWEKProperties.getProperty("userid");
      String password = ODWEKProperties.getProperty("password");

     /*
      * [Pankaj]
      * bug 1: AppletDir property Error
      * cause: additional parameter in _ctor of ODConfig
      * solution: additional parameter removed.
      * status: fixed
      */
      odConfig = new ODConfig(
            ODWEKProperties.getProperty("AfpViewer"), // AfpViewer
            ODWEKProperties.getProperty("LineViewer"), // LineViewer
            ODWEKProperties.getProperty("MetaViewer"), // MetaViewer
              Long.parseLong(ODWEKProperties.getProperty("MaxHits")), // MaxHits
              ODWEKProperties.getProperty("AppletDir"), // AppletDir
              ODWEKProperties.getProperty("Language"), // Language
              ODWEKProperties.getProperty("TempDir"), // TempDir
              ODWEKProperties.getProperty("TraceDir"), // TraceDir
              Integer.parseInt(ODWEKProperties.getProperty("TraceLevel")) // trace
              );
     
   
      odServer = null;
      try{
       odServer = new ODServer(odConfig);
      }
      catch(Throwable e){
         e.printStackTrace();
      }
     
      /*
       * [Pankaj]
       * bug 2: java.lang.UnsatisfiedLinkError, ars3wapi32.dll not loaded
       * cause: Environment variable PATH value for DLL location was not correct, it was set to "D:\IBM\DLLLs\*.DLL;"
       *       instead of "D:\IBM\DLLs;". i.e spelling mistake and path should be a directory
       * solution: path corrected
       * status: fixed
       * refer: http://www-01.ibm.com/support/docview.wss?uid=swg21430283
       */
      if (odServer == null){
         System.out.println("ODServer instance could not be created, exiting.");
         return;
      }
      odServer.setServerName(serverName);
      odServer.initialize("CitarController");
      odServer.setUserId(userId);
      odServer.setPassword(password);
      odServer.logon();
     
      System.out.println("Server Name: " + odServer.getServerName());
      System.out.println("User Id: " + odServer.getUserId());
      System.out.println("Password: " + odServer.getPassword());
      portNumber = odServer.getPort();
      System.out.println("Setting port to " + portNumber + "...");
      odServer.setPort(portNumber);
      System.out.println("Port: " + portNumber);

      /*
       * additional code starts - Pankaj
       */
      System.out.println("\nGetting no. of folders..");
      System.out.println("No. of Folders: "+odServer.getNumFolders());
     
      System.out.println("\nPrinting folder details..\n");
     
      // get all available folders
      //(**) forcing java 1.5 generic, API says, it returns enum of ODFolder type
      Enumeration<ODFolder> folders = odServer.getFolders();
     
      // get folder details
      while ( folders.hasMoreElements() ){
         ODFolder odf = folders.nextElement(); // no type casts now, refer (**) above
         System.out.println("Name: "+odf.getName());
         System.out.println("Description: "+odf.getDescription());
         System.out.println("MaxHits: "+odf.getMaxHits());
         System.out.println("NumApplGroups: "+odf.getNumApplGroups());
         //System.out.println("ApplGroupNames: "+odf.getApplGroupNames());
         System.out.println("SearchMessage: "+odf.getSearchMessage());
         System.out.println("\n-----------------");
      }
     
      /*
       * additional code ends - Pankaj
       */

     
      //TODO: continue with new code..
     
      // queryFolder(odServer);

} catch (ODException e) {
      System.out.println("ODException: " + e);
      System.out.println(" id = " + e.getErrorId());
      System.out.println(" msg = " + e.getErrorMsg());
      e.printStackTrace();
} catch (Exception e2) {
      System.out.println("exception: " + e2);
      e2.printStackTrace();
} catch (Throwable th) {
      th.printStackTrace();
}
}
}


__________________________________________________________________________

ODWEK properties file :


#--------------------------
# Windows ODWEK Properties
#---------------------------
 
 
AfpViewer=pdf
LineViewer=applet
MetaViewer=
MaxHits=500
AppletDir=/applets
Language=ENU
TempDir=c\:\\temp
TraceDir=c\:\\temp
TraceLevel=4
 
server=10.224.203.56
#server=punib14711
userid=admin
password=password
 
 



Afp2PdfConfigFile=D\:\\Program Files\\IBM\\OnDemand Web Enablement Kit\\afp2pdf.ini
Afp2PdfInstallDir=D\:\\Program Files\\IBM\\OnDemand Web Enablement Kit


_______________________________________________________________________________

I hope this is helpful to everyone who is beginning with ODWEK.

Cheers
Pankaj.

pankaj.puranik

  • Sr. Member
  • ****
  • Posts: 374
    • View Profile
Re: Problem with the initial connection with OnDemand
« Reply #9 on: September 29, 2010, 11:04:12 PM »
Here are the DLLs i included :

D:\IBM\DLLS>dir
 Volume in drive D is DATA
 Volume Serial Number is 6E7D-49DA

 Directory of D:\IBM\DLLS

09/30/2010  11:09 AM    <DIR>          .
09/30/2010  11:09 AM    <DIR>          ..
07/23/2007  10:23 PM         1,220,608 ars3wapi32.dll
07/23/2007  10:23 PM            23,040 arssck32.dll
07/23/2007  10:23 PM         1,212,416 arswwwsl32.dll
07/23/2007  10:23 PM         1,130,496 arsxapi.dll
07/23/2007  09:32 PM           884,736 ctreestd.dll
07/23/2007  09:32 PM             2,560 icudt36.dll
07/23/2007  09:32 PM           790,528 icuin36.dll
07/23/2007  09:32 PM           876,544 icuuc36.dll
               8 File(s)      6,140,928 bytes
               2 Dir(s)  186,671,648,768 bytes free


Note that "ctreestd.dll" is included because I am using ODWEK 8.4.0 on ODv8.4.1

Cheers
Pankaj.