How to use remote managed bean and JPA in JSF

Hi All,
I am familiar with referencing backing-beans and JPA properties where Glassfish and MySQL is running locally. However, is it possible to lookup these same properties using JNDI if they reside on remote servers? If so, what change is needed?
I would like to distribute the J2EE 5 application load including database by running Glassfish, MySQL on separate servers. This will put on the JSF (presentation-tier) components on it's own server while a secondary system will handle the middle tier processing and leaving the database activities to be carried out on another server. Not sure whether this is the right approach though. These hardware would run on both Solaris and Windows platforms.
Unfortunately, buying faster hardware is not an option.
Any assistance would be appreciated,
Jack

Hi Faissal,
Is your suggestion below:
//Lookup an EJB and use it
   YourRemoteBean bean = (YourRemoteBean ) ServiceLocator.findRemoteObject(jndiName); // ServiceLocator is a class that lookup
                                                                                                                                       //  the remote objectis equivalent to the following lines:
Properties props = new Properties();
    props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
            props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
            props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
            // optional.  Defaults to localhost.  Only needed if web server is running
            // on a different host than the appserver   
            // props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
            props.setProperty("org.omg.CORBA.ORBInitialHost", "remoteServer");
            // optional.  Defaults to 3700.  Only needed if target orb port is not 3700.
            // props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
            InitialContext jndiContext = new InitialContext(props);     
            InitialContext jndiContext = new InitialContext();
            YourRemoteBean bean =  (YourRemoteBean) jndiContext.lookup("ejb.YourRemoteBean");Thanks,
Jack

