Topic
  • 6 replies
  • Latest Post - ‏2012-08-12T22:55:53Z by KaranBal
denisF
denisF
5 Posts

Pinned topic Classes in docstore vs classes deployed in jar, classpath order?

‏2012-07-18T12:04:05Z |
If a class is present at the same time in the docstore and in a jar deployed in the classpath on the server, which one will be used by MDM for PIM?

Is it possible to have the .class from the doctsore picked up first by the classloader before the one deployed in the the jar?

In development the idea is to have deployed "stable versions" of the classes in a jar and allow each developer to upload their work-in-progress classes in the docstore of their own development company

Thx
Updated on 2012-08-12T22:55:53Z at 2012-08-12T22:55:53Z by KaranBal
  • KaranBal
    KaranBal
    108 Posts

    Re: Classes in docstore vs classes deployed in jar, classpath order?

    ‏2012-07-21T00:08:14Z  
    The files uploaded to the docstore are not a part of the classpath. So the product will not look into those directories and they'll not be executed. The system will always pick the .class file in the jars.

    To execute a file from the docstore you have to manually specify the location of your .class file and then execute it from either the scripting sandbox(e.g. pre-processing and post processing scripts) or an IDE like eclipse or RSA. You can find an example in tech note#1454719.
  • wpc_guy
    wpc_guy
    40 Posts

    Re: Classes in docstore vs classes deployed in jar, classpath order?

    ‏2012-07-21T12:58:49Z  
    Hi Denis,

    In our implementation, we too had similar issue of using Docstore classes or JAR classes and later we proceeded with JAR approach itself as its very direct and also in Docstore approach, sometimes classes were not getting refreshed properly even after clearing the cache and was confusing.

    You can create your custom JARs while development till the code gets stabilized and then JARs can be checked in to say Tortoise-SVN or Perforce for master copy.For subsequent releases, take JAR from SVN and keep enhancing it by adding more code and once its stable, again checkin to SVN it. Hope it helps.
    Thanks,
    wpc_guy
  • denisF
    denisF
    5 Posts

    Re: Classes in docstore vs classes deployed in jar, classpath order?

    ‏2012-07-23T12:28:26Z  
    • KaranBal
    • ‏2012-07-21T00:08:14Z
    The files uploaded to the docstore are not a part of the classpath. So the product will not look into those directories and they'll not be executed. The system will always pick the .class file in the jars.

    To execute a file from the docstore you have to manually specify the location of your .class file and then execute it from either the scripting sandbox(e.g. pre-processing and post processing scripts) or an IDE like eclipse or RSA. You can find an example in tech note#1454719.
    > KaranBal wrote:
    > The files uploaded to the docstore are not a part of the classpath. So the product will not look into those directories and they'll not be executed. The system will always pick the .class file in the jars.

    ? I don't understand here. The infocenter states that this is an official way to deploy .class files and have them available to the product as described here:
    http://pic.dhe.ibm.com/infocenter/pim/v9r1m0/topic/com.ibm.pim.app.doc/code/java/pim_tsk_makingextpointavailable.html

    ..and this is working for us given that we "register" the class in a script as described here
    http://pic.dhe.ibm.com/infocenter/pim/v9r1m0/topic/com.ibm.pim.app.doc/code/java/pim_tsk_urlmechanism.html

    MDM for PIM DO look into the docstore in /uploaded_java_classes directory and pick the .class files from here.
    So I suppose that the .class files uploaded in the docstore are available to the product classloader in some way

    >
    > To execute a file from the docstore you have to manually specify the location of your .class file and then execute it from either the scripting sandbox(e.g. pre-processing and post processing scripts) or an IDE like eclipse or RSA. You can find an example in tech note#1454719.

    Could you give me the link to this technote? thanks

    In fact we realized that in order to let the product choose the right implementation class (either in docstore or in the jar), we have to tel MDM for PIM which one to use by changing the registration scipt:

    
    //script_execution_mode=java_api="japi:///uploaded_java_classes:mdmpim.extend.myextensionpoints.ScriptingSandboxTestImpl.class"
    

    for .classes in docstore or the following if in jar
    
    //script_execution_mode=java_api="japi://mdmpim.extend.myextensionpoints.ScriptingSandboxTestImpl.class"
    


    The remaining questions is now how to tel MDM for PIM wher to look for utility classes, ie classes referenced by extensions points?
  • denisF
    denisF
    5 Posts

    Re: Classes in docstore vs classes deployed in jar, classpath order?

    ‏2012-07-23T12:41:23Z  
    • wpc_guy
    • ‏2012-07-21T12:58:49Z
    Hi Denis,

    In our implementation, we too had similar issue of using Docstore classes or JAR classes and later we proceeded with JAR approach itself as its very direct and also in Docstore approach, sometimes classes were not getting refreshed properly even after clearing the cache and was confusing.

    You can create your custom JARs while development till the code gets stabilized and then JARs can be checked in to say Tortoise-SVN or Perforce for master copy.For subsequent releases, take JAR from SVN and keep enhancing it by adding more code and once its stable, again checkin to SVN it. Hope it helps.
    Thanks,
    wpc_guy
    > wpc_guy wrote:
    > In our implementation, we too had similar issue of using Docstore classes or JAR classes and later we proceeded with JAR approach itself as its very direct and also in Docstore approach, sometimes classes were not getting refreshed properly even after clearing the cache and was confusing.

    We use the jar approach for non-dev environemnets
    But this is not an option for development environemnts as this is cumbersome, very slow and not convinient at all.
    We have multiple companies used by multiple developpers in the dev MDM for PIM instance.
    With the jar approach, every user of the PIM instance shares the same code (maybe it is possible to assign one jar per company?), so as by definition in dev, the code is not stable, it will impact the work of the all the users (developers and other) for all the companies of the PIM dev instance

    The operation for a dev to test his code would be wit the jar only approach:
    • commit to svn its change (*)
    • run a build script to build the jar
    • tell the other dev that he will deploy a new version of the jar and stop working until the server is recycled
    • copy the jar at the right place on the server
    • recycle the server
    • test
    (*) this could by avoided by building from the java files on its workstation, but if not, changed made by other developers will not be included in the jar
    So, this is not an option for development to use the jar approach all the way (except if each dev has its own MDM for PIM server)

    This is exactly the point of my initial question

    We would like to mix the jar and docstore deployment approach to solve this, ie deploy the "stable" code in the jar on the dev MDM for PIM server shared by all developper, and each developper upload in its own company docstore the unstable code it is working on. So the development process is much faster and each developer could be quite isolated from the other
    For this, we must be sure that classes in the docstore are pick up before the ones in the jar
  • KaranBal
    KaranBal
    108 Posts

    Re: Classes in docstore vs classes deployed in jar, classpath order?

    ‏2012-08-03T01:19:44Z  
    • denisF
    • ‏2012-07-23T12:28:26Z
    > KaranBal wrote:
    > The files uploaded to the docstore are not a part of the classpath. So the product will not look into those directories and they'll not be executed. The system will always pick the .class file in the jars.

    ? I don't understand here. The infocenter states that this is an official way to deploy .class files and have them available to the product as described here:
    http://pic.dhe.ibm.com/infocenter/pim/v9r1m0/topic/com.ibm.pim.app.doc/code/java/pim_tsk_makingextpointavailable.html

    ..and this is working for us given that we "register" the class in a script as described here
    http://pic.dhe.ibm.com/infocenter/pim/v9r1m0/topic/com.ibm.pim.app.doc/code/java/pim_tsk_urlmechanism.html

    MDM for PIM DO look into the docstore in /uploaded_java_classes directory and pick the .class files from here.
    So I suppose that the .class files uploaded in the docstore are available to the product classloader in some way

    >
    > To execute a file from the docstore you have to manually specify the location of your .class file and then execute it from either the scripting sandbox(e.g. pre-processing and post processing scripts) or an IDE like eclipse or RSA. You can find an example in tech note#1454719.

    Could you give me the link to this technote? thanks

    In fact we realized that in order to let the product choose the right implementation class (either in docstore or in the jar), we have to tel MDM for PIM which one to use by changing the registration scipt:

    <pre class="jive-pre"> //script_execution_mode=java_api="japi:///uploaded_java_classes:mdmpim.extend.myextensionpoints.ScriptingSandboxTestImpl.class" </pre>
    for .classes in docstore or the following if in jar
    <pre class="jive-pre"> //script_execution_mode=java_api="japi://mdmpim.extend.myextensionpoints.ScriptingSandboxTestImpl.class" </pre>

    The remaining questions is now how to tel MDM for PIM wher to look for utility classes, ie classes referenced by extensions points?
    The information gives you a way to execute .class files from doc store. But it will not search for it unless you tell it to explicitly as in your example:
    //script_execution_mode=java_api="japi://mdmpim.extend.myextensionpoints.ScriptingSandboxTestImpl.class"

    So unless you explicitly specify the location, MDMCS does not search for docstore .class files. If you want to do so, then create a custom jar and deploy it in your application server.

    Apologies for the technote link. It can only be viewed within IBM firewall. Sorry.
  • KaranBal
    KaranBal
    108 Posts

    Re: Classes in docstore vs classes deployed in jar, classpath order?

    ‏2012-08-12T22:55:53Z  
    • denisF
    • ‏2012-07-23T12:41:23Z
    > wpc_guy wrote:
    > In our implementation, we too had similar issue of using Docstore classes or JAR classes and later we proceeded with JAR approach itself as its very direct and also in Docstore approach, sometimes classes were not getting refreshed properly even after clearing the cache and was confusing.

    We use the jar approach for non-dev environemnets
    But this is not an option for development environemnts as this is cumbersome, very slow and not convinient at all.
    We have multiple companies used by multiple developpers in the dev MDM for PIM instance.
    With the jar approach, every user of the PIM instance shares the same code (maybe it is possible to assign one jar per company?), so as by definition in dev, the code is not stable, it will impact the work of the all the users (developers and other) for all the companies of the PIM dev instance

    The operation for a dev to test his code would be wit the jar only approach:
    • commit to svn its change (*)
    • run a build script to build the jar
    • tell the other dev that he will deploy a new version of the jar and stop working until the server is recycled
    • copy the jar at the right place on the server
    • recycle the server
    • test
    (*) this could by avoided by building from the java files on its workstation, but if not, changed made by other developers will not be included in the jar
    So, this is not an option for development to use the jar approach all the way (except if each dev has its own MDM for PIM server)

    This is exactly the point of my initial question

    We would like to mix the jar and docstore deployment approach to solve this, ie deploy the "stable" code in the jar on the dev MDM for PIM server shared by all developper, and each developper upload in its own company docstore the unstable code it is working on. So the development process is much faster and each developer could be quite isolated from the other
    For this, we must be sure that classes in the docstore are pick up before the ones in the jar
    This is an extremely specific use case and the forum may not be ideal to discuss it. I would suggest employing IBM Services for this or opening a PMR for an enhancement request. Normally, the system looks for classes in jars unless you explicitly specify that it should use ones in DocStore.