Accessing local reference

I have the following beans defined:
<session>
<ejb-name>EngineControllerEJB</ejb-name>
<home>com.mercury.topaz.security.authorization.engine.ejbs.controller.EngineControllerHome</home>
<remote>com.mercury.topaz.security.authorization.engine.ejbs.controller.EngineController</remote>
<ejb-class>com.mercury.topaz.security.authorization.engine.ejbs.controller.EngineControllerBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Bean</transaction-type>
<local>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</local>
<local-home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</local-home>
</session>
<session>
<ejb-name>TopazControllerEJB</ejb-name>
<home>com.mercury.topaz.security.authorization.engine.spi.ejbs.TopazControllerHome</home>
<remote>com.mercury.topaz.security.authorization.engine.spi.ejbs.TopazController</remote>
<ejb-class>com.mercury.topaz.security.authorization.engine.spi.ejbs.TopazControllerBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Bean</transaction-type>
<ejb-local-ref>
<description></description>
<ejb-ref-name>EngineControllerEJB</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</local-home>
<local>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</local>
<ejb-link>EngineControllerEJB</ejb-link>
</ejb-local-ref>
</session>
Obviously the first bean is bind with the name EngineControllerEJB. Now if I perform the lookup:
ctx.lookup("EngineControllerEJB") it retrieves the RemoteHome. How do I get the Local Home?
Thanks, Oren

For the given EJB name "MyEJB", gain the remote home
by 'ctx.lookup("MeEJB");' and the local by
'ctx.lookup(java:comp/env/MyEjb");'Really the way that it is done is that by the spec everything ejb binded to JNDI needs the java:comp/env/ejb/ prefix. Maybe if you change it to this....
<ejb-ref>
<description></description>
<ejb-ref-name>ejb/EngineControllerRemote</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</home>
<remote>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</remote>
<ejb-link>EngineControllerEJB</ejb-link>
</ejb-ref>
<ejb-local-ref>
<description></description>
<ejb-ref-name>ejb/EngineControllerLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</local-home>
<local>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</local>
<ejb-link>EngineControllerEJB</ejb-link>
</ejb-local-ref>
now you can have:
ctx.lookup("java:comp/env/ejb/EngineControllerLocal") and
ctx.lookup("java:comp/env/ejb/EngineControllerRemote")

