A prefix can be included in the EJB JNDI name dynamically?

In the Stateless annotation, we can specify the mappedName attribute to the EJB JNDI name bind.
Can we specify a prefix to the mappedName separately?
For example: We have this:
@Stateless(mappedName="myEJB")And don't want to do this:
@Stateless(mappedName="prefix/myEJB")We want to include the prefix in another place in the code dynamically.
Can we do that??

jtahlborn wrote:
eudesf wrote:
Hello! Thanks for reply!
As I can't configure programatically, there is any way to configure in an application descriptor, or in another place of the application server?
The idea is to publish two applications that use the same EJB classes, but in different JNDI namespaces, because we don't want to share the resources. Otherwise, it will result in JNDI name conflicts. The applications works in different contexts and we want to reuse the existing EJB definitions.
Any suggestion?yes you can do this. ejb 3.0 keeps the features from 2.1, namely all the xml based configuration (although it is now optional). and, the annotations are always overriden by the xml configuration. thus, you can create different deployments with different the same compiled class files. you just need to override the annotation configuration with xml configuration (via ejb-jar.xml or whatever).Yes, we can do that. I've tested here, and it works. But, can we do better?
The configuration via XML implies maintenance, and it's not good, because we have so many EJBs to maintain.
And there is another problem... The EJB classes are in JARs, and these JARs are shared across the applications.
Pretend that you have to maintain two versions of each EJB JAR. One with XML configured and other without. If we change one, the another must be changed too. How can it be productive?
I have seen some EJB implementations that are more flexible with JNDI naming.
See:
- [http://openejb.apache.org/jndi-names.html|http://openejb.apache.org/jndi-names.html]
- [http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html|http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html]
Does it have a better solution in Glassfish?

Similar Messages

  • Limitation that only 1000 records can be included in the "IN" clause

    In RapidSQL we have a limitation that only 1000 records can be included in the "IN" clause - is there a way to give more than 1000 records so that it will reduce the execution time.

    Why do you need to list more than 1000 individual items in the first place? That's generally not a good way to go about building a query.
    You can always include a query that returns as many rows as you'd like in an IN clause, i.e.
    SELECT *
      FROM some_table
    WHERE some_column IN (SELECT some_column FROM some_other_table)So if you throw the thousands of values you want in the IN list into a table, you could then query the table in your IN clause.
    From a performance standpoint, of course, you may also want to look at the EXISTS clause depending on the relative data volumes involved.
    Justin

  • I just bought a ipod touch. I am unable to use it because itunes tells me I have no internet connection (unknown error 306). I have tried all the suggestions I can find, including checking the firewall, the no proxy server is checked, resetting cache on i

    I just bought a ipod touch. I am unable to use it because itunes tells me I have no internet connection (unknown error 306). I have tried all the suggestions I can find, including checking the firewall, the no proxy server is checked, resetting cache on itunes, I even scanned the computer with Registry Easy but nothing worked.  I use Mozilla Firefox and have a PC with Windows 7. Obviously, buying a ipod and being unable to use it for 3 days (and counting) because I am unable to register it, is pretty frustrating. Can anyone help?

    Did you try all of this:
    iTunes Store loads partially or returns "Error 306" or "Error 10054"
    Proxies, parental control settings and software, security or filtering software, or a bad iTunes Store cache can cause this.
    To address proxies, Remove Internet Options proxy settings and connect to the Internet without a proxy.
    To reset iTunes Store cache:
    In iTunes, choose iTunes > Preferences (Mac) or Edit > Preferences (PC).
    Click the Advanced tab.
    Click the "Reset cache" button.
    Click OK and see if the issue is resolved.
    Adjust Parental Controls in iTunes:
    Open iTunes.
    Access iTunes preferences:
    On a Mac: From the iTunes menu, choose Preferences.
    On a Windows PC: From the Edit menu, choose Preferences.
    Click the Parental Controls tab.
    Remove restrictions on Parental Controls.
    For more information on parental controls or content filtering software, see iTunes 10.5 for Windows: May see performance issues and blank iTunes Store.
    For more information on other security software, see iTunes: Troubleshooting security software issues.

  • How can I refer to the PhotoShop Object library dynamically depend on the release of PhotoShop?

    Recently, I make a program, now I face a big program:
    I make the program by visual basic and photoshop script , but my client have different release of Photoshop, for example : photoshop 7.0 cs and cs2. I know every release of PhotoShop have ist own Object library, but in visual basic 6.0, I can only refer to one PhotoShop Object library. for example: if I refer to Photoshop 8.0 Object library, if my clients release of Photoshop is 7.0. there will be a error message : Run-time error '429 ( cant create object) Run-time error '430(Class does not support Automation or does not support expected interface), How can I refer to the PhotoShop Object library dynamically depend on the release of PhotoShop?
    my email is : [email protected] .
    any suggestion?

    Please read, and reply back here with information https://forums.adobe.com/thread/1499014
    -and try some steps such as changing browsers and turning off your firewall for downloads

  • Could take the same JNDI-names for both tags: jndi-name and local-jndi-name

    Hello!
    I try to design the weblogic-ejb-jar.xml descriptor and I ask myself, if I could
    take the same JNDI-names for both tags:
    <jndi-name> and <local-jndi-name> ?
    Could you give me and advice if this is ok?
    Thanks

    if you have two separate interfaces, you cant bind them to the same jndi
    name. you will have a local home that extends EJBLocalHome and a remote
    home called EJBHome. also you need to know which one you are looking up
    so you can cast it properly, and use it property (remote interfaces need
    PortableRemoteObject, remote parameters are passed by value, ...)
    joern kirch wrote:
    Hello!
    I try to design the weblogic-ejb-jar.xml descriptor and I ask myself, if I could
    take the same JNDI-names for both tags:
    <jndi-name> and <local-jndi-name> ?
    Could you give me and advice if this is ok?
    Thanks

  • Ejb - jndi name

     

    You do not specify JNDI name at console but in deployment descriptors.
    "Ronak Parekh" <[email protected]> wrote in message
    news:[email protected]..
    what is the jndi name for the EJB? Where do you specify the EJB jndi namein
    the console?/
    Ronak

  • Can a client call the ejb callback methods directly????

    Is there any way using which client can call the ejb callback methods directly.
    ie in the client program i want to call ejbPassivate/ejbActivate?? is there any way of doing the same

    short answer: yes, pass a reference of the ejb (bean class) to the client. This will not do what you expect however and hopefully with generate an error that you should read as "don't do this".
    better answer: you are no longer doing ejb development if you do this. those methods exists for the container to interact with your bean and are NOT meant for clients. You should NEVER do what I suggest in my "short answer".

  • I have a new ipod and when I sign in to Words with Friends it says that user name is already in use. How can I continue using the same user name with a different ipod?

    I have a new ipod and added all my apps to it. When I sign in to Words with Friends it says that "user name is already in use" because it is linked to my old ipod. How can I use the same user name with my new ipod?

    Was the iPod setup via iTunes on this computer?
    Setup via wifi?
    Was the iPod previous synced to another iTunes library/computer?
    Have you successfully synced from this iTunes library/computer before?
    Do the songs play in iTunes?           
    Do you have the right boxes checked to sync?
    iTunes: Syncing media content to iOS devices and iPod        
    Try syncing using the manual method                 

  • Can you refer to the original host name when using a challenge redirect?

    I have an authentication scheme that uses a challenge redirect to cause authentication to happen using https instead of http. However, this seems to break some of our monitoring scripts because now the credential challenge is coming from a different host name. Is it possible to refer to the original host name with some type of variable in the challenge redirect parameter? Below is an example:
    1. User accesses secured URL at http://appstenv2.company.com/testurl
    2. This webserver is hosting several aliases (appstenv2.company.com, appstenv4.company.com, appstenv6.company.com) and has a main name of appsdev.company.com - but is a single apache webserver where there is an application server plugin installed which will route to the desired application server environment based on the original hostname. So if a user accesses it with a name of appstenv2.company.com/testurl they will be routed to the "test 2" environment application server. If they access it as appstenv6.company.com, they would be routed to the "test 6" environment application server.
    3. This webserver listens on both http and https.
    4. The current challenge redirect can only redirect to a specific URL so it is set to "https://appsdev.company.com" which works fine interactively but the recorded monitoring scripts suddenly see a new hostname doing the prompting for credentials even though it is the same webserver - just a different alias.
    5. If possible, I would want to do the redirect in a relative fashion rather than absolute by using the original hostname from the URL being accessed. So, if the user was accessing http://appstenv2.company.com/testurl, I would like to redirect to https://appstenv2.company.com for the basic authentication. but with the same authentication scheme, if the user accesses http://appstenv6.company.com/testurl, I would want the challenge redirect to go to https://appstenv6.company.com. I'm hoping it's possible to use some system variable like SERVER_NAME to do this.
    Challenge Redirect: https://$SERVER_NAME
    Does anyone know if that is available in OAM 10.1.4.3 or some other way to accomplish the same thing with a single authentication scheme?

    No, there are not multiple policies - the host names for all aliases on that single webserver are together in a single host identifier. And I realize I can only have a single challenge redirect, I just want to use a variable to redirect to the host name that was accessed as opposed to a static name.

  • How can I pass the web template name dynamically to a container

    Hi Experts ,
    I have a container web item in 7.0
    I would like to pass the name of the web template to be displayed in that web item dynamically .
    how can I achieve the same .
    How can i change the visibility settings of a container using a javascript .
    Thanks in advance for your help .
    Regards
    Nikhil

    Hi Nikhil,
    When you say that you want to display the name of the template for the container item, I think you are talking about the tray caption for the item - is that correct? You can use a text item to access the web template name, but in the caption of the container item, you cannot specify other web items.
    What you can do it to use a group item in the template and embed your container layout in it. In the group item, you have an option of specifying a caption using another web item where you can reference this text item.

  • Illustrator can't work properly: "the filename, directory name, or volume label syntax is incorrect"

    When I run Illustrator there is a "New Features" pop up window, I click on "see all the new features", it popup a blank notepad and another system new message: "the filename, directory name, or volume label syntax is incorrect". Also when I try to use Typekit fonts it happens the same thing...
    Already cleared with CC Clearer, installed Extension Manager to see if its conflicting, but my Illustrator can't work properly.

    Moving this discussion to the Illustrator forum.

  • Can Nokia 6233 say the Caller's Name?

    I have a friend who uses N80 and whenever someone calls her, her phone can say the caller's name. I wanted to know wether it works with my one, 6233, too, coz i think its a really cool feature and i love it. Or is it only possible for phones with symbian, like her one?

    So far only the newer symbian phones support this feature.

  • Default ejb JNDI name in websphere ear

    Hi,
    I am using ejb2.0-2.1 in websphere 6.0 WAS.
    I have a local entity ejb.
    I wish to define a service locator for this as a singleton class that caches the entity bean's home after doing a JNDI lookup.
    I am interested in two things.
    1) Since my service locator is a simple singleton class I want it to lookup the local ejb homes using the JNDI names supplied in the websphere specific deployment descriptors correspondiing to ejb-jar.xml. (No point in even thinking of any ejb-local-ref) My service locator is defined inside the same ejb jar.
    2) Ideally I would like to not specify any explicit JNDI names in any websphere specific DD for the local ejb homes. I would like to use a JNDI name based on the ejb-name itself.
    I have been able to do 2) using JBoss.
    Thanks.
    Raster

    Hi Ravi,
    Can you please post the error message and stack trace? Also what version of WLS are you
    using? The more relevant information you can give me, the more likely I'll be able to
    help you.
    - Matt
    ravichandran wrote:
    Hi Matthew,
    Thank u for very quick response, the error is class cast exception and these objects
    are serialized and kept in ear. ur solution will be highly appreciated.
    regards
    ravi
    Matthew Shinn <[email protected]> wrote:
    Hi,
    What error are you getting (please include full error message & stack trace)?
    Also,
    is the object you are returning Serializable?
    - Matt
    ravi wrote:
    Hello Daniel
    I also have the same problem, do u have any solutions, please let me know,I was
    struggling for more than ten days.
    regards
    ravi
    [email protected] (Daniel) wrote:
    Hi, there:
    Our team is trying to write a session bean as a factory to serve
    other beans. Even the JSP (or other clients) can find the correct
    session bean residing on different ear file, the factory can't return
    properly when the returning parameter is a java object (it works fine
    if we only return int/string/etc). Is there a work-around to make
    these work?
    Thanks,
    -Daniel

  • Session EJB JNDI name

    Hello all!
    I created this SLSB:
    @Local
    public interface CatalogServiceLocal {
         public float getCatalogVersion();
    @Stateless(name="CatalogService")
    public class CatalogService implements CatalogServiceLocal {
    I'm using JSF and I want to access my SLSB from a Managed Bean but the server always complains it didn't find the given name:
    this.catalogService = (CatalogServiceLocal) ctx.lookup(JNDI_NAME);
    I tried a lot of different names (CatalogService, ejb.CatalogService...). How can I know the correct name for the lookup. I searched for it in the admin console but I didn't find it either.
    Thank you very much!
    sitaro

    Hi Sitaro,
    Please refer to the following links... you will get information about how to lookup Local EJB3...
    http://jaysensharma.wordpress.com/ejbs_weblogic/
    http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/
    Here you will get the information of Customizing The JNDI name and to look them up.
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com/  (WebLogic Wonders Are Here)

  • Surfacing the properties jndi name that we give in the database adapter

    hi all,
    I would like to know, how can we surface the properties in Oracle 11G,
    like how to surface the JNDI name that we give in the database adapter.
    I have already seen the Chapter 12 example from "Getting started with Oracle SOA suite 11 G"
    but it is talking about file adapter "Modifying the file naming convention and the destination directory"
    please advice
    thanks
    Yatan

    please help me how to do this.
    thanks
    Yatan

Maybe you are looking for

  • Stylus for the Stream 7 and Windows 8.1

    Ok, honestly I'm much more of a Mac guy these days, and used iOS since it's earliest incarnations.  Got the Stream 7 due to cost and curiousity. What I've noticed is that with this size screen - it is almost impossible to use the desktop apps due to

  • Dynamically adding a repeating subform is not working in Guided Procedures

    Hi, I created an Adobe XML form file (.xdp) with a button and a subform. In the button click event I wrote javascipt to add a new subform. This is working fine from the PDF preview with in the Adobe Live Cycle Designer.  Then I used this template in

  • Problem in the Tutorial

    Hi all, Someone had accomplished the Tutorial coming with Designer 6i R2 ? I am now in the "Generate a working form" step. I have done all the things required in the tutorial. The generation of forms fails with a lot of warnings and one error message

  • Error or tickets

    please correct me if i were wrong. after implementation if there is problem or error in handling transations in MM, does a end user raise a ticket or does a support team analyse the problem and raise ticket. does end user inform the trouble through o

  • Trying to access a file from a host that is not available

    If I try to access a file on a host that is not available/unreachable, it hangs up for about 5-10 minutes. Is there any way to speed this up? I am using JDK 1.4.2 String filename = "\\\\ip\\myFile.txt"; // ip address is unreachable File f = new File(