Subclassed EJB with RolesAllowed annotation not giving permission

A servlet is calling a method of an EJB (name EJB B). EJB B is a sub class of EJB A which contains the method and is not overridden by EJB B.
EJB A uses the annotation @RolesAllowed({"user","system","admin"})
EJB B uses the annotation @RolesAllowed({"system"})
When the call is made by the servlet the following error is produced:
JBAS014134: EJB Invocation failed on component EJB B for method xxxx: javax.ejb.EJBAccessException: JBAS014502: Invocation on method: xxxx throws exception of bean: EJB B is not allowed
If I replace the EJB A annotation with @PermitAll then the method is called without the permission problem.
I am wondering why the 'system' role allowed in EJB A is ignored in the annotation and the exception is thrown.
Is this a bug perhaps?

Hi Jay Bhaiya,
I am getting the correct output by following the below:
1: Change the SecurityRolesImpl.java to provide the below role that can access the EJB method:
*@RolesAllowed({"TestRole"})*
2: Then build the service as normal using the same build.xml
3: Do not depoly the EAR using ant and try to use the Admin Console to deploy the EAR.
4: While deploying the application through the admin console choose the below option:
Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor.
5: Then create the client stubs using the build.xml
6: Then go to the Admin Console.
Security Realm >> my realm >> users and Groups >> create a user TestUser ( pass- TestUser).
7: Then Click on the RolesAllowedEar under the depolyments tab.
Click on Security >> Roles ..
Create a New Role >>> TestRole.
Click on the Role created (TestRole) >>> Add Condition >>>
Within Add Condition >> select User >> NEXT >>>
Enter TestUser >>> Click ADD .
Click Save.
Now try to access the Web Service using the client code.
Thanks,
Sandeep

