EJB not bound Exception

Hi All,
Any body can help me to Run my first EJB. I am getting Name not bound error. I thing it is JNDI error. I generate the classes and interfaces using Xdoclet.
I am using eclipse3.1, jboss4
Please see the entry in ejb-jar.xml
<entity >
<description><![CDATA[Description for Simple]]></description>
<display-name>Name for Simple</display-name>
<ejb-name>Simple</ejb-name>
<local-home>com.interfaces.SimpleLocalHome</local-home>
<local>com.interfaces.SimpleLocal</local>
<ejb-class>com.ejb.SimpleCMP</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>Simple</abstract-schema-name>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>id</field-name>
</cmp-field>
<cmp-field >
<description><![CDATA[]]></description>
<field-name>name</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
</entity>
Please see the entry in jboss.xml file
<entity>
<ejb-name>Simple</ejb-name>
<local-jndi-name>ejb/SimpleLocal</local-jndi-name>
<method-attributes>
</method-attributes>
</entity>
When i do lookup with "ejb/SimpleLocal" name then It gives me Not Bound error.
Please help me to solve this problem.
Thanks in advance
Message was edited by:
raviadha

hi
Here is my client
HelloClient
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.*;
public class HelloClient
public static void main(String [] args)
try{
InitialContext ctx=new InitialContext();
Object obj=ctx.lookup("HelloEJB");
HelloHome home=(HelloHome)PortableRemoteObject.narrow(obj, HelloHome.class);
Integer id=new Integer(Integer.parseInt(args[0]));
Hello h=home.create(id,args[1]);
}catch(Exception e)
System.out.println(e);
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>
<enterprise-beans>
<entity>
<ejb-name>HelloEJB</ejb-name>
<local-home>HelloHome</local-home>
<local>Hello</local>
<ejb-class>HelloBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<abstract-schema-name>HelloAA</abstract-schema-name>
<cmp-field>
<field-name>helloId</field-name>
</cmp-field>
<cmp-field>
<field-name>helloName</field-name>
</cmp-field>
<primkey-field>helloId</primkey-field>
</entity>
</enterprise-beans>
</ejb-jar>

