Creating multiple stateful session beans from a java client. (EJB 3.0)

I'm having difficulties with the following:
To access the ShoppingCartBean, I have to put the following annotation in my standalone java client:
@EJB
private static ShoppingCartRemote shoppingCartBean;
The static must be there, thus only one ShoppingCartBean will exist within my java client. But as the ShoppingCartBean is a stateful session bean, I want to be able to get different beans of the same type.
What is the correct way to do this in EJB 3.0?

Great question. Because Home interfaces have been removed for the EJB 3.0 simplified
API, stateful session bean creation happens as a side-effect of injection. However, the
same is true of EJB 3.0 business interface lookups. The easiest way to create additional
stateful session beans is to lookup the same dependency that was declared via your
@EJB annotation.
E.g.,
// Assuming the declaring class is pkg1.ShoppingCartClient.java
InitialContext ic = new InitialContext();
ShoppingCartRemote scr1 = (ShoppingCartRemote)
ic.lookup("java:comp/env/pkg1.ShoppingCartClient/shoppingCartBean");
Note that the name relative to java:comp/env is the default associated with your
@EJB annotation since the name() attribute wasn't used. Alternatively, you
could have used :
@EJB(name="scb") private static ShoppingCartRemote shoppingCartBean;
InitialContext ic = new InitialContext();
ShoppingCartRemote scr1 = (ShoppingCartRemote) ic.lookup("java:comp/env/scb");
Yet another alternative is to declare the @EJB at the class-level. This just defines
the dependency without any injection, which is fine if you want to create a bunch of
them via lookup anyway.
@EJB(name="scb", beanInterface=ShoppingCartRemote.class)
public class .... {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Calling a Session bean from a java client

    Hi
    I have been using OC4J for quite some while now, and I have a lot of programs to test my session beans. But with the new versions of the container 9.0.2.0.0 production release and 9.0.3.0.0 pre-release J2EE 1.3 certified, all my test program hang in the lookup method. I have an earlier pre-release of 9.0.3.0.0 (the same version number but not j2EE 1.3 certified -> confusing) where my test programs works without any problems.
    I have included a small code sample of how I call the session beans.
    I hope some one can see what I'm doing wrong or what have changed compared to the earlier versions!
    /Thanks
    Morten
    Properties prop = new Properties();
    prop.put Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    prop.put(Context.PROVIDER_URL, "ormi://mma:23791/rmitest" );
    prop.put(Context.SECURITY_PRINCIPAL, "admin");
    prop.put(Context.SECURITY_CREDENTIALS, "welcome");
    Context ctx = new InitialContext(prop);
    //look up jndi name
    Object ref = ctx.lookup("Enterprise1");

    I got i working right now, it seems like I was using the wrong version of oc4j.jar and ejb.jar when I was building my project!

  • Accessing the same stateful session bean from multiple clients in a clustered environment

    I am trying to access the same stateful session bean from multiple
              clients. I also want this bean to have failover support so we want to
              deploy it in a cluster. The following description is how we have tried
              to solve this problem, but it does not seem to be working. Any
              insight would be greatly appreciated!
              I have set up a cluster of three servers. I deployed a stateful
              session bean with in memory replication across the cluster. A client
              obtains a reference to an instance of one of these beans to handle a
              request. Subsequent requests will have to use the same bean and could
              come from various clients. So after using the bean the first client
              stores the handle to the bean (actually the replica aware stub) to be
              used by other clients to be able to obtain the bean. When another
              client retrieves the handle gets the replica aware stub and makes a
              call to the bean the request seems to unpredictably go to any of the
              three servers rather than the primary server hosting that bean. If the
              call goes to the primary server everything seems to work fine the
              session data is available and it gets backed up on the secondary
              server. If it happens to go to the secondary server a bean that has
              the correct session data services the request but gives the error
              <Failed to update the secondary copy of a stateful session bean from
              home:ejb20-statefulSession-TraderHome>. Then any subsequent requests
              to the primary server will not reflect changes made on the secondary
              and vice versa. If the request happens to go to the third server that
              is not hosting an instance of that bean then the client receives an
              error that the bean was not available. From my understanding I thought
              the replica aware stub would know which server is the primary host for
              that bean and send the request there.
              Thanks in advance,
              Justin
              

