Obtaining FlexClient object in a filter

Hi there,
we have a special login routine which runs in a servlet filter above the blazeds Servlet. RPC calls are made via Remote Objects. We would like to switch to per client authentication but in the filter we do not have access to the client id of the Flex client that performed the request. Does anyone know how we can access the id of the client in a filter - that is before the amf message is processed by blazeds?
Any hint or help is very much appreciated.
Regards
Leo

Hi Leo. I think that FlexContext.getFlexClient().getId() in the BlazeDS Java API will give you the id of the FlexClient but that's assuming the FlexClient has already been created.
The FlexClient gets created on the server. I believe the Flex client sends an initial ping request to the server with a "nil" FlexClient id and then the server creates a new FlexClient and returns the id back to the client.
When the Flex client makes subsequent requests to the server, for example to call a remoting destination, it sends this FlexClient id.
Now, I think that BlazeDS does authentication at the destination level so that initial ping request should go through unchallenged but if you have your own special login routine and you are not letting this initial ping request go through you might run into problems.
I don't think there will be any way to get the FlexClient id if the FlexClient hasn't been created but if it has been created I think you should be able to use the code I mentioned above.
Hope that helps.
-Alex

Similar Messages

  • Why can't I open the filter gallery in Photoshop CC 2014? I've converted the photo layer into a smart object, but the filter gallery selection is still grayed out.

    Why can't I open the filter gallery in Photoshop CC 2014? I've converted the photo layer into a smart object, but the filter gallery selection is still grayed out. How do I make it active?

    Please go to Help, System Info and Copy then paste here.
    Benjamin

  • Applet throws "Unable to obtain Document object"

    Hello,
    I have an applet in a html-page and a link to show the applet (in a later version this should be a menu with links to different applets).
    If I click very often (click,click,click,click) on the link I get an exception (see below).
    Used environment:
    - Windows 2000 English
    - Internet Explorer 6
    - Java(TM) Plug-in: Version 1.4.2, Using JRE version 1.4.2 Java HotSpot(TM) Client VM
    Here are my 4 tiny source-codes:
    1. My test Applet:
       import java.util.*;
       import javax.swing.*;
       public class BigApplet extends JApplet {
          Vector vec = new Vector();
          public void init() {
             this.getContentPane().add(new JLabel("BigApplet"));
             for (int i = 0; i < 10; i++) {
                vec.add(new Object[250000]);
       }And 3 HTML-Pages:
    2. Frame.html
       <html>
          <frameset cols="80,*" frameborder="NO" border="0" framespacing="0">
             <frame src="link.html" name="menuFrame" noresize marginheight="0" marginwidth="0">
             <frame name="applet" noresize marginheight="0" marginwidth="0">
          </frameset>
       </html>3. Link.html
       <html>
          <a href="applet.html" target="applet">Applet</a>
       </html>4. Applet.html
       <applet code="BigApplet.class" codebase="bin" />The three html pages are in the same directory and the BigApplet.class is in the bin-folder of this directory.
    If I start the frame.html from Explorer and than click very fast (about 5 to 10 times) on the link to the applet I get this exception:
    netscape.javascript.JSException: Unable to obtain Document object
         at sun.plugin.AppletViewer.getDocumentBase(Unknown Source)
         at sun.plugin.AppletViewer.getCodeBase(Unknown Source)
         at sun.plugin.AppletViewer.appletInit(Unknown Source)
         at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
         at sun.plugin.viewer.IExplorerPluginObject$Initer.run(Unknown Source)If the applet is delivered by a webserver (tried IIS and Apache) the Internet Explorer crashes without a message. In that case I get a different exception (found in the log file of the java console):
    java.lang.NullPointerException
         at sun.plugin.util.URLUtil.canonicalize(Unknown Source)
         at sun.plugin.AppletViewer.getDocumentBase(Unknown Source)
         at sun.plugin.AppletViewer.getCodeBase(Unknown Source)
         at sun.plugin.AppletViewer.appletInit(Unknown Source)
         at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
         at sun.plugin.viewer.IExplorerPluginObject$Initer.run(Unknown Source)Any idee what to do to be sure that an user can not produce this error?
    Bye
    Thomas

    Hello, I am getting the same error under different circumstances. No clicking is involved. What I need to know is what causes the error? Anyone know?
    And levi_h - the end users of applets often get impatient when they don't see immediate results and will click and click and click and click, thinking that somehow they are helping the situation. You may feel they deserve to be punished, but the powers that be who are the customers who will deploy our applets don't feel that way at all, and they are the ones that pay our salaries and allow us to be sheltered, clothed, fed and send our kids to college!

  • Netscape.javascript.JSException: Unable to obtain Document object

    Hi all.
    I'm fighting against a very unusual problem involving applets and, probably, version 1.4.2_XX of the jre (in fact i've been looking for an answer over the Internet and I've found only one item related in the java programming forum. Unfortunately it was not resolved on any of the answers http://forum.java.sun.com/thread.jsp?thread=452400&forum=31&message=2532663).
    The thing is that the applet is unable to obtain any information about the parameters passed through the page; consequently, it finally crashes showing this ugly message:
    netscape.javascript.JSException: Unable to obtain Document object
         at sun.plugin.AppletViewer.getDocumentBase(Unknown Source)
         at sun.plugin.AppletViewer.getCodeBase(Unknown Source)
         at sun.plugin.AppletViewer.appletInit(Unknown Source)
         at sun.plugin.viewer.LifeCycleManager.initAppletPanel(Unknown Source)
         at sun.plugin.viewer.IExplorerPluginObject$Initer.run(Unknown Source)as I said I've been looking for information over the Internet but it seems that few people knows about it. Any suggestion? Does anybody knows if it is a mater of the IExplorer?
    The configuration of the client machine is:
    Windows XP SP1
    IExplorer 6.0
    Although the same has ocurred over:
    Windows 2000
    IExplorer 6.0
    Thank you for your time.

    Can you reproduce this error with html and applet code (and post this code)?
    A full trace might tell you something:
    To turn the full trace on you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log

  • Obtaining CORBA Object References

    I have found two separate references on the Sun site to the different ways in which clients may reference CORBA objects. In each case, three methods are listed, but one item in each list seems to be different from the 'corresponding' item in the other list.
    At URL http://java.sun.com/j2se/1.3/docs/guide/idl/jidlInitialization.html, the following list is given:
    1. From a string that was specially created from an object reference
    2. From another object, such as a naming context
    3. From the ORB operation resolve_initial_references()
    [Numbers added by me for ease of reference.]
    At URL http://java.sun.com/j2se/1.3/docs/guide/idl/jidlUsingCORBA.html, the following list is given:
    1. from a factory object. For example, the client could invoke a create method on DocumentFactory
    object in order to create a new Document. The DocumentFactory create method would return an
    object refererence for Document to the client.
    2. from the nameservice. For example, the client could obtain an object reference for the
    DocumentFactory by issuing a request on the nameservice.
    3. From a string that was specially created from an object reference
    Though items 1 and 2 from the first list seem to correspond closely to items 3 and 2 respectively from the second list, item 3 (list 1) and item 1(list 2) do not. Does anybody know how this apparent anomaly can be resolved and which (if either) of these lists is (more?) correct?
    Thanks in anticipation.
    Jan

    There really is not an anomaly here. What you are indicating as an anomaly is really two distinct things.
    There are always two steps here:
    1. How does your client get the initial object reference to the server object(s). The list 1 comprehensively describes that. Typically the initial object references will be few.
    2. Once the initial references are acquired, client can make calls using these initial references to get other object references, during the clients life time. The item 1 in list 2 is a way of doing this.
    The list 1 is giving you ALL possible ways of acquiring an object reference for the very FIRST time.
    Item 1 in list 2 is actually suggesting a pattern or a way or doing something. For example, if your client wishes to create multiple objects of a certain family, you can use a DocumentFactory on the server side. You would acquire initial reference to the DocumentFactory using one of the ways described in List 1. Once the client has the DocumentFactory reference, it can call create on it to create Document objects on the server side. Also, the create() method will return a reference to the Document object to the client.

  • Want to apply poster edges to a smart object layer, but Filter Gallery is greyed out?

    Working a Photoshop tutorial on an image.  I want to apply poster edges to a smart object layer, but Filter Gallery is greyed out.  Filter Gallery is also greyed out for all other layers in this project.  (PhotoShop CC)

    Hi Filter Gallery,
    Please click on the image tab at the top and choose mode from 16bits/channel to 8bits/channel.
    Then check if the filter gallery is still grayed out.
    Thank you for posting on Adobe Forums.

  • Get JSF objects in a Filter Class

    Hi! I have a problem with my JSF application. As the most of the web applications I have a login at the begining and I place a Listener - Filter classes for catching the session timeout to returning the user to the login page. All this works OK. The problem it´s to validate that the user only has 1 session open at the time, when the user begin session I change a flag into it's database row, and when the user logout the flags change again to false (both actions (login and logout) was fired by the user clicking it's respective buttons), this works fine, but I want to change the data flag in the database row with the timeout Filter classes after pass 1 minute. My Filter class it's like this:
        public void doFilter(ServletRequest request,ServletResponse response, FilterChain filterChain) throws IOException,ServletException {
            if ((request instanceof HttpServletRequest) && (response instanceof HttpServletResponse)) {
                HttpServletRequest httpServletRequest = (HttpServletRequest) request;
                HttpServletResponse httpServletResponse = (HttpServletResponse) response;                      
                if (!StringUtils.contains(httpServletRequest.getRequestURI(), "welcomeJSF.jsp")) {                                
                    if((httpServletRequest.getRequestedSessionId() != null) && !httpServletRequest.isRequestedSessionIdValid()){
                         /* 1 */               
                           FacesContext context = FacesContext.getCurrentInstance();
                             User user = (User) context.getExternalContext().getSessionMap().get("simpleUser");
                             UserDAO conn = new UserDAO();
                             List users = conn.findByNumber(new Long(user.getNumber()));
                             persistence.User userDB = (persistence.User) users.get(0);
                             userDB.setUse(false);
                             Transaction tx = conn.getSession().beginTransaction();
                             conn.save(userDB);
                             tx.commit();
                             conn.getSession().close();                                     
                             /* 2 */                     
                        String timeoutUrl = httpServletRequest.getContextPath()+ "/faces/" + "welcomeJSF.jsp";
                        System.out.println("Session is not invalid. Redirecting to login page. ");
                        httpServletResponse.sendRedirect(timeoutUrl);
                        return;
            filterChain.doFilter(request, response);
        }When I comment from 1 to 2 works fine, but if I want to get the context.getExternalContext().getSessionMap().get("simpleUser") i get this error:
    java.lang.NullPointerException
         at validadores.SessionTimeoutFilter.doFilter(SessionTimeoutFilter.java:53)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)This is because I'm working in a diferent conexts? How can I get Jsf objects from ServletRequest? or to pass getExternalContext().getSessionMap() to the filter class? Any ideas to change the database when the session timeouts if I'm using hibernate?
    Thanks for your time and help!

    correction :
    MyObjectProxy extends ObjectProxy{
         override callProperty(
              // your dyna logic
    and expose new MyObjectProxy(dynaInstance)

  • Obtaining Session object

    Is there is a way of obtaining the Session/Request object from the context in a normal class running within a servlet container?
    Thanks.

    For the Request object, there isn't one until a request takes place, at which time a servlet object's doGet() or doPost() method is called. If the servlet wants to call that 'normal' class then it could use a method that takes an HttpServletRequest as a parameter. Same for a session.
    If you initialize that class when the container starts up, there aren't any sessions or any requests in existence, so it doesn't make sense to ask how it can access those things.

  • BW T-code to obtain an object list related to a certain user

    Hi everybody,
    I´m looking for a transaction where I can obtain all the objects that depend on a user (Ex. jobs, programs).
    The issue is that I´m going to delete a user and I´m not sure of the consequences. For example schedule jobs will be canceled if I don´t assign those to another user. So before deleting, I would like to have a list of objects related to that user.
    The question is: Does it will happen also to programs or other ¨BW objects¨?
    Thanks in advance,
    Nina

    Hi,
    For Jobs check the table TBTCP Via Se16. this will provide you the list of jobs scheduled/Released for the specific user.
    Items like Programs and other repository objects, deleting user doesn't effect the processing/using of these objects.
    If you not sure, I would suggest to lock the user rather delete, that way you would able to recover if necessary and it also help you down the road for audit trails.
    Hope this helps.
    Kalyan.

  • Cache destroy and removing objects based on filter

    Hi,
    I have lined up a few questions to understand the ways we can destroy/remove cache entries or cache itself on a collective basis and not just the cache.remove(key).
    1. How do I remove a group of keys from the cache? Say either I know the keySet or a keySet obtained based on a filter. I can see the Java doc says namedCache also implements queryMap and that supports keySet(Filter) but unlike Map.keySet(), the set returned by this method may not be backed by the map, so changed to the set may not be reflected in the map.
    http://download.oracle.com/otn_hosted_doc/coherence/353/com/tangosol/util/QueryMap.html#keySet(com.tangosol.util.Filter)
    Now that also means cache.keySet().removeAll() may not work. Can we confirm that, as another article http://wiki.tangosol.com/display/COH35UG/Data+Affinity shows an example way to use entryset or keyset and shows this line:
    cacheLineItems.keySet().removeAll(setLineItemKeys).
    2. Is namedcache.destroy() a blocking or non-blocking? Coz in one of our tests, we created a for loop of the following code:
         a. create cache.
         b. use cache.
         c. destroy cache.
    And we expected at any point of time to have only one cache to be active on the cluster, however with the 500M as the high unit, we never saw evictions and indeed saw out of memory error. We had like 100 iterations. We expected destroy cache to basically delete the cache, thereby freeing the memory on the JVM. We only had one proxy and one storage in our test.
    3. Is namedcache.clear() a blocking or non-blocking call? Although this does not necessarily removes the cache, it only unmaps all the entries in the cache.

    Hi,
    You can remove multiple cache entries based on a filter like this...
    Filter filter = ...
    cache.invokeAll(filter, new ConditionalRemove(AlwaysFilter.INSTANCE));...or on a collection of keys like this...
    Collection keys = ...
    cache.invokeAll(keys, new ConditionalRemove(AlwaysFilter.INSTANCE));Regarding non-blocking calls, presumably for clear() I would think that the call will not return until the cache is cleared (i.e. empty) otherwise you would get all sorts of potential problems. For cache.destroy() I am not sure what state the cache will be in when the call returns. I suspect if you call this from a client it only destroys the cache locally on that client and not throughout the rest of the cluste though - but I am sure someone could confirm this.
    JK

  • How to obtain an object localized name?

    Hi everybody,
    I have a portlet that searches for folders and documents in the KD using IDocumentFolderManager and IDocumentManager objects. The problem is that when I use obj.getName(), I always get the object default name, It doesn't respect the user localization.
    This is part of the code:
    IDocumentQuery documentQuery = docMan.createQuery(folderID);
    documentQuery.setShowUnapproved(false);
    documentQuery.setSortProperty(ObjectProperty.Name);
    IObjectQuery childDocs = documentQuery.execute();
    for (int j = 0; j < childDocs.getRowCount(); j++){
    IObjectQueryRow document = childDocs.getRow(j);
    System.out.println(document.getName());
    Does anyone know how to obtain the localized name?
    Thanks!
    Claudia

    Ok, I give up. I tried this:
    <%@page import="com.plumtree.remote.portlet.*" %>
    <%@page import="com.plumtree.remote.prc.*" %>
    <%@page import="java.util.Locale" %>
    <%
         response.setLocale(Locale.FRENCH);
         IDocumentFolderManager folderMan = PortletContextFactory.createPortletContext(request, response)
              .getRemotePortalSession().getDocumentFolderManager();
         IObjectQuery subfoldersQuery = folderMan.getSubFolders(1);
         for (int i = 0; i < subfoldersQuery.getRowCount(); ++i) {
              out.write(subfoldersQuery.getRow(i).getName() + "<br/>");
    %>
    I got the primary name for the folder, not the French name. I tried setting my portal user's locale to French/France and that didn't help either. I even tried setting the portlet's primary language to French. None of that helped one bit.
    Then I saw this post from 2005:
    http://forums.bea.com/bea/thread.jspa?messageID=500018945&tstart=0
    Basically, I think this is just broken or not implemented. I would contact support and file an SR. Unless I'm missing something, it looks like the PRC is not locale-aware. And that's a bug, AFAIK.
    Chris Bucchere | bdg | [email protected] | http://www.thebdgway.com

  • Obtain Image object! HELP!!!

    Anyone knows how to obtain an Image-object without having to use methods or objects that require an X-server to be installed?
    I'm using a web-hotel that doesn't want to install an X-server on there server. Because of this I can't use:
    Image im = new ImageIcon("pic/apic.jpg").getImage();If I use this the server throws an errormessage. The reason I'm using the Image-object is that I want to be able to scale the image.
    /Anyone who can help me??

    If you can have them run the java runtime (1.4 and up) with this option your set:
    -Djava.awt.headless=true.
    If not, check out http://www.geocities.com/marcoschmidt.geo/java-image-faq.html#x
    He seems to have some information on how to get around that
    - Chris

  • Obtaining Business Object source table

    Hi,
    is there any way to obtain the business object source table?
    As I've seen the source table is written in DI API Ref.
    Is there any way to take it from SDK?
    Best regards,
    Slawomir Naborczyk

    Not that i know.
    Just make your own lookup table. There are a limited amount of objects.

  • Notification subscription when object created plus filter

    Hello everyone here.
    I have new interesting task for notification subscription. It's possible to set additional criteria when using notification on object creation, but only properties (or fields) of the actual object. See xml:
    <DataSources>
    <DataSource ID="DS" TypeID="SystemCenter1!Microsoft.SystemCenter.CmdbInstanceSubscription.DataSourceModule">
    <Subscription>
    <InstanceSubscription Type="a3d4e16f-5e8a-18ba-9198-d9815194c986">
    <AddInstance>
    <Criteria>
    <Expression>
    <SimpleExpression>
    <ValueExpression>
    <Property State="Post">$Context/Property[Type='CustomSystem_WorkItem_Library!System.WorkItem.CommentLog']/Comment$</Property>
    </ValueExpression>
    <Operator>Like</Operator>
    <ValueExpression>
    <Value>%Agree%</Value>
    </ValueExpression>
    </SimpleExpression>
    </Expression>
    </Criteria>
    </AddInstance>
    </InstanceSubscription>
    <PollingIntervalInSeconds>60</PollingIntervalInSeconds>
    <BatchSize>100</BatchSize>
    </Subscription>
    </DataSource>
    </DataSources>
    If user comment has the word 'Agree' in comment notification will be sent. I'm wondering if it is possible to address relationship object. Actually get status of incident for which this comment is created. So I can make autoanswer for closed incidents.

    Hi Sergey,
    I'm just curious about the situation when a user writes "disagree". It also like "%Agree%" in the case-incentive search. The one way is writing a custom workflow to get the required result. You can monitor an event 'new comment', filter that, get a source
    workitem, an affected user, and send a message. The easiest way is using SCORCH (just a piece of cake there).
    Cheers,
    Marat
    Site: www.scutils.com  Twitter:
      LinkedIn:
      Facebook:

  • How can I obtain an object-type variable in Forms 6i?

    i create an object-type in oracle 8i database like this:
    TYPE OBJ_TYPE_NUMBER AS OBJECT
    FIELD1 NUMBER,
    MEMBER PROCEDURE INIT, ...
    i create a variable of this object-type in a stored procedure in Oracle 8i:
    v_Number OBJ_TYPE_NUMBER(10);
    and then call it's method:
    v_Number.INIT;
    it work's!
    But when I try to compile a previous variable declaration
    (v_Number OBJ_TYPE_NUMBER;) in Oracle Forms 6i I see only an error message.
    So my question is How can I declare and use an object-type variable in Forms 6i?

    Hi,
    the release after Forms 6i is Forms9i. Forms9i does have the PLSQL engine of Oracle 9.0.0.2 database which means that it should knwo how to handle object types in PLSQL.
    Frank

Maybe you are looking for

  • Error when I call a method of AppModule from a backing bean.

    I use Jdeveloper 10.1.3.0.3 EA. In my application I have created ApplModule and UsrView(for my table USR). I have a login page (login.jsp and the backing login.java) with 2 fields userName and password and an ADF Faces Core command button (cmdCheckPa

  • Display extra information in entity header of the relational model

    Hi, Is there a way to display extra information in the header of the entity, next to the table name. Ex : each table in my model has a distinct object id. Right now I enter this info in the Dynamic Properties (Name = OBJECTID Value = 710). It would b

  • How to make a color effect

    hey, how can I make in adobe premiere pro this color effect? (looks like x-ray) thank you!!

  • IPod Color (4th Generation) Stops Playing in the Middle of Songs

    Okay, maybe I'm looking for an excuse to get a new iPod. I really don't want to, but my two and half year old iPod Color (4th generation) is starting to act funky. Starting yesterday, for no reason in the middle of songs it goes into pause mode on it

  • Web Service (SOAP) stopped working with new update

    We've got a SOAP service that sits on a second server that our main flash file calls to. It's work just fine until we've updated to the latest Flash player 9. I've read about the Socket Policy file and figure that is the issue. We are on a hosted ser