Similar Messages

  • Can I access local files?

    I am writing an application using Adobe Air that will have to utilize and store media files locally on a user's computer.  My marketing team now believes that a downloadable application that will be installed on a user's computer will be a dealbreaker for some users due to the fear of a virus, so now they are suggesting that we will have better sales numbers if people just need to log into a website to use the application.  No problem, Air applications can be embedded into a website.  But can an Air application embedded in a browser still store and manipulate files on a user's computer?  Storing media files for a large number of individuals can become cost prohibitive, so rather than store them online, we would like to create a folder on a user's system to organize their files.  Is this possible with a web-embedded Air application?
    Thanks.

    AIR applications are always installed on the user's computer. You cannot run an AIR application on a website. On a web page, you can include a link to download or install an AIR application.
    AIR applications can access local files.
    Flash Player applications can also access local files, but the user first grants permission. For example, see the FileReference.load() and FileReference.save() methods (added in Flash Player 10):
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference .html

  • Ejb-link is still required when using local references?

    Hi!
    In BEA's link (http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html#1114738) there is the following comment for weblogic-ejb-jar.xml element 'jndi-name':
    "Assigning a JNDI name to a bean is not recommended. Global JNDI names generate heavy multicast traffic during clustered server startup. See Using EJB Links for the better practice."
    Since we're using local references (local-jndi-name) to access our ejbs instead of remote references, is this still recommendation still pertinent?
    Thanks
    Christianne

    It is enough if you add the ejb-ref & ejb-link in the session bean. The
    session will look up relative to java:comp/env
    The following doc shows an example of accessing an ejb from a web app using
    ejb-link.
    http://e-docs.bea.com/wls/docs81/webapp/components.html#146848
    --Sathish
    <Christianne Carvalho> wrote in message news:[email protected]..
    I'm not getting very well how the ejb-link is used. In my case I have
    entity beans that are referenced in session beans.
    In my entity beans I have the following XDoclet tag.
    * @ejb.bean
    * name="ProductDescription"
    * display-name="ProductDescription"
    * jndi-name="ejb/ProductDescription"
    * local-jndi-name="ejb/ProductDescriptionLocal"
    * view-type="local"
    * type="CMP"
    In my session bean I'm currently getting the reference for the entity bean
    using the following code:
    productDescriptionLocalHome=(ProductDescriptionLocalHome)
    lookupLocalHome(ProductDescriptionLocalHome.JNDI_NAME);
    If I add the following XDoclet tag to my session bean, in ejb-jar.xml a
    <ejb-link> is created inside <ejb-local_ref> tag.
    * @ejb.ejb-ref ejb-name="ProductDescription" view-type="local"
    Considering the info above:
    1) In the entity bean, is there any extra tag to define the ejb-link or is
    the ejb-link only defined in the session bean?
    2) Re session bean, only adding the @ejb-ref xdoclet tag is enough for
    using the ejb-link or do I also have to change my lookup? If I do, what do
    I have to search for in the lookup?
    Thanks!

  • Access local EJB3 on Glassfish

    I'm using Eclipse and have a combined Java/Flex project using WTP that uses BlazeDS and is deployed to a Glassfish server (v2ur2).  I was able to configure everything correctly to access simple routines with the remote access, but now I would like to access an EJB3 using the local interface.  I have another project in Eclipse that is an EJB Module and the Java/Flex project specifies that as a dependency. I can access an EJB from that project using a remote interface, but am having trouble figuring out how to access one with a local interface.
    I saw another thread on the forum that referenced the EJB3 Factory available through the Adobe exchange so I downloaded that and added it to my project.  I defined the factory in services-config.xml and added a new destination in remoting-config.xml, but when I try to access the EJB, it gives me an "error accessing local resource..."
    Is there something else I need to do?  Any pointers as to what might be going wrong?  I'm assuming that specifying the Java EE Module dependency for the EJB module should pull it in and make the local interface accessible.  Is that right?  If not, what else do I need to do?  I'm fairly new to all of this and still don't completely understand how everything in the Java/Flex project is being deployed.
    Any help would be greatly appreciated!  Thanks!
    Renee

    Renee,
    I spend about 3 full days to figure out how to make this work. I eventually come to your solution, which is very nice. I would just like to add a detail: you do not need to publish the JNDI name of your EJB in the sun-ejb-jar.xml, neither in the EJB annotations. The only thing you have to make sure is to use the exact EJB class name in the web.xml file -- and both modules have to be deployed in the same enterprise application (ear).
    So, to make a quick summary of the specific things to do (this is not a complete procedure) :
         1. Create the Flex+BlazeDS combined app (or, if you want a cleaner project structure, make two separate apps : one Flex and one web app, and configure them correctly -- but this doesn't change anything to the following).
              - Add the EJB3 Factory library (.jar) from Adobe in the WebContent/WEB-INF/lib folder
              - Configure the services-config.xml to declare this factory (see help)
         2. Create the EJB module
              - Create your bean class and its local interface
              - In the bean class, do only use a basic "@Stateless" annotation, do not specify attribute in this annotation (e.g. the name of the bean or its JNDI address)
         3. Configure the remoting-config.xml file to map a destination to your EJB through its local interface (and not the remote one)
              - First, create a local reference from the web app to the EJB class:
                   <ejb-local-ref>
                        <!-- Exact name of the EJB class, or the name specified in @Stateless(name="xxx") - by default, the name attribute of the tag is the name of the EJB class -->
                        <ejb-ref-name>HelloServiceBean</ejb-ref-name>
                        <!-- Qualified name of the local interface of the EJB -->
                        <local>org.sandbox.IHelloServiceLocal</local>
                   </ejb-local-ref>
              - In the remotings-config.xml of the Flex/Web app, use the GlassFish local JNDI reference to this ref-name (e.g. prefix its name with "java:comp/env"):
                   <destination id="HelloService">
                        <properties>
                             <factory>ejb3</factory>
                             <source>java:comp/env/HelloServiceBean</source>
                        </properties>
                   </destination>
         4. Create the enterprise application containing both apps (flex/blazeds + ejb module)
    And that's all ! Deploy all this stuff to your server, and browse to your Flex app and call the EJB through a RemoteObject.
    Hope this helps. If interested, I may post on my (old) blog a full procedure to configure this example in Eclipse.
    Fred.

  • How Can I Get A Flash Movie to Access Local Files

    I have a customer that has created a Flash movie to run off a CD.  The movie is basically a set of menus with links to access local files in the same directory as the movie.  i.e. Main folder (to be root of CD) has the movie, a Documents folder with PDFs, a Movie folder with wmv and mov files, etc.
    The problem arrises when you click on a link to a file, a web browser is launched, and the browser tries to display the target file.  The movie was designed on a Windows system, and, mostly it works in a Windows environment, however, the links totally crap out on a Mac because the URLs are pc centric.
    He is a rookie flash programmer so I am trying to help him set up proper links to the files, so that the files will (hopefully) launch the proper local app and not a web browers.  i.e. if the link points to a PDF, the Adobe Reader is launched; if the link is to a mov file, then QuickTime is launched....
    Is there a way to do this?  All the tutorials I have found all seem to expect the flash movie to be running on a web server, and as such do not work when running the movie off a CD.
    Any help or suggestions would be grealy appreciated.
    A response ASAP would also be greatly appreciated as the customer needs to deliver 200 CDs of the project for a presentation tomorrow morning - I have to create the CDs...
    TIA

    Hi there,
    Maybe you would want to use swfObject, i've been using it for
    a long time now.
    http://blog.deconcept.com/swfobject/
    cheers

  • Reading files from local hard disk - Access Local Files Only

    Hi All,
    I have a local flash file published as 'Access Local Files Only', to allow me to read from local filesystem.
    What methods or classes can I use to read text and other files from the user's harddisk.
    This is the first time I am trying to do something like this, all help is grealy appreciated.
    Thanks
    Andy

    Hi, thanks for the responses
    I did some searching and found that the urlloader class is the right one for the job.
    'Access Local Files Only' option is provided for this very purpose I believe.
    If anyone has done something like this and have some sample code it would be awesome
    Cheers
    Andy

  • When I try to access Local Disk (C) a message pops up on my screen "access denied

    got a problem with my Laptop •Manufacturer: HP •Model :Compaq CQ58
    When I try to access Local Disk (C) a message pops up on my screen “access denied” when I view properties “used space 0 bytes” and “free space 0 bytes” drive c is shaded in blue completely. . .
    Homegroup won't allow me to make changes. Some of messages I came across is “Can't open access control editor” or “your system administrator has blocked you” I can save file on Local Disk (C) and I can't view anything from Local Disk C, I can't install softwares,
    when I try to troubleshoot problems it says Windows can not access C:\Windows\system32\msdt.exe and when I check diagnose it says ”a problem is preventing the troubleshooter from starting.
    I tried to refresh it to factory settings when I click get started “no action at all” even tried the options that says Remove everything and reinstall windows, still the was not action then I tried Advanced Start-up but still it didn't work. . . What can
    I do?

    1. Log in as a local administrator.
    2. Take the ownership of the C: driver.
    3. Add your ID in security and give full access.
    4. Change the NTFS permission back to normal.
    5. Reboot the computer.
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • Access local disk via Java Web Start??

    HI all ,
    I had saw the JWS document.
    It indicate we can't access local disk via JWS in that Security.
    If I need to access local disk by command, does anyone have better suggestion.
    And can I run *.bat via Java Web Start?
    Thanks very much for your help.
    Morris

    I do the both thing but still don't access to Local disk.
    I just write a simple test class within extend another that create a file (and of course sign it)but still can't create a file Local disk. this MAKE ME MAD and LOOSE MY JOB .
    here is my JNLP file:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for Pensionsrechner -->
    <jnlp
    spec="1.0+"
    codebase="file:///d:/"
    href="test.jnlp">
    <information>
    <title>Me</title>
    <vendor>myself</vendor>
    <homepage href="http://www.me.com"/>
    <description> test test test</description>
    <description kind="short">Test creatin of log file on client </description>
    </information>
    <offline-allowed/>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.4"/>
    <jar href="test2.jar"/>
    </resources>
    <application-desc main-class="secMan.Test"/>
    </jnlp>

  • When i drag and drop an image on my site. it gives the following error. "Unable to access local files due to browser security settings. To overcome this, follo"

    I am using the firefox version 17 and when i drag and drop an image on my website. It gives me the following error.
    Unable to access local files due to browser security settings. To overcome this, follow these steps: (1) Enter "about:config" in the URL field; (2) Right click and select New->Boolean; (3) Enter "signed.applets.codebase_principal_support" (without the quotes) as a new preference name; (4) Click OK and try loading the file again. Or go to the homepage for a link to the tutorial on how to do it.
    I have completed the above steps and it is still showing the same error message. Any help would be highly appreciated.
    Thanks.

    Thanks kumars ,
    I have a specific drag and drop area on our website. This works fine for all earlier releases of Firefox after these security settings
    "(1) Enter "about:config" in the URL field; (2) Right click and select New->Boolean; (3) Enter "signed.applets.codebase_principal_support" (without the quotes) as a new preference name; (4) Click OK and try loading the file again."
    Bust these settings not work for me in Firefox 17.
    Yes the drag and drop functionality is java script based and i am not using any script blocker addons.

  • Can firefox support "file:///" format to access local files (note 3 fw slashes) this works for IE but not firefox and is the format used in the "afghan war diary" from wikileaks

    can firefox support "file:///" format to access local files (note 3 fw slashes) this works for IE but not firefox and is the format used in the "afghan war diary" from wikileaks

    See http://kb.mozillazine.org/Links_to_local_pages_do_not_work

  • Accessing local files in Safari for Windows

    I am trying to access local files, such as .doc and .pdf files. I have tried
    file://server/dir/dir/file.pdf, and various numbers of slashes, but all result in Failed to open page messages.
    Any ideas? IE can do this, Firefox won't (easily).
    Chris

    If you wish to view "local" files in any browser just drag the file icon to an empty browser window.
    The "file:///blah/blah" stuff and a URL has ended for security issues.

  • Applet access local file

    I have an applet that access local files and directory.
    I have create the applet policy file.
    When viewing with appletviewer, we can type:
    appletviewer -J-Djava.security.policy=applet.policy MainApplet.html
    However, when I want to embed the applet in a html, how can the policy file be included?
    Thx a lot.

    how can the policy file be included?Applets use the java.policy wich is located in the jre/lib/security
    (C:\Program Files\Java\jre1.5.0_04\lib\security)
    There is a java.security where you can add or change the java.policy files to be
    used
    policy.url.1=file:${java.home}/lib/security/java.policy
    After changing these files make sure the jre loads again, close all browsers
    and open the page.
    Signing applets:
    http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
    second post and reply 18 for the java class file using doprivileged
    http://forum.java.sun.com/thread.jsp?forum=63&thread=409341
    4th post explaining how to set up your own policy with your own keystore
    Still problems?
    A Full trace might help us out:
    http://forum.java.sun.com/thread.jspa?threadID=656028

  • WRVS4400N accessing local services via external IP

    Hello everyone,
    Recently I'm having issues with accessing local services via external IP. Short description of configuration:
    - sub.mydomain.com pointing to my external IP.
    - few web services running on my local server with reverse proxy on Apache 2
    - firewall on router enabled
    - ips on router disabled
    - single port forwarding: WAN 80->Lan 443, WAN 443->LAN 443
    - accessing my services via sub.mydomain.com/service1, sub.mydomain.com/service2, etc
    - I had to create a new rule in internet access policy allowing LAN, any, any to
    Basicaly if I go no matter if I type http or https I will be redirected on 443.
    That configuration has beed working without any issues for a month. Recently I have increased the amount of DHCP users and suddenly it's not working any more. I can still access my services from outside but not from LAN.
    Restarting router does the trick for a while, sometimes for few minutes, sometimes longer.
    Enabling IPS is the way to go but then I'm limited to around 22Mbit/s.
    I did almost everything what is possible to solve this issue, I'm lost and frustrated. I have no idea what happend.
    What I can't understand that it was working, suddenly it's stopped and there are two solutions, either to enable IPS or to restart router which to be honest aren't the solution I'm looking for.
    Please help me point the problem.
    Thank you in advance
    Best regards
    Bartek

    Hi, My name is Eric Moyers. I am a Network Support Engineer in the Cisco Small Business Support Center.
    I recieveed your email and have looked at your posting. This seems like it may be more complicated that what should be handled in a chat. Could you please call into the the Small Business Support Center for support.
    Check the listings on this link and contact the center nearest you.
    http://www.cisco.com/en/US/support/tsd_cisco_small_business_support_center_contacts.html
    If you are in the US, please call 1-866-606-1866, and any answering agent should be able to assist you.
    Eric Moyers
    Cisco Network Support Engineer
    CCNA, CCNA-Wireless
    1-866-606-1866

  • Need to delete local references in unknown calling context

    Hi,
    I was looking for the need to delete local references and came across this documentation,
    What does unknown caller context mean? and how does it cause local references to remain allocated in reference table although the native function returns?
    http://java.sun.com/docs/books/jni/html/refs.html
    5.2.1 Freeing Local References
    You want to write a utility function that is called from unknown contexts. The MyNewString example shown in Section 4.3 illustrates the use of Delete-LocalRef to delete promptly local references in a utility function. Otherwise there will be two local references that remains allocated after each call to the MyNewString function.

    how does it cause local references to remain allocated in reference table although the native function returns?Because it doesn't return to the JVM where it gets deallocated, it returns to the unknown caller context, i.e. some other piece of native code in your JNI layer. So the references remain until the unknown caller context returns to the JVM.

  • Local references and EJBs in separate jars

    Hi
    I have trouble in getting local references when the EJBs are built in separate jar files. I am using the <ejb-link> in the <local-ejb-ref>. But I could not get reference to the EJB's local reference.
    Please let me know if there is any documentation that tells about getting local references and having the EJBs in separate jar files.
    Thanks

    Greetings,
    Hi
    I have trouble in getting local references when the
    EJBs are built in separate jar files. I am using theThere are a number of reasons why this may be happening and without more specific information it is difficult to say which you are encountering... In any case, the fact that your beans are in separate jars is not, by itself, the issue. It is worth noting, however, that Local references may only be used when both components (referencer and referencee) are co-located within the same VM instance and perhaps this little fact may shed some light on your problem??
    <ejb-link> in the <local-ejb-ref>. But I could not get<ejb-link> should point to the actual JNDI binding name, sans root nomenclature (java:comp/env/), but with full sub-context (ejb/myapp/.../MyLocalBean), of the referenced bean.
    reference to the EJB's local reference.Perhaps it goes without saying (but just to be sure :)... of course, your referenced bean must actually have Local interfaces associated with it.
    Please let me know if there is any documentation
    that tells about getting local references and having
    the EJBs in separate jar files.Both the J2EE tutorial and the EJB 2.0 spec. have the relevant information. :) However, I've already listed the requirements above: supplied local interfaces, co-located components, and correct link reference.
    I hope this helps.
    ThanksRegards,
    Tony "Vee Schade" Cook

Maybe you are looking for

  • How do I change the main iCloud account on my iPhone?

    How do I change the main iCloud account on my iPhone?

  • PDF's printing as thumbnails

    User on a laptop printing to a new Lexmark C748de printer, all his pdf's come out as thumbnails, some mirrored. I log in to the laptop and pdf's print normal. Using Window 7 Professional on the company network. User can print to the Dell MFP with no

  • Creating a custom integrator in the 12.1.1 instance .

    i have created a custom integrator and layout using the custom package through API. when i am selecting the custom integrator and downloaded the excel sheet. After entered the details in the layout , click on the add - ins button --> oracle --> uploa

  • Mountain lion problems

    Lost all contacts, sent emails, account settings in Outlook Express after installing Mountain Lion

  • Application files

    can i run applications files created in windows labview on laptops with mac of x Solved! Go to Solution.