EJB client session

What is an EJB client session? How many are there? When does it start and when does it end? Who controls that?
Thank you.

You may be thinking of a Stateful Session Bean. Each stateful session bean has state that is tied to a
particular client. In EJB 3.0, the stateful session bean is created when the client does a naming
lookup or has the stateful session bean injected. The client can remove the stateful session bean at
any time by calling a method annotated with the @Remove annotation.
The container can also choose to remove a stateful session bean. Typically, the container vendor
provides configuration options that specify the stateful session bean timeout parameters.
--ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • How to run Session ejb client program?

    Hi
    I am using weblogic server8.1 . I was running an ejb session client program it throws exception like below. Can any one tell me how to run a client in weblogic server. give the syntax for running ejb client.
    D:\Weblogicserver\user_projects\domains\mydomain\applications\MyEJB\stateful>jav
    a -cp .;c:\j2ee\j2ee.jar;c:\weblogic\classes;D:\Weblogicserver\weblogic81\server
    \lib\weblogic.jar PortfolioClient
    Exception in thread "main" java.lang.NoClassDefFoundError: PortfolioClient (wron
    g name: stateful/PortfolioClient)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    bye

    If stateful is the package for the client application, you should be executing from
    D:\Weblogicserver\user_projects\domains\mydomain\applications\MyEJB
    on the command line. The command should look like -
    java -classpath <whatever should be here> stateful.MyClient

  • Accessing client session information in ejb

    Hi!
    My prblem is the following. We want to access ejb from a servlet. We need some client session information in ejb (e.g. client username, client terminal name, client ip address) for several reason. Could anybody suggest a solution other than passing all the data through the parameter list of every method?
    Thanks for any help.
    Zoltan

    If you use stateful session bean, you can pass this information, when you create it.

  • How can I get a reference to the Local interface of a EJB 3 session?

    Hi,
    How can I get a reference to the Local interface of a EJB 3 session?
    My session implements both the local and remote interfaces, so in my client, when I look up the remote interface using the following code, I did get a reference
              processor = (IItemProcessorRemote)initialContext.lookup(IItemProcessorRemote.class.getName());but if I also look up the local interface in th eclient using this:
    processorLocal =(IItemProcessor)initialContext.lookup(IItemProcessor.class.getName());I got errors like the following, do you know why? Thanks a lot!
    Exception in thread "main" javax.naming.NameNotFoundException: sessions.IItemProcessor not found
         at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
         at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:175)
         at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
         at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:116)
         at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)

    BTW, findItemByTitle(String title) is a business method in my ItemProcessor session bean.
    public String findItemByTitle(String title) {
              AuctionItem item;
              String result = null;
              try {
                   Query query = entityManager
                             .createNativeQuery("SELECT i from AuctionItem i WHERE i.title LIKE : aTitle");
                   query.setParameter("aTitle", title);
                   item = (AuctionItem) query.getSingleResult();
                   result = item.toString();
              } catch (EntityNotFoundException notFound) {
              } catch (NonUniqueResultException nonUnique) {
              return result;
         }

  • How to get remote ejb client working with Weblogic 8.1?

    I have Weblogic 8.1 running on a WinXP box behind my firewall. Port 7001 is open to WL and remote browsers can access the console.
    I have a client machine running WinXP on a different network that is remote to the WL server. It can ping the WL server machine.
    I use JVM 1.4.2_08 on all machines.
    If I put my client machine on the LAN with the WL server, then my EJB test client works fine. If I put the client machine on the remote network then the test client fails with a ClassCastException when trying to do a PortableRemoteObject.narrow on the bean home.
    I had this running fine on JBoss 3.22 using RMI over HTTP. I added an HTTP invoker service to my jboss.xml file. I don't know if something similar is needed on the Weblogic side - any ideas on that? All I've done on the WL side is turn on Tunneling - which obviously works because the remote client gets a correct home object when doing a lookup on the bean - based on the IOR string of the home obj.
    Below I include my client code, exception, ejb-jar.xml and my weblogic-ejb-jar.xml.
    Any ideas on what else needs to be done so that a remote client can do a PortableRemoteObject.narrow? My client.jar has all of the EJB classes, and runs fine when run from LAN.
    Thanks,
    --BobC
    Client Code
    Properties p = new Properties();
    p.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
    p.put("java.naming.provider.url", "http://66.114.140.213:7001");
    InitialContext ic = new InitialContext(p);
    // Test register bean
    Object homeObj = ic.lookup("tacplanner/register");
    RegisterHome home = (RegisterHome) PortableRemoteObject.narrow(homeObj, RegisterHome.class); // <<< ClassCastException here
    Exception
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
    at com.nimblus.tacplanner.test.TestUtils.<init>(TestUtils.java:60)
    at com.nimblus.tacplanner.test.TestUtils.main(TestUtils.java:196)
    ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>register</ejb-name>
    <home> com.nimblus.tacplanner.server.ejb.stateless.RegisterHome</home>
    <remote> com.nimblus.tacplanner.server.ejb.stateless.Register</remote>
    <ejb-class>com.nimblus.tacplanner.server.ejb.stateless.RegisterSession</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <resource-ref>
    <description>The Oracle Datasource</description>
    <res-ref-name>java:/OracleDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>register</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </ejb-jar>
    weblogic-ejb-jar.xml
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
    'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>register</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    </pool>
    </stateless-session-descriptor>
    <reference-descriptor>
    <resource-description>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
    <jndi-name>OracleDS</jndi-name>
    </resource-description>
    </reference-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <jndi-name>tacplanner/register</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    --------------------

    Problem solved.
    For remote clients you need to generate and use the stub classes for EJB interfaces using Weblogic's appc utility.
    See: "http://e-docs.bea.com/wls/docs81/ejb/appc_ejbc.html#1151900"
    --BobC                                                                                                                                                                                                                                                                                                                                                                                                                               

  • EJB Client Access From JDeveloper9iR2

    I seem to be running into a lot of problems when trying to get a simple EJB client to talk to an EJB on our 9IAS platform. I have developed a simple session bean (just to test) which simply returns a string. When I create the default client code this works fine using the embedded OC4J server in Jdeveloper but I can't run a similar client against 9IAS when I deploy the code. When I go through the client wizard it seems to produce the same code as the standalone EJB OC4J client. I simply changed the name of the server (Context.PROVIDER_URL, "ormi://pe2500/). This is the parameter code I use:
    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://pe2500:23891/MyEJBs");
    This is the output I receive:
    D:\jdeveloper9ir2\jdk\bin\javaw.exe -ojvm -classpath D:\javadev\ejbservlet\ejbservlet\WEB-INF\classes;D:\jdeveloper9ir2\jdev\lib\jdev-rt.jar;D:\jdeveloper9ir2\j2ee\home\lib\ojsp.jar;D:\jdeveloper9ir2\j2ee\home\jsp\lib\taglib\ojsputil.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\j2ee\home\lib\servlet.jar;D:\jdeveloper9ir2\jdev\lib\ojc.jar;D:\jdeveloper9ir2\j2ee\home\lib\activation.jar;D:\jdeveloper9ir2\j2ee\home\lib\ejb.jar;D:\jdeveloper9ir2\j2ee\home\lib\jaas.jar;D:\jdeveloper9ir2\j2ee\home\lib\jaxp.jar;D:\jdeveloper9ir2\j2ee\home\lib\jcert.jar;D:\jdeveloper9ir2\j2ee\home\lib\jdbc.jar;D:\jdeveloper9ir2\j2ee\home\lib\jms.jar;D:\jdeveloper9ir2\j2ee\home\lib\jndi.jar;D:\jdeveloper9ir2\j2ee\home\lib\jnet.jar;D:\jdeveloper9ir2\j2ee\home\lib\jsse.jar;D:\jdeveloper9ir2\j2ee\home\lib\jta.jar;D:\jdeveloper9ir2\j2ee\home\lib\mail.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\lib\xmlparserv2.jar;D:\jdeveloper9ir2\lib\xmlcomp.jar;D:\jdeveloper9ir2\j2ee\home\oc4j.jar;D:\jdeveloper9ir2\j2ee\home\lib\servlet.jar Samplemypackage6.ctejb1Client3
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
         java.net.ConnectException: Connection refused: connect
         java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
              RMIContext.java:134
         java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
              InitialContext.java:350
         void Samplemypackage6.ctejb1Client3.main(java.lang.String[])
              ctejb1Client3.java:18
    Process exited with exit code 0.
    Can anyone tell me if this is the correct communication method for client EJB's talking to the 9IAS server?
    Any help really appreciated.
    Chris Taylor

    hi Chris Taylor, did you find the solution for this error. i too get this error and i am looking for the answer. if you find any answer please share with me too. if i get any answer for this i will reply you too.

  • Ejb client error

    Hi, I use jdev 10g. I created a session bean with wizards and after that I created I Ejb client for that bean. When I start the embedded server and run the client java file I get the following error :
    com.evermind.server.rmi.OrionRemoteException: jazn.com/admin is not allowed to call this EJB method, check your security settings (method-permission in ejb-jar.xml and security-role-mapping in orion-application.xml).
         at denemeSessionHome_StatelessSessionHomeWrapper1.create(denemeSessionHome_StatelessSessionHomeWrapper1.java:41)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
         at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    at connection to localhost/127.0.0.1 as admin
         at com.evermind.server.rmi.RMIConnection.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMIConnection.java:1527)
         at com.evermind.server.rmi.RMIConnection.invokeMethod(RMIConnection.java:1480)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:55)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:22)
         at __Proxy0.create(Unknown Source)
         at ejbpackage.denemeSessionClient.main(denemeSessionClient.java:21)
    Process exited with exit code 0.
    all settings are the default ones.
    Anyone has any idea???

    hi
    There was no problem with that... the AdviceClient is not in the package... I needed j2ee.jar and AdviceAppClient.jar to run the client and hte AdviceClient is in C\java\Projects\Advice directory.... can anyone help me with what is wrong with my first command which didnt work ...
    java -classpath c:\Sun\AppServer\lib\j2ee.jar;c:\java\Projects\Advice;c:\java\Projects\AdviceAppClient.jar AdviceClient
    This one worked though....
    java -cp {$CLASSPATH}:"C:\java\Projects\Advice";AdviceAppClient.jar;c:\Sun\AppServer\lib\j2ee.jar; AdviceClient
    I dont know what makes the difference...
    vidhya

  • Multiple EJB clients blocking

    I tried to ask this question a few months ago, but I must not have given enough
    details
    for anyone to even guess what my problem might be. So I created a simple example
    to
    demonstrate what's happening.
    I have a cluster of 2 WL servers (7.0) running on Linux. When I call an EJB multiple
    times at once from different threads in a client application, sometimes all the
    threads
    finish in a few milliseconds, but other times at least one of the threads will
    pause
    for 60 seconds before finishing. There are no error or warning indicators in any
    server
    log files. I'm trying to do something very simple: add one to a number in a database
    table without letting any two clients get the same number.
    I'm using DB2 as my database and COM.ibm.db2.jdbc.app.Driver as my driver. I have
    a
    JDBC connection pool and a DataSource, which I'm using in a stateless session
    bean.
    I lock the table in exclusive mode, query the current number, and add one to it.
    I'm
    using container-managed transactions, so I'm relying on the container to commit
    the
    update when the method ends. (I tried using a bean-managed transaction, and I
    got the
    same results.)
    For a long time I believed the problem must be with DB2, but when I put the exact
    same
    code in a JSP, it works just fine. So I know that DB2 can do what I'm asking it
    to do.
    I also tried it on a Windows NT server, and it behaves exactly the same. Comparing
    thread dumps of the two servers in the cluster taken during one of these 60 second
    wait periods doesn't show any obvious problems: the two servers both have exactly
    the
    same threads going, and they all seem pretty reasonable to me.
    Here is the code for my EJB:
    package com.davisvision.cv;
    import java.sql.*;
    import javax.ejb.*;
    public class SimpleBean implements SessionBean {
    SessionContext ctx;
    public void ejbCreate() {
    public void ejbPostCreate() {
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext c) {
    ctx = c;
    public int nextNumber() {
    String tableName = "TEST.PROVIDER_SPAWN";
    Connection con = null;
    int num = 0;
    try {
    con = CvDatabase.getConnection();
    con.setAutoCommit(false);
    Statement stmt = con.createStatement();
    stmt.executeUpdate("LOCK TABLE " + tableName + " IN EXCLUSIVE MODE");
    ResultSet rs = stmt.executeQuery("SELECT NEXT_OFFICE_NUM FROM "
    + tableName + " WHERE PROVIDER_TYPE = 'DAVIS2'");
    if (rs.next()) {
    num = rs.getInt(1);
    num++;
    int updated = stmt.executeUpdate("UPDATE " + tableName
    + " SET NEXT_OFFICE_NUM = " + num
    + " WHERE PROVIDER_TYPE = 'DAVIS2'");
    catch(Exception e) {
    num = -1;
    Logger.writeDated(Logger.FATAL, "SimpleBean.nextNumber: " + e);
    finally {
    CvDatabase.close(con);
    return num;
    And here is my client application:
    package test;
    import com.davisvision.cv.*;
    import java.util.*;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    public class TestSimpleBean implements Runnable {
    static InitialContext ctx;
    public int taskNum;
    static void getContext() {
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "t3://weblogictest:7055");
    try {
    ctx = new InitialContext(env);
    catch(NamingException e) {
    System.out.println("Unable to obtain an initial JNDI context:
    " + e);
    public void run() {
    System.out.println("Thread " + taskNum + " started.");
    try {
    Object obj = ctx.lookup("ejb-cv-Simple");
    SimpleHome h = (SimpleHome) PortableRemoteObject.narrow(obj, SimpleHome.class);
    SimpleRemote r = h.create();
    int n = r.nextNumber();
    System.out.println("Thread " + taskNum + " next number = " + n);
    catch(Exception e) {
    System.out.println("Error in thread " + taskNum + ": " + e);
    System.out.println("Thread " + taskNum + " ended.");
    public static void main(String[] args) {
    getContext();
    int n = 3;
    TestSimpleBean x = null;
    Thread t = null;
    // start each thread
    for (int i = 0; i < n; i++) {
    x = new TestSimpleBean();
    x.taskNum = i;
    t = new Thread(x);
    t.start();
    System.out.println("" + n + " threads started.");
    My deployment descriptors are as simple as I could make them:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC
    "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>Simple</ejb-name>
    <home>com.davisvision.cv.SimpleHome</home>
    <remote>com.davisvision.cv.SimpleRemote</remote>
    <ejb-class>com.davisvision.cv.SimpleBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>Simple</ejb-name>
    <method-name>
    </method-name>
    </method>
    <trans-attribute>
    Required
    </trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>Simple</ejb-name>
    <jndi-name>ejb-cv-Simple</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    This is from part of a production application, so to make sure our users aren't
    getting
    random 60-second pauses, I have the production bean deployed on just one server
    in the
    cluster with just one bean in the pool. But I really need to find the solution
    to this
    problem before development goes much further. Any guesses, sugestions, or conjectures
    would be most welcome.
    - gary

    Oops, I didn't notice that I only attached one file last time. The thread dump
    from the other server in the cluster is attached.
    My (off-topic) Linux problem must be something else: Signaling the parent
    java process was one of the first things I tried. It may have to do with the
    way that we start WL (in the background with nohup).
    - gary
    Rob Woollen <[email protected]> wrote:
    Gary Bradshaw wrote:
    Thanks for your response, Rob. I've attached the thread dumps, hopingthat they
    will be easier to read that way. They are from a Windows NT system:Thanks. Are you sure this is the right dump? The server looks
    completely idle in this dump.
    I haven't
    yet found a way to get a thread dump on my Linux system. (I know Ishould say
    "kill -3 <processId>", but each WLS has at least 72 process IDs. MaybeI just
    haven't found the right one yet.)Try ps -ef --forest  .  It'll show you graphically with a little ascii
    art the parent process/thread.
    -- Rob
    Your suggestion to do the update first would work for this particularexample
    since I know I always want to add 1 to the number, but in other similarsituations
    I will want to vary the update based on the values I find in the row.I'm looking
    for a clean way to safely do multi-user updates with JDBC. (For larger,more important
    tables I'm using entity beans).
    - gary
    Rob Woollen <[email protected]> wrote:
    Can you post the thread dumps?
    Also usually people do something like this:
    update mytable set count = count + 1
    select count from mytable
    -- Rob
    Gary Bradshaw wrote:
    I tried to ask this question a few months ago, but I must not havegiven enough
    details
    for anyone to even guess what my problem might be. So I created a
    simple
    example
    to
    demonstrate what's happening.
    I have a cluster of 2 WL servers (7.0) running on Linux. When I callan EJB multiple
    times at once from different threads in a client application, sometimesall the
    threads
    finish in a few milliseconds, but other times at least one of the
    threads
    will
    pause
    for 60 seconds before finishing. There are no error or warning indicatorsin any
    server
    log files. I'm trying to do something very simple: add one to a numberin a database
    table without letting any two clients get the same number.
    I'm using DB2 as my database and COM.ibm.db2.jdbc.app.Driver as mydriver. I have
    a
    JDBC connection pool and a DataSource, which I'm using in a statelesssession
    bean.
    I lock the table in exclusive mode, query the current number, and
    add
    one to it.
    I'm
    using container-managed transactions, so I'm relying on the containerto commit
    the
    update when the method ends. (I tried using a bean-managed transaction,and I
    got the
    same results.)
    For a long time I believed the problem must be with DB2, but when
    I
    put the exact
    same
    code in a JSP, it works just fine. So I know that DB2 can do what
    I'm
    asking it
    to do.
    I also tried it on a Windows NT server, and it behaves exactly thesame. Comparing
    thread dumps of the two servers in the cluster taken during one ofthese 60 second
    wait periods doesn't show any obvious problems: the two servers bothhave exactly
    the
    same threads going, and they all seem pretty reasonable to me.
    Here is the code for my EJB:
    package com.davisvision.cv;
    import java.sql.*;
    import javax.ejb.*;
    public class SimpleBean implements SessionBean {
    SessionContext ctx;
    public void ejbCreate() {
    public void ejbPostCreate() {
    public void ejbRemove() {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void setSessionContext(SessionContext c) {
    ctx = c;
    public int nextNumber() {
    String tableName = "TEST.PROVIDER_SPAWN";
    Connection con = null;
    int num = 0;
    try {
    con = CvDatabase.getConnection();
    con.setAutoCommit(false);
    Statement stmt = con.createStatement();
    stmt.executeUpdate("LOCK TABLE " + tableName + " IN EXCLUSIVEMODE");
    ResultSet rs = stmt.executeQuery("SELECT NEXT_OFFICE_NUM
    FROM "
    + tableName + " WHERE PROVIDER_TYPE = 'DAVIS2'");
    if (rs.next()) {
    num = rs.getInt(1);
    num++;
    int updated = stmt.executeUpdate("UPDATE " + tableName
    + " SET NEXT_OFFICE_NUM = " + num
    + " WHERE PROVIDER_TYPE = 'DAVIS2'");
    catch(Exception e) {
    num = -1;
    Logger.writeDated(Logger.FATAL, "SimpleBean.nextNumber:" + e);
    finally {
    CvDatabase.close(con);
    return num;
    And here is my client application:
    package test;
    import com.davisvision.cv.*;
    import java.util.*;
    import javax.ejb.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    public class TestSimpleBean implements Runnable {
    static InitialContext ctx;
    public int taskNum;
    static void getContext() {
    Properties env = new Properties();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "t3://weblogictest:7055");
    try {
    ctx = new InitialContext(env);
    catch(NamingException e) {
    System.out.println("Unable to obtain an initial JNDIcontext:
    " + e);
    public void run() {
    System.out.println("Thread " + taskNum + " started.");
    try {
    Object obj = ctx.lookup("ejb-cv-Simple");
    SimpleHome h = (SimpleHome) PortableRemoteObject.narrow(obj,SimpleHome.class);
    SimpleRemote r = h.create();
    int n = r.nextNumber();
    System.out.println("Thread " + taskNum + " next number= " + n);
    catch(Exception e) {
    System.out.println("Error in thread " + taskNum +
    " + e);
    System.out.println("Thread " + taskNum + " ended.");
    public static void main(String[] args) {
    getContext();
    int n = 3;
    TestSimpleBean x = null;
    Thread t = null;
    // start each thread
    for (int i = 0; i < n; i++) {
    x = new TestSimpleBean();
    x.taskNum = i;
    t = new Thread(x);
    t.start();
    System.out.println("" + n + " threads started.");
    My deployment descriptors are as simple as I could make them:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC
    "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
    "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>Simple</ejb-name>
    <home>com.davisvision.cv.SimpleHome</home>
    <remote>com.davisvision.cv.SimpleRemote</remote>
    <ejb-class>com.davisvision.cv.SimpleBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>Simple</ejb-name>
    <method-name>
    </method-name>
    </method>
    <trans-attribute>
    Required
    </trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    <?xml version="1.0"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"
    "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd" >
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>Simple</ejb-name>
    <jndi-name>ejb-cv-Simple</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    This is from part of a production application, so to make sure ourusers aren't
    getting
    random 60-second pauses, I have the production bean deployed on justone server
    in the
    cluster with just one bean in the pool. But I really need to find
    the
    solution
    to this
    problem before development goes much further. Any guesses, sugestions,or conjectures
    would be most welcome.
    - gary------------------------------------------------------------------------
    Full thread dump:
    "Thread-7" daemon prio=5 tid=0x868400 nid=0x1f8 waiting on monitor[0x136ff000..0x136ffdc0]
         at java.lang.Thread.sleep(Native Method)
         at com.davisvision.cv.CvProperties.run(CvProperties.java:153)
         at java.lang.Thread.run(Thread.java:479)
    "ListenThread.Default" prio=5 tid=0x8647d0 nid=0x1f0 runnable [0x136bf000..0x136bfdc0]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:463)
         at java.net.ServerSocket.implAccept(ServerSocket.java:238)
         at java.net.ServerSocket.accept(ServerSocket.java:217)
         at weblogic.socket.WeblogicServerSocket.accept(WeblogicServerSocket.java:26)
         at weblogic.t3.srvr.ListenThread.run(ListenThread.java:263)
    "ExecuteThread: '0' for queue: 'JMS.TimerTreePool'" daemon prio=5 tid=0x84d220nid=0x1e9 waiting on monitor [0x1312f000..0x1312fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '3' for queue: 'JMS.TimerClientPool'" daemon prio=5tid=0x84c040 nid=0x1e8 waiting on monitor [0x130ef000..0x130efdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '2' for queue: 'JMS.TimerClientPool'" daemon prio=5tid=0x84c580 nid=0x1e7 waiting on monitor [0x130af000..0x130afdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '1' for queue: 'JMS.TimerClientPool'" daemon prio=5tid=0x84cec0 nid=0x1a1 waiting on monitor [0x1306f000..0x1306fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: 'JMS.TimerClientPool'" daemon prio=5tid=0x84b370 nid=0x1a0 waiting on monitor [0x1302f000..0x1302fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "CoreHealthMonitor" daemon prio=5 tid=0x829e30 nid=0x1e6 waiting onmonitor [0x12fef000..0x12fefdc0]
         at java.lang.Thread.sleep(Native Method)
         at weblogic.t3.srvr.CoreHealthMonitorThread.run(CoreHealthMonitorThread.java:114)
    "ExecuteThread: '14' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x820420nid=0x1e5 waiting on monitor [0x12faf000..0x12fafdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '13' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81f2d0nid=0x1e4 waiting on monitor [0x12f6f000..0x12f6fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '12' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81fec0nid=0x1e3 waiting on monitor [0x12f2f000..0x12f2fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '11' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81eac0nid=0x1e2 waiting on monitor [0x12eef000..0x12eefdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '10' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81d6c0nid=0x1e1 waiting on monitor [0x12eaf000..0x12eafdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '9' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81c2d0nid=0x1e0 waiting on monitor [0x12e6f000..0x12e6fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '8' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81cec0nid=0x1df waiting on monitor [0x12e2f000..0x12e2fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '7' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81bac0nid=0x1de waiting on monitor [0x12def000..0x12defdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '6' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x81a6c0nid=0x1dd waiting on monitor [0x12daf000..0x12dafdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '5' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x8192d0nid=0x1dc waiting on monitor [0x12d6f000..0x12d6fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '4' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x819ec0nid=0x1db waiting on monitor [0x12d2f000..0x12d2fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '3' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x818990nid=0x1da waiting on monitor [0x12cef000..0x12cefdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '2' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x817630nid=0x1d9 waiting on monitor [0x12caf000..0x12cafdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '1' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x816150nid=0x1d8 waiting on monitor [0x12c6f000..0x12c6fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: 'JmsDispatcher'" daemon prio=5 tid=0x816690nid=0x1d7 waiting on monitor [0x12c2f000..0x12c2fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '2' for queue: 'weblogic.transaction.AsyncQueue'" daemonprio=5 tid=0x811cc0 nid=0x1d6 waiting on monitor [0x12bef000..0x12befdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '1' for queue: 'weblogic.transaction.AsyncQueue'" daemonprio=5 tid=0x8104c0 nid=0x1d5 waiting on monitor [0x12baf000..0x12bafdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: 'weblogic.transaction.AsyncQueue'" daemonprio=5 tid=0x80f020 nid=0x1d4 waiting on monitor [0x12b6f000..0x12b6fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "Thread-4" prio=5 tid=0x80e440 nid=0x1d3 waiting on monitor [0x12b2f000..0x12b2fdc0]
         at java.lang.Object.wait(Native Method)
         at java.util.TimerThread.mainLoop(Timer.java:427)
         at java.util.TimerThread.run(Timer.java:380)
    "ExecuteThread: '1' for queue: 'DRS'" daemon prio=5 tid=0x80d700 nid=0x1d2waiting on monitor [0x12aef000..0x12aefdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: 'DRS'" daemon prio=5 tid=0x80b160 nid=0x1d1waiting on monitor [0x12aaf000..0x12aafdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: 'Multicast'" daemon prio=5 tid=0x80a8b0nid=0x1d0 waiting on monitor [0x12a6f000..0x12a6fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '1' for queue: 'Replication'" daemon prio=5 tid=0x8072f0nid=0x1cf waiting on monitor [0x12a2f000..0x12a2fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: 'Replication'" daemon prio=5 tid=0x807430nid=0x1c9 waiting on monitor [0x129ef000..0x129efdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "LDAPConnThread 10.1.7.26:7001" daemon prio=5 tid=0x7f56c0 nid=0x1cdrunnable [0x1296f000..0x1296fdc0]
         at java.net.SocketInputStream.socketRead(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:85)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:181)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:199)
         at netscape.ldap.ber.stream.BERElement.getElement(BERElement.java:101)
         at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java:420)
    "LDAPConnThread 10.1.7.26:7001" daemon prio=5 tid=0x7f35c0 nid=0x1cbrunnable [0x128ef000..0x128efdc0]
         at java.net.SocketInputStream.socketRead(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:85)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:181)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:199)
         at netscape.ldap.ber.stream.BERElement.getElement(BERElement.java:101)
         at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java:420)
    "LDAPConnThread 10.1.7.26:7001" daemon prio=5 tid=0x7edc70 nid=0x1carunnable [0x128af000..0x128afdc0]
         at java.net.SocketInputStream.socketRead(Native Method)
         at java.net.SocketInputStream.read(SocketInputStream.java:85)
         at java.io.BufferedInputStream.fill(BufferedInputStream.java:181)
         at java.io.BufferedInputStream.read(BufferedInputStream.java:199)
         at netscape.ldap.ber.stream.BERElement.getElement(BERElement.java:101)
         at netscape.ldap.LDAPConnThread.run(LDAPConnThread.java:420)
    "VDE Transaction Processor Thread" prio=2 tid=0x7e21c0 nid=0x1c5 waitingon monitor [0x1282f000..0x1282fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at com.octetstring.vde.backend.standard.TransactionProcessor.waitChange(TransactionProcessor.java:306)
         at com.octetstring.vde.backend.standard.TransactionProcessor.run(TransactionProcessor.java:192)
    "ExecuteThread: '1' for queue: '__weblogic_admin_rmi_queue'" daemonprio=5 tid=0x7a7020 nid=0x1c4 waiting on monitor [0x127df000..0x127dfdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: '__weblogic_admin_rmi_queue'" daemonprio=5 tid=0x7d7750 nid=0x1c3 waiting on monitor [0x1279f000..0x1279fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'" daemonprio=5 tid=0x7c26b0 nid=0x1c2 waiting on monitor [0x1273f000..0x1273fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: '__weblogic_admin_html_queue'" daemonprio=5 tid=0x7c2bf0 nid=0x1c1 waiting on monitor [0x126ff000..0x126ffdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "TimeEventGenerator" daemon prio=5 tid=0x7c00d0 nid=0x1c0 waiting onmonitor [0x126bf000..0x126bfdc0]
         at java.lang.Object.wait(Native Method)
         at weblogic.time.common.internal.TimeTable.snooze(TimeTable.java:272)
         at weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:139)
         at java.lang.Thread.run(Thread.java:479)
    "ExecuteThread: '1' for queue: '_weblogic_dgc_queue'" daemon prio=5tid=0x7bfac0 nid=0x1bf waiting on monitor [0x1267f000..0x1267fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '0' for queue: '_weblogic_dgc_queue'" daemon prio=5tid=0x7be5c0 nid=0x1be waiting on monitor [0x1263f000..0x1263fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "HighPriority TimeEventGenerator" daemon prio=9 tid=0x7bee10 nid=0x1bdwaiting on monitor [0x125ff000..0x125ffdc0]
         at java.lang.Object.wait(Native Method)
         at weblogic.time.common.internal.TimeTable.snooze(TimeTable.java:272)
         at weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:139)
         at java.lang.Thread.run(Thread.java:479)
    "SpinnerRandomSource" daemon prio=5 tid=0x7bc270 nid=0x1bc waitingon monitor [0x125bf000..0x125bfdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.security.SpinnerRandomBitsSource.run(SpinnerRandomBitsSource.java:60)
         at java.lang.Thread.run(Thread.java:479)
    "ExecuteThread: '14' for queue: 'default'" daemon prio=5 tid=0x7b9050nid=0x1bb runnable [0x1257f000..0x1257fdc0]
         at weblogic.socket.NTSocketMuxer.getNextSocket(Native Method)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:534)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    "ExecuteThread: '13' for queue: 'default'" daemon prio=5 tid=0x7b8050nid=0x1ba runnable [0x1253f000..0x1253fdc0]
         at weblogic.socket.NTSocketMuxer.getNextSocket(Native Method)
         at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:534)
         at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    "ExecuteThread: '12' for queue: 'default'" daemon prio=5 tid=0x7b8840nid=0x1b9 runnable [0x124ff000..0x124ffdc0]
         at java.net.PlainDatagramSocketImpl.receive(Native Method)
         at java.net.DatagramSocket.receive(DatagramSocket.java:387)
         at weblogic.cluster.FragmentSocket.receive(FragmentSocket.java:158)
         at weblogic.cluster.MulticastManager.execute(MulticastManager.java:336)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    "ExecuteThread: '11' for queue: 'default'" daemon prio=5 tid=0x7b7360nid=0x1b8 waiting on monitor [0x124bf000..0x124bfdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '10' for queue: 'default'" daemon prio=5 tid=0x7b7ec0nid=0x1b7 waiting on monitor [0x1247f000..0x1247fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '9' for queue: 'default'" daemon prio=5 tid=0x7b6ac0nid=0x1b6 waiting on monitor [0x1243f000..0x1243fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '8' for queue: 'default'" daemon prio=5 tid=0x7b56c0nid=0x1b5 waiting on monitor [0x123ff000..0x123ffdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '7' for queue: 'default'" daemon prio=5 tid=0x7b4360nid=0x1b4 waiting on monitor [0x123bf000..0x123bfdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:146)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)
    "ExecuteThread: '6' for queue: 'default'" daemon prio=5 tid=0x7b4ec0nid=0x1b3 waiting on monitor [0x1237f000..0x1237fdc0]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:415)
         at weblogic.kernel.ExecuteThread.

  • EJB Client JAR Creation - Workspace Studio (ALSB 3.0/WLS 10)

    hi
    I'm trying to create an EJB Client JAR for an 2.1 Session Bean EJB Created in a WLS 10 domain using BEA Workspace Studio (i.e. this is the Aqualogic Service Bus 3.0 Product install).
    I'm doing this in preparation for testing the ALSB EJB Transport which requires a client JAR.
    I simply can't get a useful JAR from the facility provided in the Workspace IDE. The Workspace help is pointing to an IBM generated page and I'm following the procedure there.
    I have configured the EJB for an EJB Client Project.
    If I export an EAR from the Application containing the EJB, the EAR only contains the EJB JAR (with a Manifest entry to a non-existent Client JAR).
    If I export the EJB Client Project to a JAR the JAR is simply empty i.e. contains some descriptor type artefacts but no classes.
    I have tried this quite a few times with the same outcome. Can anyone from BEA or the user community confirm whether or not this facility actually works!
    Thanks
    Jim Nicolson

    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/ejbTransport/ejbtransport.html#wp1079062 . This is document for OSB 10xx and yours is a a version or two older than this (So it will be applicable).
    Can you please check if your EJB are complying to 2.1specification?
    However the latest version of service has support for both EJB 2.1 and EJB 3.0 specification
    http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15866/ejb.htm#CCGIFFCI
    Thanks
    Manoj

  • Need a Help to Run the EJB client

    Hello Friends,
    I'm using EJB3.0. while running my client side bean I got a Exception like this " javax.naming.NameNotFoundException: maheshwaran.count not bound." I'm new to EJB so i couldn't find specifically what is the mistake in my files.
    I created the following files. It are listed below
    FileName: count.java
    "package maheshwaran;
    public interface count {
    public int count();
    public void set(int val);
    public void remove();
    FileName2 : countBean.java
    "package maheshwaran;
    import javax.ejb.*;
    import javax.interceptor.Interceptors;
    @Stateful
    @Remote(count.class)
    @Interceptors(countCallBacks.class)
    public class countBean implements count{
    private int val;
    public int count(){
    System.out.println("count()");
    return ++val;
    public void set(int val){
    this.val=val;
    System.out.println("set()");
    @Remove
    public void remove(){
    System.out.println("remove()");
    FileName3: countCallBacks.java
    " package maheshwaran;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.ejb.*;
    import javax.interceptor.InvocationContext;
    public class countCallBacks {
    @PostConstruct
    public void construct(InvocationContext ctx){
    System.out.println("cb:construct()");
    @PostActivate
    public void activate(InvocationContext ctx){
    System.out.println("cb:activate()");
    @PrePassivate
    public void passivate(InvocationContext ctx){
    System.out.println("cb:passivate()");
    @PreDestroy
    public void destroy(){
    System.out.println("cb:destroy()");
    The client side class is following: countClient.java
    "package maheshwaran;
    import javax.naming.*;
    public class countClient {
    public static final int noofClients=3;
    public static void main(String args[]){
    try{
    Context ctx=new InitialContext(System.getProperties());
    count count[]=new count[noofClients];
    int countval=0;
    System.out.println("Instatntiating Beans");
    for(int i=0;i<noofClients;i++){
    count=(count) ctx.lookup(count.class.getName());
    count.set(countval);
    countval=count.count();
    System.out.println(countval);
    Thread.sleep(100);
    System.out.println("Calling count on Beans");
    for(int i=0;i<noofClients;i++){
    countval=count.count();
    System.out.println(countval);
    count.remove();
    Thread.sleep(50);
    }catch(Exception e){e.printStackTrace();}
    The Deployment Descriptor file is following: ejb-jar.xml
    "><?xml version="1.0" encoding="UTF-8?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLschema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    <description>Stateful Session Bean Example</description>
    <display-name>Stateful Session Bean Example</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>countBean</ejb-name>
    <business-remote>maheshwaran_dd.count</business-remote>
    </business-remote>
    <ejb-class>maheshwaran_dd.countBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <interceptors>
    <interceptor>
    <interceptor-class>maheshwaran_dd.countCallBacks</interceptor-class>
    <post-construct>
    <lifecycle-callback-method>construct</lifecycle-clallback-method>
    </post-construct>
    <post-activate>
    <lifecycle-callback-method>activate</lifecycle-callback-method>
    </post-activate>
    <pre-passivate>
    <lifecycle-callback-method>passivate</lifecycle-callback-method>
    </pre-passivate>
    </interceptor>
    </interceptors>
    <assembly-descriptor>
    <interceptor-binding>
    <ejb-name>countBean</ejb-name>
    <interceptor-class>maheshwaran_dd.countCallBacks</interceptor-class>
    </interceptor-binding>
    </assembly-descriptor>
    </ejb-jar> "
    please help me to rectify this problem.
    Thanks & regards,
    Maheshwaran Devaraj

    Hi,
    user586 wrote:
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.If you mean expirationdate (datatype: DATE) is not within 30 days (past or future) of run time, then:
    SELECT  coupon          -- or whatever columns you want
    FROM    table_x
    WHERE   expirationdate  NOT BETWEEN  SYSDATE - 30
                                AND      SYSDATE + 30
    ;

  • Ejb-client.jar

    Hi,
    I've got an EJB system that until now have been packaging as just a
    bean jar and not bothering with a ejb-client.jar. I now want to
    package as follows
    a). A bean EAR file (containing bean jar, and dependency jars) - for
    deploying on EJB server.
    b). An app EAR file (containing WAR, containing ejb-client.jar).
    The first part is done. The second raised questions about the contents
    of the ejb-client.jar. I have packaged the Home/Remote interfaces and
    all necessary utility classes (i.e omitting the Local/LocalHome/EJB
    classes). What I need to know is what goes in there in terms of
    descriptors.
    Do I just package the exact same ejb-jar.xml, jboss.xml,
    jbosscmp-jdbc.xml, weblogic-ejb-jar.xml, weblogic-cmp-rdbms-jar.xml ?
    or do I have to change these in some way ?
    Do I also add the ejb-client-jar tag to the ejb-jar.xml ? (would this
    also go in the ejb-jar.xml that goes in the bean jar ?) ... and indeed
    what would I put in there ... just the name of ejb-client-jar file
    even though its only being packaged into any application WAR (what
    purpose does it serve) ?
    TIA

    The ejb-link value should include pathnames relative to the top level of the EAR
    file.
    <ejb-link>../my_beans-client.jar#CurrencyExchange</ejb-link>
    Andy Jefferson <[email protected]> wrote:
    Deepak Vohra wrote:
    An ejb-client.jar contains the class files, the home and remote interfaces
    and the primary key class, a client program needs to call the EJBs
    contained in the ejb-jar file.
    Also, ejb-client.jar contains a copy of any classes from the ejb-jarfile
    that
    are referenced by the home and remote interfaces and the primary key
    class. Deployment descriptors are not required in the ejb-client.jar.
    ejb-client-jar element is not a required element in ejb-jar.xml. If
    ejb-client-jar.xml is specified in ejb-jar.xml ejbc generates the
    ejb-clent.jar file.
    Thx. I'm not interested in using any server-specific tools (like ejbc)
    since
    I'm deploying to multiple servers and so am generating the ejb-client
    jar
    myself in my build process. In this context, what purpose does the
    <ejb-client-jar> tag in the ejb-jar.xml descriptor have ? Why does the
    beans jar need to know anything about where the client stubs are ?
    As far as I can tell I'm including the right things in my ejb-client.jar,
    and I've tried deploying my web-app EAR to WebLogic 7.0 and I always
    get
    that it can't find the ejb-link elements. What i've got in my EAR is
    my_app.war
    META-INF/application.xml
    and in the WAR
    my JSP files
    WEB-INF/web.xml
    WEB-INF/jboss-web.xml
    lib/my_beans-client.jar
    In the WEB-INF I have ejb-ref's like the following
    <ejb-ref >
    <ejb-ref-name>ejb/CurrencyExchangeHome</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>my_domain.CurrencyExchangeHome</home>
    <remote>my_domain.CurrencyExchangeRemote</remote>
    <ejb-link>my_beans-client.jar#CurrencyExchange</ejb-link>
    </ejb-ref>
    Should I be putting the my_beans-client.jar in the EAR and not the WAR
    Seems I am missing something, but not sure what exactly.

  • Applicate Remote EJB Client

    Hello,
    I am getting to know EJB and have started with it from a Pocket Book and has started to implement and example suggested by this website: http://www.laliluna.de/articles/ejb-3-tutorial-jboss.html.
    Coming to the client part, maybe incorrectly by my part or particular to the cited website's example, I see a strong coupling on the EJB client to the Remote Interface and the actual SessionBean which I could only see sufficed by having the client on the same "project" of the EJB. Therefore I ask you, is there a way to have the EJB client on a different project, even on a different app. server than the Session Bean?
    Thank you for your help,
    TS

    the only thing you need in the client is the remote interface.
    So to share this interface between a client and a server application, you could put those interfaces in a separate library jar and share that between the two projects.

  • EJB Client JAR project produces empty JAR

    I've built an EJB module in WorkSpace Studio using the "WebLogic EJB Project" type, which is part of an EAR. I created a couple stateless session beans within this project, and then created an EJB Client JAR project using the "EJB Client JAR-->Create EJB Client Jar" menu item on the EJB project's hidden menu.
    According to the documentation, exporting an EAR file from the EAR project will cause the client JAR to be generated. I exported the EAR file from the EAR project, and sure enough, it included the client JAR (in /APP-INF/lib/). I extracted the client JAR from the EAR and opened it up to make sure it contained all of the client-side classes. I discovered that the client JAR was empty, the only contents being the MANIFEST.MF file. The interface classes were instead contained in the EJB JAR itself.
    How can I get the EJB client code to actually be included in the EJB client JAR?
    Thanks,
    Eric

    Well I have tried this with 6.1 and first
    1. One would expect the jar name to be the name in the ejb-jar.xml -
    ejb-client-jar section
    2. It outputs the file XXXEJB_Compiled.jar but it is same size as base jar
    this is 6.1 sp3
    whats up?
    Matthew Shinn wrote:
    Hi Sanjay,
    There is a bug in the documentation. The client-jar name should never be part of the
    ejbc command line. Step 3 below should be something like:
    java weblogic.ejbc xxxEJB.jar xxxEJB_Compiled.jar
    If you have an ejb-client-jar entry in your ejb-jar.xml, the client jar should be placed
    in the directory from which you ran ejbc. Make sure that the classes that you want to be
    put in the client-jar are not loaded from the classpath. This is very important or your
    client-jar won't be created correctly. The client-jar will only contain classes loaded
    from the input jar to ejbc. A bug for the incorrect documentation has already been filed
    and should be fixed soon.
    - Matt
    Sanjay Dwivedi wrote:
    Hi,
    I am trying to use the
    <ejb-client-jar> sub-element of the Sun's <ejb-jar> (EB 2.0 DTD) element of the
    ejb-jar.xml to generate the ejb-client.jar. I followed the step as documented
    by WebLogic but the files in EJB jars and ejb-client jars are identical. Here
    is what I am doing:
    1. Build the xxxEJB.jar for my EJB by running the WebLogic.ejbc on the standard
    EJB jar file.
    2. My ejb-jar.xml file has following line:
    <ejb-jar>
    <ejb-client-jar>xxxEJBClient.jar</ejb-client-jar>
    </ejb-jar>
    3. Next I used the following command to generate the ejb-client.jar file
    java weblogic.ejbc xxxEJB.jar xxxEJBClient.jar
    My xxxEJBClient.jar files consists of exactly same files (with same sizes) as
    the xxxEJB.jar file. Only difference is that the xxxEJB.jar file includes generated
    java source files for the bean implementation class and home/remote classes.
    In my opinion the xxxEJBClient.jar should not contain the EJB implementation classes.
    Any experience using the ejb-client-jar for generating the ejb-client.jar?
    Thanks,
    Sanjay.
    [att1.html]

  • EJB Client/Resource Injection

    Hi,
    could anyone explain to me why the field into which an EJB reference in an EJB client can be injected has to be static? I've read the following in the EJB3.0 tutorial (see below), but I don't know what "static context" means exactly. Care to explain, anyone?
    Thanks, Michael
    Creating a Reference to an Enterprise Bean Instance
    "Java EE application clients refer to enterprise bean instances by annotating static fields with the @EJB annotation. The annotated static field represents the enterprise bean's business interface, which will resolve to the session bean instance when the application client container injects the resource references at runtime.
    @EJB
    private static Converter converter;
    The field is static because the client class runs in a static context."

    The question was about why the field needs to be marked static. mappedName is a separate issue. The reason injected fields/methods in Application Clients need to be marked static is because of the Application Client programming model. It has always been the case that for an Application Client component the developer writes a static void main() method as the entry point, much like a regular Java Client. This means that the Application Client container invokes the application code with a static invocation, i.e. there is no instance of the main class. Injection is only useful if it takes place before the application code runs, so to accomplish that without changing the Application Client programming model, the Java EE platform spec requires that injected fields/methods be marked static.
    As for mappedName, it deals with how to map the ejb dependency to the target bean. By default in SUN's implementation, the remote @EJB dependency will map to the global JNDI name formed by taking the fully qualified type of the remote business interface, in this case <packagename>.Converter. That will work as long as the target Remote EJB has that global JNDI name. If the target Remote EJB's global JNDI name were "GlobalJNDIName", then you would need to explicitly assign that to the client's ejb dependency, as this example shows. That can be done either by using the mappedName() attribute or sun-application-client.xml.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Java EJB client "Can't connect to ORB" errors...

    I'm writing an application that is a Java EJB client application (no web
    stuff at all). Needless to say there are no examples of such an app in
    the samples dir, they are all web-based.
    My problem is that when I try to run my application (client calls a
    stateless session bean on the server and gets a "hello world" string
    back) I get a "Could not create the TestService bean:
    javax.naming.CommunicationException: Cannot connect to ORB [Root
    exception is org.omg.CORBA.COMM_FAILURE:   minor code: 1 completed:
    Maybe]" error.
    This is a very simple test, and I'm getting quite frustrated in trying
    to figure out what's actually wrong.
    Here's the client code (the bean on the server has been deployed into a
    module called achptestEjb, the bean name is TestService)
    TestService service = null;
    TestServiceHome home=null;
    String host = "localhost";
    String port = "12345";
    try {
    Properties env = new Properties();
    Context context=null;
    String jndiName="ejb/achptestEjb/TestService";
    System.out.println("JNDI name is "+jndiName);
    env.put
    ("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url", "iiop://"+host+":"+port);
    context = new InitialContext(env);
    The error comes when the new InitialContext is set with the properties
    in the env object.
    Any ideas what I'm doing wrong?
    It would be a BIG help if iPlanet included one simple pure EJB client
    example. There are some of us out here who feel HTML is too limiting
    for complicated applications.
    Douglas Bullard

    I finally found the answer to my problem.... in the Ant script I had
    copied from another example, the "-iiop" was lacking in the ejbc
    arguments - almost all of the examples assume you'll be calling EJBs
    from within the container, instead of a stand-alone client, so they
    don't use that flag.
    Putting that "-iiop" flag into the ejbc arguments fixed everything.
    Thanks, Shivani, for pointing out what is now obvious but was
    mysterious.
    Douglas Bullard
    In article <[email protected]>,
    [email protected] says...
    I'm writing an application that is a Java EJB client application (no web
    stuff at all). Needless to say there are no examples of such an app in
    the samples dir, they are all web-based.
    My problem is that when I try to run my application (client calls a
    stateless session bean on the server and gets a "hello world" string
    back) I get a "Could not create the TestService bean:
    javax.naming.CommunicationException: Cannot connect to ORB [Root
    exception is org.omg.CORBA.COMM_FAILURE:   minor code: 1 completed:
    Maybe]" error.
    This is a very simple test, and I'm getting quite frustrated in trying
    to figure out what's actually wrong.
    Here's the client code (the bean on the server has been deployed into a
    module called achptestEjb, the bean name is TestService)
    TestService service = null;
    TestServiceHome home=null;
    String host = "localhost";
    String port = "12345";
    try {
    Properties env = new Properties();
    Context context=null;
    String jndiName="ejb/achptestEjb/TestService";
    System.out.println("JNDI name is "+jndiName);
    env.put
    ("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url", "iiop://"+host+":"+port);
    context = new InitialContext(env);
    The error comes when the new InitialContext is set with the properties
    in the env object.
    Any ideas what I'm doing wrong?
    It would be a BIG help if iPlanet included one simple pure EJB client
    example. There are some of us out here who feel HTML is too limiting
    for complicated applications.
    Douglas Bullard

Maybe you are looking for