Performance of iPlanet 4.1 vs iPlanet 6.0

Hi,
We have upgraded from iPlanet 4.1 sp9 to iPlanet 6.0 sp5 on Solaris 8. We have noticed that performance has been degraded to the point where we are now going to go back to iPlanet 4.1.
We use a custom service plugin that creates dynamic html based on the incoming url. Under iPlanet 4.1 it averages about .2 seconds per page generation. Under iPlanet 6.0 it averages .9 seconds per page. Both tests are done when there is no other load on the server. I know I am dealing with tenths of a second, but we have a 2 second SLA with our clients and we receive around 500,000 http requests per day with about 100,000 being requests for our service plugin.
The servers are both configured pretty much the same. When I look at the .perf page for each server I see the following for the same 10 requests on each server:
iPlanet 4.1
Avarage Total Percent
Total number of requests: 190
Request processing time: 0.0001 0.0224
iPlanet 6.0
Average Total Percent
Total number of requests: 157
Request processing time: 0.0012 0.1896
The Request processing time is almost 10x as much for iPlanet 6 for the same requests.
What can I do to get this to be the same level as iPlanet 4.1? Has anyone seen this before and has a way to fix it?
Thanks,
Mike

I researched a similar issue for several days. I finally found a fix by adjusting the following keep-alive params in the magnus.conf. Of course, you will want to monitor performance and adjust accoriding to your load:
KeepAliveQueryMeanTime 1
KeepAliveQueryMaxSleepTime 0
Check this doc for more details:
http://sunsolve6.sun.com/search/document.do?assetkey=1-9-68380-1&searchclause=web%20performance

