JNDI bind

When I try to bind an Object to the JNDI tree in WebLogic (doesn't matter
which version), if the class of this object is not part of the CLASSPATH, it
throws an exception. But I tried the same exercise with JBoss, and it
doesn't requires that the class should be part of JBoss CLASSPATH.
My question is which implementation is right? (If there is a right or wrong
answer here. But it seems that JBoss has the most reliable and flexible
implementation... Any concerns of why WebLogic works the way it does?
Thanks in advance,
Marcelo.

Don Ferguson wrote:
>
Is this from a Java client? If so, it sounds like JBoss may be network class
loading the class from the client. That's pretty unlikely IMHO. Isn't it more likely that the JBoss SPI stores /
serialises the object to be bound directly from the client rather than passing
it to the server instance by RMI before storing it, as WLS does.
I'm guessing that the poster hasn't tried looking the object up from within the
JBoss server JVM - I think this would generate the same NoClassDef exception
that WLS throws at bind time.
This is flexible, as you say, but it is a
security hole large enough to drive a truck through.
Marcelo Caldas wrote:
When I try to bind an Object to the JNDI tree in WebLogic (doesn't matter
which version), if the class of this object is not part of the CLASSPATH, it
throws an exception. But I tried the same exercise with JBoss, and it
doesn't requires that the class should be part of JBoss CLASSPATH.
My question is which implementation is right? (If there is a right or wrong
answer here. But it seems that JBoss has the most reliable and flexible
implementation... Any concerns of why WebLogic works the way it does?
Thanks in advance,
Marcelo.

Similar Messages

  • Probmel with Local EJB JNDI Binding

    Hi friends,
    I am using jboss server. I need to deployee one session bean and one entity bean. and I have done it. but it show me jndi binding like this
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookBean' to jndi 'local/BookBean@18722656'
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookFacadeBean' to jndi 'local/BookFacadeBean@9668715'
    but it should be bind jndi bninding like this
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookBean' to jndi 'BookBean'
    [BaseLocalProxyFactory] Bound EJB LocalHome 'BookFacadeBean' to jndi 'BookFacadeBean'
    I don't understand where I am comminting mistake. I am giving ejb-jar.xml mapping below.
    <?xml version="1.0" encoding="UTF-8"?>
    <!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>
         <description>BookEJB</description>
         <display-name>BookEJB</display-name>
         <enterprise-beans>
              <session>
                   <display-name>BookFacade</display-name>
                   <ejb-name>BookFacadeBean</ejb-name>
                   <local-home>com.ejb.book.service.BookFacadeHome</local-home>
                   <local>com.ejb.book.service.BookFacadeLocal</local>
                   <ejb-class>com.ejb.book.service.BookFacadeBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
              <entity>
                   <description>EntityBean</description>
                   <display-name>BookEntity</display-name>
                   <ejb-name>BookBean</ejb-name>
                   <local-home>com.ejb.book.persistence.BookLocalHome</local-home>
                   <local>com.ejb.book.persistence.BookLocal</local>
                   <ejb-class>com.ejb.book.persistence.BookLocalBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Integer</prim-key-class>
                   <reentrant>false</reentrant>
                   <abstract-schema-name>book</abstract-schema-name>
                   <cmp-field>
                        <field-name>bookID</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookName</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookAuthor</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookVersion</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>bookPrice</field-name>
                   </cmp-field>
                   <primkey-field>bookID</primkey-field>
                   <query>
                        <description>Query By All</description>
                             <query-method>
                                  <method-name>findAll</method-name>
                                  <method-params></method-params>
                             </query-method>
                             <ejb-ql>SELECT OBJECT(u) FROM book AS u </ejb-ql>
                   </query>
                   <query>
                        <description>Query for findByBookName</description>
                        <query-method>
                             <method-name>findByPrimaryKey</method-name>
                                  <method-params>
                                       <method-param>java.lang.Integer</method-param>
                                  </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookID=?1</ejb-ql>
              </query>
                   <query>
                        <description>Query for findByBookName</description>
                        <query-method>
                             <method-name>findByBookName</method-name>
                                  <method-params>
                                       <method-param>java.lang.String</method-param>
                                  </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookName=?1</ejb-ql>
              </query>
              <query>
                        <description>Query for findByBookAuthor</description>
                        <query-method>
                             <method-name>findByBookAuthor</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookAuthor=?1</ejb-ql>
              </query>
              <query>
                   <description>Query for findByBookVersion</description>
                   <query-method>
                        <method-name>findByBookVersion</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>SELECT OBJECT(u) FROM book AS u     WHERE u.bookVersion=?1</ejb-ql>
              </query>
              <query>
                   <description>Query for findByBookPrice</description>
                   <query-method>
                        <method-name>findByBookPrice</method-name>
                        <method-params>
                             <method-param>java.lang.Float</method-param>
                        </method-params>
                   </query-method>
                   <ejb-ql>SELECT OBJECT(u) FROM book AS u WHERE u.bookPrice=?1</ejb-ql>
              </query>
              </entity>
         </enterprise-beans>
         <assembly-descriptor>
              <container-transaction>
                   <method>
                        <ejb-name>BookBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
              <container-transaction>
                   <method>
                        <ejb-name>BookFacadeBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    I appreciate if you reply me on [email protected].
    Thanks in advance.
    TumoDav (UmaShankar)

    Hi friend,
    Thanks for replying me. But , I am unable to call this EJB by simple EJBClient (simple java file) when I am trying to call this ejb, then it show me this error :-
    javax.naming.NameNotFoundException: BookFacadeBean not bound
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
         at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
         at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
         at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
         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:585)
         at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
         at sun.rmi.transport.Transport$1.run(Transport.java:153)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
         at java.lang.Thread.run(Thread.java:595)
         at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
         at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
         at sun.rmi.server.UnicastRef.invoke(Unknown Source)
         at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at EJBClient.EJBClient.BookEJBClient(EJBClient.java:45)
         at EJBClient.EJBClient.main(EJBClient.java:30)
    Here I am giving my ejb client.
    package EJBClient;
    import java.util.Iterator;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import com.ejb.book.service.BookFacadeBean;
    import com.ejb.book.service.BookFacadeHome;
    import com.ejb.book.service.BookFacadeLocal;
    import com.ejb.book.vo.BookVo;
    * @author UmaShankar
    public class EJBClient {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              BookEJBClient();
         public static void BookEJBClient(){
              String providerURL = "jnp://localhost:1099";
              String factoryName = "org.jnp.interfaces.NamingContextFactory"; //org.jnp.interfaces.NamingContextFactory
              String factoryPkgs = "org.jboss.naming:org.jnp.interfaces";
              Properties prop = System.getProperties();
              prop.put("Context.PROVIDER_URL", providerURL);
              prop.put("java.naming.provider.url", providerURL);
              prop.put("java.naming.factory.initial", factoryName);
              prop.put("java.naming.factory.url.pkgs", factoryPkgs);
              try{
                   Context ctx = new InitialContext(prop);
                   Object obj = ctx.lookup("BookFacadeBean");
                   BookFacadeHome home = (BookFacadeHome)PortableRemoteObject.narrow(obj, BookFacadeHome.class);
                   BookFacadeLocal local = home.create();
                   //java.util.Hashtable allD = local.getBookName();
                   System.out.println("-------------Start-------------------");
                   System.out.println("BookName:-"+local.getBookName());
                   System.out.println("BookAuthor:-"+local.getBookAuthor());
                   if(allD.isEmpty()){
                        System.out.println("There is no record. Empty Hash");
                   java.util.Set set = allD.keySet();
                   for(Iterator it = set.iterator();it.hasNext();System.out.println("-----------------------------")){
                        Integer key = (Integer)it.next();
                        BookVo vo = (BookVo)allD.get(key);
                        System.out.println(vo.getBookId());
                        System.out.println(vo.getBookName());
                        System.out.println(vo.getBookAuthor());
                        System.out.println(vo.getBookVersion());
                        System.out.println(vo.getBookPrive());
              }catch(Exception e){
                   e.printStackTrace();
    }

  • JNDI bind from StartupClass ?

    Hi,
    I am trying to perfrom a simple JNDI bind from my StartupClass's startUp
    method using the following code [where configFileName is a valid
    string]:
         Context ctx = new InitialContext();
         try {
              CompositeName name =
                   new CompositeName("java:comp/env/ConfigFile");
              ctx.bind(name, configFileName);
         } catch(Exception e) {
              System.err.println("\nException while trying to bind.\n");
              e.printStackTrace();
    I recieve the following exception:
    Exception while trying to bind.
    javax.naming.OperationNotSupportedException
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.naming.NamingException.<init>(NamingException.java:114)
    at
    javax.naming.OperationNotSupportedException.<init>(OperationNotSupportedException.java:39)
    at com.netscape.server.jndi.CompContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at javax.naming.InitialContext.bind(InitialContext.java:378)
    at
    com.getpaid.thinclient.config.ConfigService.initialize(ConfigService.java:123)
    at
    com.getpaid.thinclient.config.ConfigService.startService(ConfigService.java:40)
    at
    com.iplanet.ias.startup.StartupClass.startUp(StartupClass.java:53)
    at com.kivasoft.engine.Engine.invokeStartUp(Unknown Source)
    at com.kivasoft.engine.Engine.run(Compiled Code)
    at com.kivasoft.engine.Engine.main(Unknown Source)
    The same code works from a JBoss MBean (analagous to StartupClass).
    Can you tell me what, if anything, I'm doing wrong?
    Thank you,
    Eric Kahler

    The startup class uses cosnaming for JNDI so it behaves the same as the
    rich client, ie no java:comp/etc.. you will need to use the absolute
    name.
    regards
    Han-Dat
    [email protected] wrote:
    >
    Hi,
    I am trying to perfrom a simple JNDI bind from my StartupClass's startUp
    method using the following code [where configFileName is a valid
    string]:
    Context ctx = new InitialContext();
    try {
    CompositeName name =
    new CompositeName("java:comp/env/ConfigFile");
    ctx.bind(name, configFileName);
    } catch(Exception e) {
    System.err.println("\nException while trying to bind.\n");
    e.printStackTrace();
    I recieve the following exception:
    Exception while trying to bind.
    javax.naming.OperationNotSupportedException
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at javax.naming.NamingException.<init>(NamingException.java:114)
    at
    javax.naming.OperationNotSupportedException.<init>(OperationNotSupportedException.java:39)
    at com.netscape.server.jndi.CompContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at com.netscape.server.jndi.java.javaURLContext.bind(Unknown Source)
    at javax.naming.InitialContext.bind(InitialContext.java:378)
    at
    com.getpaid.thinclient.config.ConfigService.initialize(ConfigService.java:123)
    at
    com.getpaid.thinclient.config.ConfigService.startService(ConfigService.java:40)
    at
    com.iplanet.ias.startup.StartupClass.startUp(StartupClass.java:53)
    at com.kivasoft.engine.Engine.invokeStartUp(Unknown Source)
    at com.kivasoft.engine.Engine.run(Compiled Code)
    at com.kivasoft.engine.Engine.main(Unknown Source)
    The same code works from a JBoss MBean (analagous to StartupClass).
    Can you tell me what, if anything, I'm doing wrong?
    Thank you,
    Eric Kahler--
    Senior Consultant
    Sun Professional Services
    iPlanet e-commerce Solutions
    Sun Microsystems Australia Pty Ltd

  • Error in EJB JNDI Binding for EMP Bean

    Hi friends,
    I need to call a ejb from second ejb ( entity bean from a sission bean). I have defined all xml mapping in ejb.xml.jar and server specific jar file (jboss.xml.jar). I am using boss-4.0.5.GA. But when I am calling that session bean from simple desk top client. It show me this error
    23:48:59,578 ERROR [STDERR] javax.naming.NameNotFoundException: UserLocalHome not bound
    23:48:59,578 ERROR [STDERR]      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
    23:48:59,578 ERROR [STDERR]      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
    23:48:59,578 ERROR [STDERR]      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
    23:48:59,578 ERROR [STDERR]      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,578 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.transport.Transport$1.run(Transport.java:153)
    23:48:59,578 ERROR [STDERR]      at java.security.AccessController.doPrivileged(Native Method)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    23:48:59,578 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:595)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
    23:48:59,578 ERROR [STDERR]      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
    23:48:59,578 ERROR [STDERR]      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
    23:48:59,578 ERROR [STDERR]      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    23:48:59,578 ERROR [STDERR]      at javax.naming.InitialContext.lookup(InitialContext.java:351)
    23:48:59,578 ERROR [STDERR]      at com.ejb.service.UserFacadeBean.getHome(UserFacadeBean.java:51)
    23:48:59,578 ERROR [STDERR]      at com.ejb.service.UserFacadeBean.getAll(UserFacadeBean.java:74)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,578 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,578 ERROR [STDERR]      at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
    23:48:59,578 ERROR [STDERR]      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    23:48:59,578 ERROR [STDERR]      at org.jboss.ejb.Container.invoke(Container.java:954)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,578 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,578 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    23:48:59,578 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    23:48:59,578 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    23:48:59,578 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    23:48:59,578 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    23:48:59,578 ERROR [STDERR]      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
    23:48:59,578 ERROR [STDERR]      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,578 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,578 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,578 ERROR [STDERR]      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.Transport$1.run(Transport.java:153)
    23:48:59,593 ERROR [STDERR]      at java.security.AccessController.doPrivileged(Native Method)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    23:48:59,593 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:595)
    23:48:59,593 ERROR [STDERR] java.lang.NullPointerException
    23:48:59,593 ERROR [STDERR]      at com.ejb.service.UserFacadeBean.getAll(UserFacadeBean.java:75)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,593 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,593 ERROR [STDERR]      at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
    23:48:59,593 ERROR [STDERR]      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
    23:48:59,593 ERROR [STDERR]      at org.jboss.ejb.Container.invoke(Container.java:954)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,593 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,593 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    23:48:59,593 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    23:48:59,593 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
    23:48:59,593 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
    23:48:59,593 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
    23:48:59,593 ERROR [STDERR]      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
    23:48:59,593 ERROR [STDERR]      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    23:48:59,593 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    23:48:59,593 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.Transport$1.run(Transport.java:153)
    23:48:59,593 ERROR [STDERR]      at java.security.AccessController.doPrivileged(Native Method)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    23:48:59,593 ERROR [STDERR]      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    23:48:59,593 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:595)
    23:48:59,593 INFO [STDOUT] exit from getAll() method.....
    Can any one help me. how can I resolve it. When I see server log. when I found then one of bean is not perperly bind with jndi name. it showing message like this.
    23:48:21,187 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'FtacostManagerBean' to jndi 'local/FtacostManagerBean@27432016'
    It seems like , it unable to bind Manager Bean with local home. but I am not sure. Please help me. how can I resulve it.
    Here I am sending my ejb config files.
    JBoss.xml.jar
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
    <jboss>
    <enterprise-beans>
    <!--
    To add beans that you have deployment descriptor info for, add
    a file to your XDoclet merge directory called jboss-beans.xml that contains
    the <session></session>, <entity></entity> and <message-driven></message-driven>
    markup for those beans.
    -->
    <entity>
    <ejb-name>UserBean</ejb-name>
    <local-jndi-name>UserLocalHome</local-jndi-name>
    </entity>
         <session>
    <ejb-name>UserFacadeBean</ejb-name>
    <jndi-name>UserFacadeHome</jndi-name>
    <ejb-local-ref>
    <ejb-ref-name>User</ejb-ref-name>
    <local-jndi-name>UserLocalHome</local-jndi-name>
    </ejb-local-ref>
    </session>
    <!--
    write a merge file jboss-webservices.ent for webservice-description
    -->
    </enterprise-beans>
    <!--
    To specify your own assembly descriptor info here, add a file to your
    XDoclet merge directory called jboss-assembly-descriptor.xml that contains
    the <assembly-descriptor></assembly-descriptor> markup.
    -->
    <assembly-descriptor>
    <!-- message destinations -->
    <!--
    To specify additional message-destination elements, add a file in the merge
    directory called jboss-message-destinations.ent that contains them.
    -->
    </assembly-descriptor>
    <resource-managers>
    </resource-managers>
    <!--
    | for container settings, you can merge in jboss-container.xml
    | this can contain <invoker-proxy-bindings/> and <container-configurations/>
    -->
    </jboss>
    ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!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 >
    <description>Umashankar beans</description>
    <display-name>Programmed by umashnakar</display-name>
    <enterprise-beans>
    <!-- Session Beans -->
    <session>
    <display-name>UserFacade</display-name>
    <ejb-name>UserFacadeBean</ejb-name>
    <home>com.ejb.service.UserFacadeHome</home>
    <remote>com.ejb.service.UserFacadeRemote</remote>
    <ejb-class>com.ejb.service.UserFacadeBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    <!-- Entity Beans -->
    <entity>
         <description>User Bean Made by Uma</description>     
         <display-name>This is local user Entity</display-name>
         <ejb-name>UserBean</ejb-name>
         <local-home>com.ejb.persistence.UserLocalHome</local-home>
         <local>com.ejb.persistence.UserLocal</local>
         <ejb-class>com.ejb.persistence.UserLocalBean</ejb-class>
         <persistence-type>Container</persistence-type>
         <prim-key-class>java.lang.Integer</prim-key-class>
         <reentrant>false</reentrant>
         <abstract-schema-name>user</abstract-schema-name>
              <cmp-field>
              <field-name>cuId</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>accessCode</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>password</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>creationDate</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>siteId</field-name>
              </cmp-field>
              <primkey-field>cuId</primkey-field>
              <query>
                        <description>Query by accessCode</description>
                        <query-method>
                             <method-name>findByAccessCode</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>                    
                        <ejb-ql>SELECT OBJECT(u) FROM user AS u WHERE u.accessCode = ?1</ejb-ql>
              </query>
              <query>
                        <description>Query by accessCode</description>
                        <query-method>
                             <method-name>findByPassword</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM user AS u WHERE u.password = ?1</ejb-ql>
              </query>
              <query>
                        <description>Query by accessCode</description>
                        <query-method>
                             <method-name>findByCreationDate</method-name>
                             <method-params>
                                  <method-param>java.sql.Timestamp</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM user AS u WHERE u.creationDate = ?1</ejb-ql>
              </query>
              <query>
                        <description>Query by accessCode</description>
                        <query-method>
                             <method-name>findBySiteId</method-name>
                             <method-params>
                                  <method-param>java.lang.Integer</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT OBJECT(u) FROM user AS u WHERE u.siteId = ?1</ejb-ql>
              </query>
              <query>
                        <description>Query by accessCode</description>
                        <query-method>
                             <method-name>findAll</method-name>
                             <method-params/>
                        </query-method>
                             <ejb-ql>SELECT OBJECT(u) FROM user AS u </ejb-ql>
              </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor >
              <container-transaction>
    <method>
    <ejb-name>UserBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>UserFacadeBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Please rep[y me on [email protected]. I appreciate it if you come on google talk.
    Thanks in Advance.
    UmaShankar(TumoDev)
    Software Engineer                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    Hi,
    According to WAS 6 , every opened connection has to be commited (or rolledback) explicitly (didnt try autocommit) before closing. Even if all you have done with that connection is a SELECT Query.
    This has apparently solved the same problem I was getting. implement it and see whether it helps you.

  • JNDI binding issue

    Hi everyone, I'm having an issue with a not bound exception. According to the logs, I'm getting the not bound exception with the following details:
    The excerpt is here: 04/24/08 11:44:42.692 Info: [ProcessWrapper] org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myDataSource' defined in ServletContext resource [WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: WRP not bound]
    It looks for me that Spring is doing the lookup correctly but failing to find the resource in JNDI. What I found for binding in the log is following.
    04/24/08 11:44:31.302 Info: [ProcessWrapper] 11:44:31,302 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultD S' to JNDI name 'javaefaultDS'
    04/24/08 11:44:31.552 Info: [ProcessWrapper] 11:44:31,552 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=J msXA' to JNDI name 'java:JmsXA'
    04/24/08 11:44:31.614 Info: [ProcessWrapper] 11:44:31,614 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MACRAE' to JNDI name 'java:MACRAE'
    We can see these JNDI names are successfully bound. WRP is the app which I am trying to run, MACRAE is another app that works in that environment. The web server is JBoss running in a DataSynapse grid server. Any tips on how to get the binding fixed?

    OK, I seem to be getting a new exception, not sure if I did any change but ran into this exception in the logs,
    11/08/24 18:45:08 ----YOGI----the exception from this specific block is javax.naming.Reference cannot be cast to javax.sql.DataSource*
    From what I read on the web, this is prevalent in glassfish and jboss. The reason could be that missing j2ee.jar in classpath or duplicate jdbc jars. I added j2ee.jar to my application library in oc4j dint resolve the issue. I removed jdbc jar from the OAS lib folder and restarted, it dint help.
    Any other clues, anyone?

  • JNDI bind 的问题

    将 Object 绑定到JNDI时是否有限制?我将一个 java.awt.Poin 绑定时一切正常,但使用一个我自己定义的 Object 绑定时报错:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.io.InvalidClassException: failed to read class descriptor
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at weblogic.jndi.internal.ServerNamingNode_812_WLStub.rebind(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:137)
         ... 2 more
    Caused by: java.io.InvalidClassException: failed to read class descriptor
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1505)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
         at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:119)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:112)
         at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    源程序:
    import java.awt.Point;
    import java.io.Serializable;
    import java.util.Properties;
    import javax.naming.*;
    public class JndiBindTest {
    private static final String NAME = "test_point";
    public static void main(String[] args) throws NamingException {
    Context context =
    getInitialContext("t3://localhost:7001", "system", "password");
    System.out.println("-- bind java.awt.Point...");
    context.rebind(NAME, new Point(1, 2));
    System.out.println("-- bind test.jndi.MyPoint...");
    context.rebind(NAME, new MyPoint(1, 2));
    private static Context getInitialContext(
    String url,
    String user,
    String password)
    throws NamingException {
    Properties properties = new Properties();
    properties.put(
    Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, url);
    if (user != null) {
    properties.put(Context.SECURITY_PRINCIPAL, user);
    properties.put(
    Context.SECURITY_CREDENTIALS,
    password == null ? "" : password);
    return new InitialContext(properties);
    class MyPoint implements Serializable {
    int x;
    int y;
    MyPoint(int x, int y) {
    this.x = x;
    this.y = y;

    前面的错误是联接一个cluster发生的,这是连接普通Server时产生的Exception:
    -- bind java.awt.Point...
    -- bind test.jndi.MyPoint...
    javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.io.StreamCorruptedException]
         at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:83)
         at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:390)
         at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:139)
         at javax.naming.InitialContext.rebind(InitialContext.java:363)
         at test.jndi.JndiBindTest.main(JndiBindTest.java:32)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.io.StreamCorruptedException
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
         at weblogic.jndi.internal.ServerNamingNode_812_WLStub.rebind(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:137)
         ... 2 more
    Caused by: java.io.StreamCorruptedException
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
         at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:119)
         at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:112)
         at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
         at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java)
    Exception in thread "main"

  • JNDI bind/rebind and object state question

    Hi,
    I have an object that is part of an EAR application that is deployed into an app server. I load a Webapp that initializes an object and then binds it to an initial context under java:comp/env setting some initial state.
    However, when I access the object from an MDB as part of the EAR application, the state, when retrieved from the same context, was not retained. Here is the code I am using to bind the object to the context:
    if (!object.isRunning()) {
           System.out.println("Starting App...");
           object.start();
           try {
               getNamingContext().bind(object);
           } catch (Exception e) {
               System.out.println("Name bound already, rebinding...");
               try {
                   getNamingContext().rebind(object);
                   e.printStackTrace();
               } catch (Exception e1) {
                   e1.printStackTrace();
           System.out.println("Broker started...");
       }When I retrieve the object from the initial context as part of a message received within an MDB, the state is such that the object is always failing the .isRunning method test and subsequently throws an exception.
    What am I doing wrong? Is this related to the fact that possibly the WAR and the MDB create duplicate contexts when I expect there to be only one?
    Any insight is greatly appreciated.
    Thanks,
    John

    following procedure works fine for now, if there is any straight forward solutions,
    that will be helpful.
    1) Create the Subcontexts for each of the sub entries in the jndi name tree
    2) bind the object to the last entry in the tree.
    i.e if the jndi tree name is "one.two.three", and the bind object is Obj
    ctx = ctx.createSubcontext("one");
    ctx = ctx.createSubcontext("two");
    ctx = ctx.bind("three", obj);
    Thanks,
    Gangs.
    "Gangadhar" <[email protected]> wrote:
    >
    Hi,
    I am trying to bind the local object to the Weblogic JNDI, using the
    code below.
    It works fine if the bind name is a straight forward String(not a tree).
    It is
    throwing naming Exception when i am trying to bind into a new tree.
    Thanks,
    Gangs.
    //GETTING THE INITIAL CONTEXT:
    private Context getInitialContext() throws NamingException {
    Properties h = new Properties();
    h.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    h.put(Context.SECURITY_PRINCIPAL, "user");
    h.put(Context.SECURITY_CREDENTIALS, "password");
    h.put(Context.PROVIDER_URL, url);
    return new InitialContext(h);
    } catch (NamingException ne) {
    log("We were unable to get a connection to the WebLogic server
    at "+url);
    log("Please make sure that the server is running.");
    throw ne;
    private registerObject()
    throws NamingException
    // Lookup the beans home using JNDI
    Context ctx = getInitialContext();
    try{
    //This binding works fine.
    String bname = "Ganga";
    ctx.bind("plainname", bname);
    //This one throws an Naming Exception..
    ctx.rebind("one.two.three", bname);
    } catch(javax.naming.NameAlreadyBoundException nlb){
    System.out.print(nlb.getMessage());
    System.exit(0);
    }catch(javax.naming.directory.InvalidAttributesException iae){
    System.out.print(iae.getMessage());
    System.exit(0);
    }catch(NamingException ne){
    System.out.print(ne.getMessage());
    System.exit(0);
    Exception msg is : Unable to resolve 'one.two.three' Resolved: '' Unresolved:'one'

  • JNDI Bind Exception in Weblogic

    I am trying to utilize Spring's JndiTemplate to bind my own objects to JNDI. I am able to get flat names like:
    cacheManager
    But when I try a compound name like:
    rtm/cacheManager
    It fails with the following message:
    Caused by: javax.naming.NameNotFoundException: While trying to lookup 'rtm.cacheManager' didn't find subcontext 'rtm'. Resolved ''; remaining name 'rtm/cacheManager'
    How can I create a subcontext within weblogic?

    I figured it out, I need to create the subcontext prior to executing the bind.

  • JNDI binding to customised names

    I am currently developing a multi-EAR application. Grouping the EJB session beans in one EAR on one server with Remote interfaces and the EAR with the client/WAR on another. We are operating with a developed standard for JNDI names of Session Bean interfaces which follows neither the OC4J, JBoss or EJB3 specification.
    On JBoss 4.0.5 we can create these mappings in the global JNDI space using the custom jboss.xml deployment descriptor. I was wondering if the OC4J deployment descriptor (orion-ejb-jar.xml) provides the same flexibililty. There does appear to be several location fields, but no description or manual has been able to document these well enough.
    Thanks in advance.
    Grant Q
    PS -
    JBoss <EAR name>/<Bean name>/<interface type>
    Oracle <EAR name>/<JAR name>_<BeanName><interface type>
    Custom abc/<domain>/<component>/<layer>/<interface name>

    Shiye Qiu <> writes:
              > Hi, assuming that I bind an object to JNDI, is this object
              > going to be clustered? If so, does the object has to be
              > serializable?
              Yes.
              >
              > Thanks a lot
              --

  • DataSource-class pool-JNDI-bind-lookup

    Hi,
    I am a beginner in this subject and it is confused. I read that
    the best way to use the connections is from a DataSource. There
    are 2 ways to configure it:
    1- From the data-source.xml file
    2- Or using InitialContext, Context and bind method from a java
    program loaded in the startup.
    If so, which one is better?
    On the other hand, there are some classes I can use, for
    instance:
    1- OracleConnectionCacheImpl
    2- OracleConnectionPoolDataSource
    etc.
    which one is better?
    Thank you very much for any comment.
    Andres.

    Hi:
    upon further research, i find that the data
    that was used in State class at binding does not change on any update,
    like via foll -
    State s = (State)ic.lookup(JNDINAME);
    s.addHashtableEntry (key, val); or
    s.setDesc ("new desc");
    next time i lookup State class the hashtable entry is missing and desc is
    old and not "new desc".
    any help appreciated.
    thanks
    rajans
    Rajan Sadasivan wrote:
    Hi:
    I am using jdk1.3, weblogic6.0
    I am binding a state class like ->
    public class State implements Serializable {
    private String desc;
    private Hashtable sessions;
    onto the JNDI tree. Binding is done like initialCxt.bind (name,
    _state);
    and state's sessions has one entry in it and state's desc is set.
    I then use another client to do _initialCxt.lookup (name) on same
    weblogic JVM.
    The _state object is returned with correct value of desc; but the
    sessions
    hashtable is empty and the single entry is gone. I do see also the the
    State's finialize () method is called.
    Can anyone explain why i am losing hashtable information ?
    How do I make this work in weblogic jndi with hashtable info ?
    thanks
    rajans

  • JNDI bind problem

    I have a simple JNDI test program whose source is listed below. Bind fails
    with the following error.
    Operation failed: javax.naming.CommunicationException. Root exception is
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception
    is:
    java.io.StreamCorruptedException
    at
    weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :284)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :244)
    at weblogic.jndi.internal.ServerNamingNode_811_WLStub.bind(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:359)
    at javax.naming.InitialContext.bind(InitialContext.java:355)
    at com.client.mytest.main(JNDIBindTestClient.java:50)
    Caused by: java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1506)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at
    weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
    putStream.java:114)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:111)
    at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :108)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
    t.java:353)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    Exception in thread "main"
    I have listed the source code for the test program as well as the class
    Fruit (the object I am trying to bind)
    JDK 1.4.1_03
    BEA WL 8.1
    What is going on here? Any help would be greatly appreciated.
    ------------------------------------mytest.java-----------------------------
    package examples.jndi;
    import javax.naming.*;
    import java.util.Hashtable;
    * Demonstrates how to bind a Referenceable object to a context.
    * (Use Unbind to remove binding.)
    * usage: java RefObj
    class mytest {
    public static void main(String[] args) {
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try {
    // Create the initial context
    Context ctx = new InitialContext(env);
    // Create object to be bound
    Fruit fruit = new Fruit("orange");
    // Perform bind
    ctx.bind("cn=favorite", fruit);
    // Read object back
    Fruit f2 = (Fruit) ctx.lookup("cn=favorite");
    System.out.println(f2);
    // Close the context when we're done
    ctx.close();
    } catch (NamingException e) {
    System.out.println("Operation failed: " + e);
    ---- ------------------Fruit.java----------------------------------
    import javax.naming.*;
    public class Fruit implements Referenceable, java.io.Serializable{
    String fruit;
    public Fruit(String f)
    fruit = f;
    public Reference getReference() throws NamingException
    return new Reference(
    Fruit.class.getName(),
    new StringRefAddr("fruit", fruit),
    FruitFactory.class.getName(),
    null); // factory location
    public String toString()
    return fruit;
    --------------------------------------FruitFactory.java---------------------
    import javax.naming.*;
    import javax.naming.spi.ObjectFactory;
    import java.util.Hashtable;
    * This is an object factory that when given a reference for a Fruit
    * object, will create an instance of the corresponding Fruit.
    public class FruitFactory implements ObjectFactory {
    public FruitFactory() {
    public Object getObjectInstance(Object obj, Name name, Context ctx,
    Hashtable env) throws Exception {
    if (obj instanceof Reference) {
    Reference ref = (Reference)obj;
    if (ref.getClassName().equals(Fruit.class.getName())) {
    RefAddr addr = ref.get("fruit");
    if (addr != null) {
    return new Fruit((String)addr.getContent());
    return null;

    did your client progam use the same weblogic.jar on the classpath as the
    server it was calling?
    MTL wrote:
    I have a simple JNDI test program whose source is listed below. Bind fails
    with the following error.
    Operation failed: javax.naming.CommunicationException. Root exception is
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception
    is:
    java.io.StreamCorruptedException
    at
    weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :284)
    at
    weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java
    :244)
    at weblogic.jndi.internal.ServerNamingNode_811_WLStub.bind(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.bind(WLContextImpl.java:359)
    at javax.naming.InitialContext.bind(InitialContext.java:355)
    at com.client.mytest.main(JNDIBindTestClient.java:50)
    Caused by: java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1506)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    at
    weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectIn
    putStream.java:114)
    at
    weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:111)
    at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
    at
    weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java
    :108)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
    t.java:353)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
    at
    weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404)
    at
    weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:3
    0)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    Exception in thread "main"
    I have listed the source code for the test program as well as the class
    Fruit (the object I am trying to bind)
    JDK 1.4.1_03
    BEA WL 8.1
    What is going on here? Any help would be greatly appreciated.
    ------------------------------------mytest.java-----------------------------
    package examples.jndi;
    import javax.naming.*;
    import java.util.Hashtable;
    * Demonstrates how to bind a Referenceable object to a context.
    * (Use Unbind to remove binding.)
    * usage: java RefObj
    class mytest {
    public static void main(String[] args) {
    Hashtable env = new Hashtable(11);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL, "t3://localhost:7001");
    try {
    // Create the initial context
    Context ctx = new InitialContext(env);
    // Create object to be bound
    Fruit fruit = new Fruit("orange");
    // Perform bind
    ctx.bind("cn=favorite", fruit);
    // Read object back
    Fruit f2 = (Fruit) ctx.lookup("cn=favorite");
    System.out.println(f2);
    // Close the context when we're done
    ctx.close();
    } catch (NamingException e) {
    System.out.println("Operation failed: " + e);
    ---- ------------------Fruit.java----------------------------------
    import javax.naming.*;
    public class Fruit implements Referenceable, java.io.Serializable{
    String fruit;
    public Fruit(String f)
    fruit = f;
    public Reference getReference() throws NamingException
    return new Reference(
    Fruit.class.getName(),
    new StringRefAddr("fruit", fruit),
    FruitFactory.class.getName(),
    null); // factory location
    public String toString()
    return fruit;
    --------------------------------------FruitFactory.java---------------------
    import javax.naming.*;
    import javax.naming.spi.ObjectFactory;
    import java.util.Hashtable;
    * This is an object factory that when given a reference for a Fruit
    * object, will create an instance of the corresponding Fruit.
    public class FruitFactory implements ObjectFactory {
    public FruitFactory() {
    public Object getObjectInstance(Object obj, Name name, Context ctx,
    Hashtable env) throws Exception {
    if (obj instanceof Reference) {
    Reference ref = (Reference)obj;
    if (ref.getClassName().equals(Fruit.class.getName())) {
    RefAddr addr = ref.get("fruit");
    if (addr != null) {
    return new Fruit((String)addr.getContent());
    return null;

  • EJB / JNDI binding question (ColdFusion 9)

    Hello,
    I am running ColdFusion 9 (developer edition) on my local machine (Windows XP SP3; 2,66Ghz; 2Gb RAM) through / using IIS 5.1.
    Using this environment I'm trying to implement the Belgian e-ID applet (hosted on Google code) authentication example. But for the authentication to work, the SDK pdf tells me to register an EJB in JNDI.The basic configuration (being adding servlet & servlet mapping sections in the web.xml configuration file) works for identification, but no results for authentication...
    I already contacted the eID site admin(s), requesting additional information on how to achieve this, but this yielded no results as well, as they forwarded me to the vendor of my web server (ColdFusion).
    To make a long story short, is it possible to provide me with an example on how to register this / an EJB for use with the technology mentioned above?
    Thanks in advance!

    Well, your web server isn't really ColdFusion - if you just installed CF using the default settings, you're using JRun for both your web server and for the underlying J2EE container required by CF. So I'd recommend looking at the JRun documentation - just Google "jrun ejb".
    The default location and availability of JRun components in a default install of CF is a bit different than it is with a full JRun install, so you might have to reinstall CF using the JRun option, which installs a full version of JRun and then installs CF as an individual JRun server instance.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Datasource and JNDI binding

    Hi
    I'm a beginner in JNDI
    i'm used to connect the Oracle DB using JDBC ,
    now i want to use the JNDI to get a connection pooling
    i've read alot of Documentation about this field and i need to know how to set the LookUp Name to my database
    thank you

    I am not sure how to add configuration in Oracle App Server. But this how you have to do.
    Create a connection object in the app server in the name jdbc/Test . (jdbc/Test is the name of the connection which will be used to get refernece from the JNDI). In the App server you have to create the connection with you userid, password and URL for the connection.
    URL - jdbc:oracle:thin:@servername:1521:databasename
    You may need to have the connection from EJB or may be from the JSP or bean class. If the connection is required in EJB, then EJB container will get the reference. For JSP or Bean the web container will get the reference. You need to make specific entries in ejb-jar.xml and oracle-ejb-jar.xml (I hope there will be file in this name. Beacause for me I have sun-ejb-jar.xml for Sun App server.) for EJB container and in web.xml and oracle-web.xml for web container.
    Here are the entries for web Container -
    In web.xml put this entry -
    <resource-ref>
    <res-ref-name>jdbc/Test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    In oracle-web.xml put this entry -
    <resource-ref>
    <res-ref-name>jdbc/asta</res-ref-name>
    <jndi-name>jdbc/asta</jndi-name>
    </resource-ref>
    Here is how you will get the connection -
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/Test");
    Connection conn = ds.getConnection();
    Thanks

  • Unable to bind EEPersistenceManagerFactory to JNDI

    I get the following exception trying to bind EEPersistenceManagerFactory to
    JNDI with Kodo 2.2.3 (running with Weblogic 6.1 SP1):
    javax.naming.ConfigurationException. Root exception is
    java.rmi.MarshalException: failed to marshal
    bind(Ljava.lang.String;Ljava.lang.Object;Ljava.util.Hashtable;); nested
    exception is:
    java.io.NotSerializableException:
    com.solarmetric.kodo.impl.jdbc.JDBCPrefsConfiguration
    java.io.NotSerializableException:
    com.solarmetric.kodo.impl.jdbc.JDBCPrefsConfiguration
    at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
    at
    java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827)
    at
    java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
    at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
    Anyone else run into this?

    Sasha-
    That exception indicates that your PersistenceManagerFactory has not
    yet been configured with the proper driver information. Note that the
    JDOConnectionFactory does not use the system.prefs information by
    default: it is designed to be configured internally as per
    the JCA specification.
    I'm sorry to say, but it actually looks like there is no way to bind
    either the EEPersistenceManagerFactory or the JDOConnectionFactory into
    JNDI (unless you extends the EEPersistenceFactory with your own
    Referenceable implementation).
    I have made a bug report about this:
    https://bugzilla.solarmetric.com/show_bug.cgi?id=117
    We will certainly try to have this fixed as soon as possible. Can you
    please add a comment to the bug report with how urgently this is
    affecting you?
    Sasha Haghani <[email protected]> wrote:
    Patrick,
    I get a different problem with JDOConnectionFactory (in 2.2.3)...calling
    getPersistenceManager() on it throws this exception:
    Exception in thread "main" javax.jdo.JDODataStoreException: The JDBC driver
    name "null" is not a valid class.
    NestedThrowables:
    java.lang.NullPointerException
    at com.solarmetric.kodo.impl.jdbc.schema.DB.<init>(DB.java:62)
    at com.solarmetric.kodo.impl.jdbc.schema.DB.getInstance(DB.java:37)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.initConfigurati
    on(JDBCPersistenceManagerFactory.java:155)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.setup(JDBCPersi
    stenceManagerFactory.java:265)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.privateSetup(Pers
    istenceManagerFactoryImpl.java:810)
    at
    com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl.getPersistenceMan
    ager(PersistenceManagerFactoryImpl.java:53)
    "Patrick Linskey" <[email protected]> wrote:
    Sasha,
    This is a known problem with Kodo JDO 2.2.3 EE, caused by a bug in our
    JCA implementation.
    You should be able to work around this problem by binding a
    JDOConnectionFactory instead of an EEPersistenceManagerFactory.
    com.solarmetric.kodo.impl.jdbc.ee.JDOConnectionFactory extends
    EEPersistenceManagerFactory.
    Unfortunately, JDOConnectionFactory implements Serializable although it
    is not actually serializable. However, as JDOConnectionFactory also
    implements javax.resource.Referenceable, the JNDI bind should succeed.
    Finally, one other alternative is to use Kodo's JCA support to locate
    the PersistenceManagerFactory. Unfortunately, you are using WebLogic 6.1
    SP1, which has a flaky JCA implementation. Weblogic 6.1 SP2 resolves
    these problems. So, your best option is probably to upgrade your
    Weblogic install to SP2 and use JCA (as outlined in our docs).
    JDBCPrefsConfiguration will properly serialize in the next patch release
    of Kodo JDO.
    -Patrick
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com
    Kodo Java Data Objects Full featured JDO: eliminate the SQL from your code

  • EJB 3.0 local interface JNDI

    Hello
    I found some information that will probably help a lot of people having trouble with local interface not referenced in JNDI.
    You need to delacre each local interface in the web.xml.
         <ejb-local-ref>
              <ejb-ref-name>MappedNameInYourEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
    <local> yourLocalInterface
              </local>
         </ejb-local-ref>
    The weird thing about this is you don't need to do it when you use remote interface!! I would have thought Weblogic was smart enough to put your EJB in the JNDI when you declare @local on your interface!!
    Am I wrong with something here?
    When I read the EJB spec, it says you don't need to declare your EJB anywhere when you use annotation....
    If someone have an explanation I would be very happy to read about it!!!!
    Tanx

    Hi,
    In our current impl, we don't bind local business interface impl onto global jndi, this is because adding global JNDI binding for local EJB means every local business interface object must be bound into global JNDI, which will give rise to strange errors when accessing remotely or in different application context.
    On the other hand, you needn't add each local interface in the web.xml, you can use annotation through EJB link, which is the suggested way to use EJB local reference, for example:
    @Stateful(name="AccountManagementBean")
    public class AccountManagementBean
    @EJB(
    name="PersonBeanRef",
    beanName="PersonBean"
    Person person;
    @Stateless(name="PersonBean")
    public class PersonBean implements Person {
    In this example, AccountManagementBean has a local reference of PersonBean, the key is you should use beanName in @EJB, whose value is the ejb name of referenced EJB.

Maybe you are looking for