Exposing local entity beans to web tier?

Hello all,
I have a question concerning basic design issues with EJB and the JSP presentation
layer. Currently, I have designed a system using all local component interfaces
of EJB 2.0. I currently have the following architecture in place:
EJB --> Servlets (WebWork Actions) --> JSP
I'm utilizing the session facade design pattern where the business logic in encapsulated
in session beans, which internally access the entity beans, etc. However, I am
doing something of the following:
sessionBean.getUserAccounts() which returns a Collection of actual UserAcountLocal's.
I then am passing this collection off to the JSP just to cycle through each entity
bean and display the data via its getXXX() methods. No modifications to the entity
beans are being done directly in the Actions/JSPs, rather they are modified through
methods of the session beans. Now I know that there is the concept of DTO (Data
transfer objects), which send the data from the particular entity bean to a regular
java bean for presentation. I know that DTO's increase performance if one is using
remote interfaces, because there is less network traffic that occurs via that
transport method. However, I know that WebLogic performs excellent caching of
entity beans, so that multiple invocations of get() methods on entity beans will
not make a trip to the database each and every time the get() method is called.
So, my question is: Is it "safe" to continue with the current way I am designing/coding
the system? I just find it a bit tedious to create value objects for each and
every entity bean, if I know that I will not be calling setXXX() methods from
within the presentation layer. Also, with EJB 2.0 and the introduction of local
component interfaces, it seems that issues regarding limiting the amount of network
traffic don't seem to be so relevant. Any suggestions/tips are appreciated. :-)
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669

use dtos
the main reason is that if you call a getXXX() method on a local or remote
interface from your servlet then that bean is retrieved again (as the
servlet is outside the transaction involved in the initial retrieval)
For example if you retrieve 100 users and want to display them in a html
table with the user id, first name and lastname then there end up being more
than 300 SQL statements executed (this is unless your ejbs are readonly)
If you have a tool (like sql server profiler) that traces sql statements i
recommend you use it to see the staggering amount of sql statements that are
being executed by your current code - then DTOs will look much more
appealing (it worked for me) :).
I would also recommend using dtos when performing updates. Basically work
towards your servlets never directly accessing anything entity bean related.
Some people extend this further and have the DTO as the single argument in
the create method of an entity bean - I havent done this yet myself but it
looks like a good idea to me.
"Ryan LeCompte" <[email protected]> wrote in message
news:[email protected]...
>
Hello all,
I have a question concerning basic design issues with EJB and the JSPpresentation
layer. Currently, I have designed a system using all local componentinterfaces
of EJB 2.0. I currently have the following architecture in place:
EJB --> Servlets (WebWork Actions) --> JSP
I'm utilizing the session facade design pattern where the business logicin encapsulated
in session beans, which internally access the entity beans, etc. However,I am
doing something of the following:
sessionBean.getUserAccounts() which returns a Collection of actualUserAcountLocal's.
I then am passing this collection off to the JSP just to cycle througheach entity
bean and display the data via its getXXX() methods. No modifications tothe entity
beans are being done directly in the Actions/JSPs, rather they aremodified through
methods of the session beans. Now I know that there is the concept of DTO(Data
transfer objects), which send the data from the particular entity bean toa regular
java bean for presentation. I know that DTO's increase performance if oneis using
remote interfaces, because there is less network traffic that occurs viathat
transport method. However, I know that WebLogic performs excellent cachingof
entity beans, so that multiple invocations of get() methods on entitybeans will
not make a trip to the database each and every time the get() method iscalled.
So, my question is: Is it "safe" to continue with the current way I amdesigning/coding
the system? I just find it a bit tedious to create value objects for eachand
every entity bean, if I know that I will not be calling setXXX() methodsfrom
within the presentation layer. Also, with EJB 2.0 and the introduction oflocal
component interfaces, it seems that issues regarding limiting the amountof network
traffic don't seem to be so relevant. Any suggestions/tips areappreciated. :-)
>
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669