Similar Messages

  • LDAP performance vs iPlanet LDAP?

    We have 20,000 worklist users, and wonder if we should put them in the embedded
    WLS LDAP, or the iPlanet LDAP. Is there performance benchmark numbers to compare
    WLS LDAP with other 3rd party LDAP? Thanks.

    I researched a similar issue for several days. I finally found a fix by adjusting the following keep-alive params in the magnus.conf. Of course, you will want to monitor performance and adjust accoriding to your load:
    KeepAliveQueryMeanTime 1
    KeepAliveQueryMaxSleepTime 0
    Check this doc for more details:
    http://sunsolve6.sun.com/search/document.do?assetkey=1-9-68380-1&searchclause=web%20performance

  • Poor performance of iplanet 4.1 with netscape 4.79

    Hi , We have developed an application which has a controller servlet. All requests are handled by this controller servlet and the request is forwarded to a JSP page.
    RequestDispatcher rd = getServletContext().getRequestDispatcher(forwardPage);
    rd.forward(request, response);
    Now this JSP has multiple JSP includes <jsp:include/>, and each JSP might access a database to fetch data. Now my question is, this application runs on iPlanet Web Server ver. 4.1 on Windows 2000, JDK 1.2.2. Accessing the application thro' IE or Netscape 6 and above is very fast. But Netscape 4.79 does'nt seem to work. It just hangs the client system and CPU usage shoots up to 100 %, "Not responding" status. But after a long time (around 40 - 50 secs) the page shows up. What is the problem here ? My client uses only NetScape 4.79. Is there any way i could speed up this application on NS 4.79 ?
    Thanks in advance
    chanakian

    Total guess here -
    You're making heavy use of tables, and the JSP isn't provind a Content-Length header.
    Otherwise, no idea.

  • IPlanet performance information required (for sizing a new system)

    iPlanet performance. I am currently sizing a nre system and need some information around the performance of iPlanet. For example, the number of pages served against CPU usage. Does anyone know if there is a standard out there that records this information (similar to TPC for database performance). Cheers. Neil

    Hi,
    If you are planning to go  with EP 7, then installation master guide can help you.For EP 7 you need
    1)Oracle 10.2.0.2
    2)WAS java or ABAP
    3)EP installation master DVD(sapinst.exe)
    4)Support Packs (for e.g SP 10)
    This installation has KMC inbuilt that means you need not to install unlike EP6,Once installation is done you need to apply for license on https://service.sap.com --> key & requests,on this request,SAP will send you license file, it will be a TXT file, you only need to upload it on your server.
    Hope this helps,
    Regards,
    Ameya

  • Performance comparison of J2sdkee1.3.1's JMS and iPlanet MQ 2.0

    I am evaluating two JMS APIs: The free one comes with J2sdkee 1.3.1 and the iPlanet Message Queue for Java 2.0 (free for development and evaluation, not free on Production environment).
    I created two JSP pages running under Tomcat 3.3. One JSP page is calling a Java class 1 which uses j2sdkee1.3.1 JMS API: it creates InitialContext() and lookups for QueueConnectionFactory & Queue, then sends a text message to the Queue.
    I did a little performance improvement by putting this process into a static method init(), so it will be called only once. The latter request will only send message.
    The second JSP page is calling a Java class 2 which doesn't use JNDI, instead, it calls the new QueueConnectionFactory/QueueConnection classes provided by iPlanet MQ API.
    I found out that InitialContext() call and lookup process is taking quite a long time in the first case. After that, sending message is quite fast. However, if "j2ee" is shutdown in the middle, the JSP page can't recover unless I restarted Tomcat server.
    The performance of iPlanet MQ API is pretty good even if the QueueConnectionFactory/QueueConnection classes are created for each request. And it can recover after the Broker is restarted.
    Anybody experienced in using J2sdkee1.3.1 JMS API? If you know a better way to improve performance other than the static method init() which can't recover, please share your information. Appreciate it.
    Thanks,
    Ye

    Your performance comparison should be identical in all ways except for the particular server you are trying to evaluate. which should be relatively painless, given the use of JNDI.
    At the very least, ignore the JNDI lookup in your first test.
    I have found the j2ee JMS provider (the free one) to be quite slow, and also have found a bug with the shutdown and startup process changing the message order. which is a fundamental error.
    I have used IBM MQ (websphere MQ) and found it to be very fast and worked as expected. I have not used their pub/sub product (which i suspect is based on Talarian.)
    I favour servers built in native code, and integrate using JMS. just like I prefer Oracle over a pure Java RDBMS, but like the ease of integration offered with JDBC.
    I would avoid webstyle start-up companies like Iplanet. That joint effort seems like a desperate attempt at reviving Netscape thru technology, rather than thru a business concept.

  • Can I write a program in C/C++ and call iPlanet APIs and get the performance related information directly from iPlanet webserver ?

    Just to give an example, Microsoft IIS webserver provides the
    performance counters, which one can read from registry using
    APIs provided by Microsoft from a C/C++ program and get all the
    performance related data ... r some similar interfaces
    provided by iPlanet webserver ???

    The spell checked version...
    I really appreciate the replies. I have looked into RMI and think it might fit the bill, ,BUT, let me clarify a bit and see if there are any other ideas floating around out there.
    A user, using a web interface on machine A will click the , "I want my file" button. This flags the DB to create a file for that user. I will have multiple daemons running on other machines B,C,D whose sole job is to check the db, compile the file (This is the part that takes huge overhead so I wanted it distributed), then write the file. The trick is the file needs to be written to machine A. So I figure, using RMI, I can write a simple "write this file" object that will accept a byte stream or byte array, and a correct path to write to. Does this sound like a good methodology?
    I've never done anything like this so I am really shooting in the dark.
    Thanks again for the posts.
    Paul

  • WL/iPlanet Performance lag

    I am running a Weblogic 5.1SP4 application server with an iPlanet web server. I have NSAPI configured and working properly. The only thing is that the performance is horrible.
    When I go directly to WL by specifying the 7001 port on my application server, my JSP pages come up like lightening. When I go through the iPlanet web server, the very same pages take 30-60 seconds to load.
    I used the ppath method to direct all requests to the WL server. Is there something on the Weblogic side/configuration which could be slowing down this connection? (I am basically using the same weblogic.properties file which was created during the WL installation.)

    iPlanet and WL are on the same box. Our network speed is a little slow in general, however when you access our web pages over the network and specify the Weblogic port, 7001, there is no noticable network lag.
    Thanks!
    Gary
    Kumar Allamraju <[email protected]> wrote:
    Is your WLS & iPlanet located on the same box or on different boxes?
    BTW, how is your network speed?
    Kumar
    Gary Markle wrote:
    I am running a Weblogic 5.1SP4 application server with an iPlanet web server. I have NSAPI configured and working properly. The only thing is that the performance is horrible.
    When I go directly to WL by specifying the 7001 port on my application server, my JSP pages come up like lightening. When I go through the iPlanet web server, the very same pages take 30-60 seconds to load.
    I used the ppath method to direct all requests to the WL server. Is there something on the Weblogic side/configuration which could be slowing down this connection? (I am basically using the same weblogic.properties file which was created during the WL installation.)

  • IPlanet - WebLogic  bridge, performance

    We are using iPlanet as a web server and weblogic as an application server. So, there is NSAPI plug-in,redirecting some requests coming from iPlanet to WebLogic. JSPs pages and servlets are served very fast via this plug-in, whereas static html pages and images are served very slow. Response time (in case of html pages and images) is very long. The weblogic.log file does not give us any errors, whereas /https-.../logs/errors file gives the following:
    "flex log buffer overflow" - greater than 4096 characters
    What can we do to decrease response time?
    Actually we walked through parameters that can be passed into NSAPI plug-in, and we could not find anything in this plug-in related to buffer size.
    Attached file is a copy of our obj.conf file
    [obj.conf]

    We were using the same configuration, and we got the same problems
    And we got the solution :
    you have to use the libproxy.so from the WL 51 SP8 , using this heavy
    bugfixed library
    the problems didn't occur.
    Sasha Kretchetov wrote:
    We are using iPlanet as a web server and weblogic as an application server. So, there is NSAPI plug-in,redirecting some requests coming from iPlanet to WebLogic. JSPs pages and servlets are served very fast via this plug-in, whereas static html pages and images are served very slow. Response time (in case of html pages and images) is very long. The weblogic.log file does not give us any errors, whereas /https-.../logs/errors file gives the following:
    "flex log buffer overflow" - greater than 4096 characters
    What can we do to decrease response time?
    Actually we walked through parameters that can be passed into NSAPI plug-in, and we could not find anything in this plug-in related to buffer size.
    Attached file is a copy of our obj.conf file
    # Sun Netscape Alliance - obj.conf
    # You can edit this file, but comments and formatting changes
    # might be lost when the admin server makes changes.
    Init fn="load-modules" funcs="wl-proxy,wl-init" shlib="/opt/iplanet/server4/plugins/libproxy.so"
    Init fn="wl-init"
    Init fn="flex-init" access="/opt/iplanet/server4/https-1212/logs/access" 3="fo" rmat.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
    Init fn="load-types" mime-types="mime.types"
    Init fn="load-modules" shlib="/opt/iplanet/server4/bin/https/lib/libNSServletPlugin.so" funcs="NSServletEarlyInit,NSServletLateInit,NSServletNameTrans,NSServletService" shlib_flags="(global|now)"
    Init fn="NSServletEarlyInit" EarlyInit="yes"
    Init fn="NSServletLateInit" LateInit="yes"
    <Object name="default">
    NameTrans fn="NSServletNameTrans" name="servlet"
    NameTrans fn="pfx2dir" from="/servlet" dir="/opt/iplanet/server4/1212/servlet" name="ServletByExt"
    NameTrans fn="pfx2dir" from="/ns-icons" dir="/opt/iplanet/server4/ns-icons" name="es-internal"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/opt/iplanet/server4/ns-icons" name="es-internal"
    NameTrans fn="pfx2dir" from="/help" dir="/opt/iplanet/server4/manual/https/ug" name="es-internal"
    NameTrans fn="pfx2dir" from="/manual" dir="/opt/iplanet/server4/manual/https" name="es-internal"
    NameTrans fn="document-root" root="/opt/iplanet/server4/1212"
    PathCheck fn="unix-uri-clean"
    PathCheck fn="check-acl" acl="default"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-index" index-names="index.html,home.html,index.htm"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain"
    Service method="(GET|HEAD)" type="magnus-internal/imagemap" fn="imagemap"
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
    Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
    AddLog fn="flex-log" name="access"
    </Object>
    <Object name="cgi">
    ObjectType fn="force-type" type="magnus-internal/cgi"
    Service fn="send-cgi"
    </Object>
    <Object name="weblogic" ppath="*/Application1/*">
    Service fn="wl-proxy" WebLogicHost="192.168.170.12" WebLogicPort="55205"
    </Object>
    <Object name="weblogic" ppath="*/Application2/*">
    Service fn="wl-proxy" WebLogicHost="192.168.170.12" WebLogicPort="55205"
    </Object>
    <Object name="servlet">
    ObjectType fn="force-type" type="text/html"
    Service fn="NSServletService"
    </Object>
    <Object name="jsp092">
    ObjectType fn="type-by-extension"
    ObjectType fn="change-type" type="magnus-internal/jsp092" if-type="magnus-internal/jsp"
    Service fn="NSServletService" type="magnus-internal/jsp092"
    </Object>
    <Object name="ServletByExt">
    ObjectType fn="force-type" type="magnus-internal/servlet"
    Service type="magnus-internal/servlet" fn="NSServletService"
    </Object>
    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>
    obj.conf
    Content-Type:
    text/plain
    Content-Encoding:
    base64

  • RE: [iPlanet-JATO] Href click & tiled view display

    Srinivas,
    I hope that I am not oversimplifying your first question; repost if I do not
    answer your question. Independent of JATO, HTML Form button sumbits will
    include the scraping of data off the form input fields; the data will passed
    as part of the body of the HTTP request. Therefore, you would expect to
    receive all your inputs during the Button submit. In the case of a button,
    a HTTP POST request is invoked. Href clicks, only submit the NVPs which are
    encoded on the HREF URL. Therefore, it is impossible (under normal
    circumstances) to retrieve the inputs from the FORM during the Href click.
    In the case of a Href, a HTTP GET request is invoked. Some customers have
    used a pattern in which Javascript is used to capture the Href onClick()
    event to perform some runtime modifications to the HREF URL before the HTTP
    GET request is submitted. I recommend to always have the LogProxy2 utility
    running during development so that the HTTP requests and repsonses can be
    debugged. If you setup the LogProxy2 (downloadable from this Group's Files
    repository) then you would see the HTTP requests in the LogProxy2's console
    window.
    TiledView question: Remember, each TiledView requires a "primary
    DatasetModel" which it uses for iteration of the tiles. It can be
    confusing, but the API call of
    <ContainerView>.getDefaultModel()
    has no relation to the implementation class called DefaultModel. See the
    Javadoc (excerp below)
    /migtoolbox-1.1.1/doc/jato/api/com/iplanet/jato/view/ContainerView.html#getD
    efaultModel()
    "Returns this view's default model. The default model is typically used by
    DisplayField children for default value storage (if they are not bound to
    any other model). This method should always return a valid model instance.
    Note that the default model need not be an actual instance of DefaultModel,
    although this is usually the case."
    Both of your TiledView's (inner and outer) are ContainerViews, each having
    their own property for [get/set]DefaultModel(). Likewise, the ViewBean
    parent of the outer TiledView is a ContainerView as well. With these facts
    in mind, consider the behavior of the ModelManager. The ModelManager will
    ensure that only once instance of specifically named model will be provided
    during a request scope. Therefore, everytime that you make a call to
    <ModelManager>.getModel(SomeModel.class)
    no matter how many times you make this call during a request, the
    ModelManager will ensure that you get the same object reference back.
    Implicitly, you are asking for a Model with the exclusive name of
    <ModelManager>.getDefaultModelInstanceName(SomeModel.class)
    I believe that your problem is that you have the Primary Model of both the
    inner and outer TiledView's set to the same instance of the DefaultModel
    class. Therefore, the TiledViews are tripping over each other because they
    are using the same Primary model. What I would do is change the constructor
    of each TiledView to set an exclusive Primary model
    // add to constructor of outer TileView
    setPrimaryModel(getModelI(DefaultModel.class,"outer")
    // add to constructor of inner TileView
    setPrimaryModel(getModelI(DefaultModel.class,"inner")
    remember to set the "size" of the Primary Model appropriately in the
    beginDisplay() event of each TiledView before calling super.beginDisplay()
    matt
    -----Original Message-----
    From: Srinivas Chikkam [mailto:<a href="/group/SunONE-JATO/post?protectID=061212020185082096169232190043244089032032196034013195172049230091142254099102">srinivas.chikkam@w...</a>]
    Sent: Tuesday, July 17, 2001 7:36 AM
    Subject: [iPlanet-JATO] Href click & tiled view display
    Hi,
    I'm facing the following two problems in JATO. Your help will be
    appreciated.
    1) Clicking a HREF.
    I have a button and a href in a page. When I submit the page by
    clicking the button, I'm able to
    get all the user entered data (form elements) in handler method.
    However, when I click
    the href and I try to retrieve the data entered by the user in my
    corresponding handler method, I'm
    getting blank values.
    How would I be able to get the user entered data upon clicking of a href
    ? I'm copying the sample
    code for your reference.
    // This returns me 5 values entered in the 5 tiles by the user.
    public void handleBButtonRequest(RequestContext req)
    throws ServletException, IOException
    try
    System.out.println("button clicked..");
    pgSampleTiledView tiledView = getSampleTile();
    System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
    "+tiledView.getNumTiles());
    int n = tiledView.getNumTiles();
    for (int i=0; i<n; i++)
    tiledView.setTileIndex(i);
    System.out.println(i+".
    "+tiledView.getTbValue().getValue().toString());
    this.forwardTo(req);
    catch (Exception ex)
    ex.printStackTrace();
    // This returns me 0 tiles and doesn't get into for loop
    public void handleLinkModifyDistributionRequest(RequestContext req )
    throws ServletException, IOException
    try
    System.out.println("href clicked..");
    pgSampleTiledView tiledView = getSampleTile();
    System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
    "+tiledView.getNumTiles());
    int n = tiledView.getNumTiles();
    for (int i=0; i<n; i++)
    tiledView.setTileIndex(i);
    System.out.println(i+".
    "+tiledView.getTbValue().getValue().toString());
    this.forwardTo(req);
    catch (Exception ex)
    ex.printStackTrace();
    2) Tiled view display
    I have tiled view inside another tiled view. Based upon the data
    retrieved from the database, lets say, the outer tile needs to be
    displayed twice and the inner tile 3 times and 1 time.
    For Ex: Lets say, the desired output from these tiled views is as
    follows
    STOCK INVESTMENT
    stock name1
    stock name2
    stock name3
    OTHER INVESTMENT
    other investment1
    The outer tiled view displays the investment type headings (STOCK
    INVESTMENT or OTHER INVESTMENT) and inner tile
    displays the actual stock names or the other investment names. Both
    the tile views are bound to a default model. In the begin display
    of these tiled view I'm setting the size of the model as
    getPrimaryModel.setSize(requiredsize).
    If i display 3 records in the inner tiled view in the first iteration
    and i try to display 1 record in the second iteration, it displays 3
    records
    properly the first time but it doesn't display any records second
    time. super.nextTile() returns false right away second time.
    But If I try to display 1 record in the first iteration and 3 records in
    the second iteration as below, it works fine.
    STOCK INVESTMENT
    stock name1
    OTHER INVESTMENT
    other investment1
    other investment2
    other investment3
    Please let me know what could be the problem.
    Thanks
    ~ Srinivas
    The Information contained and transmitted by this E-MAIL is
    proprietary to
    Wipro Limited and is intended for use only by the individual or
    entity to which
    it is addressed, and may contain information that is privileged,
    confidential or
    exempt from disclosure under applicable law. If this is a
    forwarded message,
    the content of this E-MAIL may not have been sent with the
    authority of the
    Company. If you are not the intended recipient, an agent of the intended
    recipient or a person responsible for delivering the information
    to the named
    recipient, you are notified that any use, distribution,
    transmission, printing,
    copying or dissemination of this information in any way or in any
    manner is
    strictly prohibited. If you have received this communication in
    error, please
    delete this mail & notify us immediately at mailadmin@w...
    [Non-text portions of this message have been removed]
    [email protected]

    should read
    // add to constructor of outer TileView
    setPrimaryModel(getModel(DefaultModel.class,"outer");
    // add to constructor of inner TileView
    setPrimaryModel(getModel(DefaultModel.class,"inner");
    matt
    -----Original Message-----
    From: Matthew Stevens [mailto:<a href="/group/SunONE-JATO/post?protectID=029166114165042198028082000056130080177026031196061123241150194211220076086020224">matthew.stevens@e...</a>]
    Sent: Tuesday, July 17, 2001 9:25 AM
    Subject: RE: [iPlanet-JATO] Href click & tiled view display
    Srinivas,
    I hope that I am not oversimplifying your first question; repost
    if I do not
    answer your question. Independent of JATO, HTML Form button sumbits will
    include the scraping of data off the form input fields; the data
    will passed
    as part of the body of the HTTP request. Therefore, you would expect to
    receive all your inputs during the Button submit. In the case of
    a button,
    a HTTP POST request is invoked. Href clicks, only submit the
    NVPs which are
    encoded on the HREF URL. Therefore, it is impossible (under normal
    circumstances) to retrieve the inputs from the FORM during the Href click.
    In the case of a Href, a HTTP GET request is invoked. Some customers have
    used a pattern in which Javascript is used to capture the Href onClick()
    event to perform some runtime modifications to the HREF URL
    before the HTTP
    GET request is submitted. I recommend to always have the
    LogProxy2 utility
    running during development so that the HTTP requests and repsonses can be
    debugged. If you setup the LogProxy2 (downloadable from this
    Group's Files
    repository) then you would see the HTTP requests in the
    LogProxy2's console
    window.
    TiledView question: Remember, each TiledView requires a "primary
    DatasetModel" which it uses for iteration of the tiles. It can be
    confusing, but the API call of
    <ContainerView>.getDefaultModel()
    has no relation to the implementation class called DefaultModel. See the
    Javadoc (excerp below)
    /migtoolbox-1.1.1/doc/jato/api/com/iplanet/jato/view/ContainerView
    .html#getD
    efaultModel()
    "Returns this view's default model. The default model is typically used by
    DisplayField children for default value storage (if they are not bound to
    any other model). This method should always return a valid model instance.
    Note that the default model need not be an actual instance of
    DefaultModel,
    although this is usually the case."
    Both of your TiledView's (inner and outer) are ContainerViews, each having
    their own property for [get/set]DefaultModel(). Likewise, the ViewBean
    parent of the outer TiledView is a ContainerView as well. With
    these facts
    in mind, consider the behavior of the ModelManager. The ModelManager will
    ensure that only once instance of specifically named model will
    be provided
    during a request scope. Therefore, everytime that you make a call to
    <ModelManager>.getModel(SomeModel.class)
    no matter how many times you make this call during a request, the
    ModelManager will ensure that you get the same object reference back.
    Implicitly, you are asking for a Model with the exclusive name of
    <ModelManager>.getDefaultModelInstanceName(SomeModel.class)
    I believe that your problem is that you have the Primary Model of both the
    inner and outer TiledView's set to the same instance of the DefaultModel
    class. Therefore, the TiledViews are tripping over each other
    because they
    are using the same Primary model. What I would do is change the
    constructor
    of each TiledView to set an exclusive Primary model
    // add to constructor of outer TileView
    setPrimaryModel(getModelI(DefaultModel.class,"outer")
    // add to constructor of inner TileView
    setPrimaryModel(getModelI(DefaultModel.class,"inner")
    remember to set the "size" of the Primary Model appropriately in the
    beginDisplay() event of each TiledView before calling super.beginDisplay()
    matt
    -----Original Message-----
    From: Srinivas Chikkam [mailto:<a href="/group/SunONE-JATO/post?protectID=061212020185082096169232190043244089032032196034013195172049230091142254099102">srinivas.chikkam@w...</a>]
    Sent: Tuesday, July 17, 2001 7:36 AM
    Subject: [iPlanet-JATO] Href click & tiled view display
    Hi,
    I'm facing the following two problems in JATO. Your help will be
    appreciated.
    1) Clicking a HREF.
    I have a button and a href in a page. When I submit the page by
    clicking the button, I'm able to
    get all the user entered data (form elements) in handler method.
    However, when I click
    the href and I try to retrieve the data entered by the user in my
    corresponding handler method, I'm
    getting blank values.
    How would I be able to get the user entered data upon clicking of a href
    ? I'm copying the sample
    code for your reference.
    // This returns me 5 values entered in the 5 tiles by the user.
    public void handleBButtonRequest(RequestContext req)
    throws ServletException, IOException
    try
    System.out.println("button clicked..");
    pgSampleTiledView tiledView = getSampleTile();
    System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
    "+tiledView.getNumTiles());
    int n = tiledView.getNumTiles();
    for (int i=0; i<n; i++)
    tiledView.setTileIndex(i);
    System.out.println(i+".
    "+tiledView.getTbValue().getValue().toString());
    this.forwardTo(req);
    catch (Exception ex)
    ex.printStackTrace();
    // This returns me 0 tiles and doesn't get into for loop
    public void handleLinkModifyDistributionRequest(RequestContext req )
    throws ServletException, IOException
    try
    System.out.println("href clicked..");
    pgSampleTiledView tiledView = getSampleTile();
    System.out.println("\n\n\n\n@@@@@@@@@@@ No of tiles >>>
    "+tiledView.getNumTiles());
    int n = tiledView.getNumTiles();
    for (int i=0; i<n; i++)
    tiledView.setTileIndex(i);
    System.out.println(i+".
    "+tiledView.getTbValue().getValue().toString());
    this.forwardTo(req);
    catch (Exception ex)
    ex.printStackTrace();
    2) Tiled view display
    I have tiled view inside another tiled view. Based upon the data
    retrieved from the database, lets say, the outer tile needs to be
    displayed twice and the inner tile 3 times and 1 time.
    For Ex: Lets say, the desired output from these tiled views is as
    follows
    STOCK INVESTMENT
    stock name1
    stock name2
    stock name3
    OTHER INVESTMENT
    other investment1
    The outer tiled view displays the investment type headings (STOCK
    INVESTMENT or OTHER INVESTMENT) and inner tile
    displays the actual stock names or the other investment names. Both
    the tile views are bound to a default model. In the begin display
    of these tiled view I'm setting the size of the model as
    getPrimaryModel.setSize(requiredsize).
    If i display 3 records in the inner tiled view in the first iteration
    and i try to display 1 record in the second iteration, it displays 3
    records
    properly the first time but it doesn't display any records second
    time. super.nextTile() returns false right away second time.
    But If I try to display 1 record in the first iteration and 3 records in
    the second iteration as below, it works fine.
    STOCK INVESTMENT
    stock name1
    OTHER INVESTMENT
    other investment1
    other investment2
    other investment3
    Please let me know what could be the problem.
    Thanks
    ~ Srinivas
    The Information contained and transmitted by this E-MAIL is
    proprietary to
    Wipro Limited and is intended for use only by the individual or
    entity to which
    it is addressed, and may contain information that is privileged,
    confidential or
    exempt from disclosure under applicable law. If this is a
    forwarded message,
    the content of this E-MAIL may not have been sent with the
    authority of the
    Company. If you are not the intended recipient, an agent of the intended
    recipient or a person responsible for delivering the information
    to the named
    recipient, you are notified that any use, distribution,
    transmission, printing,
    copying or dissemination of this information in any way or in any
    manner is
    strictly prohibited. If you have received this communication in
    error, please
    delete this mail & notify us immediately at mailadmin@w...
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

  • Re: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't forget about the regular expression potential

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

    Namburi,
    When you said you used the Reg Exp tool, did you use it only as
    preconfigured by the iMT migrate application wizard?
    Because the default configuration of the regular expression tool will only
    target the files in your ND project directories. If you wish to target
    classes outside of the normal directory scope, you have to either modify the
    "Source Directory" property OR create another instance of the regular
    expression tool. See the "Tool" menu in the iMT to create additional tool
    instances which can each be configured to target different sets of files
    using different sets of rules.
    Usually, I utilize 3 different sets of rules files on a given migration:
    spider2jato.xml
    these are the generic conversion rules (but includes the optimized rules for
    ViewBean and Model based code, i.e. these rules do not utilize the
    RequestManager since it is not needed for code running inside the ViewBean
    or Model classes)
    I run these rules against all files.
    See the file download section of this forum for periodic updates to these
    rules.
    nonProjectFileRules.xml
    these include rules that add the necessary
    RequestManager.getRequestContext(). etc prefixes to many of the common
    calls.
    I run these rules against user module and any other classes that do not are
    not ModuleServlet, ContainerView, or Model classes.
    appXRules.xml
    these rules include application specific changes that I discover while
    working on the project. A common thing here is changing import statements
    (since the migration tool moves ND project code into different jato
    packaging structure, you sometime need to adjust imports in non-project
    classes that previously imported ND project specific packages)
    So you see, you are not limited to one set of rules at all. Just be careful
    to keep track of your backups (the regexp tool provides several options in
    its Expert Properties related to back up strategies).
    ----- Original Message -----
    From: <vnamboori@y...>
    Sent: Wednesday, August 08, 2001 6:08 AM
    Subject: [iPlanet-JATO] Re: Use Of models in utility classes - Pease don't
    forget about the regular expression potential
    Thanks Matt, Mike, Todd
    This is a great input for our migration. Though we used the existing
    Regular Expression Mapping tool, we did not change this to meet our
    own needs as mentioned by Mike.
    We would certainly incorporate this to ease our migration.
    Namburi
    --- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
    All--
    Great response. By the way, the Regular Expression Tool uses thePerl5 RE
    syntax as implemented by Apache OROMatcher. If you're doing lotsof these
    sorts of migration changes manually, you should definitely buy theO'Reilly
    book "Mastering Regular Expressions" and generate some rules toautomate the
    conversion. Although they are definitely confusing at first,regular
    expressions are fairly easy to understand with some documentation,and are
    superbly effective at tackling this kind of migration task.
    Todd
    ----- Original Message -----
    From: "Mike Frisino" <Michael.Frisino@S...>
    Sent: Tuesday, August 07, 2001 5:20 PM
    Subject: Re: [iPlanet-JATO] Use Of models in utility classes -Pease don't
    forget about the regular expression potential
    Also, (and Matt's document may mention this)
    Please bear in mind that this statement is not totally correct:
    Since the migration tool does not do much of conversion for
    these
    utilities we have to do manually.Remember, the iMT is a SUITE of tools. There is the extractiontool, and
    the translation tool, and the regular expression tool, and severalother
    smaller tools (like the jar and compilation tools). It is correctto state
    that the extraction and translation tools only significantlyconvert the
    primary ND project objects (the pages, the data objects, and theproject
    classes). The extraction and translation tools do minimumtranslation of the
    User Module objects (i.e. they repackage the user module classes inthe new
    jato module packages). It is correct that for all other utilityclasses
    which are not formally part of the ND project, the extraction and
    translation tools do not perform any migration.
    However, the regular expression tool can "migrate" any arbitrary
    file
    (utility classes etc) to the degree that the regular expressionrules
    correlate to the code present in the arbitrary file. So first andforemost,
    if you have alot of spider code in your non-project classes youshould
    consider using the regular expression tool and if warranted adding
    additional rules to reduce the amount of manual adjustments thatneed to be
    made. I can stress this enough. We can even help you write theregular
    expression rules if you simply identify the code pattern you wish to
    convert. Just because there is not already a regular expressionrule to
    match your need does not mean it can't be written. We have notnearly
    exhausted the possibilities.
    For example if you say, we need to convert
    CSpider.getDataObject("X");
    To
    RequestManager.getRequestContext().getModelManager().getModel(XModel.class);
    Maybe we or somebody else in the list can help write that regularexpression if it has not already been written. For instance in thelast
    updated spider2jato.xml file there is already aCSpider.getCommonPage("X")
    rule:
    <!--getPage to getViewBean-->
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getPage[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getViewBean($1ViewBean.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    Following this example a getDataObject to getModel would look
    like this:
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[CSpider[.\s]*getDataObject[\s]*\(\"([^"]*)\"]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[getModel($1Model.class]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    In fact, one migration developer already wrote that rule andsubmitted it
    for inclusion in the basic set. I will post another upgrade to thebasic
    regular expression rule set, look for a "file uploaded" posting.Also,
    please consider contributing any additional generic rules that youhave
    written for inclusion in the basic set.
    Please not, that in some cases (Utility classes in particular)
    the rule
    application may be more effective as TWO sequention rules ratherthan one
    monolithic rule. Again using the example above, it will convert
    CSpider.getDataObject("Foo");
    To
    getModel(FooModel.class);
    Now that is the most effective conversion for that code if that
    code is in
    a page or data object class file. But if that code is in a Utilityclass you
    really want:
    >
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    So to go from
    getModel(FooModel.class);
    To
    RequestManager.getRequestContext().getModelManager().getModel(FooModel.class
    You would apply a second rule AND you would ONLY run this rule
    against
    your utility classes so that you would not otherwise affect yourViewBean
    and Model classes which are completely fine with the simplegetModel call.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getModel\(]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getModel\(]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getRequestContext().getModelManager().getModel(]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    A similer rule can be applied to getSession and other CSpider APIcalls.
    For instance here is the rule for converting getSession calls toleverage
    the RequestManager.
    <mapping-rule>
    <mapping-rule-primarymatch>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-primarymatch>
    <mapping-rule-replacement>
    <mapping-rule-match>
    <![CDATA[getSession\(\)\.]]>
    </mapping-rule-match>
    <mapping-rule-substitute>
    <![CDATA[RequestManager.getSession().]]>
    </mapping-rule-substitute>
    </mapping-rule-replacement>
    </mapping-rule>
    ----- Original Message -----
    From: "Matthew Stevens" <matthew.stevens@e...>
    Sent: Tuesday, August 07, 2001 12:56 PM
    Subject: RE: [iPlanet-JATO] Use Of models in utility classes
    Namburi,
    I will post a document to the group site this evening which has
    the
    details
    on various tactics of migrating these type of utilities.
    Essentially,
    you
    either need to convert these utilities to Models themselves or
    keep the
    utilities as is and simply use the
    RequestManager.getRequestContext.getModelManager().getModel()
    to statically access Models.
    For CSpSelect.executeImmediate() I have an example of customhelper
    method
    as a replacement whicch uses JDBC results instead of
    CSpDBResult.
    matt
    -----Original Message-----
    From: vnamboori@y... [mailto:<a href="/group/SunONE-JATO/post?protectID=081071113213093190112061186248100208071048">vnamboori@y...</a>]
    Sent: Tuesday, August 07, 2001 3:24 PM
    Subject: [iPlanet-JATO] Use Of models in utility classes
    Hi All,
    In the present ND project we have lots of utility classes.
    These
    classes in diffrent directory. Not part of nd pages.
    In these classes we access the dataobjects and do themanipulations.
    So we access dataobjects directly like
    CSpider.getDataObject("do....");
    and then execute it.
    Since the migration tool does not do much of conversion forthese
    utilities we have to do manually.
    My question is Can we access the the models in the postmigration
    sameway or do we need requestContext?
    We have lots of utility classes which are DataObjectintensive. Can
    someone suggest a better way to migrate this kind of code.
    Thanks
    Namburi
    [email protected]
    [email protected]
    [Non-text portions of this message have been removed]
    [email protected]
    [email protected]

  • RE: [iPlanet-JATO] EJB in iMT

    Matt,
    Thanks for your clarifications.That helps a lot.
    We have found in a lot of cases, that your new components can be
    implemented as JATO ModelsI don't understand this.Is it that EJB acts as the Data Model or something
    Thanks,
    Gajendran.
    "Matthew Stevens"
    Subject: RE: [iPlanet-JATO]
    EJB in iMT
    10/30/01 07:34 PM
    Please respond to
    iPlanet-JATO
    Gajendran,
    The iMT for NetDynamics does not current have any translation requirement
    for EJBs. If you have a ND 3.x or ND 4.x application then you have no
    pre-existing EJBs. ND 5.0 provided an EJB 1.0 container for Session Beans
    but the Migration leaves the EJBs untouched. The migration path for ND 5.0
    EJBs to J2EE EJBs is clear - it simply requires a recompiling and packaging
    and tweaking. I have done this at some customer sites and it is very
    straight forward. In many cases, you may find that your choice of an EJB
    implementation does not truely take advantage of the features of the EJB
    container and you EJBs are simply business objects (stateless and
    stateful).
    We have found that migrating stateless and stateful ND 5.0 EJBs to JATO
    Models is very simple and greatly improves the performance in many cases.
    Now that your ND application is migated to J2EE/JATO you can easily add
    EJBs
    to the application; JATO does not prevent this in any way. Some customers
    are even adapting existing or 3rd party EJBs to JATO Models interfaces, but
    this is not necessary. Your EJBs will be packaged separately in JAR file
    and combined with JATO Application WAR file in an EAR file. We recommend
    using a good tool like Forte to generate your EJBs. I personally suggest
    that you carefully plan and analyze your requirements before moving forward
    with the EJBs. Please make sure that you your new components 'need' the
    features of the EJB container/framework. If you need an Entity bean then
    use it. We have found in a lot of cases, that your new components can be
    implemented as JATO Models. It all depends on the dynamics of the
    application and constitution of your data.
    matt
    -----Original Message-----
    From: gajendran.gopinathan@i...
    [mailto:<a href="/group/SunONE-JATO/post?protectID=123166177056078154218098066036192063041102166009043241114211116056004136218164200193244096076095219">gajendran.gopinathan@i...</a>]
    Sent: Tuesday, October 30, 2001 6:40 AM
    Subject: [iPlanet-JATO] EJB in iMT
    We have migrated an application in ND3.0 to J2EE using iMT 1.1.1.
    Is there any provision in iMT which could generate EJBs?
    What is the recommended approach towards this?
    Thanks,
    Gajendran
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    ------------------------Disclaimer------------------------
    The views of the author may not necessarily reflect those
    of the Company. All liability is excluded to the extent
    permitted by law for any claims arising as a result of the
    use of this medium to transmit information by or to
    IT Solutions (India) Pvt. Ltd.
    We have taken precautions to minimize the risk of
    transmitting software viruses, but we advise you to
    carry out your own virus checks on any attachment to
    this message. We cannot accept liability for any loss or
    damage caused by software viruses.
    ------------------------Disclaimer------------------------

    Matt,
    Thanks for your clarifications.That helps a lot.
    We have found in a lot of cases, that your new components can be
    implemented as JATO ModelsI don't understand this.Is it that EJB acts as the Data Model or something
    Thanks,
    Gajendran.
    "Matthew Stevens"
    Subject: RE: [iPlanet-JATO]
    EJB in iMT
    10/30/01 07:34 PM
    Please respond to
    iPlanet-JATO
    Gajendran,
    The iMT for NetDynamics does not current have any translation requirement
    for EJBs. If you have a ND 3.x or ND 4.x application then you have no
    pre-existing EJBs. ND 5.0 provided an EJB 1.0 container for Session Beans
    but the Migration leaves the EJBs untouched. The migration path for ND 5.0
    EJBs to J2EE EJBs is clear - it simply requires a recompiling and packaging
    and tweaking. I have done this at some customer sites and it is very
    straight forward. In many cases, you may find that your choice of an EJB
    implementation does not truely take advantage of the features of the EJB
    container and you EJBs are simply business objects (stateless and
    stateful).
    We have found that migrating stateless and stateful ND 5.0 EJBs to JATO
    Models is very simple and greatly improves the performance in many cases.
    Now that your ND application is migated to J2EE/JATO you can easily add
    EJBs
    to the application; JATO does not prevent this in any way. Some customers
    are even adapting existing or 3rd party EJBs to JATO Models interfaces, but
    this is not necessary. Your EJBs will be packaged separately in JAR file
    and combined with JATO Application WAR file in an EAR file. We recommend
    using a good tool like Forte to generate your EJBs. I personally suggest
    that you carefully plan and analyze your requirements before moving forward
    with the EJBs. Please make sure that you your new components 'need' the
    features of the EJB container/framework. If you need an Entity bean then
    use it. We have found in a lot of cases, that your new components can be
    implemented as JATO Models. It all depends on the dynamics of the
    application and constitution of your data.
    matt
    -----Original Message-----
    From: gajendran.gopinathan@i...
    [mailto:<a href="/group/SunONE-JATO/post?protectID=123166177056078154218098066036192063041102166009043241114211116056004136218164200193244096076095219">gajendran.gopinathan@i...</a>]
    Sent: Tuesday, October 30, 2001 6:40 AM
    Subject: [iPlanet-JATO] EJB in iMT
    We have migrated an application in ND3.0 to J2EE using iMT 1.1.1.
    Is there any provision in iMT which could generate EJBs?
    What is the recommended approach towards this?
    Thanks,
    Gajendran
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    ------------------------Disclaimer------------------------
    The views of the author may not necessarily reflect those
    of the Company. All liability is excluded to the extent
    permitted by law for any claims arising as a result of the
    use of this medium to transmit information by or to
    IT Solutions (India) Pvt. Ltd.
    We have taken precautions to minimize the risk of
    transmitting software viruses, but we advise you to
    carry out your own virus checks on any attachment to
    this message. We cannot accept liability for any loss or
    damage caused by software viruses.
    ------------------------Disclaimer------------------------

  • Re: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & & onSessionTimeoutEvent

    My mistake. Thanks for the clarification, Craig.
    Todd
    ----- Original Message -----
    From: "Craig V. Conover" <craig.conover@s...>
    Sent: Friday, January 04, 2002 11:14 AM
    Subject: Re: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & &
    onSessionTimeoutEvent
    Alex,
    In addition to Todd saying that the ND security object "is nothing morethan a
    sessionable object...", remember that the security object did nothing morethan
    retrieve the user profile from some persistent store: a database or athird party
    API. So the security object was just a very specialized model (a dataobject in ND
    terms, of course), although it need not be a model, it could just be anarbitrary
    Java class, whatever works best.
    Once the security object was triggered to perform a user profile lookup,the
    profile was stored in an instance of CSpUserProfile and kept in the user's
    session. The project object was then the object that was responsible forchecking
    the user profile for privileges, previous pages, and db logins and such.As Todd
    explained, the ViewBean API now does the security check (as opposed toJATO's
    module servlet, or ND's project object), so extending ViewBeanBase andoverriding
    securityCheck is a convenient way to mimic ND's security hooks. You couldeven
    override a method or event in the module servlet to do a lookup if youwant a
    greater parallel to ND, but this is unneccessary. Either way, the securitycheck
    is performed before the "page" is "loaded".
    c
    Todd Fast wrote:
    Agreed. This is partly why we have never added such a feature to JATO
    (though we've talked about it many many times), because it seemed too
    prescriptive and possibly at odds with the other solutions people favor.
    We're still on the fence. We want to add it, but feel it'll take a fair
    bit
    of design to do properly and extensibly.
    However, realize that the ND security object is nothing more than a
    sessionable object with slots for username, password, and priveleges.This
    is almost trivially easy to replicate on your own, with a small additionof
    code to automatically handle lifecycle and security checking. It wouldbe
    extremely easy to create a subclass of ViewBeanBase that would overridethe
    securityCheck() method to check the state of a sessioned "user profile"
    object. Add to the ViewBean a declared set of "privelege" strings, andyou
    can check the profile object against those required.
    I feel I'm being unclear--do you see where I'm going?
    Todd
    ----- Original Message -----
    From: "njdoe123" <first.us@a...>
    Sent: Friday, December 28, 2001 6:44 AM
    Subject: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & &
    onSessionTimeoutEvent
    Hi,
    We used a lot of "security object" in netD projects. Each used
    username, password and privilege for login. After migration,
    we have to hand code all login codes manually. Session control
    is pretty standard in j2ee, i'm wondering whether there is a
    best practice example available for netD login feature.
    Since security was one of the outstanding feature in netD, it will
    be a great idea to have a stadard plugin to support this feature
    after migration. I wish v1.2 could supply a direction, although
    there are several login methods in j2ee.
    Thanks,
    Alex Lin
    --- In iPlanet-JATO@y..., "Todd Fast" <todd.fast@s...> wrote:
    Small correction: the name of the method in ViewBean is"securityCheck()",
    not "onSecurityCheck()". The method would've been better named
    "checkSecurity()", but too late now. <grin>
    Todd
    ----- Original Message -----
    From: "Craig V. Conover" <craig.conover@s...>
    Sent: Monday, December 17, 2001 12:47 PM
    Subject: Re: [iPlanet-JATO] onSecurityCheckFailedEvent & &
    onSessionTimeoutEvent
    The iMT has a ND to JATO/J2EE mapping document that covers ND
    events and
    common ND class/variable/method mapping.
    To answer you two questions below:
    onSessionTimoutEvent is onSessionTimeout in JATO and can beoverriden in
    any class the subclasses JATO'scom.iplanet.jato.ApplicationServletBase.
    Typically, this is done in you application servlet class which allof
    your module servlets in the application will subclass.
    onSecurityCheckFailedEvent is an ND specific event that istriggered
    when a Security exception is thrown in ND. In JATO, a
    SecurityCheckException is thrown when the default securitychecking in
    JATO fails. JATO's default security is to make sure theRequestContext
    object is not null. This is done in the ViewBean API. The
    onSecurityCheck event in JATO allows you to hook into thisbehavior and
    write your own security checking, or hook in a third party API.You can
    call super so that you still get the RequextContext null check.
    You should create a "non-visual" ViewBean (behavior only) thatoverrides
    the onSecurityCheck event, and all other ViewBeans in yourapplication
    extend it to inherit this security checking behavior.
    You could also hook in the security in your application Servlet by
    overriding one of the events in ApplicationServletBase, like
    onBeforeRequest.
    craig
    njdoe123 wrote:
    Hi,
    We have the following two events (onSecurityCheckFailedEvent
    & onSessionTimeoutEvent) across all ND projects. I guess
    it's pretty common for netdynamics project.
    How do you solve the corresponding issues in j2ee ?
    Is there any example available ?
    Thanks,
    Alex
    //[[SPIDER_EVENT<this_onSecurityCheckFailedEvent>
    public int this_onSecurityCheckFailedEvent
    (CSpProjectSecurityEvent event)
    switch (event.getFailureType() )
    case NEW_SECURITY_CHECK_PRIV_FAILURE_TYPE:
    // do something
    CSpPage loginPage1 = CSpider.getPage("PgLogin");
    CSpString msg1 = new CSpString("Wrong District Code, UserID
    or
    Password. Try again.");
    loginPage1.setDisplayFieldValue("StMsg1", msg1);
    loginPage1.load (false);
    break;
    case SESSION_CONTINUITY_FAILURE_TYPE:
    // do something else
    CSpPage loginPage2 = CSpider.getPage("PgLogin");
    CSpString msg2 = new CSpString("You must login first...");
    loginPage2.setDisplayFieldValue("StMsg1", msg2);
    loginPage2.load (false);
    break;
    return (STOP);
    //]]SPIDER_EVENT<this_onSecurityCheckFailedEvent>
    //[[SPIDER_EVENT<this_onSessionTimeoutEvent>
    public int this_onSessionTimeoutEvent(CSpProjectSessionEventevent)
    CSpString msg3 = new CSpString("You were gone too long - login
    again");
    CSpPage loginPage3 = CSpider.getPage("PgLogin");
    loginPage3.setDisplayFieldValue("StMsg1", msg3);
    // stop any further processing of this original user request
    loginPage3.setDisplayFieldValue("District_ID", newCSpString(""));
    loginPage3.setDisplayFieldValue("User_ID", new CSpString(""));
    loginPage3.setDisplayFieldValue("Password", newCSpString(""));
    loginPage3.load (false);
    return (PROCEED);
    //]]SPIDER_EVENT<this_onSessionTimeoutEvent>
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, please visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    Service.
    For more information about JATO, including download information,
    please
    visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, including download information, pleasevisit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    For more information about JATO, including download information, pleasevisit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Thank you - Jin and Todd.
    Will try that.
    Atul
    --- In iPlanet-JATO@y..., Byung Jin Chun <bchun@n...> wrote:
    try using kregedit and modify the key for the jvm args, using the -x
    parameters for the 1.2 runtime
    Jin
    -----Original Message-----
    From: Todd Fast [mailto:<a href="/group/SunONE-JATO/post?protectID=101233080150035167169232031248066208071048">Todd.Fast@S...</a>]
    Sent: Tuesday, February 19, 2002 8:40 PM
    Subject: Re: [iPlanet-JATO] Re: OutOfMemoryError
    Atul--
    Out of curiosity - How do you modify the memory parameters for
    the container's VM ?? I know I should try to do some research but
    figured you may already have some insight and willingness to
    share.
    Please consider this as low priority.It differs by container; I don't remember details of any particular one.
    >
    Todd
    For more information about JATO, including download information, please
    visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp
    <http://developer.iplanet.com/tech/appserver/framework/index.jsp>
    [Non-text portions of this message have been removed]

  • IPlanet authentication over SSL

    I've written a when_compare_replace plugin for out 9.0.2.0 OID server to perform user authentication against our iPlanet LDAP server for portal users. Authentication works great as is shown in the plugin souce below but it is being done in the clear, with no encryption on any of the data.
    I've been looking and looking for ways to do the DBMS_LDAP.simple_bind_s over a secure connection and have come up with nothing. Our LDAP server has a SSL port running and performes authentication for other C and Java applications over an encrypted connection.
    I've been trying to get the DBMS_LDAP.open_ssl command to work but I'm lost when it comes to the wallets. Why does the client need a wallet with a certificate to establish a secure connection? If we have to use a wallet with a certificate, what certificate do we use? Do we need to get a cert for the OID server so we can perform encrypted authentication?
    Below is the full PL/SQL source of my OID plugin. It works as is for clear text authentication but this is not acceptable for a production system.
    PACKAGE BODY PLUGIN_WHEN_COMPARE_REPLACE AS
        --Writen by Eric Dalquist, [email protected] - 07/01/2003 for use by Michigan
        --Technological University. This code may be freely used and modified as
        --long as the original author's name, email address and creation date are
        --included.
        PROCEDURE WHEN_COMPARE_REPLACE
            ldapplugincontext IN ODS.plugincontext,
            result OUT INTEGER,
            dn IN VARCHAR2,
            attrname IN VARCHAR2,
            attrval IN VARCHAR2,
            rc OUT INTEGER,
            errormsg OUT VARCHAR2
        IS
            local_session       DBMS_LDAP.session;
            local_bind_return   PLS_INTEGER;
            local_ldap_host     VARCHAR(256);
            local_ldap_port     PLS_INTEGER;
            remote_session      DBMS_LDAP.session;
            remote_bind_return  PLS_INTEGER;
            remote_ldap_host    VARCHAR(256);
            remote_ldap_port    PLS_INTEGER;
            remote_ssl_results  PLS_INTEGER;
            search_attributes   DBMS_LDAP.STRING_COLLECTION;
            search_return       PLS_INTEGER;
            search_result       DBMS_LDAP.MESSAGE;
            search_entry        DBMS_LDAP.MESSAGE;
            search_entries      PLS_INTEGER;
            MTU_userid  VARCHAR(16);
            MTU_dn      VARCHAR(256);
            retval      PLS_INTEGER;
            --DEBUGING VARIABLES
            auth_location   VARCHAR(16);
            auth_server     VARCHAR(256);
            auth_port       PLS_INTEGER;
            context_data    VARCHAR(2048);
        BEGIN
            remote_ldap_host := 'test1.mtu.edu';
            remote_ldap_port := 389;
            --Exceptions make fall-through authentication much more difficult
            --Turn them off.
            DBMS_LDAP.USE_EXCEPTION := FALSE;
            --Move this into the local auth section later
            --Cut down on proccessing time to save CPU
            FOR l_counter IN 1..ldapplugincontext.COUNT LOOP
                IF l_counter = 1 THEN
                    local_ldap_host := ldapplugincontext(l_counter);
                ELSIF l_counter = 2 THEN
                    local_ldap_port := ldapplugincontext(l_counter);
                END IF;
                --Debuging purposes only
                IF l_counter = ldapplugincontext.COUNT THEN
                    context_data := context_data || ldapplugincontext(l_counter);
                ELSE
                    context_data := context_data || ldapplugincontext(l_counter) || ', ';
                END IF;
            END LOOP;
            IF attrname = 'userpassword' THEN
                remote_session := DBMS_LDAP.init(remote_ldap_host, remote_ldap_port);
                --Instead of putting it in a STRING_COLLECTION first just extract
                --the first element (MTU userid) right away
                MTU_userid := DBMS_LDAP.explode_dn(dn, 1)(0);
                --Find the users MTU dn based on their user id
                search_attributes(1) := 'michigantechuniqueidentifier';
                search_return := DBMS_LDAP.search_s
                    remote_session,
                    'ou=people,dc=mtu,dc=edu',
                    DBMS_LDAP.SCOPE_SUBTREE,
                    '(&(uid=' || MTU_userid || ')(objectclass=posixaccount))',
                    search_attributes,
                    0,
                    search_result
                rc := search_return;
                            --Get the number of entries found for the user id
                search_entries := DBMS_LDAP.count_entries(remote_session, search_result);
                IF search_return = DBMS_LDAP.SUCCESS AND search_entries = 1 THEN
                    --for debuging
                    auth_location := 'remote';
                    auth_server := remote_ldap_host;
                    auth_port := remote_ldap_port;
                    --Retrieve the MTU dn from the search results
                    search_entry := DBMS_LDAP.first_entry(remote_session, search_result);
                    MTU_dn := DBMS_LDAP.get_dn(remote_session, search_entry);
                    --Perform a simple bind against the remote LDAP server with the MTU dn and
                    --password passed to us.
                    remote_bind_return := DBMS_LDAP.simple_bind_s(remote_session, MTU_dn, attrval);
                    rc := remote_bind_return;
                    --If the bind was successful unbind from the server.
                    IF remote_bind_return = DBMS_LDAP.SUCCESS THEN
                        retval := DBMS_LDAP.unbind_s(remote_session);
                    END IF;
                ELSIF search_entries < 1 THEN
                    --for debuging
                    auth_location := 'local';
                    auth_server := local_ldap_host;
                    auth_port := local_ldap_port;
                    --If the user does not exist on the remote LDAP server
                    --attempt to authenticate it with the local LDAP server
                    local_session := DBMS_LDAP.init(local_ldap_host, local_ldap_port);
                    local_bind_return := DBMS_LDAP.simple_bind_s(local_session, dn, attrval);
                    rc := local_bind_return;
                    IF local_bind_return = DBMS_LDAP.success THEN
                        retval := DBMS_LDAP.unbind_s(local_session);
                    END IF;
                ELSE
                    --for debuging
                    auth_location := 'none';
                    --Too many results returned
                    rc := DBMS_LDAP.RESULTS_TOO_LARGE;
                END IF;
                --the value of 'result' determines if the user is authenticated or not
                IF rc = DBMS_LDAP.SUCCESS THEN
                    result := DBMS_LDAP.COMPARE_TRUE;
                ELSE
                    result := DBMS_LDAP.COMPARE_FALSE;
                END IF;
                errormsg := DBMS_LDAP.err2string(rc);
            ELSE
                -- Do what WHEN_COMPARE_REPLACE would have done????
                rc := DBMS_LDAP.SUCCESS;
                -- Return false if unsure that the user should be authenticated
                result := DBMS_LDAP.COMPARE_FALSE;
                errormsg := 'Not sure what I should have done here :-)';
                --Correct behavior is probably to do a search based on the DN for
                --the specified attribute and then compare the passed value to the
                --found value but until logs show this procedure is used for
                --anything other than password authentication the functionality is
                --going to be left out.
            END IF;
            INSERT INTO WHEN_COMPARE_REPLACE_LOG VALUES
                to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'),
                dn,
                attrname,
                attrval,
                MTU_userid,
                MTU_dn,
                result,
                rc,
                errormsg,
                'No Exception - Auth From: ' || auth_location,
                auth_server,
                auth_port,
                context_data
            COMMIT;
        EXCEPTION
            WHEN OTHERS THEN
                --An exception was raised
                rc := SQLCODE;
                errormsg := SUBSTR(SQLERRM, 1, 255);
                --Return false so authentication can't happen
                result := DBMS_LDAP.COMPARE_FALSE;
                INSERT INTO WHEN_COMPARE_REPLACE_LOG VALUES
                    to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'),
                    dn,
                    attrname,
                    attrval,
                    MTU_userid,
                    MTU_dn,
                    result,
                    rc,
                    errormsg,
                    'Exception - Auth From: ' || auth_location,
                    auth_server,
                    auth_port,
                    context_data
                COMMIT;
        END;
    END PLUGIN_WHEN_COMPARE_REPLACE;

    I've written a when_compare_replace plugin for out 9.0.2.0 OID server to perform user authentication against our iPlanet LDAP server for portal users. Authentication works great as is shown in the plugin souce below but it is being done in the clear, with no encryption on any of the data.
    I've been looking and looking for ways to do the DBMS_LDAP.simple_bind_s over a secure connection and have come up with nothing. Our LDAP server has a SSL port running and performes authentication for other C and Java applications over an encrypted connection.
    I've been trying to get the DBMS_LDAP.open_ssl command to work but I'm lost when it comes to the wallets. Why does the client need a wallet with a certificate to establish a secure connection? If we have to use a wallet with a certificate, what certificate do we use? Do we need to get a cert for the OID server so we can perform encrypted authentication?
    Below is the full PL/SQL source of my OID plugin. It works as is for clear text authentication but this is not acceptable for a production system.
    PACKAGE BODY PLUGIN_WHEN_COMPARE_REPLACE AS
        --Writen by Eric Dalquist, [email protected] - 07/01/2003 for use by Michigan
        --Technological University. This code may be freely used and modified as
        --long as the original author's name, email address and creation date are
        --included.
        PROCEDURE WHEN_COMPARE_REPLACE
            ldapplugincontext IN ODS.plugincontext,
            result OUT INTEGER,
            dn IN VARCHAR2,
            attrname IN VARCHAR2,
            attrval IN VARCHAR2,
            rc OUT INTEGER,
            errormsg OUT VARCHAR2
        IS
            local_session       DBMS_LDAP.session;
            local_bind_return   PLS_INTEGER;
            local_ldap_host     VARCHAR(256);
            local_ldap_port     PLS_INTEGER;
            remote_session      DBMS_LDAP.session;
            remote_bind_return  PLS_INTEGER;
            remote_ldap_host    VARCHAR(256);
            remote_ldap_port    PLS_INTEGER;
            remote_ssl_results  PLS_INTEGER;
            search_attributes   DBMS_LDAP.STRING_COLLECTION;
            search_return       PLS_INTEGER;
            search_result       DBMS_LDAP.MESSAGE;
            search_entry        DBMS_LDAP.MESSAGE;
            search_entries      PLS_INTEGER;
            MTU_userid  VARCHAR(16);
            MTU_dn      VARCHAR(256);
            retval      PLS_INTEGER;
            --DEBUGING VARIABLES
            auth_location   VARCHAR(16);
            auth_server     VARCHAR(256);
            auth_port       PLS_INTEGER;
            context_data    VARCHAR(2048);
        BEGIN
            remote_ldap_host := 'test1.mtu.edu';
            remote_ldap_port := 389;
            --Exceptions make fall-through authentication much more difficult
            --Turn them off.
            DBMS_LDAP.USE_EXCEPTION := FALSE;
            --Move this into the local auth section later
            --Cut down on proccessing time to save CPU
            FOR l_counter IN 1..ldapplugincontext.COUNT LOOP
                IF l_counter = 1 THEN
                    local_ldap_host := ldapplugincontext(l_counter);
                ELSIF l_counter = 2 THEN
                    local_ldap_port := ldapplugincontext(l_counter);
                END IF;
                --Debuging purposes only
                IF l_counter = ldapplugincontext.COUNT THEN
                    context_data := context_data || ldapplugincontext(l_counter);
                ELSE
                    context_data := context_data || ldapplugincontext(l_counter) || ', ';
                END IF;
            END LOOP;
            IF attrname = 'userpassword' THEN
                remote_session := DBMS_LDAP.init(remote_ldap_host, remote_ldap_port);
                --Instead of putting it in a STRING_COLLECTION first just extract
                --the first element (MTU userid) right away
                MTU_userid := DBMS_LDAP.explode_dn(dn, 1)(0);
                --Find the users MTU dn based on their user id
                search_attributes(1) := 'michigantechuniqueidentifier';
                search_return := DBMS_LDAP.search_s
                    remote_session,
                    'ou=people,dc=mtu,dc=edu',
                    DBMS_LDAP.SCOPE_SUBTREE,
                    '(&(uid=' || MTU_userid || ')(objectclass=posixaccount))',
                    search_attributes,
                    0,
                    search_result
                rc := search_return;
                            --Get the number of entries found for the user id
                search_entries := DBMS_LDAP.count_entries(remote_session, search_result);
                IF search_return = DBMS_LDAP.SUCCESS AND search_entries = 1 THEN
                    --for debuging
                    auth_location := 'remote';
                    auth_server := remote_ldap_host;
                    auth_port := remote_ldap_port;
                    --Retrieve the MTU dn from the search results
                    search_entry := DBMS_LDAP.first_entry(remote_session, search_result);
                    MTU_dn := DBMS_LDAP.get_dn(remote_session, search_entry);
                    --Perform a simple bind against the remote LDAP server with the MTU dn and
                    --password passed to us.
                    remote_bind_return := DBMS_LDAP.simple_bind_s(remote_session, MTU_dn, attrval);
                    rc := remote_bind_return;
                    --If the bind was successful unbind from the server.
                    IF remote_bind_return = DBMS_LDAP.SUCCESS THEN
                        retval := DBMS_LDAP.unbind_s(remote_session);
                    END IF;
                ELSIF search_entries < 1 THEN
                    --for debuging
                    auth_location := 'local';
                    auth_server := local_ldap_host;
                    auth_port := local_ldap_port;
                    --If the user does not exist on the remote LDAP server
                    --attempt to authenticate it with the local LDAP server
                    local_session := DBMS_LDAP.init(local_ldap_host, local_ldap_port);
                    local_bind_return := DBMS_LDAP.simple_bind_s(local_session, dn, attrval);
                    rc := local_bind_return;
                    IF local_bind_return = DBMS_LDAP.success THEN
                        retval := DBMS_LDAP.unbind_s(local_session);
                    END IF;
                ELSE
                    --for debuging
                    auth_location := 'none';
                    --Too many results returned
                    rc := DBMS_LDAP.RESULTS_TOO_LARGE;
                END IF;
                --the value of 'result' determines if the user is authenticated or not
                IF rc = DBMS_LDAP.SUCCESS THEN
                    result := DBMS_LDAP.COMPARE_TRUE;
                ELSE
                    result := DBMS_LDAP.COMPARE_FALSE;
                END IF;
                errormsg := DBMS_LDAP.err2string(rc);
            ELSE
                -- Do what WHEN_COMPARE_REPLACE would have done????
                rc := DBMS_LDAP.SUCCESS;
                -- Return false if unsure that the user should be authenticated
                result := DBMS_LDAP.COMPARE_FALSE;
                errormsg := 'Not sure what I should have done here :-)';
                --Correct behavior is probably to do a search based on the DN for
                --the specified attribute and then compare the passed value to the
                --found value but until logs show this procedure is used for
                --anything other than password authentication the functionality is
                --going to be left out.
            END IF;
            INSERT INTO WHEN_COMPARE_REPLACE_LOG VALUES
                to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'),
                dn,
                attrname,
                attrval,
                MTU_userid,
                MTU_dn,
                result,
                rc,
                errormsg,
                'No Exception - Auth From: ' || auth_location,
                auth_server,
                auth_port,
                context_data
            COMMIT;
        EXCEPTION
            WHEN OTHERS THEN
                --An exception was raised
                rc := SQLCODE;
                errormsg := SUBSTR(SQLERRM, 1, 255);
                --Return false so authentication can't happen
                result := DBMS_LDAP.COMPARE_FALSE;
                INSERT INTO WHEN_COMPARE_REPLACE_LOG VALUES
                    to_char(sysdate, 'Month DD, YYYY HH24:MI:SS'),
                    dn,
                    attrname,
                    attrval,
                    MTU_userid,
                    MTU_dn,
                    result,
                    rc,
                    errormsg,
                    'Exception - Auth From: ' || auth_location,
                    auth_server,
                    auth_port,
                    context_data
                COMMIT;
        END;
    END PLUGIN_WHEN_COMPARE_REPLACE;

  • Global data in a servlet using iPlanet Web Server

    Our configuration is an Applet->Servlet->JNI->C/C++ code.
    We have C code that does a number of lengthy mathematical calculations. This C code not only uses its own global variables but, it is also comprised of numerous subroutines that all call each other, reading and writing global C variables as they go. These globals are all isolated to the C code shareable object (.so) library that is included using the LoadLibrary call when the servlet is initialized.
    The problem is that in a multi-user environment (3-5 simultaneous users) we need to have each user have their own "copy" of the servlet (and the C code) so that users will not be accessing each other's global data. We can NOT have only one copy of the C code and define it as synchronized because the calculations that are performed can take a very long time and we can not hold off user requests while the firs user finishes.
    Our hope is that there is a way to configure the iPlanet Web server such that each new user that starts up a copy of the Applet/Servlet combination will get their own "space" so that they can work independently of any other user. We have at most 20 users of this system and only 3-5 simultaneous users so we should not have a problem with memory or CPU speed.
    If anyone has a solution, I would greatly appreciate it!

    The C library is shareable. But you don't want it to be shared. That's your question summarized, isn't it?
    You probably can't prevent it from being shared, so to prevent multiple use of it you would have to queue up the requests to be done one at a time. WynEaston's suggestion of having the servlet implement SingleThreadModel would help, but I believe the servlet spec allows servers to run multiple copies of a servlet that does that (as opposed to running a single copy in multiple threads).
    Your other alternative is to rewrite the math in Java, or at least in some object-oriented language where you don't need global variables (which are the source of your problem). All right, I can already hear you saying "But that wouldn't be as fast!" Maybe not, but that isn't everything. Now you have a problem in queueing theory: do you want a single server that's fast, but jobs have to wait for it, or do you want multiple servers that aren't as fast, but jobs don't have to wait? That's a question you would have to evaluate based on the usage of your site, and it isn't an easy one.

  • Problem with Connection to SQL Server via Servlet (in iPlanet 6 App Server)

    Hi ,
    I am using the iPlanet ApplicationServer 6.0 SP2 for development & testing of an internet application.
    I am facing a problem when I am trying to connect to MS SQL SERVER via the native jdbcodbc driver (obdc32.dll). The error is something like this :
    [26/Jul/2001 11:50:35:7] warning: DriverConnect: (28000): [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '\'.(DB Error: 18456)
    [26/Jul/2001 11:50:35:7] warning: ODBC-027: CreateConn: failed to create connection [new connection]: DSN=fadd,DB=cashbook,USER=test,PASS=xxxxxxxxx
    [26/Jul/2001 11:50:35:7] error: DATA-108: failed to create a data connection wit
    h any of specified drivers
    Error in connecting to the Database for cirrus :java.sql.SQLException: failed to
    create a data connection with any of specified drivers
    java.sql.SQLException: failed to create a data connection with any of specified
    drivers
    at com.netscape.server.jdbc.Driver.afterVerify(Unknown Source)
    at com.netscape.server.jdbc.Driver.connect(Unknown Source)
    at com.netscape.server.jdbc.DataSourceImpl.getConnection(Unknown Source)
    at gefa.util.DBConnection.jdbcConnectionOpen(DBConnection.java:65)
    at gefa.servlet.ServUpload.doPost(ServUpload.java:45)
    at gefa.servlet.ServUpload.doGet(ServUpload.java:29)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unkno
    wn Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)
    I have configured a DSN with the name "fadd" on the machine with the application server and it used NT authentication. I have supplied an NT userid and password that has appropriate rights on the database "cashbook".
    When I write a java standalone program, it does connect but via a servlet it does not connect.
    Can some guide me with this problem please ?
    Anything one might have observed in the past ? (may be specific to iPlanet ?)
    Thanks a lot in advance
    ~Sunil

    I'm using iPlanet App server as well and experiencing similar problem. I load my SQL Server driver by Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"), then use DriverManager.getDriver() to obtain the Driver.
    However, the Driver returned is not the SQLServerDriver as expected. The Driver returned is com.netscape.server.jdbc.Driver! And then when I do Driver.getConnection("jdbc:microsoft:sqlserver://MyServer"), it throws an SQLException saying that it doesn't accept a jdbc:microsoft:sqlserver subprotocol. Well, of course it doesn't, it's not a microsoft Driver at all.
    I suspect the problem is that the netscape Driver's acceptsURL() method ALWAYS returns true in iPlanet app server, thus when you getDriver(), the netscape Driver is always returned (and always returned as the first one since it's default?). Thus even though the same piece of code works fine as a standalone application, it just doesn't work on iPlanet app server.
    My work around is:
    Class.forName("my.Driver");
    Enumeration enu = DriverManager.getDrivers();
    Driver useThis = null;
    while (enu.hasMoreElements()) {
    Driver d = (Driver)enu.nextElement();
    if (d.getClass().toString().indexOf("my.Driver") > -1) {
    useThis = d;
    Mind that my above code does not have an performance issue. If you look into the source code of how DriverManager get a Driver for a particular URL, it also loads the whole set of available Drivers, then call acceptsURL() method on each of them to find the first "suitable" one. Thus time complexity is the same.
    I know this is not a very elegant solution and it defeats the purpose of having a DriverManager. Does any one else has a better way to solve this problem, like a way to specify the priority of each Driver so that SQLServerDriver is returned before the netscape Driver?
    Thanks a lot.

Maybe you are looking for