Similar Messages

  • EJB not bound

    Hello
    Recently i faced an Exception when i run the client that "EJB not Bound exception". It only comes on Entity bean when i run any session bean i run porperly i don't know whats happen with Entity bean plz guide me on that i m using Jboss server.
    And when i define relation b/w local ejbs how can i define forigen key?
    Best Regards
    Uzair

    hi
    Here is my client
    HelloClient
    import javax.naming.*;
    import javax.ejb.*;
    import javax.rmi.*;
    public class HelloClient
    public static void main(String [] args)
    try{
    InitialContext ctx=new InitialContext();
    Object obj=ctx.lookup("HelloEJB");
    HelloHome home=(HelloHome)PortableRemoteObject.narrow(obj, HelloHome.class);
    Integer id=new Integer(Integer.parseInt(args[0]));
    Hello h=home.create(id,args[1]);
    }catch(Exception e)
    System.out.println(e);
    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>
    <enterprise-beans>
    <entity>
    <ejb-name>HelloEJB</ejb-name>
    <local-home>HelloHome</local-home>
    <local>Hello</local>
    <ejb-class>HelloBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <abstract-schema-name>HelloAA</abstract-schema-name>
    <cmp-field>
    <field-name>helloId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>helloName</field-name>
    </cmp-field>
    <primkey-field>helloId</primkey-field>
    </entity>
    </enterprise-beans>
    </ejb-jar>

  • Deployed EJB Not Bound

    I deplyed a simple EJB on S17AS. The server.log tells me it is deployed successful.
    CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1017ca1
    CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@9d5793
    LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
    The relevant simpleEjb.jar_verified.txt is as follows
         Test Name : tests.ejb.ias.ASEjbJndiName
         Test Assertion :
         Test Description : PASSED [AS-EJB ejb] : jndi-name is simpleHome
    However, the server log did not indicate the EJB is bound even if I set the log level to finest.
    Therefore when I tried to access it, I get the following error
    Exception in thread "main" javax.naming.NameNotFoundException: No object bound f
    or java:comp/env/ejb/simpleHome
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
    ava:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at HelloClient.main(HelloClient.java:61)
    The client code is as follows
    String JNDIName = "java:comp/env/ejb/simpleHome";
    myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(
                   initContext.lookup(JNDIName), GreeterDBHome.class);
    The sun-ejb-jar.xml is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    -->
    <!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 EJB 2.0//EN' 'http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_0-0.dtd'>
    <sun-ejb-jar>
    <enterprise-beans>
    <name>simpleEjb.jar</name>
    <ejb>
    <ejb-name>simpleEJB</ejb-name>
    <jndi-name>simpleHome</jndi-name>
    <is-read-only-bean>false</is-read-only-bean>
                   <bean-pool>
                        <steady-pool-size>2</steady-pool-size>
                        <resize-quantity>5</resize-quantity>
                        <max-pool-size>20</max-pool-size>
                        <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
                   </bean-pool>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    I tried to use lookup for both "java:comp/env/ejb/simpleHome" and "java:comp/env/simpleHome". None succeed.
    Does anyone know why the ejb is deployed successful but not bound?
    Sha

    Hi, Parsuram,
    I did restart the server and the error is the same.
    Here is the sample code. I did not change them. Only the names in deployment descriptors are modified.
    Below is the info.
    *************************Remote Interface
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    * Remote interface for the GreeterDBEJB. The remote interface defines all possible
    * business methods for the bean. These are the methods going to be invoked remotely
    * by the servlets, once they have a reference to the remote interface.
    * Servlets generally take the help of JNDI to lookup the bean's home interface and
    * then use the home interface to obtain references to the bean's remote interface.
    public interface GreeterDB extends javax.ejb.EJBObject {
    * Returns the greeting String such as "Good morning, John"
         * @return the greeting String
    public String getGreeting() throws java.rmi.RemoteException;
    *************************Home Interface
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    * Home interface for the GreeterDB EJB. Clients generally use home interface
    * to obtain references to the bean's remote interface.
    public interface GreeterDBHome extends javax.ejb.EJBHome {
    * Gets a reference to the remote interface to the GreeterDBBean.
         * @exception throws CreateException and RemoteException.
    public GreeterDB create() throws java.rmi.RemoteException, javax.ejb.CreateException;
    *************************Bean Class
    Copyright � 2002 Sun Microsystems, Inc. All rights reserved.
    package samples.jdbc.simple.ejb;
    import java.util.*;
    import java.io.*;
    * A simple stateless session bean which generates the greeting string for jdbc-simple
    * application. This bean implements the business method as declared by the remote interface.
    public class GreeterDBBean implements javax.ejb.SessionBean {
    private javax.ejb.SessionContext m_ctx = null;
    * Sets the session context. Required by EJB spec.
         * @param ctx A SessionContext object.
    public void setSessionContext(javax.ejb.SessionContext ctx) {
    m_ctx = ctx;
    * Creates a bean. Required by EJB spec.
    public void ejbCreate() {
    System.out.println("ejbCreate() on obj " + this);
    * Removes a bean. Required by EJB spec.
    public void ejbRemove() {
    System.out.println("ejbRemove() on obj " + this);
    * Loads the state of the bean from secondary storage. Required by EJB spec.
    public void ejbActivate() {
    System.out.println("ejbActivate() on obj " + this);
    * Keeps the state of the bean to secondary storage. Required by EJB spec.
    public void ejbPassivate() {
    System.out.println("ejbPassivate() on obj " + this);
    * Required by EJB spec.
    public void GreeterDBBean() {
    * Returns the Greeting String based on the time
    * @return the Greeting String.
    public String getGreeting() throws java.rmi.RemoteException {
    System.out.println("GreeterDB EJB is determining message...");
    String message = null;
    Calendar calendar = new GregorianCalendar();
    int currentHour = calendar.get(Calendar.HOUR_OF_DAY);
    if(currentHour < 12) message = "morning";
    else {
    if( (currentHour >= 12) &&
    (calendar.get(Calendar.HOUR_OF_DAY) < 18)) message = "afternoon";
    else message = "evening";
    System.out.println("- Message determined successfully");
    return message;
    ************************ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright 2002 Sun Microsystems, Inc. All rights reserved.
    -->
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
    <enterprise-beans>
    <session>
    <display-name>simple</display-name>
    <ejb-name>simpleEJB</ejb-name>
    <home>samples.jdbc.simple.ejb.GreeterDBHome</home>
    <remote>samples.jdbc.simple.ejb.GreeterDB</remote>
    <ejb-class>samples.jdbc.simple.ejb.GreeterDBBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    ************************sun-ejb-jar.xml
    <sun-ejb-jar>
    <enterprise-beans>
    <name>simpleEjb.jar</name>
    <ejb>
    <ejb-name>simpleEJB</ejb-name>
    <jndi-name>ejb/simpleHome</jndi-name>
    <is-read-only-bean>false</is-read-only-bean>
                   <bean-pool>
                        <steady-pool-size>2</steady-pool-size>
                        <resize-quantity>5</resize-quantity>
                        <max-pool-size>20</max-pool-size>
                        <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
                   </bean-pool>
    </ejb>
    </enterprise-beans>
    </sun-ejb-jar>
    ************************Assemble Info
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar cvf simpleEjb.jar *
    added manifest
    ignoring entry META-INF/
    adding: META-INF/ejb-jar.xml(in = 710) (out= 350)(deflated 50%)
    adding: META-INF/sun-ejb-jar.xml(in = 803) (out= 424)(deflated 47%)
    adding: samples/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/ejb/(in = 0) (out= 0)(stored 0%)
    adding: samples/jdbc/simple/ejb/GreeterDB.class(in = 210) (out= 168)(deflated 20%)
    adding: samples/jdbc/simple/ejb/GreeterDBBean.class(in = 1441) (out= 734)(deflated 49%)
    adding: samples/jdbc/simple/ejb/GreeterDBHome.class(in = 257) (out= 177)(deflated 31%)
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>jar tf simpleEJB.jar
    META-INF/
    META-INF/MANIFEST.MF
    META-INF/ejb-jar.xml
    META-INF/sun-ejb-jar.xml
    samples/
    samples/jdbc/
    samples/jdbc/simple/
    samples/jdbc/simple/ejb/
    samples/jdbc/simple/ejb/GreeterDB.class
    samples/jdbc/simple/ejb/GreeterDBBean.class
    samples/jdbc/simple/ejb/GreeterDBHome.class
    ******************************** Deployment Info
    server1: Applications: EJB Modules: simpleEjb
    EJB Module Name: simpleEjb
    Location: C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1
    ******************************** simplEJB.jar_verified.txt
    STATIC VERIFICATION RESULTS
         NUMBER OF FAILURES/WARNINGS/ERRORS
         # of Failures : 0
    # of Warnings : 1
         # of Errors : 0
         Test Name : tests.ejb.ias.ASEjbJndiName
         Test Assertion :
         Test Description : PASSED [AS-EJB ejb] : jndi-name is ejb/simpleHome
         WARNINGS :
         Test Name : tests.ejb.businessmethod.BusinessMethodException
         Test Assertion : Enterprise bean business method throws RemoteException test
         Test Description : For [ module_simpleEjb#simpleEjb#simpleEJB ]
    For EJB Class [ samples.jdbc.simple.ejb.GreeterDBBean ] business method [ getGreeting ]
    Error: Compatibility Note: A public business method [ getGreeting ] was found, but EJB 1.0 allowed the business methods to throw the java.rmi.RemoteException to indicate a non-application exception. This practice is deprecated in EJB 1.1 ---an EJB 1.1 compliant enterprise bean should throw the javax.ejb.EJBException or another RuntimeException to indicate non-application exceptions to the Container.
    *********************** server log (no binding info)
    [05/Jan/2003:17:07:19] FINE ( 1760): [EJBClassPathUtils] EJB Class Path for [simpleEjb] is ...
    [C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\simpleEjb_1, C:\Sun\AppServer7\domains\domain1\server1\generated\ejb\j2ee-modules\simpleEjb]
    [05/Jan/2003:17:07:20] FINE ( 1760): Loading StatelessSessionContainer...
    [05/Jan/2003:17:07:20] FINE ( 1760): [BaseContainer] Registered EJB [simpleEJB] with MBeanServer under name [ias:instance-name=server1,mclass=stateless-session-bean,name=simpleEJB,root=root,standalone-ejb-module=simpleEjb,type=monitor]
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_RemoteHomeImpl_Tie", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBHome_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDBBean_EJBObjectImpl_Tie", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): main: name = "samples.jdbc.simple.ejb._GreeterDB_Stub", codebase = ""
    [05/Jan/2003:17:07:20] FINE ( 1760): [Pool-ejb/simpleHome]: Added PoolResizeTimerTask...
    [05/Jan/2003:17:07:20] FINE ( 1760): Created container with uinque id: 68275827784351744
    [05/Jan/2003:17:07:20] FINE ( 1760): Application deployment successful : com.sun.ejb.containers.StatelessSessionContainer@1083717
    [05/Jan/2003:17:07:20] INFO ( 1760): LDR5010: All ejb(s) of [simpleEjb] loaded successfully!
    [05/Jan/2003:17:07:22] FINE ( 1760): Started 48 request processing threads
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3274: successful server startup
    [05/Jan/2003:17:07:22] FINE ( 1760): The server is now ready to process requests
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@10613aa
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE3282: stdout: ejbCreate() on obj samples.jdbc.simple.ejb.GreeterDBBean@1f52460
    [05/Jan/2003:17:07:22] INFO ( 1760): CORE5053: Application onReady complete.
    *********************** Client class
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import java.util.Properties;
    import java.util.Hashtable;
    import javax.ejb.*;
    import java.sql.*;
    import javax.sql.*;
    import samples.jdbc.simple.ejb.*;
    public class HelloClient {
         public static void main(String[] args) throws Exception {
    javax.ejb.Handle beanHandle;
    GreeterDBHome myGreeterDBHome;
    GreeterDB myGreeterDBRemote;
    InitialContext initContext = null;
    Hashtable env = new java.util.Hashtable(1);
    initContext = getContextInfo();
    String JNDIName = "java:comp/env/ejb/simpleHome";
    System.out.println("- Looking up: " + JNDIName);
    myGreeterDBHome = (GreeterDBHome) javax.rmi.PortableRemoteObject.narrow(initContext.lookup(JNDIName), GreeterDBHome.class);
    myGreeterDBRemote = myGreeterDBHome.create();
              String theMessage = myGreeterDBRemote.getGreeting();
    myGreeterDBRemote.remove();
         public static InitialContext getContextInfo() {
         InitialContext ctx = null;
         String url = "iiop://1st:3700";
         String fac = "com.sun.enterprise.naming.SerialInitContextFactory";
    try {
         Properties props = new Properties();
         props.put(Context.INITIAL_CONTEXT_FACTORY, fac);
         props.put(Context.PROVIDER_URL, url);
              ctx = new InitialContext(props);
         catch (NamingException ne){
    System.out.println("We were unable to get a connection to " +
    " the application server at " + url);
    ne.printStackTrace();
    return ctx;
    *********************** Running Client from command line
    C:\Sun\AppServer7\samples\jdbc\simple\assemble\jar>java HelloClient
    - Looking up: java:comp/env/ejb/simpleHome
    Exception in thread "main" javax.naming.NameNotFoundException: No object bound for java:comp/env/ejb/simpleHome
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at HelloClient.main(HelloClient.java:34)

  • Not Bound Exception

    Hi,
    I am new to RMI, I have an existing RMI application and that application is working fine on my system. But when I tried to deploy the same application on other s/m i.e., with out any code changes it is giving the following Exception.
    I examined the code it doesn't have any hard coded or s/m dependent values. what could be the reason for this error..
    Thanks in advance,
    Tito George
    java.rmi.NotBoundException: -4be6596d-10d5d56e171--7ff3
    at sun.rmi.registry.RegistryImpl.lookup(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
    ce)
    at java.lang.Thread.run(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
    n Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Unknown Source)
    at bartrack.data.BarProxyImpl.getBartrack(BarProxyImpl.java:446)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
    ce)
    at java.lang.Thread.run(Unknown Source)

    HI,
    I made some code changes, now I am getting the following exception.
    I will describe the process. As I told this thing works fine on my s/m. But while trying to deploy on other s/m it�s giving this error.
    After RMI server is up I will setup my application�s server. Server will start without any problem. And in the client side first screen is the login screen. If server is not running we wont get the login screen. But up to login screen there is no problem. This error is generating when we are trying to login.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
            java.lang.ClassNotFoundException: bartrack.server.JBar_Stub
            at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
            at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
            at sun.rmi.transport.Transport$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
    ce)
            at java.lang.Thread.run(Unknown Source)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
    n Source)
            at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
            at sun.rmi.server.UnicastRef.invoke(Unknown Source)
            at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
            at java.rmi.Naming.rebind(Unknown Source)
            at bartrack.server.BartrackWorker.main(BartrackWorker.java:99)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
    ception is:
            java.lang.ClassNotFoundException: bartrack.server.JBar_Stub
            at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
            at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
            at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
            at sun.rmi.transport.Transport$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Sour
    ce)
            at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: bartrack.server.JBar_Stub
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
            at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
            at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
            at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
            at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
            at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
            at java.io.ObjectInputStream.readClassDesc(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            ... 9 morenote: JBar_Stub is there in the jar file
    Thanks in advance...
    Tito

  • Getting Not Bound Exception

    Hi all,
    i'm getting the following exception repeatedly while running my application using jboss server.
    20:47:43,000 ERROR [STDERR] javax.naming.NameNotFoundException: EmployeeImpl not bound

    atleast Give full stack trace

  • Ejb reference not bound when calling a stateless bean in jboss

    hi there !
    i am trying to deploy a simple stateless session bean in Jboss3.0.4_tomcat-4.1.12
    my bean is successfully deployed but when it is looked up in a jsp i am getting an exception as below :
    javax.naming.NameNotFoundException ejb not bound
    my ejb-jar.xml is as follows :
    <session>
    <display-name>FirstEJB</display-name>
    <ejb-name>First</ejb-name>
    <home>com.ejb.session.FirstHome</home>
    <remote>com.ejb.session.First</remote>
    <ejb-class>com.ejb.session.FirstEJB</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    jboss.xml is as follows:
    <jboss>
    <enterprise-beans>
    <session>
    <ejb-name>First</ejb-name>
    <jndi-name>ejb/First</jndi-name>
    </session>
    </enterprise-beans>
    </jboss>
    my jsp is as follows :
    Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL,"localhost:1099");
    props.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces" );
    props.put("java.naming.rmi.security.manager","yes");
    Context ctx = new InitialContext(props);
    System.out.println("Before LookUp");
    FirstHome home = (FirstHome)ctx.lookup("session.First");
    System.out.println("LookUp Successfull");
    First bean = home.create();
    Can anyone fix this ?
    Thanx in Advance

    Hi,
    hi Vicky !
    thanx again for ur response.
    i created a Demo.jar file as u said.
    and now where should i place my JSP ?
    first i will tell u my folder structure
    <jboss-home>/server/default/deploy/index.war
    index.war has the following
    firstEJB.jsp
    Web-inf/web.xml
    Web-inf/jboss-web.xml
    Web-inf/lib/First.jar
    First.jar file has my home , remote , bean classes.
    and ejb-jar.xml and jboss.xml files
    web.xml has the <welcome-file-list>
    jboss-web.xml has the <context-root>/</context-root>
    plz tell me where i have messed up my code.
    i have created the Demo.jar file now as u said.
    so plz tell me where should i place my jsp file.
    thanx
    lakshmi
    Since your application is having the jsp and ejb hence the deployment should be done as per the J2EE specification, where you have
    1)web-module
    2)ejb-module
    3)appliction-client module
    4)JCA(It is included in J2EE1.3+)
    Now follow the following steps:
    1)Demo.ear folder
    2)Create META-INF/application.xml
    3)Put your Demo.war and Demo.jar in Demo.ear
    4)Demo.jar and Demo.war should be as expalined earlier.Also no need to place the ejb related classes in the WEB-INF/lib of Demo.war.
    5)Write the following contents in the applicaiton.xml
    <?xml version="1.0"?>
    <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN" "http://java.sun.com/j2ee/dtds/application_1_2.dtd">
    <application>
         <display-name>Project</display-name>     
         <module>
         <ejb>
         Demo.jar
         </ejb>
         </module>     
         <module>
              <web>
                   <web-uri>Demo.war</web-uri>
                   <context-root>/demo</context-root>
              </web>
         </module>
    </application>
    6)You can create the compressed form of ear or keep it exploded in the Jboss/server/default/Demo.ear
    7)Note the console for the results of deplotment
    8)call http://localhost:8080/demo/yourjsp.jsp
    Hope now I have explained in the detail and it should work now.
    Regards
    Vicky

  • Xsi namespace not bound

    Hi,
    <p>I call a webservice and parse the response into an XMLBean. The problem is that the namepace <b><i>xsi</i></b> is defined by weblogic in the SOAP header - which must be stripped before loading the message into the XMLBean. So when i do a parse, elements with <b><i>xsi:nil</i></b> throw a not bound exception...
    <i>com.bea.xml.XmlException: error: The prefix "xsi" for attribute "xsi:nil" is not bound.</i></p>
    <p>So how do i tell the XMLBean about the xsi namepace? Any examples gratelfully received!</p>
    <p>Thanks</p>
    <p>Neil</p>

    Well, have a look at the API:
    public StreamSource(java.io.File f)
    Construct a StreamSource from a File.SCNR ;)

  • EJB reference not bound

    I'm running JBoss 3.0.1 with Tomcat 4.0.4 bundle. I have successfully deployed a EJB to Jboss and created 2 clients (java & JSP client).
    For some reasons, I'm able to run the java client but when I try the JSP client (served by Tomcat) I get this error message
    javax.servlet.ServletException: Name greetings is not bound in this Context
    Below is the code for the 2 clients & web.xml
    <----------- jsp client -------------->
    <%@ page import="javax.naming.*,
    java.util.*,
              java.util.Hashtable,
              javax.rmi.PortableRemoteObject,
    com.stardeveloper.ejb.session.*"%>
    <%
    long t1 = System.currentTimeMillis();
    InitialContext ctx = new InitialContext();
    Object ref = ctx.lookup("ejb/First");
    FirstHome home = (FirstHome) PortableRemoteObject.narrow (ref, FirstHome.class);
    First bean = home.create();
    String time = bean.getTime();
    bean.remove();
    ctx.close();
    long t2 = System.currentTimeMillis();
    %>
    <html>
    <head>
    <style>p { font-family:Verdana;font-size:12px; }</style>
    </head>
    <body>
    <p>Message received from bean = "<%= time %>".<br>Time taken :
    <%= (t2 - t1) %> ms.</p>
    </body>
    </html>
    <----------- java client ------------->
    import javax.naming.*;
    import com.stardeveloper.ejb.session.*;
    import java.util.Hashtable;
    import javax.rmi.PortableRemoteObject;
    import com.stardeveloper.ejb.session.*;
    class firstEJBclient {
         public static void main(String[] args) {
              try {
                   long t1 = System.currentTimeMillis();
                   InitialContext ctx = new InitialContext();
                   System.out.println("Got CONTEXT");
                   Object ref = ctx.lookup("ejb/First");
                   System.out.println("Got REFERENCE");
                   FirstHome home = (FirstHome) PortableRemoteObject.narrow (ref, FirstHome.class);
                   First bean = home.create();
                   String time = bean.getTime();
                   bean.remove();
                   ctx.close();
                   long t2 = System.currentTimeMillis();
                   System.out.println("Message received from bean = "+time+" Time taken : "+(t2 - t1)+" ms.");
              catch (Exception e) {
                   System.out.println(e.toString());
    <----------------- web.xml -------------------->
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <session-config>
    <session-timeout>
              1800
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
              firstEJB2.jsp
    </welcome-file>
    </welcome-file-list>
    <ejb-ref>
         <description>A reference to an entity bean</description>
         <ejb-ref-name>ejb/First</ejb-ref-name>
         <ejb-ref-type>Stateless</ejb-ref-type>
         <home>com.stardeveloper.ejb.session.FirstHome</home>
         <remote>com.stardeveloper.ejb.session.First</remote>
    </ejb-ref>
    </web-app>
    Why is it not bound?

    Please Ignore my other Message(My META-INF was not in Root and now I am able to get my beans bound).
    I am using Jboss 3.0
    I am able to access service of my HelloWorld Session Bean through a jsp.
    But not able to do so using a java client.
    my directory structure is :
    com\ideas\users\<Bean classes(Remote Interface,home interface,Bean)>
    com\ideas\users\<Bean client(a java client)>
    My java client program is :
    import javax.rmi.*;
    import javax.naming.*;
    import java.util.*;
    import com.ideas.users.*;
    public class HelloWorld {
    public static void main( String args[]) {
    try{
    Properties p = new Properties();
              p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              p.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              p.put("java.naming.provider.url","localhost");
              InitialContext ctx = new InitialContext(p);
              //Lookup the bean using it's deployment id
              Object obj = ctx.lookup("users/Hello");
    //Be good and use RMI remote object narrowing
    //as required by the EJB specification.
    HelloHome ejbHome = (HelloHome) PortableRemoteObject.narrow(obj,HelloHome.class);
    //Use the HelloHome to create a HelloObject
    Hello ejbObject = ejbHome.create();
    //The part we've all been wainting for...
    String message = ejbObject.sayHello();
    //A drum roll please.
    System.out.println( " run successfully and message is :" + message);
    } catch (Exception e){
    e.printStackTrace();
    I am able to compile but when i try to Run I get the following error message
    javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: org.jboss.proxy.ClientContainer (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.inputClassDescriptor(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.inputObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.inputClassFields(Unknown Source)
    at java.io.ObjectInputStream.defaultReadObject(Unknown Source)
    at java.io.ObjectInputStream.inputObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.rmi.MarshalledObject.get(Unknown Source)
    at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at HelloWorld.main(HelloWorld.java:25)
    Please help me out .
    Thanks in advance
    Sujith

  • Exception - javax.naming.NameNotFoundException: HelloHome not bound

    Hi Friends
    I deployed the ejb jar file successfully in JBOSS app server in "jboss-4.0.3RC1\server\default\deploy\". But when I run the client file (compiled successfully) displays the following exception :-
    Exception in thread "main" javax.naming.NameNotFoundException: HelloHome not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
    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(StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
    at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at HelloClientNew.main(HelloClientNew.java:17)
    My HelloClient.java file code is :-
    import examples.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Properties;
    public class HelloClientNew
         public static void main(String args[]) throws Exception
              Properties env = new Properties();
              env.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              env.setProperty("java.naming.provider.url","jnp://localhost:1099");
              env.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              Context ctx=new InitialContext(env);
              Object obj=ctx.lookup("HelloHome");
              HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
              Hello hello=home.create();
              System.out.println(hello.hello());
              hello.remove();
    The package "examples" contains - Hello,HelloHome,HelloLocal,HelloLocalHome and HelloBean source and class files.
    I tried a lot but still am stuck to this problem. If anybody can tell me the solution then I will be very thankful to him.
    Thanks
    Bhoopender

    Please provide me solution for this .I am also facing the same problem.
    javax.naming.NameNotFoundException: HelloBean 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(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
         at sun.rmi.transport.Transport$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.rmi.transport.Transport.serviceCall(Unknown Source)
         at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
         at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
         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 com.logica.Client.main(Client.java:18)
    public class Client {
    public static void main(String a[]){
         try{
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              env.put(Context.PROVIDER_URL,"localhost");
              env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
              Context ctx=new InitialContext(env);
              System.out.println("dfhdf"+ctx);
              Object O=ctx.lookup("HelloBean");
              //System.out.println("dafjhda"+O);
              CartHome cart=(CartHome)O;
              CartRemote Rem=cart.Create();
              CartRemote Rem1=cart.Create("99");
              Rem.addBook("java1");
              Rem.addBook("java2");
              Rem1.addBook("C1");
              Rem1.addBook("C2");
              System.out.println("Details"+Rem.ShowAllBooks());
              System.out.println("Details1"+Rem.placeOrder());
              System.out.println("Details2"+Rem1.ShowAllBooks());
              System.out.println("Details djfj"+Rem1.placeOrder());
         catch (Exception e) {
    e.printStackTrace()     ;
    Thanks,
    Krishnakumar

  • EJB not getting bound to JNDI name using Sun App Server upon deployment

    Hello,
    I've created a very simple "HelloWorld" EJB (2.1-style) and have successfully deployed it to my local application server (Sun Java System App Server Platform Edition 9.0). I now want to invoke the EJB (I have single stateless session bean that returns a string) using a simple remote client app (the client app is executing outside of the app server within its own JVM).
    From my client app I am able to create the InitialContext object, but I get error when trying to lookup my EJB's home object. My client looks as follows:
                   jndiProperties = new Properties();
                   jndiProperties.put("java.naming.factory.initial",
                        "com.sun.jndi.cosnaming.CNCtxFactory");
                   jndiProperties.put("java.naming.provider.url",
                        "iiop://localhost:3700"); // ORB listener is listening on port 3700...
                   context = new InitialContext(jndiProperties);
                   home = context.lookup("ejb/HelloWorldEJB"); // this line throws an exception (line 54)
                   ...The exception I receive is:
                   [java] 234  ERROR [main] net.blueslate.sample.ejb.helloworld.HelloWorldClient     - javax.namin
    g.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.
    org/CosNaming/NamingContext/NotFound:1.0]
         [java]     at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
         [java]     at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
         [java]     at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
         [java]     at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
         [java]     at javax.naming.InitialContext.lookup(InitialContext.java:351)
         [java]     at net.blueslate.sample.ejb.helloworld.HelloWorldClient.main(HelloWorldClient.java:5
    4)
         [java] Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/Naming
    Context/NotFound:1.0
         [java]     at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72
         [java]     at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
         [java]     at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
         [java]     ... 4 moreHere is my ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar
         xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"
         version="2.1">
         <enterprise-beans>
              <session>
                   <ejb-name>HelloWorldEJB</ejb-name>
                   <home>net.blueslate.sample.ejb.helloworld.HelloWorldRemoteHome</home>
                   <remote>net.blueslate.sample.ejb.helloworld.HelloWorldRemote</remote>
                   <local-home>net.blueslate.sample.ejb.helloworld.HelloWorldLocalHome</local-home>
                   <local>net.blueslate.sample.ejb.helloworld.HelloWorldLocal</local>
                   <ejb-class>net.blueslate.sample.ejb.helloworld.impl.HelloWorldImpl</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
         </enterprise-beans>
    </ejb-jar>Here is my sun-ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
    <sun-ejb-jar>
         <enterprise-beans>
              <ejb>
                   <ejb-name>HelloWorldEJB</ejb-name>
                   <jndi-name>HelloWorldEJB</jndi-name>
              </ejb>
         </enterprise-beans>     
    </sun-ejb-jar>I believe the root cause is that my EJB is not bound to a name within the app server. If I browse the "JNDI tree" from the app server admin console, I can see there is a root element "ejb," but there is nothing underneath. I guess I just expected to find the name of my EJB, "HelloWorldEJB." I swear I could have read somewhere in the documentation for the app server that when you deploy an EJB, the name of the EJB as specified by the "<ejb-name>" element of the ejb-jar.xml deployment descriptor gets automatically bound within the naming server to its home object.
    At this point I would appreciate any insight anyone might have regarding this problem. I suspect there is something extra I need to do when deploying my EJB so that its name gets binded to its home object; I just don't have a clue at this point what that is.
    I should also mention that I have played with the parameter passed to 'context.lookup()' - I tried passing: "ejb/HelloWorldEJB", "HelloWorldEJB", etc - nothing seems to work. FWIW, if I just pass in "ejb", I don't receive an exception (I was glad to see this work since the JNDI tree-view from the app server admin console shows "ejb" as one of the root-elements within the naming-tree - this indicated to me I was on the right track in my diagnosis of the problem; i.e., it's probably not a connectivity or protocol issue)
    Thank you very much for your time and help.

    Nevermind folks - I got it to work. All my configuration was correct; I had other issues with the ejb-jar file that the verifier informed me of (my previous deployments were with the verifier turned-off).

  • Exception is thrown "mydb is not bound"(needs urgent help)

    We r three students and our final project is a BPM(Business peocess Management)system.
    BPM is actually a workflow system(managing the business processes)and all the rules and constraints are applied from the Rule Management System.
    we have started the implementation, and therefore we need some help related to the implementation.
    We r using EJB2.0 with JBuilder9, JBoss3.2 as the application server and tomcate as the web server.
    problem:
    I want to create manual database connection using DataSource,
    I am using mysql and database name is mydb.
    I have done all the reqiured configration of mysql with Joss and it is working.
    After getting the initial context, when i try to lookup the datasource, exception is thrown "mydb is not bound"
    Initial context is correct because i have tried entity beans asd it works well.
    code is
    Hashtable contextValues = new Hashtable();
    contextValues.put(Context.PROVIDER_URL, "jnp://loopback:1099");
    contextValues.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    Context context = new InitialContext(contextValues);
    context.lookup("java://mydb");
    Kindly help me if u find time,
    regards!

    try java:comp/env/jdbc/mydb or java:comp/env/mydb

  • Class not Found Exception while running an EJB

    I have created and published a EJB in Oracle 8i (in a particular
    schema) by running the deployejb tool supplied. The ejb was
    published successfully. On running the client program I get an
    error saying that the mybeans's HomeHelper class cannot be
    found. This error occurs when there is a lookup to the home
    interface of the bean. The exception thrown says Reasons are
    unknown. On checking the objects of type 'JAVA CLASS' I found
    that the homeHelper class object had been created automatically
    be the deploy process. What is the reason for the class not
    found exception and what can I do to correct it. ?
    The code for the beans is as given below :
    Home Interface
    package mituser ;
    import javax.ejb.*;
    import java.rmi.RemoteException;
    public interface MITUserHome extends EJBHome {
    public MITUser create()
    throws CreateException, RemoteException;
    Remote Interface
    package mituser ;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface MITUser extends EJBObject {
    public int validateUserName (String username)
    throws java.sql.SQLException, RemoteException;
    public int validatePassword (String username, String password)
    throws java.sql.SQLException, RemoteException;
    public String validateSearchAccess (String username, String
    password)
    throws java.sql.SQLException, RemoteException;
    Bean
    package mituserServer ;
    import java.sql.*;
    import java.rmi.RemoteException;
    import javax.ejb.*;
    public class MITUserBean implements SessionBean {
    SessionContext ctx;
    public void ejbCreate() throws CreateException,
    RemoteException {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void ejbRemove() {
    public void setSessionContext(SessionContext ctx) {
    this.ctx = ctx;
    public int validateUserName (String username) throws
    SQLException, RemoteException
    int count = 0 ;
    Connection conn =
    new oracle.jdbc.driver.OracleDriver().defaultConnection ();
    PreparedStatement ps =
    conn.prepareStatement ("select count(username) from
    useraccountinfo where username = ?");
    try {
    ps.setString (1, username);
    ResultSet rset = ps.executeQuery ();
    if (!rset.next ())
    throw new RemoteException ("no registered user with User
    Name " + username);
    count = rset.getShort(1) ;
    return count ;
    } finally {
    ps.close();
    public int validatePassword (String username, String password)
    throws SQLException, RemoteException
    int count = 0 ;
    Connection conn =
    new oracle.jdbc.driver.OracleDriver().defaultConnection ();
    PreparedStatement ps =
    conn.prepareStatement ("select count(username) from
    useraccountinfo where username = ? and password = ?");
    try {
    ps.setString (1, username);
    ps.setString(2, password);
    ResultSet rset = ps.executeQuery ();
    if (!rset.next ())
    throw new RemoteException ("Invalid Password ");
    count = rset.getShort(1) ;
    return count ;
    } finally {
    ps.close();
    public String validateSearchAccess (String username, String
    password) throws SQLException, RemoteException
    String searchaccess = "" ;
    Connection conn =
    new oracle.jdbc.driver.OracleDriver().defaultConnection ();
    PreparedStatement ps =
    conn.prepareStatement ("select searchprofileaccess from
    useraccountinfo where username = ? and password = ?");
    try {
    ps.setString (1, username);
    ps.setString(2, password);
    ResultSet rset = ps.executeQuery ();
    if (!rset.next ())
    throw new RemoteException ("Access Denied for " +
    username );
    searchaccess = rset.getString(1) ;
    return searchaccess ;
    } finally {
    ps.close();
    Client program
    import mituser.MITUser;
    import mituser.MITUserHome;
    import oracle.aurora.jndi.sess_iiop.ServiceCtx;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Hashtable;
    public class Client {
    public static void main (String [] args) throws Exception {
    int count = 0 ;
    String access = "" ;
    if (args.length != 4) {
    System.out.println("usage: Client serviceURL objectName
    user password");
    System.exit(1);
    String serviceURL = args [0];
    String objectName = args [1];
    String user = args [2];
    String password = args [3];
    Hashtable env = new Hashtable();
    env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    env.put(Context.SECURITY_AUTHENTICATION,
    ServiceCtx.NON_SSL_LOGIN);
    Context ic = new InitialContext(env);
    MITUserHome home = (MITUserHome)ic.lookup (serviceURL +
    objectName);
    MITUser testBean = home.create ();
    count = testBean.validateUserName("MITA");
    if (count > 0 )
    System.out.println ("Valid User");
    else
    System.out.println ("Invalid User");
    count = testBean.validatePassword("MITA", "MITA");
    if (count > 0 )
    System.out.println ("Valid Password");
    else
    System.out.println ("Invalid Password");
    access = testBean.validateSearchAccess("MITA", "MITA");
    if ( access.equalsIgnoreCase("YES") )
    System.out.println ("Search Access Available");
    else
    System.out.println ("Search Access Denied");
    The Descriptor file
    // MIT UserBean EJB deployment descriptor
    SessionBean mituserServer.MITUserBean {
    BeanHomeName = "test/mitUserJDBCBean";
    RemoteInterfaceClassName = mituser.MITUser;
    HomeInterfaceClassName = mituser.MITUserHome;
    AllowedIdentities = {MIT};
    SessionTimeout = 20;
    StateManagementType = STATEFUL_SESSION;
    RunAsMode = CLIENT_IDENTITY;
    TransactionAttribute = TX_REQUIRED;
    Batch File for deploying the ejb
    @echo off
    if (%ORACLE_HOME%)==() goto usage
    if (%ORACLE_SERVICE%)==() goto usage
    if (%JDK_CLASSPATH%)==() goto usage
    @echo on
    set CLASSPATH=.;%ORACLE_HOME%\lib\aurora_client.jar;%ORACLE_HOME%
    \jdbc\lib\classes111.zip;%ORACLE_HOME%\sqlj\lib\translator.zip;%
    ORACLE_HOME%\lib\vbjorb.jar;%ORACLE_HOME%\lib\vbjapp.jar;%
    JDK_CLASSPATH%
    javac -g mituser\MITUser.java
    javac -g mituser\MITUserHome.java
    javac -g mituserServer\MITUserBean.java
    jar cf0 mituser.jar mituser\MITUser.class
    mituser\MITUserHome.class mituserServer\MITUserBean.class
    javac -g Client.java
    call deployejb -republish -temp temp -u mit -p mit -s %
    ORACLE_SERVICE% -descriptor mituser.ejb mituser.jar
    @echo off
    goto done
    :usage
    @echo -------------------------------------------------------
    @echo Following are the requirements to run this script
    @echo set ORACLE_HOME to installed Oracle home
    @echo set ORACLE_SERVICE to the CORBA service name of
    your databae
    @echo for example sess_iiop://localhost:2481:ORCL
    @echo set JDK_CLASSPATH to the full path of your JDK
    classes.zip
    @echo -------------------------------------------------------
    :done
    Batch file for running the cleint program
    @echo off
    if (%ORACLE_HOME%)==() goto usage
    if (%ORACLE_SERVICE%)==() goto usage
    if (%JDK_CLASSPATH%)==() goto usage
    @echo on
    set CLASSPATH=.;%ORACLE_HOME%\lib\aurora_client.jar;%ORACLE_HOME%
    \jdbc\lib\classes111.zip;%ORACLE_HOME%\sqlj\lib\translator.zip;%
    ORACLE_HOME%\lib\vbjorb.jar;%ORACLE_HOME%\lib\vbjapp.jar;%
    JDK_CLASSPATH%;server_generated.jar
    java Client %ORACLE_SERVICE% /test/mitUserJDBCBean mit mit
    @echo off
    goto done
    :usage
    @echo -------------------------------------------------------
    @echo Following are the requirements to run this script
    @echo set ORACLE_HOME to installed Oracle home
    @echo set ORACLE_SERVICE to the CORBA service name of
    your databae
    @echo for example sess_iiop://localhost:2481:ORCL
    @echo set JDK_CLASSPATH to the full path of your JDK
    classes.zip
    @echo -------------------------------------------------------
    :done
    I know this is not strictly to do with JDBC but there appears to
    be no discussion forum for EJB
    Hoping for a response soon as it us very URGENT
    Thanks
    Mita
    null

    I have created and published a EJB in Oracle 8i (in a particular
    schema) by running the deployejb tool supplied. The ejb was
    published successfully. On running the client program I get an
    error saying that the mybeans's HomeHelper class cannot be
    found. This error occurs when there is a lookup to the home
    interface of the bean. The exception thrown says Reasons are
    unknown. On checking the objects of type 'JAVA CLASS' I found
    that the homeHelper class object had been created automatically
    be the deploy process. What is the reason for the class not
    found exception and what can I do to correct it. ?
    The code for the beans is as given below :
    Home Interface
    package mituser ;
    import javax.ejb.*;
    import java.rmi.RemoteException;
    public interface MITUserHome extends EJBHome {
    public MITUser create()
    throws CreateException, RemoteException;
    Remote Interface
    package mituser ;
    import javax.ejb.EJBObject;
    import java.rmi.RemoteException;
    public interface MITUser extends EJBObject {
    public int validateUserName (String username)
    throws java.sql.SQLException, RemoteException;
    public int validatePassword (String username, String password)
    throws java.sql.SQLException, RemoteException;
    public String validateSearchAccess (String username, String
    password)
    throws java.sql.SQLException, RemoteException;
    Bean
    package mituserServer ;
    import java.sql.*;
    import java.rmi.RemoteException;
    import javax.ejb.*;
    public class MITUserBean implements SessionBean {
    SessionContext ctx;
    public void ejbCreate() throws CreateException,
    RemoteException {
    public void ejbActivate() {
    public void ejbPassivate() {
    public void ejbRemove() {
    public void setSessionContext(SessionContext ctx) {
    this.ctx = ctx;
    public int validateUserName (String username) throws
    SQLException, RemoteException
    int count = 0 ;
    Connection conn =
    new oracle.jdbc.driver.OracleDriver().defaultConnection ();
    PreparedStatement ps =
    conn.prepareStatement ("select count(username) from
    useraccountinfo where username = ?");
    try {
    ps.setString (1, username);
    ResultSet rset = ps.executeQuery ();
    if (!rset.next ())
    throw new RemoteException ("no registered user with User
    Name " + username);
    count = rset.getShort(1) ;
    return count ;
    } finally {
    ps.close();
    public int validatePassword (String username, String password)
    throws SQLException, RemoteException
    int count = 0 ;
    Connection conn =
    new oracle.jdbc.driver.OracleDriver().defaultConnection ();
    PreparedStatement ps =
    conn.prepareStatement ("select count(username) from
    useraccountinfo where username = ? and password = ?");
    try {
    ps.setString (1, username);
    ps.setString(2, password);
    ResultSet rset = ps.executeQuery ();
    if (!rset.next ())
    throw new RemoteException ("Invalid Password ");
    count = rset.getShort(1) ;
    return count ;
    } finally {
    ps.close();
    public String validateSearchAccess (String username, String
    password) throws SQLException, RemoteException
    String searchaccess = "" ;
    Connection conn =
    new oracle.jdbc.driver.OracleDriver().defaultConnection ();
    PreparedStatement ps =
    conn.prepareStatement ("select searchprofileaccess from
    useraccountinfo where username = ? and password = ?");
    try {
    ps.setString (1, username);
    ps.setString(2, password);
    ResultSet rset = ps.executeQuery ();
    if (!rset.next ())
    throw new RemoteException ("Access Denied for " +
    username );
    searchaccess = rset.getString(1) ;
    return searchaccess ;
    } finally {
    ps.close();
    Client program
    import mituser.MITUser;
    import mituser.MITUserHome;
    import oracle.aurora.jndi.sess_iiop.ServiceCtx;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Hashtable;
    public class Client {
    public static void main (String [] args) throws Exception {
    int count = 0 ;
    String access = "" ;
    if (args.length != 4) {
    System.out.println("usage: Client serviceURL objectName
    user password");
    System.exit(1);
    String serviceURL = args [0];
    String objectName = args [1];
    String user = args [2];
    String password = args [3];
    Hashtable env = new Hashtable();
    env.put(Context.URL_PKG_PREFIXES, "oracle.aurora.jndi");
    env.put(Context.SECURITY_PRINCIPAL, user);
    env.put(Context.SECURITY_CREDENTIALS, password);
    env.put(Context.SECURITY_AUTHENTICATION,
    ServiceCtx.NON_SSL_LOGIN);
    Context ic = new InitialContext(env);
    MITUserHome home = (MITUserHome)ic.lookup (serviceURL +
    objectName);
    MITUser testBean = home.create ();
    count = testBean.validateUserName("MITA");
    if (count > 0 )
    System.out.println ("Valid User");
    else
    System.out.println ("Invalid User");
    count = testBean.validatePassword("MITA", "MITA");
    if (count > 0 )
    System.out.println ("Valid Password");
    else
    System.out.println ("Invalid Password");
    access = testBean.validateSearchAccess("MITA", "MITA");
    if ( access.equalsIgnoreCase("YES") )
    System.out.println ("Search Access Available");
    else
    System.out.println ("Search Access Denied");
    The Descriptor file
    // MIT UserBean EJB deployment descriptor
    SessionBean mituserServer.MITUserBean {
    BeanHomeName = "test/mitUserJDBCBean";
    RemoteInterfaceClassName = mituser.MITUser;
    HomeInterfaceClassName = mituser.MITUserHome;
    AllowedIdentities = {MIT};
    SessionTimeout = 20;
    StateManagementType = STATEFUL_SESSION;
    RunAsMode = CLIENT_IDENTITY;
    TransactionAttribute = TX_REQUIRED;
    Batch File for deploying the ejb
    @echo off
    if (%ORACLE_HOME%)==() goto usage
    if (%ORACLE_SERVICE%)==() goto usage
    if (%JDK_CLASSPATH%)==() goto usage
    @echo on
    set CLASSPATH=.;%ORACLE_HOME%\lib\aurora_client.jar;%ORACLE_HOME%
    \jdbc\lib\classes111.zip;%ORACLE_HOME%\sqlj\lib\translator.zip;%
    ORACLE_HOME%\lib\vbjorb.jar;%ORACLE_HOME%\lib\vbjapp.jar;%
    JDK_CLASSPATH%
    javac -g mituser\MITUser.java
    javac -g mituser\MITUserHome.java
    javac -g mituserServer\MITUserBean.java
    jar cf0 mituser.jar mituser\MITUser.class
    mituser\MITUserHome.class mituserServer\MITUserBean.class
    javac -g Client.java
    call deployejb -republish -temp temp -u mit -p mit -s %
    ORACLE_SERVICE% -descriptor mituser.ejb mituser.jar
    @echo off
    goto done
    :usage
    @echo -------------------------------------------------------
    @echo Following are the requirements to run this script
    @echo set ORACLE_HOME to installed Oracle home
    @echo set ORACLE_SERVICE to the CORBA service name of
    your databae
    @echo for example sess_iiop://localhost:2481:ORCL
    @echo set JDK_CLASSPATH to the full path of your JDK
    classes.zip
    @echo -------------------------------------------------------
    :done
    Batch file for running the cleint program
    @echo off
    if (%ORACLE_HOME%)==() goto usage
    if (%ORACLE_SERVICE%)==() goto usage
    if (%JDK_CLASSPATH%)==() goto usage
    @echo on
    set CLASSPATH=.;%ORACLE_HOME%\lib\aurora_client.jar;%ORACLE_HOME%
    \jdbc\lib\classes111.zip;%ORACLE_HOME%\sqlj\lib\translator.zip;%
    ORACLE_HOME%\lib\vbjorb.jar;%ORACLE_HOME%\lib\vbjapp.jar;%
    JDK_CLASSPATH%;server_generated.jar
    java Client %ORACLE_SERVICE% /test/mitUserJDBCBean mit mit
    @echo off
    goto done
    :usage
    @echo -------------------------------------------------------
    @echo Following are the requirements to run this script
    @echo set ORACLE_HOME to installed Oracle home
    @echo set ORACLE_SERVICE to the CORBA service name of
    your databae
    @echo for example sess_iiop://localhost:2481:ORCL
    @echo set JDK_CLASSPATH to the full path of your JDK
    classes.zip
    @echo -------------------------------------------------------
    :done
    I know this is not strictly to do with JDBC but there appears to
    be no discussion forum for EJB
    Hoping for a response soon as it us very URGENT
    Thanks
    Mita
    null

  • EJB is not throwing exception to calling Action class in Unix environment

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

    Hi
    We are using Weblogic Server 9.2.3.0.
    One of our EJB is not throwing exception to calling Action class in Unix environment. Its working fine in Windows.
    Somehow the EJB is swallowing the exception.
    any idea? I suspect it may be environmental issue?
    thank you

  • How to check was the object bound or not without exception handling?

    context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
    How to check was the object bound or not without exception handling?

    context.lookup("someName");throws NameNotFoundException in case object was not bound to someName.
    How to check was the object bound or not without exception handling?

  • JNDI Exception :  [System] not bound in naming services

    Hi All,
    Is there any way to resolve this JNDI exception "Invalid Path: [System/Launchers] not bound in naming service" ?
    Thanks in Advance

    This did not work dear. I assume when you say [Add ur datasource], you mean the name of the datasource, and I did as you told. I was wondering though that I have an independent java class which try to get data source from WSAD server, then how does web.xml help, may be I am not understanding the connection here.
    Just to let you know, that same java class gets the datasource from 4.0 test server. I am running both servers now i.e. 4.0 test and 5.0 test server on different ports, and only data source from 4.0 workd good. Do you have any other solution, which I can try.
    Is there any difference the way data source is accessed between 4.0 and 5.0 versions.
    Thanks in advance.
    Open web.xml, There will reference tab,, then take
    Resource, Add ur datasourse on where the Cursor points
    and then JNDI Name.
    U need to restart ..

Maybe you are looking for

  • Samsung SyncMaster 940MW

    I have just bought a new SyncMaster 940MW tv/Monitor and a new Mac Mini. They work great together and I have set the monitor at 1440x900, which gives the best quality image, but everytime I restart the Mac or wake it from sleep the monitor size reset

  • Upgraded to Mavericks and cannot connect AIM to Messages

    I recently upgraded to Mavericks and decided to try out the Messages app for instant messaging for the first time. For some reason, I cannot connect my AIM accounts to work with Messages even though they have always worked perfectly fine through Adiu

  • How to form an Endeca query where a field must start with certain letters

    hi, Is it possible to form an Endeca query to retrieve a field that must start with certain letters? Say like get all users who's first letter is 'A' ? I checked with Range filters but it is supporting only numerical fields as well as Wild card searc

  • Authorisation object for  posting parked document

    Hi Gurus, In our company, documents are being parked via an interface. After this, i require that only one particular person be able to post document if the GL account is say 100000 and no one else should be able to post this document eg if GL accoun

  • Email In and Out of LabVIEW

    I am interested in sending and receiving email programatically from LabVIEW. I have yet to find something that does everything well. Besides the following list, what have people used for email with LabVIEW. Thanks. Fred Genett Internet Toolkit : SMTP