Similar Messages

  • How to use a managed bean in a bounded task flow without definig it in adfc-config

    Dear all
    I create a bounded task flow without page fragments (the pages are jspx), i created a jspx page with a button that its action has bounded to a managed bean function.
    i defined the managed bean on the corresponding bounded task flow, but it does not work.
    But there is no problem when i define the managed bean in adfc-config.xml.
    can anybody help me with this problem.
    is it possible to use jspx page with backing bean in bounded task flows, without defining the beans on adfc-config?
    Thank you very much

    Dear Timo
    I use jDev 11.1.1.6 and the scope is Request.Although when i use task flow page fragment and create jsff pages, there is no problem.

  • How to use the Managed Review and Approval

    Hi,
    I'm a RIA Consultant at iDA MediaFoundry, Adobe Gold Partner in Belgium. I'm trying to figure out how the new solution accelerators work and how we can use them in the solutions that we develop for clients.
    I'm a bit stuck though with the Managed Review and Approval solution accelerator. I cannot figure out how the application actually works, how it communicates with livecycle and how we can use this application in our projects for clients.
    Does anyone have a tutorial or a document on how to use this solution accelerator? I know this is a rather big question, and the answer will be even bigger, but I really could use some help from anyone who knows how to use all this.
    Thanks in advance for your answer.
    Kind regards,
    Ronald Kamp

    I would also suggest that you look at the resources on devnet.
    http://www.adobe.com/devnet/livecycle/testdrive.html (see the Managed Review & Approval)
    as well as the downloads and full documentation http://www.adobe.com/devnet/livecycle/solutionaccelerators.html

  • How to execute vb script with out using Remote manager in oim 11g r2

    Hi Currently,
    i have a requirement to execute  vb script (present on a remote machine in which connector server is installed) from oim machine while using Exchange connector (11.1.1.6).
    This can be achieved by using remote manager,but i dont want to use remote manager.
    Hence decided to use Action scripts.
    As per connector configuration,
    i have configured Action scripts in Lookup.Exchange.UM.Configuration lookup definition, by means of three entries
    After Create Action Language      Shell
    After Create Action Target           Resource
    After Create Action File              /home/scripts/Disable.bat
    Disable.bat has the following ,
    Powershell.exe -File C:\scripts\Setup.vbs
    -%Log on Name%
      Exit
    As Setup.vbs is expecting a parameter of log on name, i was providing the same.
    But while creating the user,as this script gets called, getting the following error and hence 'create User' is getting failed.
    Problem while PowerShell execution System.Management.Automation.RemoteException: This task does not support recipients of this type. The specified recipient XXXXXXXXXXX...XXXXX is of type UserMailbox. Please make sure that this recipient matches the required recipient type for this task.
    While provisioning the user to Exchange , i have selected 'Recepient type' as 'User Mail box' explicitly, but still getting the error.
    Please provide any pointers to resolve the issue.
    Thanks in advance
    Kumar

    As far as I know Oracle and MySQL are two different products.
    Why do you clutter an Oracle forum with MySQL questions?
    If MySQL is such a tremendous RDBMS, like many people state (as 'free' means per definition better),
    why don't you visit a MySQL forum where fellow MySQL aficionados can answer you MySQL questions?
    In short, why don't you stop abusing Oracle forums?
    Sybrand Bakker
    Senior Oracle DBA

  • How to use application managed entity manager in EJB?

    I finish reading The EntityManager Interface in JEE tutorial.
    I know I can use container manager entity manager in EJB, but I want to explore how to use application managed entity manager in EJB.
    Can I use application managed entity manager in EJB (container management JTA transaction is used)? Where do I should close entity manager if can?
    The following is an example from JEE tutorial, but didn't find where to calose entity manager. and can I create mutiple EntityManagerFactory objects and Entity Manager objects to use them in a JTA transaction?
    @PersistenceUnit
    EntityManagerFactory emf;
    EntityManager em;
    @Resource
    UserTransaction utx;
    em = emf.createEntityManager();
    try {
      utx.begin();
      em.persist(SomeEntity);
      em.merge(AnotherEntity);
      em.remove(ThirdEntity);
      utx.commit();
    } catch (Exception e) {
      utx.rollback();

    Seems like a very poor example, the whole power of EJBs is to use Container Managed Transactions so you don't NEED to manage the transaction and the entity manager yourself. What you posted is code I would expect in a non-JEE application, or in a piece of code which requires fine-tuned transaction boundaries such as batched data importing logic.
    If I were you I'd research JPA in steps.
    a) learn about JPA as an API outside of the scope of EJBs (recommended reading: the book 'Pro JPA 2')
    b) learn about Container Managed Transactions in EJBs
    c) learn about Bean Managed Transactions in EJBs
    Right now you're rushing into c). I can understand that it raises many question marks at this point.

  • What is difference between Managed Bean and Backing Bean?

    What is difference between Managed Bean and Backing Bean? Please guide me how to create them and when to use them?
    Please post sample for both beans.

    Hi,
    managed beans and backing beans are quite the same in that the Java object is managed by the JavaServer Faces framework. Manage in this respect means instantiation. The difference is that backing beans contain component "binding" references, which managed beans usually don't. Do backing beans are page specific versions of managed beans.
    Managed beans are configured either in the faces-config.xml file, or using ADF Faces and ADFc, in the adfc-config.xml file
    Frank
    Edited by: Frank Nimphius on Jan 31, 2011 8:49 AM

  • [Kindly help me understand]Urgent:Provisioning using Remote Manager

    Hi,
    I have a requirement to auto provision a resource to a 3rd party system as soon as it is created. We can not do it using DB Connector, as well as WebServices.
    The remanining option is to have their jar in our system and invoke a Java Task, which introduces tight coupling and not well suited.
    So, I have thought about creating a Remote Task, where in I would introduce my jar, which will just open a URL Connection to the 3rd party system using Remote Manager.
    My query here is:
    1. Is this a feasible and a good approach?
    2. If yes, then how do i connect to this api using Remote Manager. I created a Remote Task, and defined a IT Resource Type definition. As per my understanding, we need to introduce a IT Resource of type Remote Manager as well. However, the design console is now showing any type of IT Resource Form.
    OIM version used: 11.1.1.5 and references used : http://itnaf.org/2011/07/27/installing-and-testing-remote-manager-on-oim-10g/
    Please suggest how to go about it.
    Thanks!

    Kewl

  • Pageless Managed beans and operation bindings, design question

    Hi,
    I am using ADF Faces and ADF BC and JDev 10.1.3.
    I want to declaratively execute an operation binding from a managed bean which does not have a page definition.
    How can I create a page definition for a managed bean which will allow me to define and call operation bindings in the same way that you can in a backing bean?
    In the past I have used the binding layer to get references to the AM and then execute the client methods directly.
    How can I do this declaratively from a managed bean?
    regards,
    Brenden

    Hi Steve,
    a good example would be a managed bean which is used by many pages for provide dynamic page forwarding (using global forwards).
    The page forwarding is based on what data the user has selected and the entry tasklist will have pages added and removed based on the users entered information.
    At the moment I use references in the managed bean which get the binding context by evaluating #{data} to get a reference to the AM and directly call an client method, which calls a PL/SQL procedure and returns a global forward string. The AM is imported into the managed bean and methods called directly.
    This is just one example, but probably the best I can come up with for now.
    In a backing bean I can use an operation binding to call a method and get a result declaratively like this:
            BindingContainer bindings  = getBindings();
            OperationBinding operation = bindings.getOperationBinding("getUserByEmail");
            operation.getParamsMap().put("email", email);
            String userName = (String)operation.execute();whereas in a managed bean I have to get direct references to the AM to call the method directly.
    if there is a way to do this in the same way as backing beans it would seem a more abstracted and cleaner approach?
    regards,
    Brenden

  • Document about how to use each BI Bean

    Anyone know whether there is any document on how to use each BI Beans besides Bean's javadoc?

    I would recommend downloading the latest BI10g samples from the BI Beans website. Click here for downloads, demos and documentation for BI Beans 10.1.2.0.0.
    For the graph there is a lot of really good information located on the Reports OTN page. This explains how to use many of the features of the BI Beans graph and contains some really good examples of how to format a graph.
    http://www.oracle.com/technology/products/reports/htdocs/faq/Graph_FAQ_with_style.html
    I would recommend reviewing the OU course on the BI Beans Query Model as this explains the basics of how to construct and manage queries:
    Oracle9i JDeveloper: Explore the BI Beans Query Model (Development Tools)
    http://education.oracle.com/pls/web_prod-plq-dad/show_desc.redirect?dc=D18655&p_org_id=1001&lang=US&source_call=
    The BI Beans query model supports powerful and flexible query techniques for analytic applications. This course explores this query model, both from an API perspective and a user interface perspective, with the goal of illustrating advanced query techniques for custom business intelligence applications.
    BI Beans 10g provides a lot of new features. We have a viewlet that explains in detail how to use one of the key new features: JSP list tags. This viewlet demonstrates a number of list tags, such as:
    * DimensionMember
    * CascadingDimensionMember
    * AWProgram
    * Navigation
    This viewlet can be viewed directly from the link on OTN:
    http://www.oracle.com/technology/products/bib/1012/viewlets/MS%20Developing%20Executive%20Insight.html
    There are OBEs posted on OTN:
    Develop Business Intelligence Objects using OracleBI Beans
    http://www.oracle.com/technology/obe/obe_bi/bibeans/bibeans_1012/developolapobjects/lessonlist.html
    Create business intelligence objects using BI Beans. These analytic objects, such as crosstabs, graphs, and calculations, can be used in either HTML-client or Java-client applications.
    Develop Business Intelligence Applications using OracleBI Beans
    http://www.oracle.com/technology/obe/obe_bi/bibeans/bibeans_1012/buildbibeansapps/lessonlist.html
    Create BI Beans HTML-client (JSP) applications and Java-client applications.
    For more information on using BI Beans graphs with non-OLAP data sources please refer to the following JDeveloper tutorial:
    Adding a BI Beans Graph in an ADF Business Components/JSP/Struts Application
    http://www.oracle.com/technology/obe/obe9051jdev/BIBeansOBE/BIBeansOBE.htm
    Hope this helps
    Oracle Business Intelligence Beans Product Management Team
    Oracle Corporation

  • Managed Beans and Data Access Object

    I have a question / need help understanding how to configure backing bean and model objects so that memory and object creation/deletion is done as efficiently as possible.
    1. I have a .jsf page with a form and a commandbutton that submits the form inputs to a backing bean (enrollispbean is backing bean)
    <h:commandButton value="Enter" action="#{enrollispbean.insert}"/>
    2. The backing bean is used for form handling - the insert() method is used to read the data fields from the form and create a SQL string that will be submitted to a model object, DbInsert, that is used as a generic data access object that connects to the database and insert the SQL string:
    public class EnrollIspBean {
    private String beanvar1="";
    private String beanvar2= "";
    // DbInsert is data access object
    private DbInsert dbinsert = new DbInsert();
    public String insert (){
    String sqlstmt;
    sqlstmt = "INSERT INTO ispmain VALUES(beanvar1, beanvar2,..)"
    dbinsert.insert(sqlstmt);
    return "success"; }
    3. DbInsert is the data access object that contains a method, insert(), that accepts a sql string to insert into the database. This method contains the code to obtain a connection from the database connection pool and then execute the sql statement (note: error checking code not shown):
    public class DbInsert {
    public void insert(String sqlstmt) throws SQLException {
    Connection conn = null;
    GetDBConnection getdbconnection = new GetDBConnection();
    PreparedStatement stmt = null;
    conn = getdbconnection.getdbconn();
    stmt = conn.prepareStatement(sqlstmt);
    stmt.executeUpdate();
    stmt.close();
    conn.close();
    return;
    Where I need help understanding is how to set up the scope for the managed beans and data access object. Currently, I have the backing bean within the session scope (using the facesconfig.xml file). My main question is how to set up the scope for the Data Access Object - currently I do not have it as a managed bean within facesconfig.xml. Instead I am creating a new instance within the backing bean:
    private DbInsert dbinsert = new DbInsert();
    Is this the best way to do this? Will the DBInsert object now be tied to the session scope of the backing bean (i.e., when backing bean is deleted, the DbInsert object will be deleted from session scope as well.)
    Ideally I would like the data access object to be available as a shared object throughout the life of the application. When I was programming using a servlet approach, I would have created a servlet to load on startup. Now that I'm using java server faces, I'm confused about the scope / how to efficiently set up a data access object that I want to be available to all backing beans in the application.
    tnanks for any help understanding this.
    Tom

    I was thinking about setting the data access object as application scope so that it can be used by an backing bean to execute sql statements.
    If I do set it as application scope, however, if I do this, do I still need to declare a new instance of the object from within each bean that uses the object?
    For example do I need to declare a new instance of the data access object from within the bean? or, should I assume that there is always an instance of the bean available in the application scope, and if so, how do I reference it from within the bean?
    Bean Code:
    public class EnrollIspBean {
    // DbInsert is data access object
    private DbInsert dbinsert = new DbInsert();
    Finally, I understand performance may be an issue if I have one instance of the data access object available in the application scope - is there a way to make multiple instances available in the application scope?
    thanks

  • How to use remote desktop client in mountain lion

    How to use remote desktop client in mountain lion.
    I want to connect my other system(ubuntu) using mac remote desktop client, But i could not locate remote desktop client in moutain lion.

    In Ubuntu 12.xx use Dash to find "Desktop Sharing" and set the preferences, including requiring a password.
    Then in Ubu use System Settings > Network to determine your Ubu machine's IP address, such as 192.168.1.13.
    On the Mountain Lion Mac do Finder > Go > Connect to Server   and enter:  vnc://192.168.1.13  or whatever your IP is.  Enter the password that you used in the Ubu Desktop Sharing setup, when asked.
    On the Ubu machine answer the question that pops up asking for permission to connect.  Your Ubu screen will now show up on the Mac, and you can remote control it.   Here I am running "Octave" (a math program) on the Ubu machine, remotely.
    Works great!  BTW, you can do this from an iPad too, using a VNC client such as Mocha VNC Lite.  You can even run both remotes simultaneously.
    Good luck.

  • Use ADF Managed Bean to get the username in BPM Workspace

    Hi all,
    I used JSF and ADF to build the UI of human task. And I want to get the username of the user who is manipulate on BPM Workspace. For example, an ADF form can display the username of current user in BPM Workspace. I also try this approach: use Manage Bean, and bind this bean to a output text in ADF form. The code fragment I use to get the current username is:
    ADFContext.getCurrent().getSecurityContext().getUserPrincipal().getName();
    But it does not work. The value I get is Anonymous.
    So, plz help me solve this problem

    Hi, please try this function as below:
    public String getUserLogin() throws WorkflowException,
    BPMIdentityException,
    BPMUnsupportedAttributeException {
    String userId = "";
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    return userId;
    Regards.

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • How to use the selection profile and status profile for production order?

    Hi expert,
       I want to know how to use the selection profile and status profile for production order. what's the usage for these two selection profile and status profile ?
      Please help me.
      thanks in advance.
      george.shi

    Hi George,
    There are are two types of statuses.One is system status and second one is user status.These statuses will tell us current situation of an order.
    We can't change system statuses.But we can create our own statuses through status profile.With this profile we can control user statuses.
    In this status profile,
    1.We define the sequence in which user statuses can be activated,
    2.We define initial statuses
    3. Allow or prohibit certain business transactions.
    Selection profiles are used to select the objects (say production orders) with different status combinations.We assign status profiles to selection profiles in BS42 T-Code.
    Regards,
    Raja.
    Edited by: Rajarao on Oct 30, 2008 6:21 AM
    Edited by: Rajarao on Oct 30, 2008 6:22 AM

  • How to use external hard drive and iTunes together?

    how to use external hard drive and iTunes together?

    Yes I did get to that part.... I went trough external to retrive itunes folder... When I selected the folder, it said that it was locked, choose another folder... I then went to my external again to my itunes folder and and used command I to see if folder was locked and it wasn't.... it was suggested on another forum to reboot.. which I did and still same problem... All I want to do is link my external hard drive that has my itunes playlist from another Mac to my new one.. and to also use the external as the main source for adding new songs to my playlist...

Maybe you are looking for