Similar Messages

  • BC4J DAOs vs. Local Entity Beans

    We are beginning a brand new project and trying to evaluate the costs/benefits of using BC4J entity objects versus local entity beans for our persistence needs.
    I've read the "Simplifying J2EE and EJB Development with BC4J" white paper including the "How Does EJB 2.0 Change the Picture?" section, but that seems to have been written at a time when EJB 2.0 support was a rarity.
    I'd like to get some feedback from people who have had experience with both. We are basically starting this application from scratch, although we have relational tables from our legacy C++ application that will serve as the basis for the Java object model. So what would we gain/lose by using entity objects?
    I must admit, I'm leaning toward using entity beans over a vendor-specific persistence framework, but if there are compelling reasons to choose entity objects (besides those mentioned in the white paper), I'd like to hear them. Please speak slowly, as I'm new to BC4J. :)
    Thanks for your time.

    I've read the "Simplifying J2EE and EJB Development with BC4J" white paper including the "How Does EJB 2.0 Change the Picture?" section, but that seems to have been written at a time when EJB 2.0 support was a rarity.IMO there's no change.
    What Sun doesn't tell you in the specs, but is much talked about on theserverside.com and in most
    anti-patterns threads, and in the up coming book J2EE Anti-Patterns; EJB Entities are basically
    broke with no solution. Reason: EjbStore() can throw an exception due to DB constraint violation
    after the business method returns. This drives the scenario where all business integrity is
    forced up into the middle tiers (EJB and business mediator tiers). etc etc ... EJB Entities are
    useful for the 5% to 1% of a business model and application that is transactional IMO.
    I.E. 95%++ of most apps/web sites are read only. Why use a heavy and expensive transactional
    component for reading rows from a DB to be displayed on an Inventory screen? The only reason
    to do this is if you have stock in Sun and your appserver vendor or want your project to last
    forever or get canceled. -- Seriously, do your home work, using Entities as your persistance
    tier mediator, for the 95% of your project that's read only, and for reports which involve
    joins, select criteria etc etc will be a serious problem to just code and even bigger problem
    to be responsive and scalable.
    Do this experiment: implement a report that joins several tables, selects on where criteria,
    orders by some attribute in EJB Entity bean technology. Seriously try to code this solution.
    Hint: spray water on your appserver box since it'll almost explode. :)
    Then try: do the same report in SQL. One SQL statement usually will do it and it's all in the
    DB. The data returned to the middle tier is ready for JSP formating.
    Try another EJB experiment: implement a finder based on criteria that returns a Collection.
    Do the same in SQL: time the perf difference.
    Hint: Maybe you're getting the picture, that EJB Entity 2.0 --> 10.0 what-ever, never wrote into
    the specs any means for joins, or high perf finders based on criteria.
    My opinion and experience: EJB Entity is good for one portion of a project if that; the single
    part that's transactional (usually the shopping cart or similar). All other data access needs
    to be through a DAO tier that's SQL based. With BC4J you get transactional support too, so
    why bother with EJB, except to be wrapped by SLSB's for remotability from the client.
    I'd like to get some feedback from people who have had experience with both. We are basically starting this application from scratch, although we have relational tables from our legacy C++ application that will serve as the basis for the Java object model. So what would we gain/lose by using entity objects? I'm at the end of phase one of a medium scale BC4J project which was initiated after scrapping
    a Sun Blueprint J2EE 1.2 architecture for the above reasons, plus the unmentioned time to market
    issue. We found hand coding the Sun architecture to be 400% slower, if you don't hit any of the
    above mentioned bumps in the road. We never got to reports, which would have been imposible without
    custom DAOs.
    I must admit, I'm leaning toward using entity beans over a vendor-specific persistence framework, but if there are compelling reasons to choose entity objects (besides those mentioned in the white paper), I'd like to hear them. Please speak slowly, as I'm new to BC4J. :)You're not the first to ask this question nor the last. Sun's happy talk in the face of their
    king has great cloths sell job to fend off .net will take more than just J2EE Anti-patterns books
    to displell. Try the reports and finders experiements in EJB 2.0. You'll no doubt learn alot
    and read more news group posts in the process.
    Heck, you might even discover that 903 oc4j's CMR and EQL can instantiate 1000's of Entity beans,
    JNDI entries, return a Collection of handles, your client get the ValueObjects and build a report
    in less than a minute and 100's of customers can do this simultanteously. __NOT__ :)
    Cheers,
    curt

  • Business components mapped to EJB 2.0 local entity beans

    Hi ,
    I read about the new feature in JDev 903 that is "Creating business components mapped to EJB 2.0 local entity beans". but I am not able to find any documentation on it.can anyone provide me any link or help on this topic.
    Thanx,
    Prasoon

    Prasoon -
    For JDeveloper 10g, version 9.0.5.1, there is information on this topic located in the help:
    Building J2EE Applications >
    Working with the Business Tier >
    Developing Enterprise JavaBean Applications >
    Using Business Component Entity Facades
    Hope this helps,
    Lynn
    Java Tools Team

  • Error deploying entity bean on web logic server

    i am trying to deploy a container managed persistence entity bean on web logic server when i run the command ejbc which generates the final jar file ready to deploy having its stub and skeleton it gives me the error that the return type of create(int) method should have a type of bean home interface while in accordance with ejb1.1 specicication it should be the type of primary key and a null value should be returned.
    plz let me know where i am doing it wrong.

    thanks for ur quick response sir i am using this services provided by sun microsystem first time and
    am really thankful to Sun Microsystem for this great deal of help to the new commers but sir my problem is still there.
    following is the method which i have written in the code
         public InvoicePK ejbCreate(int id)
              this.id=id;
              return null;
    and here it is the error generated by the server deployment tool.
    [9.2.8] In EJB Invoice, the return type for the create method create(int) must be the bean's remote interface type.
    [9.2.8] In EJB Invoice, the findByPrimaryKey method must return the Entity bean's remote interface type.
    [9.2.8] In EJB Invoice, the return type for the method findByPrimaryKey(com.swi.InvoicePK) must be the entity bean's remote interface type (for a single-object finder) or a collection thereof (for a mult-object finder).
    the detail of files created by me are as follows.
    1. Invoice (Entity Bean)
    2. InvoicePK (Primary Key file)
    3. MyRemoteInterface (remote interface for entity bean)
    4. MyHomeInterface (home interface for entity bean)
    plz let me know where i am doing wrong and oblige.

  • Calling Local Entity Beans from another Application

    Hi,
    I packaged all my Local entity Beans in 1 single Application (APP1.EAR).
    I then I have another Application (APP2.EAR) which is made of Session Beans which require access to the APP1 application.
    I'm using this code to achieve this:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "manager");
    env.put(Context.PROVIDER_URL, "ormi://<host>/APP1");
    context = new InitialContext(env);
    ... (BeanLocalHome)context.lookup("java:comp/env/ejb/BeanLocal");
    I get the Following Exception:
    javax.naming.NameNotFoundException: java:comp/env/ejb/BeanLocal not found
    1) is there any problem with this code?
    2) can local interfaces be accessed by another Application (or can they be accessed only by the same application) ?
    Regards.
    giuseppe.

    Hi ,
    thank you for your answer.
    I'm still in trouble:
    these are the steps:
    App1.jar entity beans.
    App2.jar Session bean.
    I embedded the App1.jar into the App2.ear
    dir :
    App1.jar
    App2.jar
    application.xml (added the App1.jar)
    then I added this in the ejb-jar.xml deployment descriptor for App2.jar
    <ejb-link>../App1.jar#BeanName</ejb-link>
    for each entity bean.
    But I still get :
    javax.naming.NameNotFoundException: java:comp/env/ejb/BeanNameLocal not found
    java.lang.Object com.evermind.server.ApplicationContext.lookup(java.lang.String, boolean)
    ApplicationContext.java:110
    java.lang.Object com.evermind.server.ApplicationContext.lookup(java.lang.String)
    ApplicationContext.java:66
    java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
    What am I missing ??
    Thanks.
    giuseppe.

  • Cannot lookup local entity bean through JNDI

    I have an local entity bean with local-jndi-name as "ejb/Address". After deployed
    to WL 8.1 server and tested on the Admin page, I got:
    The EJB Address has not been tested successfully. There was a problem determining
    the JNDI Name of the given bean.
    When looking up this bean by:
    Object ref2 = context.lookup("ejb/Address");
    or
    Object ref2 = context.lookup("java:comp/env/ejb/Address");
    or
    Object ref2 = context.lookup("/ejb/Address");
    I got the same error:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    remaining name: /app/ejb/iitga_ejb.jar#Address/local-home
         at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
    -- Failed initializing bean access.
    Has anyone successfully deployed/lookuped local entity beans in WL 8.1 server?
    Thanks,

    Does the ejb have a jndi binding?
    "Henry Niu" <[email protected]> wrote:
    >
    I have an local entity bean with local-jndi-name as "ejb/Address". After
    deployed
    to WL 8.1 server and tested on the Admin page, I got:
    The EJB Address has not been tested successfully. There was a problem
    determining
    the JNDI Name of the given bean.
    When looking up this bean by:
    Object ref2 = context.lookup("ejb/Address");
    or
    Object ref2 = context.lookup("java:comp/env/ejb/Address");
    or
    Object ref2 = context.lookup("/ejb/Address");
    I got the same error:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
    remaining name: /app/ejb/iitga_ejb.jar#Address/local-home
         at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)
    -- Failed initializing bean access.
    Has anyone successfully deployed/lookuped local entity beans in WL 8.1
    server?
    Thanks,

  • User threads and local entity beans

    I have started a background thread to handle transferring large files via ftp. This thread needs to be able to access the entity beans via a local interface (to log its progress). I have started oc4j with -userThreads (debugger -Doc4j.userThreads=true) and I get the NameNotFoundException when trying to find the beans via a local home interface.
    The code looks like this:
    <code>
    InitialContext context = new InitialContext();
    JobLocalHome home = (JobLocalHome)context.lookup(JOB);
    JobLocal job = home.findByPrimaryKey("java:comp/env/ejb/JobLocal");
    </code>
    This code works perfectly when called from the context of another bean, but not from the background thread. Can background threads use local interfaces? Or do I have to have remote interfaces on these beans just to allow the background thread to operate?

    Hi - Resolved this one
    The Target for the compiler was set wrong in Jdeveloper!!!
    Set to "default" resolved this
    Tks

  • Difficulty deploying Entity Bean in Web.ser.5.1

    I am trying to deploy the Container managed Entity beans in Weblogic
    App.Server5.1.But while using the command "java weblogic.ejbc source.jar
    target.jar" I get the following error
    ERROR: Error from ejbc: [9.2.8] In EJB Beans, the home interface must
    define the findByPrimaryKey me
    thod.
    ERROR: ejbc found errors.
    I am not familiar with the
    xml deployment descriptor.I used the xml files from the weblogic
    examples and modified it to fit my example.
    Can anyone help me out.

    From what the message says, your EJB has to define a findByPrimaryKey
    method. It does not. You should make sure that it does.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Manjunath Kalmani <[email protected]> wrote in message
    news:[email protected]..
    I am trying to deploy the Container managed Entity beans in Weblogic
    App.Server5.1.But while using the command "java weblogic.ejbc source.jar
    target.jar" I get the following error
    ERROR: Error from ejbc: [9.2.8] In EJB Beans, the home interface must
    define the findByPrimaryKey me
    thod.
    ERROR: ejbc found errors.
    I am not familiar with the
    xml deployment descriptor.I used the xml files from the weblogic
    examples and modified it to fit my example.
    Can anyone help me out.

  • Multiple instances of the same entity bean?

    I am designing a J2EE application that is made up of a number of separate components that each have a well-defined responsibility. Each component is made up of one or more J2EE components (web clients and EJBs). I want to design the application such that it is easy in the future to deploy each component (or a group of components) on different servers. In order to do this I need to make sure that the interfaces between each component are exposed as remote interfaces (but I will use local interfaces inside each component). However, there are a number of entity beans that need to be accessed by more than one component. I am wondering how best to expose these entity beans. I believe there are a number of options:
    1. Expose remote interfaces on each of the shared entity beans. The disadvantage of this approach is that it is inefficient and that I will not be able to take advantage of container managed relationships. (I am intending to use container managed persistence.)
    2. Create a facade object (stateful session bean) for each of the entity beans which exposes a remote interface and in turn accesses the shared entity beans locally. The disadvantage of this approach is that I have to create some extra EJBs and that I cannot directly make use of container managed relationships etc from the client component.
    3. I don't know if this is an option but I am wondering whether I can deploy a copy of each shared entity bean with each application component. The advantage of this approach is that the component would access the entity locally and could make use of container managed relationships. However, I don't know what the issues are with having more than one instance (per primary-key) of an entity in the same application. I don't know whether this would cause errors of whether they would get out of sync (because different instances with the same primary key would be updated by different clients). Initially each component would be deployed in the same server but later they would be deployed in different servers. In both cases with this option each component (JAR) would have copies of the shared entity bean classes.
    Any suggestions as to the best approach and whether the last option is feasible would be much appreciated.
    Thanks.

    I think 2 beats 1. The main reason being to minimise the number of network calls. You're basically asking, are fascades a good idea? and the answer is yes.
    You can obviously do 3 in different app servers. However you'll need to configure your app servers so they can handle the fact that they're not the only ones updating the database. This is to handle concurrency as you mentioned. How you do this will depend on your app server and will affect performance, but shouldn't be a problem.
    I think you should definately decide up front what's going in different app servers, I dunno if 3 would work in the same app server.
    Why do you would want to use multiple app servers?
    Why not have everything in the same app?
    Is is just the 1 database?
    You can use clustering for scalability.

  • How to persist local entity reference?

    I had a remote entity bean A hold a reference to a remote entity bean B's handle. Now I change them to local entity beans. But Local entity bean doesn't support Handle and I found local entity stub is not even Serializable (WebSphere5.0). How do I persist local entity bean B's reference? This is kind of non-container managed relationship. Why ejb2.0 spec doesn't support local entity Handle? How do you do non-container managed relationship without handle?

    "I had a remote entity bean A hold a reference to a remote entity bean B's handle."
    You hold a reference; as in an instance variable? If so, how did you use the handle? What did you do with the reference when the entity was stored or passivated?
    "Now I change them to local entity beans. But Local entity bean doesn't support Handle... Why ejb2.0 spec doesn't support local entity Handle? "
    Handle objects are intended to assist with holding for long-lived references to remote objects by avoiding the potential problems associated with holding a reference directly to the remote object. Since there are no concerns with respect to working remotely, Local objects do not need a Handle. Just hold reference to the Local directly, like you would any other object.
    "...and I found local entity stub is not even Serializable."
    Well of course not, it's not a remote object. One of the main points driving the use of local interfaces is to limit access to components. Hence only components within the same JVM as the Local can access it.
    "How do I persist local entity bean B's reference?"
    What do you mean by "persist"? Were you actually storing the Handle object into the database?! If so, then I see why you wanted a serializable Local Handle.

  • CMP Entity beans using local interfaces

    Why CMP entity beans with CMR relation ship using local interfaces only?
    Why we should not use remote interface to get the CMR field relationship?
    Pls give me the solutions

    "Local interfaces provide the foundation for container-managed relationships among entity beans and session beans. The bean uses the local interface to maintain its references to other beans. For example, an entity bean uses its local interfaces to maintain relationships to other entity beans. Using local interfaces, beans can also expose their state and use pass-by-reference to pass their state between related bean instances. "
    http://java.sun.com/developer/technicalArticles/ebeans/EJB20CMP/

  • Web services and entity beans

    Hi,
    I want to implement a web service which stores some information.
    I decided to bulid it using ejb.
    Can i expose a web service as an entity bean?
    If so,can anybody introduce me some example?
    If not,what is the solution?

    Yes, u can do that by creating EJB controls first and then add that EJB control to WebService.
    Which Editor is using . if u r using Weblogic Workshop 8.1
    Creat project and then just right click and create EJB Control for that and then add this to web Service
    If u wanna any other information reply ..

  • Using local session bean interface from web container using EJB 3.0

    Hi,
    How can you use a local session bean interface from Java (rather than data controls) in a web container using EJB 3.0?
    I can use a remote interface by looking up InitialContext, but I can't find a local interface this way (even from another session EJB). I can use a local interface from an EJB using annotation "EJB", but as I understand, this is not available in the web container.
    If I try to add an ejb-jar.xml file, these seems to mess up by project...
    Hope you can help.
    Roger

    The portable way to retrieve an EJB reference in Java EE is to either inject it or look it up via the
    component's private naming environment. The simplest way is :
    @EJB
    private DocumentManager dm;
    The global JNDI name is only used as an implementation specific way to uniquely assign an
    identifier to a specific Remote EJB. It's best for this not to appear directly in the source code.
    There's more on global JNDI names in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    The alternative to annotations is to use an ejb-ref to declare the ejb dependency. The ejb-ref
    is declared in the standard deployment descriptor corresponding to the component doing the
    lookup. Each ejb-ref has an ejb-ref-name, e.g. <ejb-ref-name>DM_ref</ejb-ref-name>
    The code looks up the ejb-ref-name relative to the java:comp/env namespace to retrieve the
    EJB reference.
    DocumentManager dm = (DocumentManager)
    new InitialContext().lookup("java:comp/env/DM_ref");

  • Regarding ENTITY bean local interfaces

    Hi all,
    I have a component session bean - containing a number of service methods for creating, retrieving, updating & deleting instances of a related entity bean. This session bean is used by another session facade bean, which invokes the various service methods in some sequence to complete a major task.
    In the component session bean, the retireve methods return the local interface of the entity bean - on which it operates. The update methods accespt local interfaces of entity bean which can be directly updated.
    My question is : Is it a right approach to pass the entity bean instances between method calls.
    Thanks in advance,
    Baskar

    Your pointers regarding pt 2 was nice. Thanks.
    This being my first J2ee design, I'am just collecting as much information as possible to stay confident.
    Later, I started thinking a bit more regarding pt 1.
    Where, I decided using individual session beans for different components(representing unique functionalities).
    i.e,, I'am just thinking, should I use individual session beans for each of these different components.
    What if I use standard java classes - implementing pre-defined interfaces for each of these components & use the components through these interfaces in session facade.
    Now, I'll be using entity bean creates/retrieves/updates/deletes from inside normal java classes.
    I thought, this would obviate the need for JNDI lookups - each time I want to use the components in my session facade.
    But, I'am not sure of where this will impact..As far as I can visualize, this seems to be normal. Please share ...your thoughts regarding this. (something regarding transactions ??)

  • Create a entity using a session bean in web dynpro

    Hi.
    I want to create an entity bean object trough an EJB session bean in web dynpro, e.g using a form in a WD application filled in by a user.
    I understand how to display a list of entity beans through a session bean and a table, but I don't understand how to create (or edit or remove) such information.
    My session beans look like this:
    @Stateless
    public class MyObjectBean implements MyObjectLocal {
         @PersistenceContext(name = "MyObject", unitName="ProjectPU")
         public EntityManager em;
         public void create(MyObject myObject) {
              em.persist(myObject);
         public void edit(MyObject myObject) {
              em.merge(myObject);
         public void remove(MyObject myObject) {
              em.remove(em.merge(myObject));
         public MyObject find(Integer id) {
              return em.find(MyObject.class, id);
         @SuppressWarnings("unchecked")
         public List<MyObject> findAll() {
              return em.createNamedQuery("MyObject.findAll").getResultList();
    So the model class would be called Request_MyObjectLocal_create.
    I attempted to use [this|http://help.sap.com/saphelp_nwce10/helpdata/en/45/dd45e4bc295595e10000000a1553f7/frameset.htm] help file but I find the answer (step 17) quite unclear.
    Help is greatly appreciated!
    Vincent.

    I've just found the solution from Steve Muench weblog, always useful by the way!
    You can find the solution at this link http://radio.weblogs.com/0118231/stories/2004/05/07/handcodingDynamicDiscoveryOfEjbdeployedAppmodule.html
    In summary, we need to use the class com.evermind.server.rmi.RMIInitialContextFactory, which supports dynamic lookup, and implement the lookup ourselves.
    The code I've written to lookup the service is listed below:
    public static ApplicationModule getAppModuleManutencao() {
    try {
    Context ctx = getContext();
    ManutencaoFacadeHome home = (ManutencaoFacadeHome) ctx.lookup(EJB_MANUTENCAO_BEAN_NAME);
    ApplicationModule am = ApplicationModuleProxy.create(home, null);
    return am;
    } catch (NamingException nex) {     
    nex.printStackTrace();
    return null;
    private static InitialContext getContext() {   
    try {     
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.PROVIDER_URL, "opmn:ormi://dsv008:OC4J_dvt20/mct");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    return new InitialContext(env);
    }catch (NamingException e) {     
    e.printStackTrace();
    return null;
    I hope this helps someone!!!
    Cheers!

Maybe you are looking for

  • HT201250 Why won't Time Machine won't restore my iphoto library [says there is not enough room on my hard drive.]  Any ideas?

    I've got 20,000 plus photos on my HD [yes, I know, way tooo many].  I'm trying to clean up by storing them on an external HD, but for several months I've not been able to export iphoto [even geniuses can't figure out why].  So as a work around, I'm t

  • Out of process memory

    When I doing a bulk insert, following error occurs, Please provide me a Solution. ERROR at line 1: ORA-20009: Error on Procedure temp_bill_calls ORA-04030: out of process memory when trying to allocate 768 bytes (Typecheck heap,seg:kggfaAllocSeg) ORA

  • Design issue with an application

    Hi Requirement : I have an application which needs to access database and show the resultset on the screen. The design is as follows: (I am implementing Connection Pooling as I have not been able to configure the Tomcat's Connection Pooling) 1)I have

  • Smart forms with barcode

    Hi Experts, I have requirement to create bar code in smart form, the barcode format will be 39 full ASCII . I have tried to create a character format with this font but it is not available in smartstyles. Can you please help me how Can I create this

  • How to configure monthly fee in SAP MOBILISER

    Hi All, I have a problem in configuring monthly fee in  mobiliser. According to my requirement from each customer we need to deduct the some amount of fee in a monthly basis. Is there any predefined scheduler related to this? Please help me in this.