              If 'allow-concurrent-call' does exactly what you need, then you don't have a problem,
              do you?
              Except of course if you switch ejb containers. Oh well.
              Mike
              "FBenvadi" <[email protected]> wrote:
              >I've got the same problem.
              >I understand from you that concurrent access to a stateful session bean
              >is
              >not allowed but there is a
              >token is weblogic-ejb-jar.xml that is called 'allow-concurrent-call'
              >that
              >does exactly what I need.
              >What you mean 'you'll get a surprise when you go to production' ?
              >I need to understand becouse I can still change the design.
              >Thanks Francesco
              >[email protected]
              >
              >"Mike Reiche" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Get the fix immediately from BEA and test it. It would be a shame to
              >wait
              >until
              >> December only to get a fix - that doesn't work.
              >>
              >> As for stateful session bean use - just remember that concurrent access
              >to
              >a stateful
              >> session bean is not allowed. Things will work fine until you go to
              >production
              >> and encounter some real load - then you will get a surprise.
              >>
              >> Mike
              >>
              >> [email protected] (Justin Meyer) wrote:
              >> >I just heard back from WebLogic Tech Support and they have confirmed
              >> >that this is a bug. Here is their reply:
              >> >
              >> >There is some problem in failover of stateful session beans when its
              >> >run from a java client.However, it is fixed now.
              >> >
              >> >The fix will be in SP2 which will be out by december.
              >> >
              >> >
              >> >Mike,
              >> >Thanks for your reply. I do infact believe we are correctly using
              >a
              >> >stateful session bean however it may have been misleading from my
              >> >description of the problem. We are not accessing the bean
              >> >concurrently from 2 different clients. The second client will only
              >> >come into play if the first client fails. In this case we want to
              >be
              >> >able to reacquire the handle to our stateful session bean and call
              >it
              >> >from the secondary client.
              >> >
              >> >
              >> >Justin
              >> >
              >> >"Mike Reiche" <[email protected]> wrote in message
              >news:<[email protected]>...
              >> >> You should be using an entity bean, not a stateful session bean
              >for
              >> >this application.
              >> >>
              >> >> A stateful session bean is intended to be keep state (stateful)
              >for
              >> >the duration
              >> >> of a client's session (session).
              >> >>
              >> >> It is not meant to be shared by different clients - in fact, if
              >you
              >> >attempt to
              >> >> access the same stateful session bean concurrently - it will throw
              >> >an exception.
              >> >>
              >> >> We did your little trick (storing/retrieving handle) with a stateful
              >> >session bean
              >> >> on WLS 5.1 - and it did work properly - not as you describe. Our
              >sfsb's
              >> >were not
              >> >> replicated as yours are.
              >> >>
              >> >> Mike
              >> >>
              >> >> [email protected] (Justin Meyer) wrote:
              >> >> >I am trying to access the same stateful session bean from multiple
              >> >> >clients. I also want this bean to have failover support so we want
              >> >to
              >> >> >deploy it in a cluster. The following description is how we have
              >tried
              >> >> >to solve this problem, but it does not seem to be working. Any
              >> >> >insight would be greatly appreciated!
              >> >> >
              >> >> >I have set up a cluster of three servers. I deployed a stateful
              >> >> >session bean with in memory replication across the cluster. A client
              >> >> >obtains a reference to an instance of one of these beans to handle
              >> >a
              >> >> >request. Subsequent requests will have to use the same bean and
              >could
              >> >> >come from various clients. So after using the bean the first client
              >> >> >stores the handle to the bean (actually the replica aware stub)
              >to
              >> >be
              >> >> >used by other clients to be able to obtain the bean. When another
              >> >> >client retrieves the handle gets the replica aware stub and makes
              >> >a
              >> >> >call to the bean the request seems to unpredictably go to any of
              >the
              >> >> >three servers rather than the primary server hosting that bean.
              >If
              >> >the
              >> >> >call goes to the primary server everything seems to work fine the
              >> >> >session data is available and it gets backed up on the secondary
              >> >> >server. If it happens to go to the secondary server a bean that
              >has
              >> >> >the correct session data services the request but gives the error
              >> >> ><Failed to update the secondary copy of a stateful session bean
              >from
              >> >> >home:ejb20-statefulSession-TraderHome>. Then any subsequent requests
              >> >> >to the primary server will not reflect changes made on the secondary
              >> >> >and vice versa. If the request happens to go to the third server
              >that
              >> >> >is not hosting an instance of that bean then the client receives
              >an
              >> >> >error that the bean was not available. From my understanding I
              >thought
              >> >> >the replica aware stub would know which server is the primary host
              >> >for
              >> >> >that bean and send the request there.
              >> >> >
              >> >> >Thanks in advance,
              >> >> >Justin
              >>
              >
              >
              

  • Initialize a stateful session bean from another

