Topic
  • 10 replies
  • Latest Post - ‏2012-03-28T21:44:33Z by HenriqueLira
HenriqueLira
HenriqueLira
9 Posts

Pinned topic NullPointerException when accessing a library group

‏2012-03-27T19:11:55Z |
Hello,

I'm using the IBM CMIS fo Content (1.0.0.1) with CM EE 8.4.3 and am having a NullPointerException when try to acess any library group (e.g. /default group). The only library group that I can access without any problems is "/ALL_ITEM_TYPE_APP"

The cmisRoot is configured = /cmRoot

Any help?

Thanks in advance,
Henrique

com.ibm.ecm.cmis.exceptions.CMISRuntimeException: CQL007: Unexpected internal error. See additional information in the logs for IBM CMIS for Content Manager and in the logging section of the documentation. To gather additional information, turn on debug or trace level logging and restart the services.
at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceList(DatastoreHelper.java:2451)
at com.ibm.ecm.cmis.dal.cm8.DALCM8Repository.choiceListByAttribyteNameFromDatabase(DALCM8Repository.java:1325)
at com.ibm.ecm.cmis.dal.cm8.type.CM8TypeDefinition.addCustomPropertyDefs(CM8TypeDefinition.java:320)
at com.ibm.ecm.cmis.dal.cm8.type.CM8TypeDefinition.processCm8Type(CM8TypeDefinition.java:138)
at com.ibm.ecm.cmis.dal.cm8.type.CM8TypeDefinition.<init>(CM8TypeDefinition.java:127)
at com.ibm.ecm.cmis.dal.cm8.type.CM8FolderObjectType.getTypeDefinitionType(CM8FolderObjectType.java:113)
at com.ibm.ecm.cmis.app.render.CMISTypeRenderer.createTypeEntry(CMISTypeRenderer.java:102)
at com.ibm.ecm.cmis.app.render.CMISTypeRenderer.render(CMISTypeRenderer.java:219)
at com.ibm.ecm.cmis.app.beans.BaseCollection.renderResponse(BaseCollection.java:1046)
at com.ibm.ecm.cmis.app.beans.BaseCollection.renderGETResponse(BaseCollection.java:1029)
at com.ibm.ecm.cmis.app.beans.Type.renderGETResponse(Type.java:69)
at com.ibm.ecm.cmis.app.beans.BaseCollection.get(BaseCollection.java:734)
at com.ibm.ecm.cmis.app.servlet.CMISServlet.doGet(CMISServlet.java:146)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at com.ibm.ecm.cmis.app.servlet.CMISServlet.service(CMISServlet.java:418)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at com.ibm.ecm.integration.common.compression.CompressionFilter.doFilter(CompressionFilter.java:44)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ecm.integration.common.authentication.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:156)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ecm.cmis.wsdl.util.WSDLFilter.doFilter(WSDLFilter.java:72)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ecm.integration.common.nls.servlet.LocaleFilter.doFilter(LocaleFilter.java:57)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ecm.integration.common.messageTrace.servlet.MessageTraceFilter.doFilter(MessageTraceFilter.java:84)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
Caused by: com.ibm.content.cm.exception.NativeException: CQL007: Unexpected internal error. See additional information in the logs for IBM CMIS for Content Manager and in the logging section of the documentation. To gather additional information, turn on debug or trace level logging and restart the services.
... 55 more
Caused by: java.lang.NullPointerException
at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceListFromExtTable(DatastoreHelper.java:2461)
at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceList(DatastoreHelper.java:2444)
... 54 more
Updated on 2012-03-28T21:44:33Z at 2012-03-28T21:44:33Z by HenriqueLira
  • TigerTrix
    TigerTrix
    38 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-27T20:43:38Z  
    It is trying to retrieve the choice list values. Choice lists are a list of valid values that the applications should list for the user to pick from when entering data rather than a free form entry field. This shows up in document type and folder type information. The stack trace indicates you have called CMIS to get a type definition. What was the URL GET request? Do you know which type it is getting?

    Regardless, I do not know why it shows up at this level of browsing because usually choice lists do not usually apply to the item types at the root, library group, or library levels and associated item types. Usually only normal document types and folder types for things inside a library would be subject to choice lists for custom metadata. But somehow, it seems to be stumbling across a call that is retrieving an item type definition, and working on getting the choice list at this point. If you had a trace of which item type it was trying to look up, that might help narrow down the problem.

    In terms of the actual NullPointerException, I cannot trace the exactly line in the CMIS 1.0.0.1 version you are using. But it looks to be either (A) a recently discovered problem with foreign key table names when not upper-cased, or (B) an unexpected situation where it is failing to get the database connection from the CM API. The case for (A) does result in a NullPointerException and can be worked around by using all upper case table name and in the foreign key definition, or not using foreign keys to external tables. A fix for (A) is known, pending an official support request or will likely ride along in any subsequent fix. The case for (B) is an exact match for the trace I just checked, but is completely unexpected. If (B), an official support request would be needed to troubleshoot further, or if you are within IBM you can reach the team internally. If case (B), this is something that should be investigated and fixed. But a lot has changed to this particular implementation and might already be fixed. I know it has been more thoroughly validated more recently, and the only issue was (A).

    For CM-CMIS, there are 3 kinds of choices lists -- (1) by simple properties file entries (cmpathservice.properties), (2) by CM server native support by foreign key to another item type (and flagged to show as drop-down), (3) or by CM server native support by foreign key to an external table (but within same DB schema) (and flagged to show as drop-down). All these are detailed in the CM-CMIS information center. This stack trace shows that for whatever item type it is checking, it discovered a #3 -- foreign key to an external table. In a trace I just checked, I could not confirm that it is checking for the "show as drop down" flag in this case. But does this sound familiar? Do you think you have a foreign key defined in CM Sys Admin on some item type? The implementation has most definitely found a foreign key, and seems to think it is not to a normal CM item type.

    You can further work around by (A) not using choice lists or at least not by foreign key to external item type, (B) switching to another choice list implementation, (C) disabling "show as drop down" (which I have taken note of that might not be honored for external tables), or (D) override the CM native choice list of foreign key by providing a properties-file based choice list (cmpathservice.properties) which will override the lookup to the external table (but will not circumvent the enforcement aspect). But for this, you must identify which item type and attribute this pertains to. Then you can use cmpathservice.properties to override that one.
  • HenriqueLira
    HenriqueLira
    9 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-27T21:07:35Z  
    • TigerTrix
    • ‏2012-03-27T20:43:38Z
    It is trying to retrieve the choice list values. Choice lists are a list of valid values that the applications should list for the user to pick from when entering data rather than a free form entry field. This shows up in document type and folder type information. The stack trace indicates you have called CMIS to get a type definition. What was the URL GET request? Do you know which type it is getting?

    Regardless, I do not know why it shows up at this level of browsing because usually choice lists do not usually apply to the item types at the root, library group, or library levels and associated item types. Usually only normal document types and folder types for things inside a library would be subject to choice lists for custom metadata. But somehow, it seems to be stumbling across a call that is retrieving an item type definition, and working on getting the choice list at this point. If you had a trace of which item type it was trying to look up, that might help narrow down the problem.

    In terms of the actual NullPointerException, I cannot trace the exactly line in the CMIS 1.0.0.1 version you are using. But it looks to be either (A) a recently discovered problem with foreign key table names when not upper-cased, or (B) an unexpected situation where it is failing to get the database connection from the CM API. The case for (A) does result in a NullPointerException and can be worked around by using all upper case table name and in the foreign key definition, or not using foreign keys to external tables. A fix for (A) is known, pending an official support request or will likely ride along in any subsequent fix. The case for (B) is an exact match for the trace I just checked, but is completely unexpected. If (B), an official support request would be needed to troubleshoot further, or if you are within IBM you can reach the team internally. If case (B), this is something that should be investigated and fixed. But a lot has changed to this particular implementation and might already be fixed. I know it has been more thoroughly validated more recently, and the only issue was (A).

    For CM-CMIS, there are 3 kinds of choices lists -- (1) by simple properties file entries (cmpathservice.properties), (2) by CM server native support by foreign key to another item type (and flagged to show as drop-down), (3) or by CM server native support by foreign key to an external table (but within same DB schema) (and flagged to show as drop-down). All these are detailed in the CM-CMIS information center. This stack trace shows that for whatever item type it is checking, it discovered a #3 -- foreign key to an external table. In a trace I just checked, I could not confirm that it is checking for the "show as drop down" flag in this case. But does this sound familiar? Do you think you have a foreign key defined in CM Sys Admin on some item type? The implementation has most definitely found a foreign key, and seems to think it is not to a normal CM item type.

    You can further work around by (A) not using choice lists or at least not by foreign key to external item type, (B) switching to another choice list implementation, (C) disabling "show as drop down" (which I have taken note of that might not be honored for external tables), or (D) override the CM native choice list of foreign key by providing a properties-file based choice list (cmpathservice.properties) which will override the lookup to the external table (but will not circumvent the enforcement aspect). But for this, you must identify which item type and attribute this pertains to. Then you can use cmpathservice.properties to override that one.
    Thanks for the detailed response. Actually I'm not doing anything complex: when I login (I'm using apache chemistry for testing), is presented the list of library groups like this:

    default group
    TST_LIBRARY_GROUP
    ALLITEMTYPES_APP

    If I enter in ALLITEMTYPES_APP everything works, but if I try to enter others library groups the error happens.

    The URL used when the error occurs is: http://myserver:9080/cmcmis/resources/$x!icmnlsdb/Type/%24p!-2_ClbLibraryv-1. If I put that URL, for example, direct in Firefox the same error happens.

    Interesting: I am currently using DKPoolWAS to connect. When I was not using the pool and signed directed as icmadmin the error did not seem to happen.
  • TigerTrix
    TigerTrix
    38 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-27T22:08:44Z  
    Thanks for the detailed response. Actually I'm not doing anything complex: when I login (I'm using apache chemistry for testing), is presented the list of library groups like this:

    default group
    TST_LIBRARY_GROUP
    ALLITEMTYPES_APP

    If I enter in ALLITEMTYPES_APP everything works, but if I try to enter others library groups the error happens.

    The URL used when the error occurs is: http://myserver:9080/cmcmis/resources/$x!icmnlsdb/Type/%24p!-2_ClbLibraryv-1. If I put that URL, for example, direct in Firefox the same error happens.

    Interesting: I am currently using DKPoolWAS to connect. When I was not using the pool and signed directed as icmadmin the error did not seem to happen.
    There is no explanation for why ClbLibrary would be trying to look up a foreign key in an external table. There should be no foreign keys on ClbLibrary at all, and especially not one to an external table. I cannot think of any reason why the foreign key list on ClbLibrary would return anything at all. When you look in CM Sys Admin at the item type definition for ClbLibrary, do you see any foreign keys defined?

    About WAS pool versus not, that might explain case (B) that I had referred to where the trace seemed to match something that accessed the connection object from the CM API. I still would have thought that object always valid, but maybe that isn't true in this case. If so, then it would be a defect and the function to look up external table values when a foreign key exists would have to find another way to access the database connection. So if there is no problem getting the database connection from the CM API when not using WAS DB connection pooling, then I figure it is still doing the lookup, but finds no error, but probably doesn't do anything of consequence other than a performance impact if the check was unnecessary.

    1. The first problem is that it thinks there is a foreign key.
    2. The second problem is that when it does think there is one, the database connection is NULL when pooling enabled.

    What puzzles me is that I know for a fact this is validated with WAS DB connection pooling enabled, because it is stated a required configuration steps to attain desired performance & scaling due to the way stateless services operate.
    Updated on 2012-03-27T22:08:44Z at 2012-03-27T22:08:44Z by TigerTrix
  • HenriqueLira
    HenriqueLira
    9 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T14:32:09Z  
    • TigerTrix
    • ‏2012-03-27T22:04:34Z
    There is no explanation for why ClbLibrary would be trying to look up a foreign key in an external table. There should be no foreign keys on ClbLibrary at all, and especially not one to an external table. I cannot think of any reason why the foreign key list on ClbLibrary would return anything at all. When you look in CM Sys Admin at the item type definition for ClbLibrary, do you see any foreign keys defined?

    About WAS pool versus not, that might explain case (B) that I had referred to where the trace seemed to match something that accessed the connection object from the CM API. I still would have thought that object always valid, but maybe that isn't true in this case. If so, then it would be a defect and the function to look up external table values when a foreign key exists would have to find another way to access the database connection. So if there is no problem getting the database connection from the CM API when not using WAS DB connection pooling, then I figure it is still doing the lookup, but finds no error, but probably doesn't do anything of consequence other than a performance impact if the check was unnecessary.

    1. The first problem is that it thinks there is a foreign key.
    2. The second problem is that when it does think there is one, the database connection is NULL when pooling enabled.

    What puzzles me is that I know for a fact this is validated with WAS DB connection pooling enabled, because it is stated a required configuration steps to attain desired performance & scaling due to the way stateless services operate.
    I checked the ClbLibrary and actually there are two foreign keys defined (see attached image). But it was not me who created this table or these foreign keys ...

    To better understand the problem, I have disabled the DKPoolWas and repeated my tests: when logged as icmadmin, I can access all library groups and no error occurs ... when logged as another user, going into a library group I get an error, but with a different trace. The trace (see below) says that the user is not allowed to select the table ICMSTRI001001 which is exactly the table of the foreign keys in ClbLibrary! I checked in db2 and really only those who have permission to access this table is the user icmadmin.

    I do not understand why there are these foreign keys and why the trace of the error is different when the DKPooWas is enabled.

    Best,
    Henrique

    Trace:

    Caused by: com.ibm.content.cm.exception.NativeException: CQL057: IBM Content Manager server error. See additional information in the logs for IBM CMIS for Content Manager and in the logging section of the documentation. Turn on debug or trace level logging and restart the IBM Content Manager services to gather additional information.
    ... 55 more
    Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=HLIRA;SELECT;ICMADMIN.ICMSTRI001001, DRIVER=3.61.65
    at com.ibm.db2.jcc.am.ed.a(ed.java:676)
    at com.ibm.db2.jcc.am.ed.a(ed.java:60)
    at com.ibm.db2.jcc.am.ed.a(ed.java:127)
    at com.ibm.db2.jcc.am.gn.c(gn.java:2554)
    at com.ibm.db2.jcc.am.gn.d(gn.java:2542)
    at com.ibm.db2.jcc.am.gn.a(gn.java:2034)
    at com.ibm.db2.jcc.am.hn.a(hn.java:6500)
    at com.ibm.db2.jcc.t4.cb.g(cb.java:140)
    at com.ibm.db2.jcc.t4.cb.a(cb.java:40)
    at com.ibm.db2.jcc.t4.q.a(q.java:32)
    at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
    at com.ibm.db2.jcc.am.gn.gb(gn.java:2005)
    at com.ibm.db2.jcc.am.hn.qc(hn.java:3053)
    at com.ibm.db2.jcc.am.hn.b(hn.java:3499)
    at com.ibm.db2.jcc.am.hn.dc(hn.java:683)
    at com.ibm.db2.jcc.am.hn.executeQuery(hn.java:657)
    at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceListFromExtTable(DatastoreHelper.java:2491)
    at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceList(DatastoreHelper.java:2444)
    ... 54 more
  • TigerTrix
    TigerTrix
    38 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T17:10:30Z  
    I checked the ClbLibrary and actually there are two foreign keys defined (see attached image). But it was not me who created this table or these foreign keys ...

    To better understand the problem, I have disabled the DKPoolWas and repeated my tests: when logged as icmadmin, I can access all library groups and no error occurs ... when logged as another user, going into a library group I get an error, but with a different trace. The trace (see below) says that the user is not allowed to select the table ICMSTRI001001 which is exactly the table of the foreign keys in ClbLibrary! I checked in db2 and really only those who have permission to access this table is the user icmadmin.

    I do not understand why there are these foreign keys and why the trace of the error is different when the DKPooWas is enabled.

    Best,
    Henrique

    Trace:

    Caused by: com.ibm.content.cm.exception.NativeException: CQL057: IBM Content Manager server error. See additional information in the logs for IBM CMIS for Content Manager and in the logging section of the documentation. Turn on debug or trace level logging and restart the IBM Content Manager services to gather additional information.
    ... 55 more
    Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=HLIRA;SELECT;ICMADMIN.ICMSTRI001001, DRIVER=3.61.65
    at com.ibm.db2.jcc.am.ed.a(ed.java:676)
    at com.ibm.db2.jcc.am.ed.a(ed.java:60)
    at com.ibm.db2.jcc.am.ed.a(ed.java:127)
    at com.ibm.db2.jcc.am.gn.c(gn.java:2554)
    at com.ibm.db2.jcc.am.gn.d(gn.java:2542)
    at com.ibm.db2.jcc.am.gn.a(gn.java:2034)
    at com.ibm.db2.jcc.am.hn.a(hn.java:6500)
    at com.ibm.db2.jcc.t4.cb.g(cb.java:140)
    at com.ibm.db2.jcc.t4.cb.a(cb.java:40)
    at com.ibm.db2.jcc.t4.q.a(q.java:32)
    at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
    at com.ibm.db2.jcc.am.gn.gb(gn.java:2005)
    at com.ibm.db2.jcc.am.hn.qc(hn.java:3053)
    at com.ibm.db2.jcc.am.hn.b(hn.java:3499)
    at com.ibm.db2.jcc.am.hn.dc(hn.java:683)
    at com.ibm.db2.jcc.am.hn.executeQuery(hn.java:657)
    at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceListFromExtTable(DatastoreHelper.java:2491)
    at com.ibm.content.cm.model.helper.DatastoreHelper.retrieveChoiceList(DatastoreHelper.java:2444)
    ... 54 more
    Reference Attributes
    These are reference attributes. Reference attributes with delete rules (restrict / cascade / or other) use database foreign keys to reference the referential integrity. The table referenced in your error is the "RI" table that it references. So this definitely explains what is going on. Libraries (ClbLibrary folder type) have reference attributes, such as a reference to a folder that they map to.

    Table Level Access Restricted
    It is very common to restrict database table level access in a production environment to only database administrator user ids, such as "icmadmin", and restrict access to other IDs like the "icmconct" which are the underlying end user connect ID for non-admins when you do not define individual operating system and database user ids for every CM user. In many test systems, people don't lock down the table level access. But in production system it is more common. So in your system, access to the RI table is restricted to only database admin users. If you actually use choice lists by foreign key to external table (within same schema) then you must grant table level access to non-admin users to the particular table that you intentionally want to draw values from.

    Underlying Problem 1: Choice Lists by Foreign Key to External Table Not Checking Display Flag
    The underlying problem is that the choice lists implementation (for the case of foreign key to external table) is not checking the display flag to avoid querying values to return any foreign key as a choice list. This is true even if you intentionally define a foreign key to external table for validation purposes that you do not intend to display as a drop down list, such as if the list is huge. But this also applies whenever reference attribute exist because they result in foreign keys to the RI table, and they need to be ignored too. When database access is restricted, you get a failure. When not restricted, there is a performance/scaling implication due to the unnecessary table query, and will be affected by RI table size.

    I have reported an informal defect to see that it should be resolved upstream. Remember only official IBM support reports will drive a fix pack. Else this should make its way in upstream.

    Problem 2: Choice Lists by Foreign Key to External Table Problem With WAS DB Connection Pooling
    It also appears that choice lists by foreign key to external tables do not work when WAS DB connection pooling is enabled. I think the NullPointerException you are running into is a NULL connection object from the CM API. This would either be a limitation of Choice Lists by Foreign Key to External Tables that it cannot be used with WAS DB pooling, or is a defect if it can be solved. I have reported an informal defect to see if it can be addressed upstream by first attempting to fix, else clarify in documentation.

    But this issue goes away if you aren't intentionally using choice lists by foreign key to external tables, if problem 1 is fixed.
  • HenriqueLira
    HenriqueLira
    9 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T17:51:46Z  
    • TigerTrix
    • ‏2012-03-28T17:10:30Z
    Reference Attributes
    These are reference attributes. Reference attributes with delete rules (restrict / cascade / or other) use database foreign keys to reference the referential integrity. The table referenced in your error is the "RI" table that it references. So this definitely explains what is going on. Libraries (ClbLibrary folder type) have reference attributes, such as a reference to a folder that they map to.

    Table Level Access Restricted
    It is very common to restrict database table level access in a production environment to only database administrator user ids, such as "icmadmin", and restrict access to other IDs like the "icmconct" which are the underlying end user connect ID for non-admins when you do not define individual operating system and database user ids for every CM user. In many test systems, people don't lock down the table level access. But in production system it is more common. So in your system, access to the RI table is restricted to only database admin users. If you actually use choice lists by foreign key to external table (within same schema) then you must grant table level access to non-admin users to the particular table that you intentionally want to draw values from.

    Underlying Problem 1: Choice Lists by Foreign Key to External Table Not Checking Display Flag
    The underlying problem is that the choice lists implementation (for the case of foreign key to external table) is not checking the display flag to avoid querying values to return any foreign key as a choice list. This is true even if you intentionally define a foreign key to external table for validation purposes that you do not intend to display as a drop down list, such as if the list is huge. But this also applies whenever reference attribute exist because they result in foreign keys to the RI table, and they need to be ignored too. When database access is restricted, you get a failure. When not restricted, there is a performance/scaling implication due to the unnecessary table query, and will be affected by RI table size.

    I have reported an informal defect to see that it should be resolved upstream. Remember only official IBM support reports will drive a fix pack. Else this should make its way in upstream.

    Problem 2: Choice Lists by Foreign Key to External Table Problem With WAS DB Connection Pooling
    It also appears that choice lists by foreign key to external tables do not work when WAS DB connection pooling is enabled. I think the NullPointerException you are running into is a NULL connection object from the CM API. This would either be a limitation of Choice Lists by Foreign Key to External Tables that it cannot be used with WAS DB pooling, or is a defect if it can be solved. I have reported an informal defect to see if it can be addressed upstream by first attempting to fix, else clarify in documentation.

    But this issue goes away if you aren't intentionally using choice lists by foreign key to external tables, if problem 1 is fixed.
    Thanks again for your detailed response. I could understand what is happening in both cases: with DKPoolWAS enabled and disabled.

    In my environment I have to work with DKPoolWAS enabled and have checked that my Item Types have no choice lists by foreign key to external tables.

    In this case it seems that the error is related to a solution of the Problem 1. So I must ask an official IBM support, because there is no workaround. I'm right?

    Thanks again,
    Henrique
  • TigerTrix
    TigerTrix
    38 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T18:21:17Z  
    Thanks again for your detailed response. I could understand what is happening in both cases: with DKPoolWAS enabled and disabled.

    In my environment I have to work with DKPoolWAS enabled and have checked that my Item Types have no choice lists by foreign key to external tables.

    In this case it seems that the error is related to a solution of the Problem 1. So I must ask an official IBM support, because there is no workaround. I'm right?

    Thanks again,
    Henrique
    Workarounds
    1. Avoid using document types or folder types that have reference attributes. Don't define them, or restrict access by ACL, or restrict listing in types lists to pick from by the hiddenTypes configuration setting (cmpathservice.properties).
    Note: this alone will not avoid running into data from system types or hidden types that can trigger retrieval once discovered, such as libraries which is a special folder type that is not listed for users to create from but will discover them while browsing.
    2. Change CMIS root configuration to start browsing from a specific folder that will not encounter any types (system types or user types) that have reference attributes. You can use the Browser commandline tool to browse and see the paths. Once you have picked a folder to start CMIS browsing from, you can set that value as the cmisRoot configuration setting in cmpathservice.properties. So you could set it to /cmRoot/default group/default library or /cmRoot/default group/repository root. That should work as long as the mapped type does not show through on cmis root or if your application doesn't try to inspect the type of CMIS root. If that doesn't work, then you must map a folder within a library, such as /cmRoot/default group/repository root/myCustomCmisRootFolder. This way you have jumped past the problem.
    3. Grant table level access to the RI table to the icmconct user and disable WAS connection pooling (not recommended).
  • TigerTrix
    TigerTrix
    38 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T18:22:24Z  
    • TigerTrix
    • ‏2012-03-28T18:21:17Z
    Workarounds
    1. Avoid using document types or folder types that have reference attributes. Don't define them, or restrict access by ACL, or restrict listing in types lists to pick from by the hiddenTypes configuration setting (cmpathservice.properties).
    Note: this alone will not avoid running into data from system types or hidden types that can trigger retrieval once discovered, such as libraries which is a special folder type that is not listed for users to create from but will discover them while browsing.
    2. Change CMIS root configuration to start browsing from a specific folder that will not encounter any types (system types or user types) that have reference attributes. You can use the Browser commandline tool to browse and see the paths. Once you have picked a folder to start CMIS browsing from, you can set that value as the cmisRoot configuration setting in cmpathservice.properties. So you could set it to /cmRoot/default group/default library or /cmRoot/default group/repository root. That should work as long as the mapped type does not show through on cmis root or if your application doesn't try to inspect the type of CMIS root. If that doesn't work, then you must map a folder within a library, such as /cmRoot/default group/repository root/myCustomCmisRootFolder. This way you have jumped past the problem.
    3. Grant table level access to the RI table to the icmconct user and disable WAS connection pooling (not recommended).
    But I do not intend to discourage you from opening an official support issue. I am only trying to help let you know what all your choices are.
  • TigerTrix
    TigerTrix
    38 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T18:37:51Z  
    • TigerTrix
    • ‏2012-03-28T18:22:24Z
    But I do not intend to discourage you from opening an official support issue. I am only trying to help let you know what all your choices are.
    Workaround Clarification
    2. ... about #2 from my previous comment, when configuring cmisRoot=... in cmpathservice.properties, if you identify a folder within a library, you really should post the "fast path" value to the folder, which will be reported by the Browser command-line tool if fastFolderAccessPaths=false in cmpathservice.properties. "Fast paths" always work, whether or not generating fast paths is on or off later. And they are faster to open CMIS root if it can jump straight to it without resolving the path. Library paths have no "fast path" variation because they are equally fast. Only within a library does resolving name-only paths incur additional cost beyond a fast path.
  • HenriqueLira
    HenriqueLira
    9 Posts

    Re: NullPointerException when accessing a library group

    ‏2012-03-28T21:44:33Z  
    • TigerTrix
    • ‏2012-03-28T18:37:51Z
    Workaround Clarification
    2. ... about #2 from my previous comment, when configuring cmisRoot=... in cmpathservice.properties, if you identify a folder within a library, you really should post the "fast path" value to the folder, which will be reported by the Browser command-line tool if fastFolderAccessPaths=false in cmpathservice.properties. "Fast paths" always work, whether or not generating fast paths is on or off later. And they are faster to open CMIS root if it can jump straight to it without resolving the path. Library paths have no "fast path" variation because they are equally fast. Only within a library does resolving name-only paths incur additional cost beyond a fast path.
    Hello,

    I adopted the second workaround that you suggested and got to work with DKPoolWAS. At the moment we are only performing tests with the CMIS and CM EE then we will not ask the official support from IBM.

    Thanks for your help on this problem.
    Henrique