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.

Similar Messages

  • 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

  • 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

  • [dev] Tools to manage/access local dev siebel adaptive db server?

    Tried to use SQL Developer with Sybase jdbc jar, plus correct config on tcpip + port etc. for dbeng9.exe command. Port connected fine with telnet. But login fail with SQL Developer.
    I'm hoping to able to access the local DB directly, and drop corrupted tables with constraints error that cannot sync with server DB!

    Hi,
    to access local database, you can use the dbisql tool in \bin folder where your Siebel is installed.
    Regards.

  • How can i access privacy setting from ipad3 to access local photos?

    when i try to access my localphotos, it says that i can enable the access on privacy setting, how do i get there?

    The only options I have on settings are:
    My account, preferences, facebook, help, and about.
    When i go to preference, all i have is product improvement, presentation mode and access local photos.
    I enabled "always use native photo brower" however, there is no privacy setting there.
    When the app was first installed, I clicked "dont allow" by mistake when prompted to use local photos, can i get that restored or what would i need to do...
    Thanks,
    Eli

  • I can not access local pics on my z10 via BlackBerry express and other apps that can share pics.

    While sharing or editing or using pics on apps such as BlackBerry express Whatsapp bbm etc,I cannot access local pictures. When I tap on add picture or share picture, the light gets dim for a second so as to open gallery but nothing happens then. My z10 is running on bb 10.2.1.3062

    In Disk Utility, you should see an icon in the drive list representing the external drive. Below that is an icon for each volume on the drive. One of those is the Time Machine backup volume. If there are no others, then there is no other data on the drive, at least none that you can get to.

  • Read DB MS Access localiced in my own SAP Server

    Dear all.
    I'm trying to read a DB MS Access localiced in my SAP server, but I don't know what connection string I must to put in DataSource..., I try a lot of things but not ok ... and all examples that I have seen allways call to local path or accesible by user path, not server path...,
    Can you help me??... Is there any FM that I can get the path server and put in it??
    I mould to do it throught ODBC and Native SQL??
    Noted the path where is in the DB Access it's not accesible by the users.
    MDB Connetion Infomations u2026.
    CONCATENATE u2018Provider=u2019 u201Du2019Microsoft.Jet.OLEDB.4.0u201Du2019 u2018;u2019
    INTO SQL.
    CONCATENATE SQL u2018Password=u2019 u201Du201Du201D u2018;u2019
    INTO SQL.
    CONCATENATE SQL u2018User ID=u2019 u201Du2019Adminu201Du2019 u2018;u2019
    INTO SQL.
    CONCATENATE SQL u2018Data Source=u2019 u201Du2019myserver\usr\db_access.mdbu201Du2019 u2018;u2019
    INTO SQL.
    CONCATENATE SQL u2018Mode=u2019 u201Du2019Share Deny Noneu201Du2019
    INTO SQL.
    Thks for all.

    As those tables are from SQL Server, as you don't tell how you "imported" them, etc etc, the only advice I can give is:
    . Use proper case
    . Enclose table name in "
    . teset with select *
    e.g.:
    SELECT * FROM CAT
    TABLE_NAME
    aBcDEf
    SELECT * FROM "aBcDEf";Try it out!
    Yoann.

Maybe you are looking for