    Hi,
    I am trying to create and initialize a stateful session bean from another stateful session bean. The code is as follows
    This method belongs to DefaultSessionBean where it creates the AdminSessionBean based on few checks and returns it to the client.
        public AdminSession getAdminSession() throws UnknownException, WarningException {
            checkSessionUser("getAdminSession");
            if (isAdmin()) {
                AdminSession adminSession;
                try {
                    final Context context = IToolsUtil.getInitialContext();
                    adminSession = (AdminSession)context.lookup("AdminSession");
                    System.out.println("Successfully created the adminsession bean");
                } catch (NamingException ne) {
                    ne.printStackTrace();
                    throw new UnknownException (new CatalogHelper("ITOOLS_100019", new Object[]{"Admin", ne.getMessage()}));
                System.out.println("adminsession will be returned");
                return adminSession;
            } else {
                throw new WarningException (new CatalogHelper("ITOOLS_000042", sessionUser.getUserhandle()));
        }Another method in DefaultSessionBean, creates its local interface and returns it.
        public DefaultSessionLocal getDefaultSessionLocal() {
            DefaultSessionLocal dsl = (DefaultSessionLocal)context.getBusinessObject(DefaultSessionLocal.class);
            System.out.println("local created.");
            return dsl;
        }Client call initialize method of the AdminSessionBean which is mentioned below:
        public void initialize(DefaultSession ds) throws WarningException, UnknownException {
            this.ds = ds.getDefaultSessionLocal();
            this.rfl = ReadFieldList.getInstance();
            this.fm = new FinderMethods();
        }The client code where it gets the adminSession and initializes is
       public static AdminSession getAdminSession(DefaultSession ds) throws ViewException {
            AdminSession as;
            try {
                as = ds.getAdminSession();
                System.out.println("got admin session");
            } catch (WarningException we) {
                 we.printStackTrace();
                throw new ViewException(we.getCatalogHelper());
            } catch (UnknownException ue) {
                ue.printStackTrace();
                throw new ViewException(ue.getCatalogHelper());
            } catch (OracleRemoteException ore) {
                ore.printStackTrace();
                throw new ViewException(new CatalogHelper("ITOOLS_050003", ore.getMessage()));
            // Initialize Admin Session
            try {
                System.out.println("before getting it.");
                as.initialize(ds);
                System.out.println("adminsession is initialized");
            } catch (WarningException we) {
                as.remove();
                as = null;
                throw new ViewException(we.getCatalogHelper());
            } catch (UnknownException ue) {
                as.remove();
                as = null;
                throw new ViewException(ue.getCatalogHelper());
            } catch (OracleRemoteException ore) {
                as.remove();
                as = null;
                throw new ViewException(new CatalogHelper("ITOOLS_050003", ore.getMessage()));
            System.out.println("got admin session");
            return as;
        }Apart from this I am using OC4J 10.1.3.1 tool test my application.
    When I am calling initialize method of the AdminSession I am getting the following error.
    06/10/24 12:26:08 Entered
    06/10/24 12:26:08 got default session
    06/10/24 12:26:08 Successfully created the adminsession bean
    06/10/24 12:26:08 adminsession will be returned
    06/10/24 12:26:08 got admin session
    06/10/24 12:26:08 before getting it.
    2006-10-24 12:26:08.156 WARNING J2EE RMI-00009 Exception returned by remote server: {0}
    06/10/24 12:26:08 com.itools.vs.view.exception.ViewException
    06/10/24 12:26:08      at com.itools.vs.view.util.ViewUtil.getAdminSession(ViewUtil.java:71)
    06/10/24 12:26:08      at com.itools.vs.view.backing.Admin.CreateUser.submit_action(CreateUser.java:182)
    06/10/24 12:26:08      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    06/10/24 12:26:08      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    06/10/24 12:26:08      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    06/10/24 12:26:08      at java.lang.reflect.Method.invoke(Method.java:585)
    06/10/24 12:26:08      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    06/10/24 12:26:08      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
    06/10/24 12:26:08      at org.ajax4jsf.framework.ajax.AjaxActionComponent.broadcast(AjaxActionComponent.java:88)
    06/10/24 12:26:08      at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:274)
    06/10/24 12:26:08      at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:250)
    06/10/24 12:26:08      at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:405)
    06/10/24 12:26:08      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
    06/10/24 12:26:08      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
    06/10/24 12:26:08      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
    06/10/24 12:26:08      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
    06/10/24 12:26:08      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    06/10/24 12:26:08      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:67)
    06/10/24 12:26:08      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:223)
    06/10/24 12:26:08      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
    06/10/24 12:26:08      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:368)
    06/10/24 12:26:08      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:866)
    06/10/24 12:26:08      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:448)
    06/10/24 12:26:08      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:216)
    06/10/24 12:26:08      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
    06/10/24 12:26:08      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
    06/10/24 12:26:08      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    06/10/24 12:26:08      at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    06/10/24 12:26:08      at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    06/10/24 12:26:08      at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    06/10/24 12:26:08      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    06/10/24 12:26:08      at java.lang.Thread.run(Thread.java:595)
    06/10/24 12:26:08 ITOOLS_050003: Failed to get Admin Session.
    Exception is "Error marshalling objects, Not Serializable: java.io.NotSerializableException: DefaultSession_RemoteProxy_6nein01; nested exception is:
         java.io.NotSerializableException: DefaultSession_RemoteProxy_6nein01".
    [b/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Your remote client passes a DefaultSession to AdminSession.initialize(..). This DefaultSession has to be a remote type. In your client, how does it get DefaultSession?
    Did your client look up DefaultSession, and have it return a (sessionContext.getBusinessObject(DefaultSession.class))? If so, it should work.

  • How can I create a stateful session bean?

    I created a stateless session bean. Now I want to make it be a stateful session bean. How can I do? Where can I find a session bean sample?
    Thanks
    Qing

    Look at this site. The tutorial explains it all.
    Well if you want to convert your stateless EJB to stateful, all you have to do is change the deployment descriptor and re-deploy the ejb. You should be ready to go.
    All the best.

  • Error execute query from stateful session bean

    Hi,
    I created a stateful session bean, it's flow are as following:
    - client invoke open()
    - client "iterate" using method next()
    - client invoke close()
    In open, I get Connection to db-source, create a PreparedStatement, and execeute the query, store in a resultset.
    In next(), I traverse the resultSet using next().
    In close(), I close both resultset, statemtn, and connection.
    Here's the snippet of my code:public SynchCatalogBean implements SessionBean {
        private Connection conn;
        private PreparedStatement stmt;
        private ResultSet rs;
        private static final String = "SELECT ? FROM ?";
        public void openCategory() throws RemoteException {
            DataSource dataSource =
                (DataSource)jndiContext.lookup(DATASOURCE);
            con = dataSource.getConnection();
            stmt = con.prepareStatement(QUERY);
            stmt.setString(1, "id");
            stmt.setString(2, "category");
            rs = stmt.executeQuery(); //this throws exception
        public String next() throws ... {
            if (rs.next())
        public void close() throws ... {
            rs.close();
            stmt.close();
            conn.close();
    }Well, the problem is, once I test with a simple client, the line rs = stmt.executeQuery() produce exception like this:[SynchCatalog] TRANSACTION ROLLBACK EXCEPTION:Error opening category; nested exception is:
        java.rmi.RemoteException: Error opening category
    [SynchCatalog] java.rmi.RemoteException: Error opening category
    [SynchCatalog]  at matashop.product.ejb.SynchCatalogBean.openCategory(SynchCatalogBean.java:66)
    [SynchCatalog]  at java.lang.reflect.Method.invoke(Native Method)
    [SynchCatalog]  at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSessionContainer.java:570)
    [SynchCatalog]  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:190)
    [SynchCatalog]  at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:209)
    [SynchCatalog]  at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
    [SynchCatalog]  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:263)
    [SynchCatalog]  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
    [SynchCatalog]  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
    [SynchCatalog]  at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:326)
    [SynchCatalog]  at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:392)
    ...My stateful-bean is "read-only" bean, it just execute a select statement, so why Jboss complain about transaction exception? Can anyone help me?
    -- Verdi March --

    agree, you cannot pass tablenames as ? parameters. Instead you should generate your SQL statement dynamically
    private static final String = "SELECT ? FROM ";
    public void openCategory() throws RemoteException {
    stmt = con.prepareStatement(QUERY + "category");
    stmt.setString(1, "id");

  • Web Service from stateful Session Bean deleted after server restart

    Hi,
    i created a stateful session bean and from this a web service.
    I am able to deploy it and it works really fine.
    My problem is: after a server restart the web service is gone and i
    have to deploy it again.
    I have some other web services (but these are web services from stateless session beans)
    but they "survive" the server restart.
    I don't want to deploy the web service after every server restart, did I forget something or
    is it a general problem of stateful session beans or web services?
    Thanks in advance
    Jens

    Hello Björn,
    I am not quite sure what your problem is but did you have a look at these articles:
    http://help.sap.com/saphelp_nw04/helpdata/en/4d/993441c73cef23e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/be/2e2c4142aef623e10000000a155106/frameset.htm
    I hope they can give you some idea.
    Regads
    Vyara

  • How create  EJB 2.1 Stateful Session Bean in a EJB 3.0 Session Bean

    Hi All,
    We have been developing on EJB 2.1. We are now adding a module on EJB 3.0.
    How can we "create" a stateful session bean with create method signature similar to create(String id)?
    We have tried
    // this is the remote interface
    @EJB AddressBean abean;
    But not working
    Any help will be appreciated.

    There is no explicit create() call for EJB 3.0 session beans. It doesn't really matter though
    since you can accomplish the same thing by defining your own business method to act
    as an initializer for whatever state you'd like. E.g.
    @Remote
    public interface FooInterface {
    public void initialize(String id);
    // ... other business methods
    @EJB FooInterface fooRef;
    fooRef.initialize("foo");
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Error in updating secondary stateful session bean

              Hi all,
              I have set up a cluster of 2 managed servers with WebLogic 6.1. I have a
              stateful session bean and several stateless session beans. the stateful
              session bean keeps user info and limited cached objects, all are
              serializable. it seems working fine, even after killing any one of the
              servers, as long as one is alive. a java application client creates a
              stateful session bean first, then calls stateless session beans with the
              remote interface of the stateful bean as a method parameter. No problem
              when stateful session bean is created. However, each stateless bean method
              generates the following error message if I turn the debug on (level 64). No
              exception stack traces, and all methods execute successfully.
              <Error> <EJB> <Failed to update the secondary copy of a stateful session
              bean from home:clientsession>
              I wonder what causes the error, and why it tries to update the stateful
              session bean. in all stateless session beans, only read into the stateful
              bean.
              Thank you,
              Fujin
              

    This has been fixed in WLS 6.1 SP2.
              jagdip Talla wrote:
              > Hi Fujin,
              > please let me know, if u were able to solve the problem..
              >
              > hi guys,
              > appreciate if you could give me some clues
              > how to solve this problem ?
              >
              > i hv 2 WLS instances in a cluster,
              > when one server instance is shut down, i keep getting these errors ?
              > is it normal ?
              > <Feb 19, 2002 2:57:53 PM SGT> <Error> <EJB> <Failed to update the secondary copy of a stateful session bean from home:ejb/xyzrel1_2/xxxxHome>
              >
              > appreciate if u can let me know, if u could solve it..?
              >
              > thanks n regads
              > jagdip
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • Stateful session bean

    I am creating a web application using JSPs and want to keep stateful information from one call to the next.  In the first jsp I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    In the second JSP I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    out.println("<hr>Username get<br>");
    out.println(testbean.getUsername());
    out.println("<hr>");
    The second JSP always prints null for the username.  I always thought when creating a stateful session bean, it looks for an instantiated class that is tied to the client and then if it isn't found, creates a new class.  It appears to always be creating a new object.
    Every example I see, shows then creating the stateful and then stuffing it into the session.  Is this really the way to do it?

    I am creating a web application using JSPs and want to keep stateful information from one call to the next. In the first jsp I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    In the second JSP I run the code:
    InitialContext ic = new InitialContext();
    StatefulTestLocal testbean = ((StatefulTestLocalHome)ic.lookup("java:comp/env/ejb/StatefulTestBean")).create();
    testbean.setUsername(request.getParameter("uname"));
    out.println("<hr>Username get");
    out.println(testbean.getUsername());
    out.println("<hr>");
    The second JSP always prints null for the username. I always thought when creating a stateful session bean, it looks for an instantiated class that is tied to the client and then if it isn't found, creates a new class. It appears to always be creating a new object.
    Every example I see, shows then creating the stateful and then stuffing it into the session. Is this really the way to do it?

  • My weblogic 7 can not run stateful session bean??

    Hi,all
    I create a stateful session bean in jbuilder 7 and deploy it to weblogic 7,it
    successed.The Home interface have a method like this:
    public TestRemote create(int var) throws RemoteException, CreateException;
    But the client test bean call the create(int var) method throwing
    a exception :
    java.lang.IllegalArgumentException: wrong number of arguments
    Start server side stack trace:
    java.lang.IllegalArgumentException: wrong number of arguments
         at java.lang.reflect.Constructor.newInstance(Native Method)
         at weblogic.rmi.internal.OIDManager.makeActivatableServerReference(OIDManager.java:203)
         at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:129)
         at weblogic.common.internal.RemoteObjectReplacer.getReplacement(RemoteObjectReplacer.java:265)
         at weblogic.common.internal.RemoteObjectReplacer.replaceObject(RemoteObjectReplacer.java:107)
         at weblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:53)
         at weblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.replaceObject(ChunkedObjectOutputStream.java:239)
         at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:323)
         at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:107)
         at weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:82)
         at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
         at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:762)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:295)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    -- Failed: create(0)
         at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:109)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:127)
         at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLStub.create(Unknown Source)
         at com.berserk.ejb.TestClient1.create(TestClient1.java:102)
         at com.berserk.ejb.TestClient1.main(TestClient1.java:199)
    -- Return value from create(0): null.
    Then I deploy it to the borland application server 4.5,it did work!!
    Somebody can help me ?thx

    Try throwing a CreateException in ejbCreate (int var).
    Jackie wrote:
    hi,Sabha:
    My source codes is like this.
    the home interface:
    import java.rmi.*;
    import javax.ejb.*;
    public interface TestHome extends EJBHome
    public TestRemote create(int var) throws RemoteException, CreateException;
    the remote interface :
    import java.rmi.*;
    import javax.ejb.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public interface TestRemote extends EJBObject
    public void saycool() throws java.rmi.RemoteException;
    the stateful bean:
    import java.rmi.*;
    import javax.ejb.*;
    public class Test implements SessionBean
    private SessionContext sessionContext;
    private int m_var;
    public void ejbCreate(int var)
    this.m_var=var;
    public void ejbRemove()
    public void ejbActivate()
    public void ejbPassivate()
    public void setSessionContext(SessionContext sessionContext)
    this.sessionContext = sessionContext;
    public void saycool() throws java.rmi.RemoteException
    System.out.println("so cool");
    the client test class:
    import javax.naming.*;
    import java.util.Properties;
    import javax.rmi.PortableRemoteObject;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class TestClient1
    static final private String ERROR_NULL_REMOTE = "Remote interface reference
    is null. It must be created by calling one of the Home interface methods first.";
    static final private int MAX_OUTPUT_LINE_LENGTH = 100;
    private boolean logging = true;
    private TestHome testHome = null;
    private TestRemote testRemote = null;
    //Construct the EJB test client
    public TestClient1()
    long startTime = 0;
    if (logging)
    log("Initializing bean access.");
    startTime = System.currentTimeMillis();
    try
    //get naming context
    Context ctx = getInitialContext();
    //look up jndi name
    Object ref = ctx.lookup("TestRemote");
    //cast to Home interface
    testHome = (TestHome) PortableRemoteObject.narrow(ref, TestHome.class);
    if (logging)
    long endTime = System.currentTimeMillis();
    log("Succeeded initializing bean access.");
    log("Execution time: " + (endTime - startTime) + " ms.");
    catch(Exception e)
    if (logging)
    log("Failed initializing bean access.");
    e.printStackTrace();
    private Context getInitialContext() throws Exception
    String url = "t3://lettam:7001";
    String user = null;
    String password = null;
    Properties properties = null;
    try
    properties = new Properties();
    properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, url);
    if (user != null)
    properties.put(Context.SECURITY_PRINCIPAL, user);
    properties.put(Context.SECURITY_CREDENTIALS, password == null
    ? "" : password);
    return new InitialContext(properties);
    catch(Exception e)
    log("Unable to connect to WebLogic server at " + url);
    log("Please make sure that the server is running.");
    throw e;
    // Methods that use Home interface methods to generate a Remote interface
    reference
    public TestRemote create(int var)
    long startTime = 0;
    if (logging)
    log("Calling create(" + var + ")");
    startTime = System.currentTimeMillis();
    try
    testRemote = testHome.create(var);
    if (logging)
    long endTime = System.currentTimeMillis();
    log("Succeeded: create(" + var + ")");
    log("Execution time: " + (endTime - startTime) + " ms.");
    catch(Exception e)
    if (logging)
    log("Failed: create(" + var + ")");
    e.printStackTrace();
    if (logging)
    log("Return value from create(" + var + "): " + testRemote + ".");
    return testRemote;
    // Methods that use Remote interface methods to access data through the bean
    public void saycool()
    if (testRemote == null)
    System.out.println("Error in saycool(): " + ERROR_NULL_REMOTE);
    return ;
    long startTime = 0;
    if (logging)
    log("Calling saycool()");
    startTime = System.currentTimeMillis();
    try
    testRemote.saycool();
    if (logging)
    long endTime = System.currentTimeMillis();
    log("Succeeded: saycool()");
    log("Execution time: " + (endTime - startTime) + " ms.");
    catch(Exception e)
    if (logging)
    log("Failed: saycool()");
    e.printStackTrace();
    public void testRemoteCallsWithDefaultArguments()
    if (testRemote == null)
    System.out.println("Error in testRemoteCallsWithDefaultArguments():
    " + ERROR_NULL_REMOTE);
    return ;
    saycool();
    // Utility Methods
    private void log(String message)
    if (message == null)
    System.out.println("-- null");
    return ;
    if (message.length() > MAX_OUTPUT_LINE_LENGTH)
    System.out.println("-- " + message.substring(0, MAX_OUTPUT_LINE_LENGTH)
    + " ...");
    else
    System.out.println("-- " + message);
    //Main method
    public static void main(String[] args)
    TestClient1 client = new TestClient1();
    client.create(0);
    // Use the client object to call one of the Home interface wrappers
    // above, to create a Remote interface reference to the bean.
    // If the return value is of the Remote interface type, you can use it
    // to access the remote interface methods. You can also just use the
    // client object to call the Remote interface wrappers.
    Thank you for your help!!
    "Sabha" <[email protected]> wrote:
    Can you attach the sources of your ejb. Thanks.
    -Sabha
    "Jackie Lee" <[email protected]> wrote in message
    news:[email protected]...
    Hi,all
    I create a stateful session bean in jbuilder 7 and deploy it to weblogic7,it
    successed.The Home interface have a method like this:
    public TestRemote create(int var) throws RemoteException,CreateException;
    But the client test bean call the create(int var) method throwing
    a exception :
    java.lang.IllegalArgumentException: wrong number of arguments
    Start server side stack trace:
    java.lang.IllegalArgumentException: wrong number of arguments
    at java.lang.reflect.Constructor.newInstance(Native Method)
    atweblogic.rmi.internal.OIDManager.makeActivatableServerReference(OIDManager.j
    ava:203)
    at weblogic.rmi.internal.OIDManager.getReplacement(OIDManager.java:129)
    atweblogic.common.internal.RemoteObjectReplacer.getReplacement(RemoteObjectRep
    lacer.java:265)
    atweblogic.common.internal.RemoteObjectReplacer.replaceObject(RemoteObjectRepl
    acer.java:107)
    atweblogic.common.internal.ChunkedObjectOutputStream.replaceObject(ChunkedObje
    ctOutputStream.java:53)
    atweblogic.common.internal.ChunkedObjectOutputStream$NestedObjectOutputStream.
    replaceObject(ChunkedObjectOutputStream.java:239)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:323)
    atweblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObject
    OutputStream.java:107)
    atweblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:8
    2)
    at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:346)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:300)
    atweblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:762)
    atweblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:295)
    atweblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    End server side stack trace
    -- Failed: create(0)
    atweblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.
    java:109)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:127)
    at com.berserk.ejb.Test_a6z4o8_HomeImpl_WLStub.create(Unknown Source)
    at com.berserk.ejb.TestClient1.create(TestClient1.java:102)
    at com.berserk.ejb.TestClient1.main(TestClient1.java:199)
    -- Return value from create(0): null.
    Then I deploy it to the borland application server 4.5,it did work!!
    Somebody can help me ?thx
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Reentrant call to a stateful session bean

    Hi,
    I have a problem that seems to be a very common problem but I
    steel didn't find any solution for it.
    We have a jsp page that call to stateful session been, the
    problem occur when I click twice on any link/button then I get
    java.rmi.RemoteException: Illegal attempt to make a reentrant call to a stateful
    session bean from home:....
    I have tried to set the <allow-concurrent-calls> to true but it doesn't help,
    I am getting this exception no matter the value of this tag.
    I am using WL61 sp2 (the last version) , Does anybody find a solution for that,
    I don't want to use javascript in order to work around this problem.
    Thanks,

    I think this is a different error from concurrent access (when client's
    attempt to access the same bean concurrently WebLogic throws LockTimedOut error
    (or client blocks if allow-concurrent-calls is true)).
    This error probably means that your code attempetd to reenter bean in the same
    transaction - how do you invoke it and what is the stack trace?
    Haim Cohen <[email protected]> wrote:
    Hi,
    I have a problem that seems to be a very common problem but I
    steel didn't find any solution for it.
    We have a jsp page that call to stateful session been, the
    problem occur when I click twice on any link/button then I get
    java.rmi.RemoteException: Illegal attempt to make a reentrant call to a stateful
    session bean from home:....
    I have tried to set the <allow-concurrent-calls> to true but it doesn't help,
    I am getting this exception no matter the value of this tag.
    I am using WL61 sp2 (the last version) , Does anybody find a solution for that,
    I don't want to use javascript in order to work around this problem.
    Thanks, --
    Dimitri

  • Spawning thread in the stateful session bean

    I ran into an interesting issue: I am spawning a thread inside
    my stateful session bean's ejbCreate(...) method. The spawned
    thread runs in an infinite loop until some stop signal. The
    thread uses some BMP entity beans to access some data from DB,
    it creates some BMP entity beans as well as creates another
    stateful session bean in each iteration. The application ran
    into a crash. Now I have a couple questions:
    - First, is it an allowed operation to have a stateful session
    bean spawn off threads? Am I violating the specs?
    - Second, is it also allowed to have that thread create another
    bmp entity bean and another stateful session bean? Again, am I
    violating the specs also in here?
    Your responses will be very much appreciated.
    - Simon

    From the EJB 2.0 Spec, Section 24.1.2:
    <quote>
    These networking functions are reserved for the EJB Container.
    Allowing the enterprise bean to use these functions could compromise
    security and decrease the Container’s ability to properly manage the
    runtime environment.
    • The enterprise bean must not attempt to manage threads. The
    enterprise bean must not attempt to start, stop, suspend, or resume
    a thread; or to change a thread’s priority or name. The enter-prise
    bean must not attempt to manage thread groups.
    <quote>
    And, spawning threads in weblogic is highly discouraged in any
    server-side component. An application should not be designed this
    way.
    Bill
    Simon wrote:
    I ran into an interesting issue: I am spawning a thread inside
    my stateful session bean's ejbCreate(...) method. The spawned
    thread runs in an infinite loop until some stop signal. The
    thread uses some BMP entity beans to access some data from DB,
    it creates some BMP entity beans as well as creates another
    stateful session bean in each iteration. The application ran
    into a crash. Now I have a couple questions:
    - First, is it an allowed operation to have a stateful session
    bean spawn off threads? Am I violating the specs?
    - Second, is it also allowed to have that thread create another
    bmp entity bean and another stateful session bean? Again, am I
    violating the specs also in here?
    Your responses will be very much appreciated.
    - Simon

  • Help!!! Stateful session bean clustering

              I posted this message on interest.clustering.in-memory-replication. But there is
              no answer at all. Could anyone give me
              some hints? Thanks a lot. I am a student and this work is part of my course project.
              It is due soon.
              =================================================================
              I have a big problem to get stateful session bean in-memory replication run on
              clustering. I have three server instances on three nodes and there is always errors
              from the server instance like this when I run the client to invoke the bean methods:
              <Jan 4, 2002 6:47:31 PM EST> <Error> <EJB> <Failed to update the secondary copy
              of a stateful session bean from home:stateful.ejb.AgentSTF>
              Besides, the load balancing can not work probably too. Below is what I get.
              Statistics for different servers:
              "myserver" processed 160 (12%) of 1311 invocations "ejbperf-3" processed 1151
              (88%) of 1311 invocations
              End Client...
              Load balancing works fine with stateless and entity bean.
              Any comments are greatly appreciated.
              Jenny
              

    Hi Jenny,
              Please could you open a case to the customer support ([email protected]) There is a Cr
              on this issue CR059046
              Description of the CR
              WLS 6.1SP1 - Accessing Stateful Session Bean from Stateless Session Bean in a
              cluster fails with errors
              <Oct 5, 2001 5:08:25 PM GMT+00:00> <Error> <EJB> <Failed to update the
              secondary copy of a stateful session bean from home:UserState>
              Regards
              Stephane
              Jenny Liu wrote:
              > I posted this message on interest.clustering.in-memory-replication. But there is
              > no answer at all. Could anyone give me
              > some hints? Thanks a lot. I am a student and this work is part of my course project.
              > It is due soon.
              >
              > =================================================================
              >
              > I have a big problem to get stateful session bean in-memory replication run on
              > clustering. I have three server instances on three nodes and there is always errors
              > from the server instance like this when I run the client to invoke the bean methods:
              >
              > <Jan 4, 2002 6:47:31 PM EST> <Error> <EJB> <Failed to update the secondary copy
              > of a stateful session bean from home:stateful.ejb.AgentSTF>
              >
              > Besides, the load balancing can not work probably too. Below is what I get.
              >
              > Statistics for different servers:
              > "myserver" processed 160 (12%) of 1311 invocations "ejbperf-3" processed 1151
              > (88%) of 1311 invocations
              > End Client...
              >
              > Load balancing works fine with stateless and entity bean.
              >
              > Any comments are greatly appreciated.
              >
              > Jenny
              >
              Regards,
              Stephane Kergozien
              BEA Support
              

  • Looking up EJBs from a java client

    While trying to migrate my application from standalone-oc4j
    to Oracle Application Server 10g, I ran into the following problem.
    My application has a stateless session bean. When trying to lookup the bean (from a java client), I get the following exception:
    javax.naming.NamingException: Lookup error: javax.naming.AuthenticationException
    Invalid username/password for UnifyoccEAR (ias_admin)
    My code used the username/password I used to log into web-based console (which I used to deploy the application). The lookup code follows:
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    OracleJASLayer.INITIAL_CONTEXT_FACTORY);
    env.put(Context.PROVIDER_URL, "ormi://localhost:3201/UnifyoccEAR");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, username);
    env.put(Context.SECURITY_CREDENTIALS, password);
    Context ctx = new InitialContext(env);
    Object obj = ctx.lookup("unify/nxj/controlCenters/occ/ControlCenterEJB");
    On a whim, I tried the old SCOTT/TIGER username/password and got the following
    exception:
    javax.naming.NoPermissionException: Not allowed to look up unify/nxj/controlCenters/occ/ControlCenterEJB,
    check the namespace-access tag setting in orion-application.xml for details
    So evidently, SCOTT/TIGER is in the security database used by the app (but isn't
    authorized) while the ias_admin user is not in the security database.
    I have the following questions:
    1. In the default configuration, is there a username/password I can use to
    lookup EJB homes in the jndi namespace of an OC4J instance? If so, what
    is it?
    2. Where is the security database? I tried looking in the web-based console
    to find how to configure security and could not figure it out. I did find
    the Security page for the application, but when I tried to add a user,
    it had no effect. Furthermore, this page did not show a user entry for
    SCOTT; hence, it doesn't seem that OC4J is actually using the information
    on this page. This is strange because the path to this page is:
    Farm > Application Server: ias_admin.lab10.sac.unify.com > OC4J: home > Application: UnifyoccEAR > Security
    I then went to the Security page for the default application and found
    that it did have a SCOTT user. So I added a new user and tried to run
    my java client. This resulted in the javax.naming.AuthenticationException
    described above (I was expected the NoPermissionException encounted when
    using SCOTT/TIGER). Next, I used the Security page for the default application
    to change the password for SCOTT and reran my java client using SCOTT/TIGER.
    This time I was expecting an AuthenticationException exception, but got the
    NoPermission exception. Therefore, it seems that OC4J isn't using this
    security data either.
    Hunting in the console (again) for the security database, I stumble accross
    the Infrasturcture page and see an Identity Management section and see that
    it is configure to use an Oracle Internet Directory server. Using
    <ORACLE_HOME>/bin/oidadmin, I connect to the directory server and look
    for the SCOTT user. I don't find it, so I believe that this can't be the
    security database either.
    3. Finally, how do I configure the OC4J instance such that it will allow
    anonymous users to lookup my EJB from a java client?
    Please help a confused and frustrated user.

    Looking at your example, it looks like you are using a J2EE client container or some properties file to specify the JNDI environment used to create the initial context (for you use the no-arg constructor to InitialContext). Since our application needs to the ability to dynamically connect to ejb's running on different Java application servers (e.g., WebLogic, WebSphere, JBoss), such an approach will not work. Instead we must do it the old-fashioned way and pass the jdni connection info to the InitialContext constructor.
    In any event, our problem isn't how to write the connection code, it is how to test it. Specifically, we can't figure out a valid username/password that will allow us to look up the home. Nor can we figure out how to configure security for the oc4j instance.

Maybe you are looking for

  • Authorization error in sm59 with a weird pop-up

    Hi I want to use a server proxy, therefore created an http connection in sm59 of the xi-system pointing to the ERP-System. My connection parameters Target Host: my ERP-System Host path prefix: /sap/xi/engine?type=entry (maybe receiver?!) Service Numb

  • Loose data

    Hello, I acquire data from 2 device 6025E by sharing the scan clock. But I have some problem to save data on DIADEM. I loose datas. For example, with a test during 2mn30, I have only a duration of 2mn15 on DIADEM. Moreover, I loose data during all th

  • Accrual document configuration steps

    Hi expert can any one give configuration step for accrual and deferral document (prepaid expenses)   regards krishnamohan

  • Good practice for charging notebook

    Gday, I just bought new pavilion notebook and  read this on the User Manual: "The computer does not use battery power when the computer is connected to AC external power with an approved AC adapter or an optional docking/expansion device." (chapt 6 p

  • Enterprise Manager not able to connect to the Database Instance

    After logging into the OEM as a SYS user , I was able to mount the database . The Database status shown to me as below, Listener - up Agent Connection to the Instance - unavailable Database instance- down - message - Enterprise Manager is not able to