Remove() on EJBObect really removes associated session bean(Stateless) ?

Look at code snippet
hello.getGreetings();//hello is EJB Remote Object
hello.remove();
hello.getGreetings();//This shouldn't work ... But it is giving me greeting message

Look at code snippet
hello.getGreetings();//hello is EJB Remote Object
hello.remove();
hello.getGreetings();//This shouldn't work ... But it
is giving me greeting messageNo, of course you cannot delete an instance of stateless bean.
It's because they live in a pool and only EJB container decides when to create or delete bean instances.

Similar Messages

  • Naming Exception Error for Session Bean (Stateless) in JDeveloper

    I have written a session bean stateless in JDeveloper Environment. When i running that bean i getting the following error message.
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused:
    how can we resolve this error?

    http://forum.java.sun.com/thread.jsp?forum=54&thread=484437&tstart=0&trange=15
    -Regards
    Manikantan

  • HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean

    HOWTO: Using a BC4J Application Module in an Stateless EJB Session Bean
    by Steve Muench
    Overview
    BC4J provides automatic facilities for deploying any application module as a stateful EJB session bean. If you want to leverage the features of your BC4J application module from a stateless EJB session bean, it's not automatic but it is straightforward to implement. This howto article explains the details.
    For our example, we will create a stateless EJB session bean that uses a container-managed transaction. To keep things simple, let's assume the session bean has a single public method on its remote interface named createDepartment() with the following signature:
    public void createDepartment(int id, String name, String loc) throws AppException
    AppException is an example of an application-specific exception that our method will throw if any problems arise during its execution.The goal of this article is to illustrate how to use the BC4J application module named com.example.hr.HRApp as part of the implementation of this createDepartment method on our stateless enterprise bean. Let's assume that the HRApp application module has a view object member named Departments, based on the com.example.hr.DeptView view object, based on the familiar DEPT table and related to the com.example.hr.Dept entity object so our view can be updateable.
    Creating the Stateless Session Bean
    We can start by using the JDeveloper Enterprise Bean wizard to create a new stateless session bean called StatelessSampleEJB implemented by:[list][*]com.example.StatelessSampleEJBBean (Bean class)[*]com.example.StatelessSampleEJBHome (Home interface)[*]com.example.StatelessSampleEJB (Remote interface)[list]
    We then use the EJB Class Editor to add the createDepartment method to the remote interface of StatelessSampleEJB with the signature above. We edit the remote interface to make sure that it also reflects that the createDepartment method thows the AppException like this:
    package com.example;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface StatelessSampleEJB extends EJBObject {
      void createDepartment(int id, String name, String loc)
      throws RemoteException,AppException;
    }Before we start adding BC4J into the picture for our implementation, our StatelessSampleEJBBean class looks like this:
    package com.example;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class StatelessSampleEJBBean implements SessionBean {
      public void ejbCreate(){}
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){
      public void createDepartment(int id, String name, String loc) 
      throws AppException {
        // TODO: Implement method here
    }We can double-click on the ejb-jar.xml file in our project to see the XML deployment descriptor for the bean we just created:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
    </ejb-jar>We need to add the extra <assembly-descriptor> section in this file to indicate that the createDepartment method will require a transaction. After this edit, the ejb-jar.xml file looks like this:
    <ejb-jar>
       <enterprise-beans>
          <session>
             <description>Session Bean ( Stateless )</description>
             <display-name>StatelessSampleEJB</display-name>
             <ejb-name>StatelessSampleEJB</ejb-name>
             <home>com.example.StatelessSampleEJBHome</home>
             <remote>com.example.StatelessSampleEJB</remote>
             <ejb-class>com.example.StatelessSampleEJBBean</ejb-class>
             <session-type>Stateless</session-type>
             <transaction-type>Container</transaction-type>
          </session>
       </enterprise-beans>
       <assembly-descriptor>
          <container-transaction>
             <method>
                <ejb-name>StatelessSampleEJB</ejb-name>
                <method-name>createDepartment</method-name>
                <method-params>
                   <method-param>int</method-param>
                   <method-param>java.lang.String</method-param>
                   <method-param>java.lang.String</method-param>
                </method-params>
             </method>
             <trans-attribute>Required</trans-attribute>
          </container-transaction>
       </assembly-descriptor>
    </ejb-jar>
    Aggregating a BC4J Application Module
    With the EJB aspects of our bean setup, we can proceed to implementing the BC4J application module aggregation.
    The first thing we do is add private variables to hold the EJB SessionContext and the instance of the aggregated BC4J ApplicationModule, like this:
    // Place to hold onto the aggregated appmodule instance
    transient private ApplicationModule _am  = null;
    // Remember the SessionContext that the EJB container provides us
    private           SessionContext    _ctx = null;and we modify the default, empty implementation of the setSessionContext() method to remember the session context like this:
    public void setSessionContext(SessionContext ctx){ _ctx = ctx; }We add additional constants that hold the names of the J2EE datasource that we want BC4J to use, as well as the fully-qualified name of the BC4J application module that we'll be aggregating:
    // JNDI resource name for the J2EE datasource to use
    private static final String DATASOURCE = "jdbc/OracleCoreDS";
    // Fully-qualified BC4J application module name to aggregate
    private static final String APPMODNAME = "com.example.hr.HRApp";We expand the now-empty ejbCreate() and ejbRemove() methods to create and destory the aggregated instance of the BC4J application module that we'll use for the lifetime of the stateless session bean. When we're done, ejbCreate() it looks like this:
    public void ejbCreate() throws CreateException {
      try {
        // Setup a hashtable of environment parameters for JNDI initial context
        Hashtable env = new Hashtable();
        env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
        // NOTE: we want to use the BC4J app module in local mode as a simple Java class!
        env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
        env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
        // Create an initial context, using this hashtable of environment params
        InitialContext ic = new InitialContext(env);
        // Lookup a home interface for the application module
        ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
        // Using the home, create the instance of the appmodule we'll use
        _am = home.create();
        // Register the BC4J factory to handle EJB container-managed transactions
        registerContainerManagedTransactionHandlerFactory();
      catch(Exception ex) {
         ex.printStackTrace();
        throw new CreateException(ex.getMessage());
    }and ejbRemove() looks like this:
    public void ejbRemove() {
      try {
        // Cleanup any appmodule resources before getting shutdown
        _am.remove();
      catch(JboException ex) { /* Ignore */ }
    }The helper method named reigsterContainerManagedTransactionHandlerFactory() looks like this:
    private void registerContainerManagedTransactionHandlerFactory() {
      SessionImpl session = (SessionImpl)_am.getSession();
      session.setTransactionHandlerFactory(
        new TransactionHandlerFactory() {
          public TransactionHandler  createTransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
          public JTATransactionHandler createJTATransactionHandler() {
            return new ContainerManagedTxnHandlerImpl();
    }The last detail is to use the BC4J appmodule to implement the createDepartment() method. It ends up looking like this:
    public void createDepartment(int id, String name, String loc)
    throws AppException {
      try {
        // Connect the AM to the datasource we want to use for the duration
        // of this single method call.
        _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
        // Use the "Departments" view object member of this AM
        ViewObject departments = _am.findViewObject("Departments");
        // Create a new row in this view object.
        Row newDept = departments.createRow();
        // Populate the attributes from the parameter arguments.
        newDept.setAttribute("Deptno", new Number(id));
        newDept.setAttribute("Dname", name);
        newDept.setAttribute("Loc", loc);
        // Add the new row to the view object's default rowset
        departments.insertRow(newDept);
        // Post all changes in the AM, but we don't commit them. The EJB
        // container managed transaction handles the commit.
        _am.getTransaction().postChanges();
      catch(JboException ex) {
        // To be good EJB Container-Managed Transaction "citizens" we have
        // to mark the transaction as needing a rollback if there are problems
        _ctx.setRollbackOnly();
        throw new AppException("Error creating dept "+ id +"\n"+ex.getMessage());
      finally {
        try {
          // Disconnect the AM from the datasource we're using
          _am.getTransaction().disconnect();
        catch(Exception ex) { /* Ignore */ }
    Building a Test Client
    With the EJB-Tier work done, we can build a sample client program to test this new stateless EJB Session Bean by selecting the bean in the Oracle9i JDeveloper IDE and choosing "Create Sample Java Client" from the right-mouse menu.
    When the "Sample EJB Client Details" dialog appears, we take the defaults of connecting to embedded OC4J container. Clicking the (OK) button generates the following test class:
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import com.example.StatelessSampleEJB;
    import com.example.StatelessSampleEJBHome;
    public class SampleStatelessSampleEJBClient {
      public static void main(String [] args) {
        SampleStatelessSampleEJBClient sampleStatelessSampleEJBClient =
           new SampleStatelessSampleEJBClient();
        try {
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY,
                  "com.evermind.server.rmi.RMIInitialContextFactory");
          env.put(Context.SECURITY_PRINCIPAL, "admin");
          env.put(Context.SECURITY_CREDENTIALS, "welcome");
          env.put(Context.PROVIDER_URL,
                  "ormi://localhost:23891/current-workspace-app");
          Context ctx = new InitialContext(env);
          StatelessSampleEJBHome statelessSampleEJBHome =
               (StatelessSampleEJBHome)ctx.lookup("StatelessSampleEJB");
          StatelessSampleEJB statelessSampleEJB;
          // Use one of the create() methods below to create a new instance
          // statelessSampleEJB = statelessSampleEJBHome.create();
          // Call any of the Remote methods below to access the EJB
          // statelessSampleEJB.createDepartment( int id, java.lang.String name, java.lang.String loc );
        catch(Throwable ex) {
          ex.printStackTrace();
    }We uncomment the call to the create() method and add a few calls to the createDepartment() method so that the body of the test program now looks like this:
    // Use one of the create() methods below to create a new instance
    statelessSampleEJB = statelessSampleEJBHome.create();
    // Call any of the Remote methods below to access the EJB
    statelessSampleEJB.createDepartment( 13, "Test1","Loc1");
    System.out.println("Created department 13");
    statelessSampleEJB.createDepartment( 14, "Test2","Loc2");
    System.out.println("Created department 14");
    try {
      // Try setting a department id that is too large!
      statelessSampleEJB.createDepartment( 23456, "Test3","Loc3");
    catch (AppException ax) {
      System.err.println("AppException: "+ax.getMessage());
    }Before we can successfully run our SampleStatelessSampleEJBClient we need to first run the EJB bean that the client will try to connect to. Since Oracle9i JDeveloper supports local running and debugging of the EJB-Tier without doing through a full J2EE deployment step, to accomplish this prerequisite step we just need to right-mouse on the StatelessSampleEJB node in the System Navigator and select "Run". This starts up the embedded OC4J instance and runs the EJB right out of the current out path.Finally, we can run the SampleStatelessSampleEJBClient, and see the output of the test program in the JDeveloper log window:
    Created department 13
    Created department 14
    AppException: Error creating dept 23456
    JBO-27010: Attribute set with value 23456 for Deptno in Dept has invalid precision/scale
    Troubleshooting
    One error that might arise while running the example is that the database connection information in your data-sources.xml for the jdbc/OracleCoreDS datasource does not correspond to the database you are trying to test against. If this happens, then double-check the file .\jdev\system\oc4j-config\data-sources.xml under the JDeveloper installation home directory to make sure that the url value provided is what you expect. For example, to work against a local Oracle database running on your current machine, listening on port 1521, with SID of ORCL, you would edit this file to have an entry like this for jdbc/OracleCoreDS :
    <data-source
        class="com.evermind.sql.DriverManagerDataSource"
        name="OracleDS"
        location="jdbc/OracleCoreDS"
        xa-location="jdbc/xa/OracleXADS"
        ejb-location="jdbc/OracleDS"
        connection-driver="oracle.jdbc.driver.OracleDriver"
        username="scott"
        password="tiger"
        url="jdbc:oracle:thin:@localhost:1521:ORCL"
        inactivity-timeout="30"
    />This is the data-sources.xml file that gets used by the embedded OC4J instance running in JDeveloper.
    Conclusion
    Hopefully this article has illustrated that it is straightforward to utilize the full power of BC4J in local mode as part of your EJB Stateless Session Beans using container-managed transaction. This example illustrated a single createDepartment method in the enterprise bean, but by replicating the application module interaction code that we've illustrated in createDepartment, any number of methods in your stateless session bean can use the aggregated application module instance created in the ejbCreate() method.
    Code Listing
    The full code listing for the SampleStatelessEJB bean implementation class looks like this:
    * StatelessSampleEJB
    * Illustrates how to use an aggregated BC4J application module
    * in local mode as part of the implementation of a stateless
    * EJB session bean using container-managed transaction.
    * HISTORY
    * smuench/dmutreja 14-FEB-2002 Created
    package com.example;
    import oracle.jbo.*;
    import oracle.jbo.server.*;
    import javax.ejb.*;
    import oracle.jbo.domain.Number;
    import oracle.jbo.common.PropertyConstants;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import oracle.jbo.server.ejb.ContainerManagedTxnHandlerImpl;
    public class StatelessSampleEJBBean implements SessionBean {
      // JNDI resource name for the J2EE datasource to use
      private static final String DATASOURCE = "jdbc/OracleCoreDS";
      // Fully-qualified BC4J application module name to aggregate
      private static final String APPMODNAME = "com.example.hr.HRApp";
      // Place to hold onto the aggregated appmodule instance
      transient private ApplicationModule _am  = null;
      // Remember the SessionContext that the EJB container provides us
      private           SessionContext    _ctx = null;
      public void ejbCreate() throws CreateException {
        try {
          // Setup a hashtable of environment parameters for JNDI initial context
          Hashtable env = new Hashtable();
          env.put(JboContext.INITIAL_CONTEXT_FACTORY,JboContext.JBO_CONTEXT_FACTORY);
          env.put(JboContext.DEPLOY_PLATFORM, JboContext.PLATFORM_LOCAL);
          env.put(PropertyConstants.INTERNAL_CONNECTION_PARAMS,DATASOURCE);
          // Create an initial context, using this hashtable of environment params
          InitialContext ic = new InitialContext(env);
          // Lookup a home interface for the application module
          ApplicationModuleHome home = (ApplicationModuleHome)ic.lookup(APPMODNAME);
          // Using the home, create the instance of the appmodule we'll use
          _am = home.create();
          // Register the BC4J factory to handle EJB container-managed transactions
          registerContainerManagedTransactionHandlerFactory();
        catch(Exception ex) {
           ex.printStackTrace();
          throw new CreateException(ex.getMessage());
      public void ejbActivate(){}
      public void ejbPassivate(){}
      public void ejbRemove(){}
      public void setSessionContext(SessionContext ctx){ _ctx = ctx; }
      public void createDepartment(int id, String name, String loc)
      throws AppException {
        try {
          // Connect the AM to the datasource we want to use for the duration
          // of this single method call.
          _am.getTransaction().connectToDataSource(null,DATASOURCE,false);
          // Use the "Departments" view object member of this AM
          ViewObject departments = _am.findViewObject("Departments");
          // Create a new row in this view object.
          Row newDept = departments.createRow();
          // Populate the attributes from the parameter arguments.
          newDept.setAttribute("Deptno", new Number(id));
          newDept.setAttribute("Dname", name);
          newDept.setAttribute("Loc", loc);
          // Add the new row to the view object's default rowset
          departments.insertRow(newDept);
          // Post all changes in the AM, but we don't commit them. The EJB
          // container managed transaction handles the commit.
          _am.getTransaction().postChanges();
        catch(JboException ex) {
          // To be good EJB Container-Managed Transaction "citizens" we have
          // to mark the transaction as needing a rollback if there are problems
          _ctx.setRollbackOnly();
          throw new AppException("Error creating dept "+ id +\n"+ex.getMessage());
        finally {
          try {
            // Disconnect the AM from the datasource we're using
            _am.getTransaction().disconnect();
          catch(Exception ex) { /* Ignore */ }
      private void registerContainerManagedTransactionHandlerFactory() {
        SessionImpl session = (SessionImpl)_am.getSession();
        session.setTransactionHandlerFactory(
          new TransactionHandlerFactory() {
            public TransactionHandler createTransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();
            public JTATransactionHandler createJTATransactionHandler() {
              return new ContainerManagedTxnHandlerImpl();

    Hi Steve, It4s me again;
    About the question I made, I tried with a single assembly-descriptor tag and a single container-transaction tag in the deployment descriptor of the session bean and these were the results.
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Then I tried with multiple assembly-descriptor tags each with a single container-transaction tag and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    Finally I tried with a single assembly-descriptor and multiple container tags and the results were:
    java.lang.NullPointerException
         void com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(java.lang.Throwable)
         java.lang.Object com.evermind.server.rmi.RMIConnection.invokeMethod(com.evermind.server.rmi.RMIContext, long, long, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         java.lang.Object com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
         void __Proxy1.modificaEnvoltura(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String)
         void SamplemdeController.envolturaControlEJBClient.main(java.lang.String[])
    How can I make my Stateless Session bean work out?

  • Connect Java Application with a Session Bean

    Hi,
    my Problem is following:
    I have session bean (stateless) and i try to write i client for it!
    I get always the same error message, when i call the java ClientApplication from the Command line:
    java -jar Betting_server.jar BettingServer
    StartBetting Server
    Part1
    Caught an unexpected exception!
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory. Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:217)
    at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
    at javax.naming.InitialContext.init(InitialContext.java:219)
    at javax.naming.InitialContext.<init>(InitialContext.java:195)
    at at.siemens.mma.iap.betting.server.CreateQRunTimer$RemindTask.run(CreateQRunTimer.java:47)
    at java.util.TimerThread.mainLoop(Timer.java:432)
    at java.util.TimerThread.run(Timer.java:382)
    My configuration:
    jboss-3.2.1_tomcat-4.1.24
    j2sdkee1.3.1
    j2sdk1.4.1_02
    My Client Class:
    package betting.server;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.util.*;
    import betting.ejb.*;
    public class CreateQRunTimer {
         Timer timer;
         public CreateQRunTimer() {
              timer = new Timer();
              timer.schedule(new RemindTask(),
                        0, //initial delay
                        1*60*1000); //subsequent rate 30 minutes
         class RemindTask extends TimerTask {
              public void run() {
                   String logicalBettingBeanName = "MyBetting";
                   Betting bet;
                   BettingHome bethome;
                   try
                        System.out.println("Part1");
                        Properties props = new Properties();
                             props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
                             props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
                             props.put("java.naming.provider.url", "localhost:1099");
                        InitialContext ic = new InitialContext(props);
                        System.out.println("Part2");
                        Object objref = ic.lookup(logicalBettingBeanName);
                        System.out.println("Part3");
                        bethome =(BettingHome)PortableRemoteObject.narrow(objref,BettingHome.class);
                        bet = bethome.create();
                        long qRunMagicNum = bet.DB_CreateQRun();
                        if(bet.CreateConfigurationFileQuery(qRunMagicNum) == false)
                             // failed
                             System.out.print("CreateConfigFileQuery failed");
                        else
                             bet.TransferXMLFiles("tvbetqrun.conf",0);
                             System.out.print("CreateConfigFileQuery succed");
                   catch (Exception ex)
                        System.err.println("Caught an unexpected exception!");
                        ex.printStackTrace();
                   System.out.println("Run GG");
                   //System.exit(0); //Stops the AWT thread (and everything else)

    Normally, if you are executing the client from the command line, you do not specify the classpath in a XML file (unless you are using ant or something similar). You can specify the classpath by using the -classpath option.
    Try something like
    java -classpath <path_to_jboss>/client/jbossall-client.jar;Betting_server.jar BettingServer
    You can check the classpath in your client with the statement
    System.out.print(System.getProperty("java.class.path"));

  • Deploying session bean on sun java application server

    Hi,
    I'm using sun java system application server 8.2.
    I just want to deploy a session bean (stateless) on it.
    Please tell me the procedure.
    Thanks

    problem is coming in Resource Type and Factory class when configuring JNDI.
    what value I should give for the Resource Type and Factory class?
    Please tell me.
    Thanks

  • Problem in running a simple session bean in JOnAS

    Hi folks ,
    I just started to learn J2EE using Netbeans(5.5) and JOnAS (4.8.4 ) . I
    tried to run a simple session bean(stateless)
    invoked through client application. I successfully deployed in jonas using Netbeans (5.5) but i can't able to successfully run it.
    Output i got when i run client application :
    ==========================
    init:
    deps-jar:
    init:
    deps-jar:
    compile:
    library-inclusion-in-archive:
    dist:
    compile:
    run:
    Feb 19, 2007 11:07:08 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:10 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:11 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:13 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:14 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:15 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:17 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:18 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:19 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:20 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:22 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Native Method)
            at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
            at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:320)
            ... 13 more
    Feb 19, 2007 11:07:23 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2257)
            at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2278)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:208)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:221)
            at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImpl.java:104)
            at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl.java:152)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:146)
            at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:286)
            at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
            at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
            at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:89)
            at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:128)
            at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:288)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at SimpleSessionClient.Main.main(Main.java:34)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
            at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:336)
            at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:191)
            ... 12 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at sun.nio.ch.Net.connect(Nativ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    There is a ClassDefNotFound Exception, this means that a class used (probably by the corba marshalling stuff) cannot be located. You'll need to add these classes to the client's CLASSPATH.
    Usually a client-jar file can be created or is provided by the j2ee server. If you're using the sun-wapp-server then it is done this way:
    - deploy the beans to the server (asadmin deploy)
    - create the client-stubs (asadmin client-stubs)
    - add the created client-stubs to the clients class path.
    I don't remember the exact commands for asadmin. Plz check the help. (asadmin help)
    In JBOss youll have to add jboss-all.jar to the client's classpath. It depends on the j2ee server you use.

  • Best way to remove Stateful session beans

    Hi folks.
    I'm running Weblogic 6.1. I'm trying to find the best way of removing
    stateful session beans. I know to call EJBObject.remove() on the
    client side, but this will not always happen if the client crashes or
    times out. This is a java client application connection to weblogic,
    no servlets are involved.
    Is there a way to signal the appserver to remove all stateful session
    beans associated with a user when the User logs out? I would rather
    not remove them using a time out mechanism.
    thanks.
    rob.

    But in the documentation and also based on my experience I noticed that the
    timeout does not take effect till the max-beans-in-cache limit is reached.
    How do you handle that?
    "Thomas Christen" <[email protected]> wrote in message
    news:3e35795d$[email protected]..
    Hi,
    Is there a way to signal the appserver to remove all stateful session
    beans associated with a user when the User logs out? I would rather
    not remove them using a time out mechanism.Had the same problem and solved it the following way :
    - The client has thread polling its sessionbean at the server (every 30
    Sec.)
    - The session bean has a short timeout (2 Minutes)
    If the client fails, the timeout will catch it otherwise the client will
    gracefully call remove bevor exit.
    Regards
    Tomy

  • Cannot remove stateful session bean when transaction timed out

    The transaction timeout is set to 5 minutes. After several operations on the transactional
    stateful session bean(implements SessionSynchronization), the transaction timed out
    after 5 minutes and I got the IllegalStateException when calling another business
    method. After the transaction rolled back, weblogic.ejb20.locks.LockTimedOutException
    was thrown when attempting to remove the bean. It seems the lock on the bean was
    not released even though the transaction had been rolled back. Does anyone know how
    to remove the bean in this kind of situation?
    Here is the stacktrace:
    ####<Jun 11, 2002 2:39:35 PM PDT> <Notice> <EJB> <app1x.zaplet.cc> <server25044server>
    <ExecuteThread: '11' for queue: 'default'> <> <23168:7b09681c532dc7e3> <010015> <Error
    marking transaction for rollback: java.lang.IllegalStateException: Cannot mark the
    transaction for rollback. xid=23168:7b09681c532dc7e3, status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException:
    Transaction timed out after 299 seconds
    Xid=23168:7b09681c532dc7e3(3203140),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=299,seconds left=60,activeThread=Thread[ExecuteThread: '11' for queue:
    'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[server25044+server25044server]=(state=active),properties=({weblogic.jdbc=t3://10.0.100.93:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=server25044server+10.0.100.93:7001+server25044+,
    Resources={})],CoordinatorURL=server25044server+10.0.100.93:7001+server25044+)]>
    java.lang.IllegalStateException: Cannot mark the transaction for rollback. xid=23168:7b09681c532dc7e3,
    status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction
    timed out after 299 seconds
    Xid=23168:7b09681c532dc7e3(3203140),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds
    since begin=299,seconds left=60,activeThread=Thread[ExecuteThread: '11' for queue:
    'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[server25044+server25044server]=(state=active),properties=({weblogic.jdbc=t3://10.0.100.93:7001}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=server25044server+10.0.100.93:7001+server25044+,
    Resources={})],CoordinatorURL=server25044server+10.0.100.93:7001+server25044+)]
         at weblogic.transaction.internal.TransactionImpl.throwIllegalStateException(TransactionImpl.java:1486)
         at weblogic.transaction.internal.TransactionImpl.setRollbackOnly(TransactionImpl.java:466)
         at weblogic.ejb20.manager.BaseEJBManager.handleSystemException(BaseEJBManager.java:255)
         at weblogic.ejb20.manager.BaseEJBManager.setupTxListener(BaseEJBManager.java:215)
         at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessionManager.java:371)
         at weblogic.ejb20.internal.BaseEJBObject.preInvoke(BaseEJBObject.java:117)
         at weblogic.ejb20.internal.StatefulEJBObject.preInvoke(StatefulEJBObject.java:169)
         at mypackage.MyBean_wbr3eg_EOImpl.addRecipients(MyBean_wbr3eg_EOImpl.java:450)
    ####<Jun 11, 2002 2:39:37 PM PDT> <Info> <EJB> <app1x.zaplet.cc> <server25044server>
    <ExecuteThread: '11' for queue: 'default'> <> <> <010049> <EJB Exception in method:
    remove: weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:AppmailBean
    with primary key:21,775,960,933,010,237 timed-out after waiting 0 ms. The transaction
    or thread requesting the lock was:Thread[ExecuteThread: '11' for queue: 'default',5,Thread
    Group for Queue: 'default'].>
    weblogic.ejb20.locks.LockTimedOutException: The lock request from EJB:AppmailBean
    with primary key:21,775,960,933,010,237 timed-out after waiting 0 ms. The transaction
    or thread requesting the lock was:Thread[ExecuteThread: '11' for queue: 'default',5,Thread
    Group for Queue: 'default'].
         at weblogic.ejb20.locks.ExclusiveLockManager$LockBucket.lock(ExclusiveLockManager.java:448)
         at weblogic.ejb20.locks.ExclusiveLockManager.lock(ExclusiveLockManager.java:258)
         at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSessionManager.java:226)
         at weblogic.ejb20.manager.StatefulSessionManager.acquireLock(StatefulSessionManager.java:216)
         at weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessionManager.java:310)
         at weblogic.ejb20.manager.StatefulSessionManager.remove(StatefulSessionManager.java:754)
         at weblogic.ejb20.internal.StatefulEJBObject.remove(StatefulEJBObject.java:86)
         at mypackage.MyBean_wbr3eg_EOImpl.remove(MyBean_wbr3eg_EOImpl.java:7308)

    If a stateful session throws a RuntimeException (your rollback) the container destroys the instance of the bean and all
    associated state information is lost, as required by the EJB specification.
    If you want to maintain client state it is generally best to use HttpSession objects (if you have a web application)
    for short-lived, client-specific data and JPA entities or other database backed storage for long-lived data.

  • Howto call the @Remove method of a stateful session bean after JSF page ...

    I use EJB3, JPA, JSF in my web application. There are 2 database tables: Teacher and Student. A teacher can have many (or none) students and a student can have at most 1 teacher.
    I have a JSF page to print the teacher info and all his students' info. I don't want to load the students' info eagerly because there's another JSF page I need to display the teacher info only. So I have a stateful session bean to retrieve the teacher info and all his students' info. The persistence context in that stateful session bean has the type of PersistenceContextType.EXTENDED. The reason I choose a stateful session bean and an extended persistence context is that I want to write something like this without facing the lazy initialization exception:
    <h:dataTable value="#{backingBean.teacher.students}" var="student">
        <h:outputText value="${student.name}"/>
    </h:dataTable>Because my session bean is stateful, I have a method with the @Remove annotation. This method is empty because I don't want to persist anything to the database.
    Now, my question is: How can I make the @Remove method of my stateful session bean be called automatically when my JSF page finishes being rendered?

    Philip Petersen wrote:
    I have a few questions concerning the EJB remove method.
    1) What is the purpose of calling the remove method on stateless session
    bean?There isn't one.
    >
    2) What action does the container take when this method is called?It checks that you were allowed to call remove (a security check) and then
    just returns.
    >
    3) What happens to the stateless session bean if you do not call the remove
    method?Nothing
    >
    4) Is it a good practice to call the remove method, or should the remove
    method be avoided in the case of stateless session beans?
    Personally, I never do it.
    -- Rob
    >
    >
    Thanks in advance for any insight that you may provide.
    Phil--
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com
    [att1.html]

  • Business Delegate (remove session bean)

    HI all,
    I followed the code example of Business Delegate pattern
    as described in java.sun.com site.
    Everything is well, but I have only a doubt:
    in Business Delegate's constructor the Business Delegate object
    create the session bean reference that it will use.
    I don't see any call to session.remove() method.
    Is it a forgetfulness or there is no real need to call the remove method ?
    May developers rely on the Application Server for bean's removal ?
    (removal for Statfeul or pooling for Stateless)
    Many thanks in advance
    Moreno

    Yes, it's fine to rely on the ejb container to remove both stateful session bean and stateless session bean resources. Most ejb containers define a timeout period after which stateful session beans that have not been accessed will be removed. Similar settings typically control the amount of time a stateless session bean instance will be pooled within the container.
    If you'd like more predictable, programmatic control for stateful session bean removal, you can explicitly call EJBObject.remove(). In that case, the ejb container is required to call ejbRemove on the corresponding stateful session bean, assuming it hasn't already been removed. For stateless session beans, EJBObject.remove() is merely a hint to the container, and might not result in any specific action on the pooled instances. Hope this helps.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • When will Stateful Session Bean be removed?

    I develop a stateful session bean and deploy it in the oc4j server successfully.
    I write a java GUI Frame.
    This Frame call this stateful Session bean and get some data,
    and hold its remote interface reference as Frame's private member.
    Code like that:
    public class CargoFrame extends JFrame
    //private member
    private DataPager dataPager;
    I found that before i release CargoFrame, Stateful session bean will be removed.
    And System report session time out.
    And i want to know when stateful session bean will be removed,
    and how to set the session time?

    Default is 30mts.
    This is done as a parameter in orion-ejb-jar.xml. Please look at the EJB Guide at http://otn.oracle.com/docs/products/ias/doc_library/903doc_otn/generic.903/a97677/dtdxml.htm#634197 for details
    regards
    Debu

  • Remove() on Session Bean

    Is it strictly necessary to call the remove() method of a session bean when
    I am done using it? Won't the container simply clean up session beans when
    the session times-out, or will they be left hanging around in memory?
    Is it simply a case of 'good programming practice' to call remove() at the
    right times?
    Mark.

    My response was for stateless session beans. For stateless session beans, there
    is not a direct correspondance between calling remove on the EJBObject and the
    containter callind ejbRemove on the bean. The container only calls ejbRemove on
    the bean when it evicts a bean from the freepool. In WLS 5.1, this never
    happens.
    For stateful session beans, calling remove on the EJBObject will cause ejbRemove
    to be called on the bean class. If you don't call remove, the container will
    eventually passivate the bean and then remove it from the disk (once it has been
    passivated for > idle-timeout-seconds). You will save yourself some disk access
    if you call remove on the reference.
    In general, it's probably good practice to call remove.
    -- Rob
    Tom Preston wrote:
    You don't have to call remove. Here is a post with Rob Wollen response on the
    remove issue from a couple days ago on ejb list:
    ++++++++++++++=
    No.
    -- Rob
    Eran Erlich wrote:
    Hi.
    Is there any difference if I call it or not ?
    will calling ejbRemove affect the free pool or cache in any way ?
    Thanks.
    --Eran++++++++++++++=
    Mark Bower wrote:
    Is it strictly necessary to call the remove() method of a session bean when
    I am done using it? Won't the container simply clean up session beans when
    the session times-out, or will they be left hanging around in memory?
    Is it simply a case of 'good programming practice' to call remove() at the
    right times?
    Mark.--
    Tom
    Thomas Preston
    Vacation.com, Inc.
    Engineering Department
    617.210.4850 x 124

  • Remove on stateless session bean

    Will failing to call remove on a stateless session bean cause it to be
    passivated rather then removed when it is no longer used? I have read
    for a statefull bean failing to remove a bean can cause a peformance
    hit since passivate takes a bigger system resource hit over remove.
    Jeff

    No, remove() on stateless session bean doesn't do anything.
    Jeffrey Ellin <[email protected]> wrote:
    Will failing to call remove on a stateless session bean cause it to be
    passivated rather then removed when it is no longer used? I have read
    for a statefull bean failing to remove a bean can cause a peformance
    hit since passivate takes a bigger system resource hit over remove.
    Jeff--
    Dimitri

  • How to remove recently accessed channel from desktop session in sun one 7

    Actually we are facing one issue with the desktop session . We created a container and then deployed our jsr 168 portlet in that. Now if we are accessing that portlet through http://host:port/portal/dt?provider=<containerchannel>/<channelfor jsr168> we are actually able to see the portlet. Now we kept the link in one of the menu items of enterprise sample. Now if we click on that link our portlet gets displayed in new window. But the problem is if we refresh the enterprise sample page then it is showing our portlet instead of the content that should be shown in enterprise sample. Can we remove the channel from the desktop session.
    Any help will be highly appreciated
    Edited by: user8941231 on Nov 17, 2010 4:59 AM

    Change your iCloud ID password and the old device will no longer have access to your iCloud account.  You can change it here: https://iforgot.apple.com/iForgot/iForgot.html.  After doing so, you'll need to change it on all your devices too.

  • How to remove clear button on message file upload bean item?

    Dear Guru's.
                    How to remove clear button on message file upload bean item .
    Regards,
    Srinivas

    Hi Raghu,
    This is srinivas i am also facing this issue how u achieve this can u share me this is urgent for me .
    Regards,
    Srinivas

Maybe you are looking for

  • I keep getting a message saying "Could not complete your request because of a program error"

    I keep getting a message saying ( Could not complete your request because of a program error?? Does anyone know what this means or how to fix?

  • Bootcamp Installation Repeatedly Crashes

    Hi: I am unable to install Windows XP using Boot Camp Assistant. On multiple attempts, the install process crashes in the middle with an error message that reads: Press any key to boot from CD ….. Disk Error Press any key to restart I would be very,

  • Oracle Messenger Not Able to connect to the server

    Hi All, I am working on OCS 10g 10.1.2.3 in a single box linux (RHEL ES Rel-3.0 taroon update 4) I am not able to connect the Oracle Messenger with the oracle server. While logging in, it is showing that 'Unable to connect to Server' message.. Please

  • Online customer service

    Not sure if this is the right forum for this, but I have to pose a question.  If online support can't make basic changes to customers accounts then how are they supposed to "support" the account? The definition of support being "To provide for or mai

  • How to buy license for iWorks '09 (with upgrade version 9.3)

    I have installed iWorks '09 trial with 9.3 upgrade on my wife's MacBook 10.7.5.  I would like to purchase the license, but the links to do that don't seem to work. Is the purchase still possible? How do I do it?  Thanks.