Similar Messages

  • Deploying ejb with webservice annotation problem

    I have the following code:
    HelloInf.java:
    package com.bekijkhet;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import javax.jws.WebService;
    @WebService
    public interface HelloInf extends java.rmi.Remote {
    java.lang.String sayHello()
    throws java.rmi.RemoteException;
    Hello.java:
    package com.bekijkhet;
    import javax.ejb.Remote;
    @Remote
    public interface Hello {
    public String sayHello();
    public String sayHelloRemote();
    HelloLocal.java:
    package com.bekijkhet;
    import javax.ejb.Local;
    @Local
    public interface HelloLocal {
    public String sayHello();
    public String sayHelloLocal();
    HelloBean.java:
    package com.bekijkhet;
    import javax.ejb.Stateless;
    @Stateless
    public class HelloBean implements Hello,HelloLocal,HelloInf {
    public String sayHello() {
    return "Hello World!!!!";
    public String sayHelloLocal() {
    return "Hello Local World!!!!";
    public String sayHelloRemote() {
    return "Hello Remote World!!!!";
    When I compile these, add them to a jar and try to deploy them to a standalone oc4j 11g container I don't see the Webservice. I do see the EJB. Why isn't the webservice annotation picked up?
    BTW: I use jdk 6 u03.
    Mvg Andre Broers

    Hi,
    since there is no enterpise manager in OC4J 11 I am wondering how you verifying the non existence of the WebService. Just asking because I need a clue how to verify this issue.
    Frank

  • Calling Glassfish jdbc Datasorce in EJB 3.0 with @Resource annotation.

    I tried EJB 3.0 with netbeans and glassfish and "{color:#ff0000}+_ORACLE_+{color}". I wanted to link the oracle database to GLASSFISH server and I followed the instructions.After I clicked 'ping' button, it displayed as *{color:#339966}'PING SUCCEED".{color}*
    But I couldn't call my datasource from the eje stateless session bean with @Resource annotation.It resulted a dependency injection exception. Can some one tell me how to do this properly.
    {color:#ff0000}Thanks in Advance!!!!{color}

    Frank, yes, I can modify if it is necessary the datasource but, how can I say in the xxxx-jdbc.xml not to use JTA transactions when this data source is called inside a ejb 3.0 method?
    I'm using Jdev11g and the integrated Web Logic Server.
    Thank's

  • Securing an EJB with Annotations

    I would like to build an EJB that uses annotations to secure various functions but the only documentation I have come across is specific to JBoss which uses a custom annotation to specify the security domain. I would prefer to build this in an application server agnostic manner, is there a way in JBoss to specify the domain without using this custom annotation?
    Ultimately the plan is to provide a user interface such that if a user logs in he is presented with a certain set of capabilities and if an admin logs in another set of capabilities. After a user logs in using JAAS is there a way to get the roles that the user belongs to from the Web Tier (i.e. a Flex Client, JSP, Thick Client)? Thanks in advance.

    JaM2003 wrote:
    Thanks for your input duffymo. I would agree that I would prefer to keep these things outside the EJB, but my understanding is that the descriptor files overwrite what is in the EJB so there is no harm in having them there right?No idea.
    My basic issue is trying to authenticate Flex Clients properly. I was unable to find a great deal of information about Flex Clients and JAAS online so I have resorted to building an EJB that does the authentication based on username/passwords given to it. Not as clean as I would prefer but at this point I see no alternative.Good question. I don't know the answer.
    %

  • When I login to my bank, I get the message: 403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied. Have new MacBook Air with Yosemite. How to solve this problem?

    When I try to login to the website of my bank, I get the following error message:
    403 - Forbidden: Access is denied.
    You do not have permission to view this directory or page using the credentials that you supplied.
    I have a new MacBook Air with OS Yosemite installed.
    What is the problem and how can I solve it?

    Some websites require a special client certficate for access. If you don't have that certficate, you'll have to contact the site operator to find out how to get one.
    Sometimes the problem is caused by a web server that is configured to request an optional client certificate. Safari treats the request as mandatory. In that case, other browsers such as Firefox and Chrome may be able to connect to the site, because they ignore the request.
    The first time you were prompted for a certificate, you may have clicked through a dialog that requested access to the Apple certificate in your keychain that is used to secure the iMessage service. In that case, you may be able to regain access to the site in Safari by doing as follows.
    Back up all data.
    Double-click anywhere in the line below on this page to select it:
    com.apple.idms.appleid.prd
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    Paste into the search field in the Keychain Access window by clicking in it and pressing the key combination command-V. An item may appear in the list of keychain items. The Name will begin with string you searched for, and the Kind will be "certificate."
    Delete the item by selecting it and pressing the delete key. It will be recreated automatically the next time you launch the Messages or FaceTime application.
    The next time you visit a site that prompts for an optional client certificate, cancel out of the prompt. You may have to do this several times before the server stops asking.
    Credit for this idea to Christian Braukmueller of SAP.

  • Why when I try to login the Itunes Connect with my Apple ID it always says: "Apple ID does not have permission to access iTunes Connect."?

    Why when I try to login the Itunes Connect with my Apple ID it always says: "Apple ID does not have permission to access iTunes Connect."?

    Look on one of your bank statements and be sure to enter the billing address exactly as it shows on the statement. Some folks forget where they actually get the statement. They put their home address in iTunes/Mac App Store and they actually get the statement at their place of employment or vice versa.

  • When I try to open some pictures in finder with preview I get a message that I do not have permission to open it.  It tells me to go to file - info.  Don't know what to do from there.

    When I try to open some pictures in finder with preview I get a message that I do not have permission to open it.  It tells me to go to file - info.  Don't know what to do from there.

    When you do Get Info for a picture, what does it say in Sharing & Permissions for your username. The Privilege should be "Read & Write"

  • Hi, I have a macbook pro with a new hard drive installed. My WD external drive backup on time machine now wont let me access the files. I get a prompt saying 'you do not have permission to access the files'

    hi, I have a macbook pro with a new hard drive installed and restored. My WD external drive backup on time machine now wont let me access the files. I get a prompt saying 'you do not have permission to access the files' After my new drive was installed I plugged in time machine and it started backing up. I paused it when I realised that it was running for more than a few minutes. I now realise that it probably started backing up the new hard drive all over again. Which makes me think that the original back up must be on the WD back I cant seem to access it. Any ideas would be helpful.

    See E-10 in the first link.
    Time Machine Troubleshooting
    Time Machine Troubleshooting Problems

  • Im trying to update my iphone with ios 5 but, for some reason its not giving me the option to do it? i've restored my phone once like it says do on the website and it hasnt done it? what can i do ?

    Im trying to update my iphone with ios 5 but, for some reason its not giving me the option to do it? i've restored my phone once like it says do on the website and it hasnt done it? what can i do ?

    Are you sure you have a 3GS and not a 3G?  The 3G cannot be updated to iOS5.  What version are you on now?... Settings > General > About > Version

  • How do I register with iTunes without using a credit card it's not giving me a none option???

    How can I register with iTunes without using a credit card it's not giving me a none option!!

    Did you follow these instructions? You have to. Also, you have to use an email addresss that you have not used with Apple before, it has to be a new acciount.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    Question
    I used to be able to copy or drag and drop links from the address window. Now with the update, only the address is copied or dragged not the link. (Says something about not giving site information). I want to be able to drag and drop or copy links.

    To be more precise, you can setup a JComponent or JPanel on top of your JavaFX nodes that has a TransferHandler that can convert the (AWT/Swing) images dragged to the app to JavaFX image and then insert it into the underlying node.
    As for the file chooser itselft: ListView and the JavaFX composer can allow you to create one quite easily. TreeView can aslso be used to a lesser extend (still a big buggy). For both of these, there are small bugs in the Cell API that may (or may not) prevent from displaying a proper thumbnail in the cells.
    You can also use a regular JFileChooser if you do not mind the dialog box having a different LnF from the rest of your application.

  • The below vi is not giving me what I want. If I select 2 with maximum number of 3 then there are 3 array elements display that is correct but if I select 8 with the same maximum number of 3 then only 1 array element display. Why is that?

    The below vi is not giving me what I want. If I select 2 with maximum number of 3 then there are 3 array elements display that is correct but if I select 8 with the same maximum number of 3 then only 1 array element display. Why is that?
    Attachments:
    test2.vi ‏29 KB

    It's because in case 2 you hold the array build result from the previous loop iteration in a shift register...in case 8 you do not...
    You say that if you set the maximum number to three it will produce an array with three elements, that is not correct, it will run when the iteration index is 0,1,2 and 3...resulting in 4 elements. If you want 3 you need to decrement the maximum number to 2. The same goes for case 8.
    MTO

  • My problems started with an error 50 message when trying to download bought films. After un-installing and downloading iTunes, a number of times, I still cannot open iTunes on my PC and keep getting the message "you do not have permission to open"

    I have removed all spyware, anti virus software and removed all iTunes programs - as suggested by Apple. I still cannot open iTunes on my PC because of the message "you do not have permission to open this file, folder"
    I have changed and checked all permissions to allow this but still get the same message.
    iTunes is located on my C drive and I now do not have the neccesary permissions to open it.

    Hey Chris-
    It has been some time since you posted this message and I see you haven't gotten any replies, but  I have the same issue and I was wondering if you figured out how to resolve it.  Hopefully you were able to figure it out. 

  • Can't connect to sharepoint with username and password, keeps telling me I do not have permission?

    I am trying to connect to my sharepoint site via the ms document connection.  I enter in the correct site address and proper credentials, but it keeps telling me that I do not have permission.  What am I doing wrong?
    Thanks for your help!

    What folder? Did you run Disk Utility to fix permissions?

  • When I move this version (3.6.12) to the application folder I get a message saying that I "do not have permission to access some of the items." I am the administrator with read and write rights. Any ideas?

    When I move this version (3.6.12) to the applications folder on a new i-Mac, I get the message that I "do not have permission to access some of the items." I do have read and write rights on all applications and hard drive. Any ideas?

    * Download a new copy of the Firefox program: http://www.mozilla.com/firefox/all.html
    * Trash the current Firefox application to do a clean (re)install.
    * Install the new version that you have downloaded.
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

Maybe you are looking for

  • How do I transfer photos from my PC to my iphone5

    How do I transfer photos from my PC to my iphone

  • 3 or more displays...?

    I have read in numerous places within Apple's documentation and seen in their videos the use of two (2) displays... but is Aperture capable of utilizing 3 or more displays effectively? I currently run four (4) displays; three (3) 20.1" Flat-Panel and

  • Convert HTML TO PDF

    Hello Experts, I need to convert the document type HTM to PDF then send it thru e-mail as attachment, is there any FM for this? I'm looking at this FM CONVERT_ABAPSPOOLJOB_2_PDF, but i think it requires a spool id and the program is required to run i

  • Why doesn't iCloud always sync correctly?

    I get the message that the sync cannot be completed, while before it worked perfectly? Kind regards, Jeska

  • How to run an application

    Dear! Please tell me how to call another application (ex: IE, Notepad...)? thank,