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();
}

Similar Messages

  • 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.

  • 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/

  • A problem determining the JNDI Name of a local EJB with WL 8.1

    Hi,
    I created a very simple local EJB and deployed it with Weblogic8.1. When I test
    it in the Weblogic server admin page, I got the following message:
    "The EJB MyLocal has not been tested successfully. There was a problem determining
    the JNDI Name of the given bean."
    Can anyone help figure out the problem?
    Thanks
    Henry

    Does the ejb have a target server specified?
    Does the Ejb have a Jndi binding as specified in the <local-jndi-name></local-jndi-name>
    element of weblogic-ejb-jar.xml?
    thanks,
    Deepak
    "Henry" <[email protected]> wrote:
    >
    >
    Hi,
    I created a very simple local EJB and deployed it with Weblogic8.1. When
    I test
    it in the Weblogic server admin page, I got the following message:
    "The EJB MyLocal has not been tested successfully. There was a problem
    determining
    the JNDI Name of the given bean."
    Can anyone help figure out the problem?
    Thanks
    Henry

  • 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.

  • Fail to lookup the local EJB by JNDI in Managed Server

    Hi all,
    I currently in a deep problem, and can't figure out the cause of it. It just annoying me for week.
    In my app, I have binded to the local ejb to JNDI (let's say "ejb/CustomerLocal"), then the client lookup the Local EJB by the following code.
    localIc = new InitialContext();
    home = (EJBLocalHome)localIc.lookup("ejb/CustomerLocal");
    It works well as I do development in the Domain Admin Server. However, when I do the System Integration Test and deploy my app to the managed server, the app fail. It just can't do the Local EJB lookup. Following is the exception.
    javax.naming.NameNotFoundException: Unable to resolve 'ejb/CustomerLocal' Resolved ejb[Root exc
    eption is javax.naming.NameNotFoundException: Unable to resolve 'ejb.CustomerLocal' Resolved ejb
    ]; remaining name CustomerLocal'
    Does anybody know the cause of it and have solution?
    Thanks a lot

    Hi,
    Just now I replicated the same problem what you are facing. I created one managed server. When I deployed my ejb to admin server I did not get any problem. But when I deploy the same into my managed server I got Naming Exception. Because I did n/t specify Context.PROVIDER_URL. A provider URL contains bootstrap server information that the initial context factory can use to obtain an initial context. So when you deploy EJB on another server, you have to get the Naming service from that server. Hence provider URL must pointing to that server. So I included following statements before lookup my ejb in managed server.
    Properties p=new Properties ();
    p.put (Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    p.put (Context.PROVIDER_URL,"t3://localhost: 7003");
    Context ctx=new InitialContext (p);
    FacadeHome home=(FacadeHome) ctx.lookup ("ejb/CustomerLocal");
    In my case managed server port number is 7003. Now onwards managed server (Port number 7003) will provide ‘Naming Service’, not by admin server (port number 7001), which is default.
    Note: Context.PROVIDER_URL— specifies the URL of the WebLogic Server that provides the name service. The default is t3://localhost: 7001. When you are not specified it will assume that POVIDER_URL is t3://localhost: 7001 this is nothing but your admin server in your case. However, a JNDI client may need to access a name space other than the one identified in its environment. In this case, it is necessary to explicitly set the java.naming.provider.url (provider URL) property used by the InitialContext constructor.
    I hope it helps.
    Regards,
    Kuldeep Singh.

  • Challenge: call local ejb from remote ejb on weblogic 9.2

    Hi ALL,
    How do I call to local ejb from remote ejb object. The jar file is deployed on weblogic server 9.2, if you want get it http://geocities.yahoo.com.br/lindembe/BEAProject.jar and the source code are http://geocities.yahoo.com.br/lindembe/BEAProject.zip. It is a sample app with two ejb that works so good on JBOSS, JOnAS, but BEA Weblogic.....
    The complete problem you watch http://forum.java.sun.com/thread.jspa?threadID=768718&messageID=4387570#4387570
    or
    http://forums.bea.com/bea/message.jspa?messageID=600043148&tstart=0

    Your code in SigemFacadeBean should just do:
    InitialContext ctx = new InitialContext();
    when you lookup the local EJB. (This will work on all app servers. There's no need to put an app-server specific intial context factory in your code.)
    Also, you can remove the jndi-name setting for the local ejb from your weblogic-ejb-jar.xml. jndi-name is only applied to remote ejbs.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Problem with Local Interfaces (WSAD 5)

    I built an Entity Bean with Local Interface and a Remote Interface (apperently they both have the same JNDI name in WSAD)
    and when I look up for the name from other Session Bean (same EJB group) and I try to cast it to the local interface there is a classCastException.............
    HELP ME

    Nidhi
    I had the same problems as you that went away. If you have both remote and local interfaces defined, and your remote inerface can be accessed via JNDI lookup using (say) "ejb/sessionbean/stateless/HelloHome", then you can access the local intercafe using "local:ejb/ejb/sessionbean/stateless/HelloHome".
    The URL http://localhost:9080/UTC/initialize?port=2809 is very useful to browse the JNDI tree. Just expand "Local EJB beans" and position your mouse over the item of interest. The JNDI lookup name will echo in the bottom (solid) frame of the browser. The only problem is that the jndilookup name will appear (mistakenly) as local:/ejb/ejb/stateless......, just get rid of the first forward-slash to make it look like local:ejb/ejb/stateless....
    Hope this helps
    Somnath

  • Client EJB JNDI lookup broken in OC4J 9.0.2?

    I have a client program that connects to an EJB in the application server and invokes methods on it. If it look up the EJB using the actual JNDI binding, it works fine. If I look it up in java:comp/env (and use the ejb-ref in application-client.xml and ejb-ref-mapping in orion-application-client.xml) the client program catches the following exception:
    caught : javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/logging/Logger
    javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/logging/Logger
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.mycompany.common.logging.ejb.test.LoggerEJBTest.main(LoggerEJBTest.java:37)
    Now, assuming I don't have any typos (and I'd be thrilled if someone pointed it out if that were the case), then it looks like this is a bug in OC4J 9.0.2: the ejb-ref and ejb-ref-mapping elements do not work. For the record, I am using the same ejb-ref and ejb-ref-mapping elements for a servlet's web.xml and orion-web.xml, respectively, without problems.
    Here are relevant file excerpts:
    LoggerEJBTest.java:
    String hostName = "localhost";
    String hostPort = "23791";
    String userName = "abc";
    String password = "def";
    String providerURL = "ormi://" + hostName + ":" + hostPort + "/ghi";
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, providerURL);
    env.put(Context.SECURITY_PRINCIPAL, userName);
    env.put(Context.SECURITY_CREDENTIALS, password);
    System.out.println("create initial context");
    Context context = new InitialContext(env);
    System.out.println("get home object");
    //works when uncommented
    //Object homeObject = context.lookup("logging/Logger");
    //broken:
    Object homeObject = context.lookup("java:comp/env/ejb/logging/Logger");
    ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <description>abc</description>
    <display-name>abc</display-name>
    <enterprise-beans>
    <session>
    <description>Logger Bean</description>
    <display-name>Logger</display-name>
    <ejb-name>Logger</ejb-name>
    <home>com.mycompany.common.logging.ejb.LoggerHome</home>
    <remote>com.mycompany.common.logging.ejb.Logger</remote>
    <ejb-class>com.mycompany.common.logging.ejb.LoggerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    orion-ejb-jar.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 2.0 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
         <enterprise-beans>
              <session-deployment name="Logger" location="logging/Logger">
         </enterprise-beans>
    </orion-ejb-jar>
    application-client.xml:
    <?xml version="1.0"?>
    <!DOCTYPE application-client PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application Client 1.3//EN" "http://java.sun.com/dtd/application-client_1_3.dtd">
    <application-client>
         <display-name>logging test</display-name>
    <ejb-ref>
    <ejb-ref-name>ejb/logging/Logger</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.mycompany.common.logging.ejb.LoggerHome</home>
    <remote>com.mycompany.common.logging.ejb.Logger</remote>
    <ejb-link>Logger</ejb-link>
    </ejb-ref>
    </application-client>
    orion-application-client.xml:
    <?xml version="1.0"?>
    <!DOCTYPE orion-application-client PUBLIC "-//Evermind//DTD J2EE Application-client runtime 1.2//EN" "http://xmlns.oracle.com/ias/dtds/orion-application-client.dtd">
    <orion-application-client>
    <ejb-ref-mapping location="logging/Logger" name="ejb/logging/Logger" />
    </orion-application-client>

    As far as I know, the only way to lookup an EJB (deployed to
    OC4J) from a regular java class using the "ApplicationClientInitialContextFactory"
    class and the logical JNDI name is to include your regular java
    class (i.e. the client) in your application's EAR file (the file
    you use to deploy your application to OC4J).OK, but that sounds like a pretty silly constraint. Shouldn't the ApplicationClientInitialContextFactory know how to do the mapping using the application-client.xml and orion-application-client.xml settings? What does the OC4J server provide that makes this magically work?
    From the information you have supplied, it appears that you may
    not want to include your client (java) class in your EAR file.That is correct. It is an integration test program, not meant to be deployed into the application server.
    So now the question is, "Do you want to make your client part
    of your J2EE application, and include it in the application
    EAR file?"
    If you do, then you have made several mistakes which prevent
    you from doing that, but I don't want to explain further, since
    you may not want to do that, anyway!Not applicable. But on that topic, aside from being able to auto-start a client application within the OC4J JVM, are there any other reasons why I might want to deploy a client in that manner? I mean, honestly, these things are called "clients" and "servers" for a reason.
    Now if you have been reading other postings to this forum,
    and if you have read the documentation for OC4J, you would
    know that it requires J2SDK 1.3.1 only (not 1.4.0).I am well aware of the other postings on that topic. I am, however, counting on Oracle to live up to their promise to certify 1.4 with with the next update to OC4J:
    Limits of 10g
    That aside, I already consider OC4J 9.0.2 to be a broken product at this point anyway, so hacking it to use Java 1.4 doesn't bother me that much. OC4J 9.0.2 works about as well with Java 1.4 as with Java 1.3, assuming one replaces the tools.jar. The other major incompatibility is that Oracle SOAP breaks if a web service EJB home&remote interface is compiled with Java 1.4:
    http://forums.oracle.com/forums/message.jsp?id=936894
    Alas, we're using Apache SOAP 2.3 rather than the ass-backwards stuff in OC4J, anyways, so there's no problem.

  • A prefix can be included in the EJB JNDI name dynamically?

    In the Stateless annotation, we can specify the mappedName attribute to the EJB JNDI name bind.
    Can we specify a prefix to the mappedName separately?
    For example: We have this:
    @Stateless(mappedName="myEJB")And don't want to do this:
    @Stateless(mappedName="prefix/myEJB")We want to include the prefix in another place in the code dynamically.
    Can we do that??

    jtahlborn wrote:
    eudesf wrote:
    Hello! Thanks for reply!
    As I can't configure programatically, there is any way to configure in an application descriptor, or in another place of the application server?
    The idea is to publish two applications that use the same EJB classes, but in different JNDI namespaces, because we don't want to share the resources. Otherwise, it will result in JNDI name conflicts. The applications works in different contexts and we want to reuse the existing EJB definitions.
    Any suggestion?yes you can do this. ejb 3.0 keeps the features from 2.1, namely all the xml based configuration (although it is now optional). and, the annotations are always overriden by the xml configuration. thus, you can create different deployments with different the same compiled class files. you just need to override the annotation configuration with xml configuration (via ejb-jar.xml or whatever).Yes, we can do that. I've tested here, and it works. But, can we do better?
    The configuration via XML implies maintenance, and it's not good, because we have so many EJBs to maintain.
    And there is another problem... The EJB classes are in JARs, and these JARs are shared across the applications.
    Pretend that you have to maintain two versions of each EJB JAR. One with XML configured and other without. If we change one, the another must be changed too. How can it be productive?
    I have seen some EJB implementations that are more flexible with JNDI naming.
    See:
    - [http://openejb.apache.org/jndi-names.html|http://openejb.apache.org/jndi-names.html]
    - [http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html|http://fixunix.com/weblogic/221782-dynamic-jndi-name-weblogic-ejb-jar-xml.html]
    Does it have a better solution in Glassfish?

  • Unable to find Local Ejb home in websphere 6.0

    Its really anoying as am unable to guess . I am invoking an EJB locally using code as below . The Ejb works fine while testing with UniversalTestClient However when i try to invoke it from my Client it gives jndi error.
    Am using RAD 6.0 IDE and WebSphere6.0 and Ejb 2.1
    I tried calling ejb providing different jndi names as below but it doesn't work .
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
    env.put (Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809/");
    try{
    InitialContext icontext = new InitialContext(env);
    // Object result = icontext.lookup("local:ejb/DefaultSession");
    // Object result = icontext.lookup("D7VRC491Node01Cell/nodes/D7VRC491Node01/servers/server1/TestEj b/ejb/com/test/ejbs/DefaultSessionLocalHome");
    // Object result = icontext.lookup("local:ejb/ejb/com/test/ejbs/DefaultSessionLocalHome");
    Object result = icontext.lookup("ejb/com/dhsmv/ejbs/DefaultSessionLocalHome");
    DefaultSessionLocalHome localHome = (DefaultSessionLocalHome) result;
    DefaultSessionLocal localSession = (DefaultSessionLocal) localHome.create();
    String strTest = localSession.welcome(" Hello World ");
    System.out.println(" Retrieved ejb method ..." + strTest);
    I get an exception that first component of jndi name is not available. Please suggets where is the problem hiding. Is there any thing wrong with jndi name .
    Thanks.

    The CORBA error could suggest your bootstrap port is already being used by another process. Try changing it to something else.
    Assuming your webconsole works - its something like this (although off the top of my head can't be sure...)
    Select servers from the menu on the left, then select, your server.
    From the newly loaded page, on the right hand side, you should see a link called "Ports". Modify your bootstrap port, usual value is 2809.
    How does that work?

  • Weblogic Ejb JNDI Naming

    Dear all,
    when I use Stateless Session bean with mappedName properties, it JNDI name become like mappName+#+packagename+classname.
    I don't want "#" notation between them.
    if it is not possible, how can i know default JNDI name without using mappedName property?
    With Regards,
    Wai Phyo

    Make use of the weblogic-ejb-jar.xml file to control the EJB JNDI name. The following example works in WebLogic 11g and replaces the default #<package><class> with the specified values.
    Regards
    Neil
    <weblogic-enterprise-bean>
    <ejb-name>DepartmentEJB</ejb-name>
    <stateless-session-descriptor>
    <business-interface-jndi-name-map>
    <business-remote>com.sopragroup.uk.whitepaper.hr.jee.ejb.department.DepartmentRemote</business-remote>
    <jndi-name>ejb/HR/DepartmentEJB</jndi-name>
    </business-interface-jndi-name-map>
    </stateless-session-descriptor>
    <enable-call-by-reference>true</enable-call-by-reference>
    <jndi-name>ejb/HR/DepartmentEJB</jndi-name>
    <local-jndi-name>ejb/HR/DepartmentEJBLocal</local-jndi-name>
    </weblogic-enterprise-bean>

  • Unable to lookup local EJB reference (ejb 2.1)

    Hi All,
    I am trying to do a simple local EJB lookup of ejb2(XDCGIVTCursorHoldableJDBCReader) from ejb1(XDCGIVTBatchController), Both the ejbs are located in the same EAR. This is weblogic 10
    I am running into name-not-found exceptions.
    Here is my ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
         <enterprise-beans>
              <session>
                   <ejb-name>XDCGIVTBatchController</ejb-name>
                   <home>xxx.BatchJobControllerHome</home>
                   <remote>xxx.BatchJobController</remote>
                   <ejb-class>xxx.BatchJobControllerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/local/XDCGIVTCursorHoldableJDBCReader</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <local-home>xxx.CursorHoldableJDBCReaderLocalHome</local-home>
                        <local>xxx.CursorHoldableJDBCReaderLocal</local>
                        <ejb-link>XDCGIVTCursorHoldableJDBCReader</ejb-link>
                   </ejb-local-ref>
                   <resource-ref>
                        <res-ref-name>wm/BatchWorkManager</res-ref-name>
                        <res-type>commonj.work.WorkManager</res-type>
                        <res-auth>Container</res-auth>
                        <res-sharing-scope>Shareable</res-sharing-scope>
                   </resource-ref>
              </session>
              <session>
                   <ejb-name>XDCGIVTCursorHoldableJDBCReader</ejb-name>
                   <local-home>xxx.CursorHoldableJDBCReaderLocalHome</local-home>
                   <local>xxx.CursorHoldableJDBCReaderLocal</local>
                   <ejb-class>xxx.CursorHoldableJDBCReaderBean</ejb-class>
                   <session-type>Stateful</session-type>
                   <transaction-type>Bean</transaction-type>
                   <resource-ref>
                        <res-ref-name>jdbc/IVTdb</res-ref-name>
                        <res-type>javax.sql.DataSource</res-type>
                        <res-auth>Container</res-auth>
                        <res-sharing-scope>Unshareable</res-sharing-scope>
                   </resource-ref>
              </session>
         </enterprise-beans>
    </ejb-jar>
    and here is my weblogic-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    ** This file was automatically generated by
    ** EJBGen WebLogic Server 10.3 SP0 Fri Jul 25 16:30:05 EDT 2008 1137967
    -->
    <weblogic-ejb-jar
    xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>XDCGIVTBatchController</ejb-name>
    <stateless-session-descriptor>
    </stateless-session-descriptor>
         <jndi-name>ejb/XDCGIVTBatchController</jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
         <ejb-name>XDCGIVTCursorHoldableJDBCReader</ejb-name>
         <local-jndi-name>XDCGIVTCursorHoldableJDBCReader</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    I am using the following code to do the lookup
    Object hm = new InitialContext().lookup("java:comp/env/ejb/local/XDCGIVTCursorHoldableJDBCReader);
    I have also tried looking up with
    java:comp/env/ejb/XDCGIVTCursorHoldableJDBCReader with no success.
    Any ideas? suggestions? what am I doing wrong?
    Thanks in advance!!
    Neeraj

    Hey Matt,
    So the flow is as follows
    1. Servlet looks up EJB1
    2. EJB1 starts a commonj.work using the commonj.WorkManager
    3. The worker tries to lookup EJB2 using java:comp/env (and thats the same place I tried to dump the namespace)
    Could it be that I am getting a new namespace in the commonj worker ? This doesn't seem to be the case in IBM WebSphere.
    Thanks for your help!
    Neeraj

  • How to create a local EJB 3.0 and execute in JDeveloper?

    Hello guys!
    I'm brand new with EJB 3.0.
    I would like to know how can I create a @Local EJB and a client in JDeveloper?
    It's was ease to create a @Remote EJB and the sample java client, how can I do same to @Local EJB?
    I'm using JDeveloper 10.1.3.1.0.3914
    Thanks in advance.

    Creating a @Local EJB is just as easy, just replace the @Remote by @Local, or checkmark local in the EJB wizard.
    You can create a client for a @Local EJB, as local methods aren't available outside the EJB container, that's why they are called local. A test client doesn't run in the ejb container, and therefor cannot access the local ejb methods.
    If you want to test the local methods of an ejb, you should create another ejb which calls the first.

  • Defining a many-to-many relationship with CMP EJBs  : does it work for you

    Curious to know whether someone has been able to set up a many to many relationship between two entity beans.
    I have been struggling with this for days now and I can't get it to work.
    In my test project I have two entity beans, resp. Consultant and Solution.
    Consultant has a cmr field called 'solutions', which is a collection object from the opposite side (Solution).
    This is the source of the ejb-jar.xml file
    <?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>EJB JAR description</description>
         <display-name>EJB JAR</display-name>
         <enterprise-beans>
              <session>
                   <ejb-name>ProfilerBean</ejb-name>
                   <home>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerHome</home>
                   <remote>com.atosorigin.tcc.testing.ejbses.profiling.Profiler</remote>
                   <local-home>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerLocalHome</local-home>
                   <local>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerLocal</local>
                   <ejb-class>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                        <ejb-ref-name>EJBTesting/Solution</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocalHome</local-home>
                        <local>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocal</local>
                        <ejb-link>SolutionBean</ejb-link>
                   </ejb-local-ref>
                   <ejb-local-ref>
                        <ejb-ref-name>EJBTesting/Consultant</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocalHome</local-home>
                        <local>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocal</local>
                        <ejb-link>ConsultantBean</ejb-link>
                   </ejb-local-ref>
              </session>
              <entity>
                   <ejb-name>ConsultantBean</ejb-name>
                   <home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantHome</home>
                   <remote>com.atosorigin.tcc.testing.ejbcmp.profiling.Consultant</remote>
                   <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocalHome</local-home>
                   <local>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocal</local>
                   <ejb-class>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Consultant</abstract-schema-name>
                   <cmp-field>
                        <field-name>firstname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>lastname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>country</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
                   <query>
                        <query-method>
                             <method-name>findBySolution</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT Object(c) FROM Consultant AS c,
                        IN(c.solutions) s WHERE s.id = ?1 </ejb-ql>
                   </query>
              </entity>
              <entity>
                   <ejb-name>SolutionBean</ejb-name>
                   <home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionHome</home>
                   <remote>com.atosorigin.tcc.testing.ejbcmp.profiling.Solution</remote>
                   <local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocalHome</local-home>
                   <local>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocal</local>
                   <ejb-class>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.String</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>Solution</abstract-schema-name>
                   <cmp-field>
                        <field-name>description</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>name</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>parent</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
                   <query>
                        <query-method>
                             <method-name>findChildSolutions</method-name>
                             <method-params>
                                  <method-param>java.lang.String</method-param>
                             </method-params>
                        </query-method>
                        <ejb-ql>SELECT Object(s) FROM Solution AS s WHERE
                        s.parent = ?1</ejb-ql>
                   </query>
                   <query>
                        <query-method>
                             <method-name>findTopLevelSolutions</method-name>
                             <method-params/>
                        </query-method>
                        <ejb-ql>Select Object(s) FROM Solution AS s WHERE
                        (s.parent = &apos;none&apos;)</ejb-ql>
                   </query>
              </entity>
         </enterprise-beans>
         <relationships>
              <ejb-relation>
                   <description>A consultant may have one or more areas of expertise</description>
                   <ejb-relation-name>Consultant_Solutions</ejb-relation-name>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantBean</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>ConsultantBean</ejb-name>
                        </relationship-role-source>
                        <cmr-field>
                             <cmr-field-name>solutions</cmr-field-name>
                             <cmr-field-type>java.util.Collection</cmr-field-type>
                        </cmr-field>
                   </ejb-relationship-role>
                   <ejb-relationship-role>
                        <ejb-relationship-role-name>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionBean</ejb-relationship-role-name>
                        <multiplicity>Many</multiplicity>
                        <relationship-role-source>
                             <ejb-name>SolutionBean</ejb-name>
                        </relationship-role-source>
                   </ejb-relationship-role>
              </ejb-relation>
         </relationships>
         <assembly-descriptor>
              <container-transaction>
                   <description>container-transaction</description>
                   <method>
                        <ejb-name>SolutionBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>ProfilerBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>ConsultantBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    I created a stateless session bean as a business facade for the two entity beans. I then created a webservice to test the beans.
    What works :
    - create a consultant
    - get a consultant
    - create a solution
    - get a solution
    (basically everything that doesn't involve the relationship field.
    However, what doesn't work is the method call assignSolution:
    - assign solution : this is implemented as follows
    Business Method.
         public void assignSolution(String consultantID, String solutionID)
              throws ProfilingException {
              // TODO : Implement
              ConsultantLocal cons = null;
              SolutionLocal sol = null;
              try {
                   cons = consHome.findByPrimaryKey(consultantID);
                   sol = solHome.findByPrimaryKey(solutionID);
                   Collection solutions = cons.getSolutions();
                   solutions.add(sol);
                   //sol.getConsultants().add(cons);
              } catch (FinderException ex) {
                   ex.printStackTrace();
                   throw new ProfilingException("failed to retrieve data from DB", ex);
    As you can see I am trying to use the CM Relationship in this methhod. Adding the solution to a consultant should be as simple as adding a solution object to the collection retrieved with the getSolutions accessor. The Container is expected to persist the information in my MAXDB database.
    However this doesn't happen.
    The ORM details as defined in the persistent.xml follows :
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">
    <persistent-ejb-map>
         <locking
              type="Table"/>
         <db-properties>
              <data-source-name>TCC_PORTAL_PROFILER</data-source-name>
              <database-vendor
                   name="SAPDB"/>
         </db-properties>
         <entity-beans>
              <entity-bean>
                   <ejb-name>ConsultantBean</ejb-name>
                   <table-name>PFL_CONSULTANTS</table-name>
                   <field-map
                        key-type="NoKey">
                        <field-name>firstname</field-name>
                        <column>
                             <column-name>FIRSTNAME</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>lastname</field-name>
                        <column>
                             <column-name>LASTNAME</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>country</field-name>
                        <column>
                             <column-name>COUNTRY</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="PrimaryKey">
                        <field-name>id</field-name>
                        <column>
                             <column-name>ID</column-name>
                        </column>
                   </field-map>
                   <finder-descriptor>
                        <method-name>findBySolution</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                        <load-selected-objects
                             lock="read"/>
                   </finder-descriptor>
              </entity-bean>
              <entity-bean>
                   <ejb-name>SolutionBean</ejb-name>
                   <table-name>PFL_SAPSOLUTIONS</table-name>
                   <field-map
                        key-type="NoKey">
                        <field-name>description</field-name>
                        <column>
                             <column-name>DESCRIPTION</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>name</field-name>
                        <column>
                             <column-name>NAME</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="NoKey">
                        <field-name>parent</field-name>
                        <column>
                             <column-name>PARENTID</column-name>
                        </column>
                   </field-map>
                   <field-map
                        key-type="PrimaryKey">
                        <field-name>id</field-name>
                        <column>
                             <column-name>ID</column-name>
                        </column>
                   </field-map>
                   <finder-descriptor>
                        <method-name>findChildSolutions</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                        <load-selected-objects
                             lock="read"/>
                   </finder-descriptor>
                   <finder-descriptor>
                        <method-name>findTopLevelSolutions</method-name>
                        <method-params/>
                        <load-selected-objects
                             lock="read"/>
                   </finder-descriptor>
              </entity-bean>
         </entity-beans>
         <relationships>
              <table-relation>
                   <help-table>PFL_CONS_SOL_MAP</help-table>
                   <table-relationship-role
                        key-type="PrimaryKey">
                        <ejb-name>ConsultantBean</ejb-name>
                        <cmr-field>solutions</cmr-field>
                        <fk-column>
                             <column-name>CONSULTANTID</column-name>
                             <pk-field-name>id</pk-field-name>
                        </fk-column>
                   </table-relationship-role>
                   <table-relationship-role
                        key-type="PrimaryKey">
                        <ejb-name>SolutionBean</ejb-name>
                        <fk-column>
                             <column-name>SOLUTIONID</column-name>
                             <pk-field-name>id</pk-field-name>
                        </fk-column>
                   </table-relationship-role>
              </table-relation>
         </relationships>
    </persistent-ejb-map>
    The error in the default trace file when calling the method states, there is an "inconsistency in the number of primary keys". Details follow.
    #1.5#000F1F188E5C004400000000000010480003E76C80EFD57A#1098880364327#com.sap.engine.services.ejb#com.atosorigin.tcc/EJBCMPProfilingTest#com.sap.engine.services.ejb#Guest#2####4d2b2370281411d9a40d000f1f188e5c#SAPEngine_Application_Thread[impl:3]_31##0#0#Error##Java###
    [EXCEPTION]
    #1#com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method assignSolution.
         at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerObjectImpl0.assignSolution(ProfilerObjectImpl0.java:822)
         at com.atosorigin.tcc.testing.ejbses.profiling.Profiler_Stub.assignSolution(Profiler_Stub.java:533)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy73.assignSolution(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:146)
         at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:68)
         at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
         at SoapServlet.doPost(SoapServlet.java:51)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:339)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:317)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:810)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:238)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    Caused by: com.sap.engine.services.applocking.exception.SAPAppLockingIllegalArgumentException: Inconsistency in number of primary keys
         at com.sap.engine.services.applocking.TableLockingImpl.getArgument(TableLockingImpl.java:385)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:128)
         at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
         at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
         at com.sap.engine.services.ejb.entity.pm.PersistentM2M.create(PersistentM2M.java:172)
         at com.sap.engine.services.ejb.entity.pm.PersistentCacheM2M.add(PersistentCacheM2M.java:197)
         at com.sap.engine.services.ejb.entity.pm.multiple.CollectionM2M.add(CollectionM2M.java:57)
         at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerBean.assignSolution(ProfilerBean.java:201)
         at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerObjectImpl0.assignSolution(ProfilerObjectImpl0.java:771)
         ... 32 more
    I can't figure out what the problem is with the ORM mapping defined.
    On the database level I have three tables. Consultant maps to PFL_CONSULTANT, Solution to PFL_SAPSOLUTIONS. The third table PFL_CONS_SOL_MAP is the help table used for the relationship (having two fields, which are in fact foreign keys from the other two tables to express the assignment of solutions to consultants (where a consultant can have one or more solutions).
    ps. : I am running Netweaver Developer Workplace (Netweaver 2004, at stack level 5)
    Message was edited by: Theo Paesen

    Hm, after disabling 'automatic locking' it works.

Maybe you are looking for