A problem with a Filter

I'm not sure whether filters shoud be discussed here - but I'll give it a try.
So, I'm having a filter that takes the response, changes it, and then prints it to the client (the way it is shown in the Sun tutorial)
out = res.getOutputStream();
response = (HttpServletResponse) res;
request = (HttpServletRequest) req;
MemoryResponseWrapper responseWrapper = new MemoryResponseWrapper(response);
filterChain.doFilter(request, responseWrapper);
responseText = responseWrapper.toString();
// some actions with the responseText
out.print(responseText);
out.flush();
out.close();
public class MemoryResponseWrapper extends HttpServletResponseWrapper {
    private CharArrayWriter mOutput;
    public MemoryResponseWrapper(HttpServletResponse response){
        super(response);
        mOutput = new CharArrayWriter();
    public String toString() {
        String result = mOutput.toString();
        return result;
     public PrintWriter getWriter() throws IOException {
          PrintWriter output = new PrintWriter(mOutput);
                                         return output;
}There are two scenarios:
- public void doFilter(..) { .. } - in this case the users' session are mixed - users get other users' pages instead of their own.
- public synchronized void doFilter(..) { .. } - the above problem is not occuring, but the pages load very slowly (probably due to the synchronization)
Also, I think it's important to mention - in the filter body I call request.getSession();
Using Tomcat 5.0, JDK 1.4.2
Message was edited by:
Glammy

Instead of synchronizing the doFilter() method, thereby making all requests to all servlets controlled by the filter wait in line, I think it would be better to try making the filter and servlets thread-safe. Not using class-level (instance or static) variables and only using local variables would go a long way towards completing that task.

Similar Messages

  • Problem with Extract Filter

    I have Problem with Extract Filter which was working OK until recently.
    Now, when I choose the filter the screen does not come up as the extract screen as it should and no other action can be taken except to press escape which returns me to normal. working.    Looks as if the extraction function has been sleected but does not show?
    I am trying to use the  extract on a layer.  Have tried to use it on a selection also.
    Anyone suggest a solution please?
    Bill

    Without a way to reset the tool, the only possibility seems to be to reset your preferences as described in the FAQ.
    http://forums.adobe.com/thread/375776?tstart=0
    You either have to physically delete (or rename) the preference files or, if using the Alt, Ctrl, and Shift method, be sure that you get a confirmation dialog.
    This resets all settings in Photoshop to factory defaults.
    (A complete uninstall/re-install will not affect the preferences and a corrupt file there may be causing the problem.)

  • Problem with ALV filter functionality when filtered for multiple values

    Hi,
    I am facing a problem with ALV filter functionality.
    I have displayed an ALV with some columns col_A, col_B and col_C
    col_A---- col_B -
    col_C
    1----
    a -
    abc
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    5----
    f -
    stu
    From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
    Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
    i.e. after applying the filter the ALV table looks as below:
    col_A---- col_B -
    col_C
    3----
    c -
    lmn
    But ideally it should be:
    col_A---- col_B -
    col_C
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    I could not find any OSS note related to this issue.
    Please help me resolve this issue.
    Thanks,
    Feroz

    Hi,
    I am facing a problem with ALV filter functionality.
    I have displayed an ALV with some columns col_A, col_B and col_C
    col_A---- col_B -
    col_C
    1----
    a -
    abc
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    5----
    f -
    stu
    From the settings link I am applying filter on column col_C and selected multiple values say 'pqr', 'xyz' and 'lmn'.
    Now the ALV is showing rows only for last selection i.e . results are fetched only for value 'lmn'.
    i.e. after applying the filter the ALV table looks as below:
    col_A---- col_B -
    col_C
    3----
    c -
    lmn
    But ideally it should be:
    col_A---- col_B -
    col_C
    2----
    b -
    pqr
    3----
    c -
    lmn
    4----
    d -
    xyz
    I could not find any OSS note related to this issue.
    Please help me resolve this issue.
    Thanks,
    Feroz

  • Could not complete the ... command because of a problem with the filter module interface

    I just reinstalled Photoshop CS6. I'm running OS X 10.8.2 .
    I use the Nik plugins suite, and reinstalled them as well. Now whenever I try to use one of those plugins I get the error "Could not complete the ... command because of a problem with the filter module interface."
    The reinstallation was a bit of a struggle due to issues on Adobe's end, and I am hesitatnt to just dive in and reinstall without wome idea as to what might cause these errors.
    Any insight appreciated.
    Stu

    Not sure I know what you mean by "disabling the Nik filter folder".
    I have the latest updates for the Nik filters and they are compatible with CS6.
    Since yesterday I tried uninstalling the Nik filters, manually locating and removing every file related to Nik/Nik Software, redownloading the Nik installers, uninstalling/reinstalling Photoshop, and reinstalling the Nik filters. Same result.
    I am pretty sure this is something on the Photoshop end, but am not sure what to do next. Maybe repeat the above and use the Creative Suite cleaner before reinstalling?
    Stu

  • Can't use certain filters- "problem with the filter module interface"

    Hello,
    I frequently use the BPelt Flatten and Multifill plugins and they have always worked perfectly until today. Now I get the following error: "Could not complete the [Multifill/Flatten] command because of a problem with the filter module interface."
    I use Photoshop CS6 Extended with the Creative Cloud membership, and just recently updated to version 13.1.1 x64. I believe this may be related, as the plugins worked before the update and nothing else has changed.  Any recommendations on how to fix this? Is it possible to undo  the update?

    Usually this means a bug in the third party plugin that you are using.

  • Strange Problem with InKeyset filter

    I encountered a strange problem with inkeyset filter.I am trying to do some operations on the the selected set of keys within a cache. I have posted the psuedo code below
    InKeySetFilter inKeySet=new InKeySetFilter(AlwaysFilter.INSTANCE,orgDestFlightSubset);
    // Set of Keys for NamedCacheInstance
    inKeySet.ensureConverted
    (NamedCacheInstance.getCacheService().getBackingMapManager().getContext().getKeyToInternalConverter());
    Extra code to be Added
    System.out.println(NamedCacheInstance.entrySet(inKeySet).size());
    Always prints 0 eventhoug the keys are present in cache. If i add the following code
    NamedCacheInstance.get(orgDestFlightSubset.toArray()[0]) above printing it gives 1 as a result.
    I am sure that object is in cache becoz cache.get() does not call the DB again
    Can anyone tell me what could be the possible problem?

    Hi,
    user10866091 wrote:
    I encountered a strange problem with inkeyset filter.I am trying to do some operations on the the selected set of keys within a cache. I have posted the psuedo code below
    InKeySetFilter inKeySet=new InKeySetFilter(AlwaysFilter.INSTANCE,orgDestFlightSubset);The orgDestFlightSubset must contain keys in Java format which are existing cache keys.
    user10866091 wrote:
    // Set of Keys for NamedCacheInstance
    inKeySet.ensureConverted
    (NamedCacheInstance.getCacheService().getBackingMapManager().getContext().getKeyToInternalConverter());I assume NamedCacheInstance is a NamedCache instance obtained from CacheFactory.
    In this case you should not call the ensureConverted method. This is called by Coherence on the storage nodes upon deserializing of the filter.
    Try these changes.
    Best regards,
    Robert

  • Problem with applying filter?

    Hello All,
      I am facing problem with filter.
      I am developing a smart sunc application using
      following BAPIs.
           GetList          MEREP_CONTACT_GETLIST        
           GetDetail        MEREP_CONTACT_GETDETAIL      
           Create           MEREP_CONTACT_CREATE         
           Modify           MEREP_CONTACT_MODIFY         
           Delete           MEREP_CONTACT_DELETE         
      I am using person number as filtering criteria.
      When i use emulator then it works properly.
      But at the MI client it does not seem to be working
      as all records are getting downloaded.
      Can anyone help me in this?
      Thanks in advacne.

    Hello Kishor,
    I am now getting following exceptions.
    [20060713 09:38:45:281] E [MI/Smartsync             ] Error while Smart Sync inbound processing: java.lang.IllegalStateException: No field available :ReusableFieldDescriptorIt [rowDescriptor=cZCONTACTSB_010, index=3]
    java.lang.IllegalStateException: No field available :ReusableFieldDescriptorIt [rowDescriptor=cZCONTACTSB_010, index=3]
         at com.sap.ip.me.smartsync.syncIn.processors.InternalRowProcessor.setNextFieldWithWriter(InternalRowProcessor.java:138)
         at com.sap.ip.me.smartsync.syncIn.processors.RowProcessorManager$RowProcessorDispatcher.setNextField(RowProcessorManager.java:409)
         at com.sap.ip.me.smartsync.syncIn.SaxSyncInProcessor$4.characters(SaxSyncInProcessor.java:730)
         at com.sap.ip.me.xmlParser.MIXMLEventHandlerManager.characters(MIXMLEventHandlerManager.java:72)
         at com.sap.ip.me.xmlParser.MIXMLParser.sendCharacters(MIXMLParser.java:263)
         at com.sap.ip.me.xmlParser.MIXMLParser.parse(MIXMLParser.java:158)
         at com.sap.ip.me.smartsync.syncIn.SaxSyncInProcessor.processSyncInMessage(SaxSyncInProcessor.java:87)
         at com.sap.ip.me.smartsync.syncIn.SyncInRuntimeImpl.processSyncInMessage(SyncInRuntimeImpl.java:250)
         at com.sap.ip.me.smartsync.core.SmartSyncRuntimeImpl.process(SmartSyncRuntimeImpl.java:344)
         at com.sap.ip.me.smartsync.core.SmartSyncRuntimeManager.process(SmartSyncRuntimeManager.java:214)
         at com.sap.ip.me.smartsync.core.SyncAdapter.process(SyncAdapter.java:56)
         at com.sap.ip.me.sync.SyncManagerImpl.processSingleContainer(SyncManagerImpl.java:160)
         at com.sap.ip.me.sync.SyncManagerMerger.processInboundContainers(SyncManagerMerger.java:166)
         at com.sap.ip.me.sync.SyncManagerImpl.processSyncCycle(SyncManagerImpl.java:709)
         at com.sap.ip.me.sync.SyncManagerImpl.syncForUser(SyncManagerImpl.java:1142)
         at com.sap.ip.me.sync.SyncManagerImpl.processSynchronization(SyncManagerImpl.java:774)
         at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:402)
         at com.sap.ip.me.sync.SyncManagerImpl.synchronizeWithBackend(SyncManagerImpl.java:285)
         at com.sap.ip.me.api.sync.SyncManager.synchronizeWithBackend(SyncManager.java:79)
         at com.sap.ip.me.apps.jsp.Home$SyncRunnable.run(Home.java:447)
         at java.lang.Thread.run(Thread.java:534)
    regards,
    Abhijit

  • Problem with alv filter

    Hi all,
    I have a problem when i filter ALV column, which has data type  BELNR (FI doc No). I input in filter FI doc: 40000007 (8 char long, w/o zero ahead), then i get the empty result. The really one i want to get is a ALV line with FI doc = '40000007'.
    Could u pls help me?
    Thanks and regards,
    Hung.

    Check the field catalog for field BELNR, it should have conversion exit ALPHA. (check your report or execute [The Consistency Check|http://help.sap.com/saphelp_sm32/helpdata/EN/d6/23253963143e6ae10000000a11402f/frameset.htm])
    Regards,
    Raymond

  • Problem with ALV Filter Option

    Hi
    In 4.6C version when i click on a column for Filter option, i am able to key only 20 Chars( Visible length is 16 ). Whereas in 4.7 version,  i am able to key in 40 Chars in the Input field of the filter option. Is this a problem with 4.6C version. Please Help...

    Hi
    Can you check report BCALV_TEST_FULLSCREEN_FILTER in 46C. When you put a filter on C60 ( 60 Char field ) the screen display of select-option is small but when you select the multiple options, you can key in upto 60 chars and the filter works well. Check if thsi rpogram helps you.
    Cheers.

  • Query problem with hierarchy filter

    Hello everybody,
    i have a problem with a BEx Query 3.5 on a BW 7.01-System. This query includes the cha cost category as free characteristic which is filtered on a node. When we execute this query everythin works correktly. When I now select a filter value in BEx fpr this char the formula value in the row does not change. When I drilldown on this char the correct data was shown. This problem occurs only with this hierarchy node. With other selected nodes this problem does not occur.
    We have regenerated this query in rsrt but that don't fix this issue.
    Has anybody an answer?

    hello,
    the problem is known. You may check whether implementing the following note solves the issue:
        1434532
    best regards,
    Jerome

  • Problem with widescreen filter

    Hi everybody
    I'm working with Final Cut Pro 5. When attaching the widescreen filter to the footage and I'm ajusting the 4:3 picture in the mask, the picture no longer is as sharp as it was without the filter.
    I think this had something to do with the realtime in Final Cut Pro 5, since in FCP HD, when I had to render the widescreen filter, this problem didn't occur. (Kind of the same problem seems to be when I create "Text" and attach a normal dissolve which causes a shuttered image during the fade; I solved this problem by attaching the motion blur filter, so FCP5 was obliged to render - and it worked). However this didn't resolve the widescreen problem...
    Has anybody an idea on this topic or experienced the same problem? Could this may be a problem with the software?
    Thanks for your help
    greetz

    Thanks for your answer. I wasn't aware of the percentage based issue. If this is the problem, that means that the offset adjusting with keyframes is quite useless since I always have then offsets that reach for instance from -33 to -44, with offstet numbers like -33, -34, - 35...
    Is there any solution to this problem to avoid the softness at all? Like recompressing the whole footage after the filter adjusting? Is there actually no problem with the RT; on FCP HD there was no such problem.
    I'monitoring externally and I see the softness also on the canvas and also when the clip was exported etc.
    thanks

  • IDOC: Problem with data filter for IDOC extension field

    Hallo!
    I've created an idoc extension for the basic type DEBMAS06 that works fine. Now I want to use a data filter for one field ( company code ) of my segment. Every segment with a company code different from 100 should be filtered and not send to the other client. But what happend is that for all customers that have at least one company code different from 100, all segments including the one with cc 100 were deleted and a error "Segment ... does not exist for message type DEBMAS" appeared on the screen.
    Does anyone have any ideas about this problem?

    Not sure about changes to be made at the filtering options.
    An alternative would be sending the data to XI as it is and perform the mapping to remove the unnecessary segments.
    Disadvantage: Unnecessary processing of segment would be done at XI.
    Advantage: The integration logic would be completely handled by XI.
    Regards,
    Prateek

  • Problems with a Filter

    Hello experts,
    I have generated a Model like following.
    Start_Point ->Form1 -> Service1(Bapi) -> Table1 -> Service2(ApplicationService) -> Filter -> Table -> End_Point.
    Form1 gives a String to the Input of Service1 and write an Entry in Table1
    No Attributes are mapped between Table1 -> and Service2.
    The problem is that the Filter is Based on Table1. How can I define that Service2 shall wait until Service1 has written something in Table1???
    Thanks for your help
    Marco

    Sorry, imagehosting. I understand
    [http://img444.imageshack.us/my.php?image=visualcomposerstoryboargg7.png]
    What should happen is that I type in a  lastname in Form1. This clearfiy a employeeunit with a BAPI which write default Values in the table Decision_table. Now Shoult AplicationService2 based on the Filter(which is based on DecisionTable) return a table with a list of entries.
    And GetAllCarBO shall wait until GetDecBO has written something in Decision_Table.
    Hope you can help me
    Many thanks
    Regards
    Marco
    Edited by: Marco Gennari on Jun 11, 2008 12:18 PM
    Edited by: Marco Gennari on Jun 11, 2008 12:28 PM

  • Authorization Problem with Hierarchical Filter

    Hi Gurus!
    In our BW system I created a query that includes hierarchy-enabled characteristic
    (0costcenter). 0costcenter has a hierarchy node variable to restrict
    user's  data by using authorization.
    Then I created an authorization object from t-code RSECADMIN, in this auth.
    object,  restricted 0costcenter from hierarchy authorization tab , and
    selected 6 nodes (the nodes have no sub-nodes).
    In our web template ( WAD 7.0 ) I used hierarchical filter to see the 6 nodes in our report. It works fine when I first open the template in our Enterprise Portal that we see in the variable screen,0costcenter's variable captures the nodes that I restricted in our authorization object.
    In the portal the hierarchical filter displays only selected nodes but this filter shows the hierarchy's root (name of the hierarchy) and when we choose the root the analysis displays all the values, the authorization do not work here.
    From RSECADMIN, In the hierarchy authorization tab, I tried all the type of hierarchies but all of them gave the same result.
    When i execute the report in BEx Analyzer, the authorization works fine, I think the problem is about hierarchical filter but i cannot find any solution...
    Can you give me an idea plz..
    Thank you!

    Hi,
    I think this is caused by program error.
    Take a look:
    [1075125|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1075125] - Unauthorized data displayed when structure element expanded
    [917565|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=917565] - Query displays unauthorized data
    [981828|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=981828] - No authorization for assigned inactive hierarchy
    [654947|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=654947] - Hierarchy authorizations with compound characteristics
    Only available in German:
    [1158432|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1158432] - Zu viele Werte berechtigt bei Hierachie mit Intervallen
    Hope this helps.
    Regards
    Andreas

  • Problems with Declarative filter

    I created a text item and a search button. I also do have a IR.
    Now I want to apply the value entered in the text item to the IR by using declarative filter. So in the property of the search button, I have mentioned
    Target : Page in this Application
    Page : Same page no
    set these items : IRC_DII_EXTERNALID
    with these values : &P3_SRCH_EXTERNAL_ID (Text item Name)
    Now when I click the Search button, I could not see the value of the text item in the URL. I typed it manually in the URL and submitted it and it is working fine fine. Could anyone please point out where lies the problem.
    Thanks
    Deb

    Hi
    Amend the button to have no target. Then go to the conditional branch that was created when you created the button (it should be conditional on that button being pressed) and put your 'set these items... with these values...' in the branch.
    I've just done a test and managed to recreate your problem. I now have it working.
    Cheers
    Ben

Maybe you are looking for