Topic
  • 10 replies
  • Latest Post - ‏2012-10-04T00:56:25Z by KaranBal
ArupKar
ArupKar
15 Posts

Pinned topic CWPAP0137E:No current context is available

‏2012-08-31T09:14:53Z |
I applied FP8 in the PIM 9.0.0 FP6. After the fix pack installation was done, I manually did changes to the necessary config files for implementation specific changes. flow-config.xml, etc.

in flow-config.xml, there are some custom jsps defined.

Whenever, these jsps are called from within PIM (like custom tools), I get an error in the logs:

8/31/12 11:13:04:218 CEST 00000012 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet /manageContent.jsp in application ccd_MDMforPIM. Exception created : com.ibm.pim.common.exceptions.PIMInternalException: CWPAP0137E:No current context is available
at com.ibm.ccd.api.context.DefaultContextImpl.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Constructor.java:516)
at com.ibm.pim.context.PIMContextFactory.getCurrentContextInternal(Unknown Source)
at com.ibm.pim.context.PIMContextFactory$1.initialValue(Unknown Source)
at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:141)
As per the logs, it seems that the PIM context is not available. Can anyone suggest, what am I doing wrong ?

Thanks in advance !
Updated on 2012-10-04T00:56:25Z at 2012-10-04T00:56:25Z by KaranBal
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-08-31T09:23:44Z  
    Hi,

    I can suggest to check the following thing from the release notes for fix pack:
    *Attention: You must recompile the solution Java code. Refer to Step 2. Installing the fix pack section for specific instructions."

    I could help, but I'm not sure
  • MohanaKera
    MohanaKera
    21 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-08-31T09:33:40Z  
    Seems like you are using 'getCurrentContext()' API. Have you tried using the getContext(...) API instead - this API will need the user/password information but if getContext() API works, it means that getCurrentContext() doesn't have an existing context to work with ...
  • ArupKar
    ArupKar
    15 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-08-31T09:36:36Z  
    Seems like you are using 'getCurrentContext()' API. Have you tried using the getContext(...) API instead - this API will need the user/password information but if getContext() API works, it means that getCurrentContext() doesn't have an existing context to work with ...
    Well..I dont want to create a new context every time (which is not recommended too), so I am using the current context.
    this was working fine in the earlier fix pack.
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-09-03T14:45:14Z  
    • ArupKar
    • ‏2012-08-31T09:36:36Z
    Well..I dont want to create a new context every time (which is not recommended too), so I am using the current context.
    this was working fine in the earlier fix pack.
    I think MohanaKera meant just to test if it is even possible to get a context. Of course you do not want that each time.
  • MohanaKera
    MohanaKera
    21 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-09-03T14:49:49Z  
    I think MohanaKera meant just to test if it is even possible to get a context. Of course you do not want that each time.
    Yes, that is what I meant. Getting a new context each time is not recommended but this test will tell you whether a context is really not available.

    If getting the current context was working fine with the previous fixpack but no longer works in the current fixpack with NO code changes in your implementation, then you will need to work with support to analyze the issue.

    thanks.
  • KaranBal
    KaranBal
    108 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-09-03T17:49:43Z  
    Yes, that is what I meant. Getting a new context each time is not recommended but this test will tell you whether a context is really not available.

    If getting the current context was working fine with the previous fixpack but no longer works in the current fixpack with NO code changes in your implementation, then you will need to work with support to analyze the issue.

    thanks.
    I agree with Mohana's test there.
    There are certain newer fix packs where getCurrentContext doesn't seem to work(esp when used within a jsp). So, to test whether the issue is with your code or the implementation of getCurrentContext; try using getContext. If the program works correctly, then the issue is with getCurrentContext implementation. If even getContext doesn't work, then you need review your code to look for the root cause.
  • ArupKar
    ArupKar
    15 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-10-01T13:16:45Z  
    • KaranBal
    • ‏2012-09-03T17:49:43Z
    I agree with Mohana's test there.
    There are certain newer fix packs where getCurrentContext doesn't seem to work(esp when used within a jsp). So, to test whether the issue is with your code or the implementation of getCurrentContext; try using getContext. If the program works correctly, then the issue is with getCurrentContext implementation. If even getContext doesn't work, then you need review your code to look for the root cause.
    Just to update you all reg. the solution for this issue:

    There is a work around that you can implement for the time being until the code fix becomes available: please refer to instructions on http://www-01.ibm.com/support/docview.wss?uid=swg1JR40852 for the description of the known work around.
  • KaranBal
    KaranBal
    108 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-10-01T22:47:54Z  
    • ArupKar
    • ‏2012-10-01T13:16:45Z
    Just to update you all reg. the solution for this issue:

    There is a work around that you can implement for the time being until the code fix becomes available: please refer to instructions on http://www-01.ibm.com/support/docview.wss?uid=swg1JR40852 for the description of the known work around.
    The APAR is not related to the issue you described. That APAR merely takes cares of warning messages in the logs for DB Manager. It has no effect on getCurentContext or context not found.
    If your issue is resolved, then it is likely that some other change fixed it.
  • ArupKar
    ArupKar
    15 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-10-03T16:40:01Z  
    • KaranBal
    • ‏2012-10-01T22:47:54Z
    The APAR is not related to the issue you described. That APAR merely takes cares of warning messages in the logs for DB Manager. It has no effect on getCurentContext or context not found.
    If your issue is resolved, then it is likely that some other change fixed it.
    Well, I was advised by the support team regarding this and it worked for me to get the available context, without any other changes. So, I'll consider this as a solution for this bug until a final fix is available.

    Regarding the suppressing of warning messgaes, in the above link there are two statements in the try block, one is to register the thread(so that there are no warning messages) and the other one seems to be for the context:

    try
    {
    com.ibm.ccd.connectivity.common.HTTPUtils.setRequestCtxToCurrent(request);
    com.ibm.ccd.common.util.FuzaoThread.registerJSP(request.getRequestURL() + "",request);
    }
  • KaranBal
    KaranBal
    108 Posts

    Re: CWPAP0137E:No current context is available

    ‏2012-10-04T00:56:25Z  
    • ArupKar
    • ‏2012-10-03T16:40:01Z
    Well, I was advised by the support team regarding this and it worked for me to get the available context, without any other changes. So, I'll consider this as a solution for this bug until a final fix is available.

    Regarding the suppressing of warning messgaes, in the above link there are two statements in the try block, one is to register the thread(so that there are no warning messages) and the other one seems to be for the context:

    try
    {
    com.ibm.ccd.connectivity.common.HTTPUtils.setRequestCtxToCurrent(request);
    com.ibm.ccd.common.util.FuzaoThread.registerJSP(request.getRequestURL() + "",request);
    }
    Okay, I learnt something new today. I was aware of the APAR#JR42706 for this getCurrentContext issue and thats why I suggested using getContext to check the logic, but not that we could use the workaround from the other APAR(seemingly unrelated) as a workaround for it. Thats good to know.
    Thanks for following up.