Javax.naming.LinkException: Help please

Hi all,
I hope one of you can help figure this out.
I am useing WLS 7 on Win2K.
When I try this:
home = (ObjectIDLocalHome) ctx.lookup("ObjectIDLocalHome");
I get this:
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: Unable to resolve 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home' Resolved: ''
Unresolved:'java:app' ; remaining name 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
My weblogic-ejb-jar.xml has:
<weblogic-enterprise-bean>
<ejb-name>ObjectID</ejb-name>
<entity-descriptor>
<entity-cache>
<cache-between-transactions>False</cache-between-transactions>
</entity-cache>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>7.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
</entity-descriptor>
<local-jndi-name>ObjectIDLocalHome</local-jndi-name>
</weblogic-enterprise-bean>
And my ejb-jar.xml has:
<entity>
<description>Entity Bean ( CMP )</description>
<display-name>ObjectID</display-name>
<ejb-name>ObjectID</ejb-name>
<local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
<local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
<ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>ObjectIDBean</abstract-schema-name>
And yes the EJB lives in gs-ejbs.jar
When I goto the WLS console and look at the JNDI Tree I see ObjectIDLocalHome under javax.
I hope this is just something stupid that I have over looked. HELP please.
Brad

Hi Guys,
Please help me with the solution if any one got it by now ??
Malay
>
Shan, have you found a solution? I'm interested in
knowing since the same error
is happening at my end!
Thanks!
"Shan" <[email protected]> wrote:
I am facing the same problem too. Please someonesolve it.
Thanks.
~Shan
"George Job" <[email protected]> wrote:
I too am facing the same problem. Does anyone have
a solution to this
problem.
please help.
"zollen" <[email protected]> wrote:
I am having the same problem. I even packaged the
ejbs and jps files
into a web
application archive file. It does not seems tosolve the problem. Would
you mind
sharing your solution??
Brad@NoWhere wrote:
Hi all,
I hope one of you can help figure this out.
I am useing WLS 7 on Win2K.
When I try this:
home = (ObjectIDLocalHome)
ctx.lookup("ObjectIDLocalHome");
I get this:
javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
Unable to resolve'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
Resolved:
Unresolved:'java:app' ; remaining name'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
My weblogic-ejb-jar.xml has:
<weblogic-enterprise-bean>
<ejb-name>ObjectID</ejb-name>
<entity-descriptor>
<entity-cache>
<cache-between-transactions>False</cache-between-tran
sactions>
</entity-cache>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>7.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</ty
pe-storage>
</persistence-use>
</persistence>
</entity-descriptor>
<local-jndi-name>ObjectIDLocalHome</local-jndi-name>
</weblogic-enterprise-bean>
And my ejb-jar.xml has:
<entity>
<description>Entity Bean ( CMP)</description>
<display-name>ObjectID</display-name>
<ejb-name>ObjectID</ejb-name>
<local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome<
/local-home>
><local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
><ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-c
lass>
><persistence-type>Container</persistence-type>
><prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>ObjectIDBean</abstract-schema-n
ame>
And yes the EJB lives in gs-ejbs.jar
When I goto the WLS console and look at the JNDITree I see ObjectIDLocalHome
under javax.
I hope this is just something stupid that I haveover looked. HELP
please.
Brad

Similar Messages

  • Javax.naming.LinkException  JNDI error Help please

    Hello All,
    I am trying my first bean on Weblogic 7 and can't seem to get the deployment descriptor correct. The home
    interface is, ObjectIDLocalHome and the full class name is com.oga.gserve.biz.oid.ObjectIDLocalHome. I am
    using the fully qualified class name so that I can do an EJBHomeFactory latter on.
    I have used the WLS console and see my bean in the JNDI tree I also used the following to find it:
    public static void loop(final Context ctx, final String name) throws Exception {
    try {
    String local;
    NamingEnumeration childrenOfNaming = ctx.list(name);
    while (childrenOfNaming.hasMore()) {
    NameClassPair ncPair = (NameClassPair) childrenOfNaming.next();
    System.out.print(ncPair.getName() + " (type ");
    System.out.println(ncPair.getClassName() + ")");
    if (name.length() > 0) {
    local = name + "." + ncPair.getName();
    } else {
    local = ncPair.getName();
    loop(ctx, local);
    } catch (javax.naming.CannotProceedException e) {
    // We are at a leaf, no more children.
    I find ObjectIDLocalHome as type javax.naming.LinkRef, as a leaf of com.oga.gserve.biz.oid
    So I know it exist!
    But why as a javax.naming.LinkRef?
    Now when I try the following:
    String cName = ObjectIDLocalHome.class.getName();
    ObjectIDLocalHome home = (ObjectIDLocalHome) ctx.lookup(cName);
    I get:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: Unable to resolve
    'java:app.ejb/gs-ejbs.jar#ObjectID/local-home' Resolved: '' Unresolved:'java:app' ; remaining name
    'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    What is wrong?
    It must be in one of the .xmls but I can't see it:
    weblogic-ejb-jar.xml
    <?xml version = '1.0'?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>ObjectID</ejb-name>
    <entity-descriptor>
    <pool>
    </pool>
    <entity-cache>
    <cache-between-transactions>False</cache-between-transactions>
    </entity-cache>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    <entity-clustering>
    </entity-clustering>
    </entity-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <local-jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>OIDServer</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <reference-descriptor>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</jndi-name>
    </ejb-local-reference-description>
    </reference-descriptor>
    <local-jndi-name>com.oga.gserve.biz.oid.OIDServerLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    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>
    <display-name>OIDRecord</display-name>
    <enterprise-beans>
    <session>
    <description><Session Bean ( Stateless )></description>
    <display-name>OIDServer</display-name>
    <ejb-name>OIDServer</ejb-name>
    <local-home>com.oga.gserve.biz.oid.OIDServerLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.OIDServerLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.OIDServerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-local-ref>
    <description><The Entity Bean we get our ID cahce from.></description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    </ejb-local-ref>
    </session>
    <entity>
    <description><Entity Bean ( CMP )></description>
    <display-name>ObjectID</display-name>
    <ejb-name>ObjectID</ejb-name>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>ObjectIDBean</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>blockSize</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>nextId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>name</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean AS o]]></ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean o WHERE o.name = ?1]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>OIDServer</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>ObjectID</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Thank you for any help,
    Brad

    Hello All,
    I am trying my first bean on Weblogic 7 and can't seem to get the deployment descriptor correct. The home
    interface is, ObjectIDLocalHome and the full class name is com.oga.gserve.biz.oid.ObjectIDLocalHome. I am
    using the fully qualified class name so that I can do an EJBHomeFactory latter on.
    I have used the WLS console and see my bean in the JNDI tree I also used the following to find it:
    public static void loop(final Context ctx, final String name) throws Exception {
    try {
    String local;
    NamingEnumeration childrenOfNaming = ctx.list(name);
    while (childrenOfNaming.hasMore()) {
    NameClassPair ncPair = (NameClassPair) childrenOfNaming.next();
    System.out.print(ncPair.getName() + " (type ");
    System.out.println(ncPair.getClassName() + ")");
    if (name.length() > 0) {
    local = name + "." + ncPair.getName();
    } else {
    local = ncPair.getName();
    loop(ctx, local);
    } catch (javax.naming.CannotProceedException e) {
    // We are at a leaf, no more children.
    I find ObjectIDLocalHome as type javax.naming.LinkRef, as a leaf of com.oga.gserve.biz.oid
    So I know it exist!
    But why as a javax.naming.LinkRef?
    Now when I try the following:
    String cName = ObjectIDLocalHome.class.getName();
    ObjectIDLocalHome home = (ObjectIDLocalHome) ctx.lookup(cName);
    I get:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: Unable to resolve
    'java:app.ejb/gs-ejbs.jar#ObjectID/local-home' Resolved: '' Unresolved:'java:app' ; remaining name
    'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    What is wrong?
    It must be in one of the .xmls but I can't see it:
    weblogic-ejb-jar.xml
    <?xml version = '1.0'?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>ObjectID</ejb-name>
    <entity-descriptor>
    <pool>
    </pool>
    <entity-cache>
    <cache-between-transactions>False</cache-between-transactions>
    </entity-cache>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    <entity-clustering>
    </entity-clustering>
    </entity-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <local-jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>OIDServer</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <reference-descriptor>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</jndi-name>
    </ejb-local-reference-description>
    </reference-descriptor>
    <local-jndi-name>com.oga.gserve.biz.oid.OIDServerLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    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>
    <display-name>OIDRecord</display-name>
    <enterprise-beans>
    <session>
    <description><Session Bean ( Stateless )></description>
    <display-name>OIDServer</display-name>
    <ejb-name>OIDServer</ejb-name>
    <local-home>com.oga.gserve.biz.oid.OIDServerLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.OIDServerLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.OIDServerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-local-ref>
    <description><The Entity Bean we get our ID cahce from.></description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    </ejb-local-ref>
    </session>
    <entity>
    <description><Entity Bean ( CMP )></description>
    <display-name>ObjectID</display-name>
    <ejb-name>ObjectID</ejb-name>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>ObjectIDBean</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>blockSize</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>nextId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>name</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean AS o]]></ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean o WHERE o.name = ?1]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>OIDServer</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>ObjectID</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Thank you for any help,
    Brad

  • Javax.naming.LinkException Please Help

    Hello All,
    I am trying my first bean on Weblogic 7 and can't seem to get the deployment descriptor correct. The home
    interface is, ObjectIDLocalHome and the full class name is com.oga.gserve.biz.oid.ObjectIDLocalHome. I am
    using the fully qualified class name so that I can do an EJBHomeFactory latter on.
    I have used the WLS console and see my bean in the JNDI tree I also used the following to find it:
    public static void loop(final Context ctx, final String name) throws Exception {
    try {
    String local;
    NamingEnumeration childrenOfNaming = ctx.list(name);
    while (childrenOfNaming.hasMore()) {
    NameClassPair ncPair = (NameClassPair) childrenOfNaming.next();
    System.out.print(ncPair.getName() + " (type ");
    System.out.println(ncPair.getClassName() + ")");
    if (name.length() > 0) {
    local = name + "." + ncPair.getName();
    } else {
    local = ncPair.getName();
    loop(ctx, local);
    } catch (javax.naming.CannotProceedException e) {
    // We are at a leaf, no more children.
    I find ObjectIDLocalHome as type javax.naming.LinkRef, as a leaf of com.oga.gserve.biz.oid
    So I know it exist!
    But why as a javax.naming.LinkRef?
    Now when I try the following:
    String cName = ObjectIDLocalHome.class.getName();
    ObjectIDLocalHome home = (ObjectIDLocalHome) ctx.lookup(cName);
    I get:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: Unable to
    resolve 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home' Resolved: '' Unresolved:'java:app' ; remaining
    name 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    What is wrong?
    It must be in one of the .xmls but I can't see it:
    weblogic-ejb-jar.xml
    <?xml version = '1.0'?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>ObjectID</ejb-name>
    <entity-descriptor>
    <pool>
    </pool>
    <entity-cache>
    <cache-between-transactions>False</cache-between-transactions>
    </entity-cache>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    <entity-clustering>
    </entity-clustering>
    </entity-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <local-jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>OIDServer</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <reference-descriptor>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</jndi-name>
    </ejb-local-reference-description>
    </reference-descriptor>
    <local-jndi-name>com.oga.gserve.biz.oid.OIDServerLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    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>
    <display-name>OIDRecord</display-name>
    <enterprise-beans>
    <session>
    <description><Session Bean ( Stateless )></description>
    <display-name>OIDServer</display-name>
    <ejb-name>OIDServer</ejb-name>
    <local-home>com.oga.gserve.biz.oid.OIDServerLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.OIDServerLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.OIDServerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-local-ref>
    <description><The Entity Bean we get our ID cahce from.></description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    </ejb-local-ref>
    </session>
    <entity>
    <description><Entity Bean ( CMP )></description>
    <display-name>ObjectID</display-name>
    <ejb-name>ObjectID</ejb-name>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>ObjectIDBean</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>blockSize</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>nextId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>name</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean AS o]]></ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean o WHERE o.name =
    ?1]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>OIDServer</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>ObjectID</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Thank you for any help,
    Brad

    you must pack all .java into one package ,even the client,
    then you can use it normally.
    <Brad@NoWhere> wrote in message news:[email protected]...
    Hello All,
    I am trying my first bean on Weblogic 7 and can't seem to get thedeployment descriptor correct. The home
    interface is, ObjectIDLocalHome and the full class name iscom.oga.gserve.biz.oid.ObjectIDLocalHome. I am
    using the fully qualified class name so that I can do an EJBHomeFactorylatter on.
    >
    I have used the WLS console and see my bean in the JNDI tree I also usedthe following to find it:
    >
    public static void loop(final Context ctx, final String name) throwsException {
    >
    try {
    String local;
    NamingEnumeration childrenOfNaming = ctx.list(name);
    while (childrenOfNaming.hasMore()) {
    NameClassPair ncPair = (NameClassPair)childrenOfNaming.next();
    System.out.print(ncPair.getName() + " (type ");
    System.out.println(ncPair.getClassName() + ")");
    if (name.length() > 0) {
    local = name + "." + ncPair.getName();
    } else {
    local = ncPair.getName();
    loop(ctx, local);
    } catch (javax.naming.CannotProceedException e) {
    // We are at a leaf, no more children.
    I find ObjectIDLocalHome as type javax.naming.LinkRef, as a leaf ofcom.oga.gserve.biz.oid
    So I know it exist!
    But why as a javax.naming.LinkRef?
    Now when I try the following:
    String cName = ObjectIDLocalHome.class.getName();
    ObjectIDLocalHome home = (ObjectIDLocalHome) ctx.lookup(cName);
    I get:
    javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException: Unable to
    resolve 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home' Resolved: ''Unresolved:'java:app' ; remaining
    name 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    What is wrong?
    It must be in one of the .xmls but I can't see it:
    weblogic-ejb-jar.xml
    <?xml version = '1.0'?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC
    '-//BEA Systems, Inc.//DTD WebLogic 7.0.0 EJB//EN'
    'http://www.bea.com/servers/wls700/dtd/weblogic-ejb-jar.dtd'>
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>ObjectID</ejb-name>
    <entity-descriptor>
    <pool>
    </pool>
    <entity-cache>
    <cache-between-transactions>False</cache-between-transactions>
    </entity-cache>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    <entity-clustering>
    </entity-clustering>
    </entity-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <enable-call-by-reference>True</enable-call-by-reference>
    <local-jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>OIDServer</ejb-name>
    <stateless-session-descriptor>
    <pool>
    <max-beans-in-free-pool>100</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <stateless-clustering>
    </stateless-clustering>
    </stateless-session-descriptor>
    <transaction-descriptor>
    </transaction-descriptor>
    <reference-descriptor>
    <ejb-local-reference-description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <jndi-name>com.oga.gserve.biz.oid.ObjectIDLocalHome</jndi-name>
    </ejb-local-reference-description>
    </reference-descriptor>
    <local-jndi-name>com.oga.gserve.biz.oid.OIDServerLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    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>
    <display-name>OIDRecord</display-name>
    <enterprise-beans>
    <session>
    <description><Session Bean ( Stateless )></description>
    <display-name>OIDServer</display-name>
    <ejb-name>OIDServer</ejb-name>
    <local-home>com.oga.gserve.biz.oid.OIDServerLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.OIDServerLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.OIDServerBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-local-ref>
    <description><The Entity Bean we get our ID cahcefrom.></description>
    <ejb-ref-name>ejb/ObjectIDLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    </ejb-local-ref>
    </session>
    <entity>
    <description><Entity Bean ( CMP )></description>
    <display-name>ObjectID</display-name>
    <ejb-name>ObjectID</ejb-name>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>ObjectIDBean</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>blockSize</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>nextId</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>name</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean AS
    o]></ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT(o) FROM ObjectIDBean o WHERE o.name
    => ?1]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>OIDServer</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>ObjectID</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    Thank you for any help,
    Brad

  • Javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundExc

    Hi,
    I get this message when i tried to run the application after i have deployed the EJBs and the application. When i test the EJBs i am also getting that there is a problem in the JNDI name but everything looks fine in the DD and i have checked them twice!! Its really frustrating me as i have finish some work soon.. if you know what i mean. Any help is appreciated , thanks in advance.

    The message is----------->> javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException                                                                                                                                                                                                                           

  • Javax.naming.LinkException:

    While Login to my application I am getting this in my log. How to resolve this? Anyone please guide me.
    javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'jdbc.TestDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/TestDS']; Link Remaining Name: 'jdbc/TestDS'
    -Thanks

    Have you defined the jdbc connection on the server you are deploying the application to (internal, stand alone...)?
    you get the error because the jdbc datasource is not defined.
    Timo

  • Javax.naming.LinkException: .  Root exception is javax.naming.NameNotFoundException

    Hi
    I have a startup class which needs to access a local entity bean. It used to work
    in weblogic 6.1, i am currently migrating to 8.1 and i get a Link Exception. I
    tried to make the startup class as a listener with in the application (EAR), it
    still complains.
    Since it worked in 6.1 i am sure there should be a way for a startup class to
    access a local EJB, please help, i have seen lot of posting regarding this issue
    in the newsgroup but no clear answer.
    Any one who faced this problem before and had it solved please do repsond ASAP.
    U can mail to me at [email protected]
    Thanks
    Siju

    Are you sure the EJB deployed with that JNDI name?
    Can you show me your weblogic-ejb-jar.xml?
    -- Rob
    Arun wrote:
    Hi,
    Do we have a solution for this problem? I am encountering this problem with an
    Applciation Lifecycle Listener. I have deployed this Listener with my EAR file
    and it accesses a local ejb (stateful) in its postStart() method. The JNDI look
    up is causing a LinkException (root exception is NameNotFoundException)
    I am not at my work PC but the application was something like this.
    "weblogic-application.xml" had something like.
    <listener>
    <listener-class>MyListener</listener-class>
    <listener-uri>mylistener.jar</listener-uri>
    </listener>
    where mylistener.jar was placed at the root of the EAR file.
    MyListener.java was something like,
    import weblogic.application.ApplicationLifecycleListener;
    import weblogic.application.ApplicationLifecycleEvent;
    import mypackage.mylocalhome;
    import mypackage.mylocal;
    import javax.naming.*;
    public class MyListener extends ApplicationLifecycleListener {
    public void preStart(ApplicationLifecycleEvent evt) {
    System.out.println
    ("MyListener(preStart) -- we should always see you..");
    } // preStart
    public void postStart(ApplicationLifecycleEvent evt) {
    try {
    System.out.println
    ("MyListener(postStart) -- we should always see you..");
    Context ctx = new InitialContext();
    mylocalhome localhome = (mylocalhome)ctx.lookup("MYLOCALJNDINAME");
    mylocal localobj = localhome.create();
    } catch (Exception e) {
    e.printStackTrace();
    } // postStart
    public void preStop(ApplicationLifecycleEvent evt) {
    System.out.println
    ("MyListener(preStop) -- we should always see you..");
    } // preStop
    public void postStop(ApplicationLifecycleEvent evt) {
    System.out.println
    ("MyListener(postStop) -- we should always see you..");
    } // postStop
    public static void main(String[] args) {
    System.out.println
    ("MyListener(main): in main .. we should never see you..");
    } // main
    Any help is greatly appreciated.
    Thanks,
    Arun
    Rob Woollen <[email protected]> wrote:
    We'll need some more info. Can you show me your weblogic-ejb-jar.xml,
    the code you are using to lookup the bean, and the full exception?
    -- Rob
    Siju Hariharan wrote:
    Hi
    I have a startup class which needs to access a local entity bean. Itused to work
    in weblogic 6.1, i am currently migrating to 8.1 and i get a Link Exception.I
    tried to make the startup class as a listener with in the application(EAR), it
    still complains.
    Since it worked in 6.1 i am sure there should be a way for a startupclass to
    access a local EJB, please help, i have seen lot of posting regardingthis issue
    in the newsgroup but no clear answer.
    Any one who faced this problem before and had it solved please do repsondASAP.
    U can mail to me at [email protected]
    Thanks
    Siju

  • Javax.naming.NameNotFoundException in Jdeveloper 10g

    HI,
    I just migrate my source code from Jdeveloper 9 to Jdeveloper 10g. Since then, all my codes do not work properly.
    I cut and pasted from old version data-source.xml to 10g data-source.xml. However, when I run the project, I got javax.naming.NameNotFoundException:jdbc/mbciwebEjb not found. I check my data-souces.xml which in embeded-oc4j/config folder. The definition is there.
    Can anybody help me?
    Thanks

    ganesh wrote:
    using WLS 8.1:
    deployed all session beans in jar1
    deployed all entity beans in jar2
    session code trying to jndi lookup entity bean, using localhome interface.
    the entity bean descriptor has <local-jndi-name> tag specified
    but jndi lookup from session bean is failing, is this because session bean is in different jar.
    what is solution please
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: While trying to look up /app/ejb/ejbs2.jar#UserEntity/local-home in /app/ejb/ejbs1.jar#UserManagerBean.; remaining name '/app/ejb/ejbs2/jar#UserEntity/local-home'
         at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:869)
         at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:148)Are these two jar deployed in the same application or different
    applications?
    -- Prasad

  • Javax.naming.NameNotFoundException: buslogic.HRAppFacade not found, help!!!

    I have followed the tutorial on http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm to create my own EJB with Jdeveloper, but I got some errors. Please help.
    When I run the client, it gave out the following errors:
    javax.naming.NameNotFoundException: buslogic.HRAppFacade not found
         at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at client.HRAppFacadeClient.main(HRAppFacadeClient.java:15)
    Process exited with exit code 0.
    I have created the entity and facade (with interface), but the client couldn't lookup the facade, giving out the above error. How to solve the problm? Thanks.
    The following is my source code:
    Employees.java
    package buslogic.persistence;
    import java.io.Serializable;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    @Entity
    @NamedQueries({
    @NamedQuery(name = "Employees.findAll", query = "select o from Employees o"),
    @NamedQuery(name = "Employees.findEmployeeById", query = "select o from Employees o where o.empid = :empid")
    @Table(name = "\"employees\"")
    public class Employees implements Serializable {
    @Id
    @Column(name="empid")
    private int empid;
    @Column(name="name")
    private String name;
    @Column(name="phone")
    private int phone;
    public Employees() {
    public int getEmpid() {
    return empid;
    public void setEmpid(int empid) {
    this.empid = empid;
    public String getName() {
    return name;
    public void setName(String name) {
    this.name = name;
    public int getPhone() {
    return phone;
    public void setPhone(int phone) {
    this.phone = phone;
    (HRAppFacadeBean.java)
    package buslogic;
    import buslogic.persistence.Employees;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name="HRAppFacade")
    public class HRAppFacadeBean implements HRAppFacade, HRAppFacadeLocal {
    @PersistenceContext(unitName="EJB_Project")
    private EntityManager em;
    public HRAppFacadeBean() {
    public Object mergeEntity(Object entity) {
    return em.merge(entity);
    public Object persistEntity(Object entity) {
    em.persist(entity);
    return entity;
    /** <code>select o from Employees o</code> */
    public List<Employees> queryEmployeesFindAll() {
    return em.createNamedQuery("Employees.findAll").getResultList();
    /** <code>select o from Employees o where o.empid = :empid</code> */
    public Employees queryEmployeesFindEmployeeById(int empid) {
    return (Employees)em.createNamedQuery("Employees.findEmployeeById").setParameter("empid", empid).getSingleResult();
    public void removeEmployees(Employees employees) {
    employees = em.find(Employees.class, employees.getEmpid());
    em.remove(employees);
    (HRAppFacade.java)
    package buslogic;
    import buslogic.persistence.Employees;
    import java.util.List;
    import javax.ejb.Remote;
    @Remote
    public interface HRAppFacade {
    Object mergeEntity(Object entity);
    Object persistEntity(Object entity);
    List<Employees> queryEmployeesFindAll();
    Employees queryEmployeesFindEmployeeById(int empid);
    void removeEmployees(Employees employees);
    (HRAppFacadeLocal.java)
    package buslogic;
    import buslogic.persistence.Employees;
    import java.util.List;
    import javax.ejb.Local;
    @Local
    public interface HRAppFacadeLocal {
    Object mergeEntity(Object entity);
    Object persistEntity(Object entity);
    List<Employees> queryEmployeesFindAll();
    Employees queryEmployeesFindEmployeeById(int empid);
    void removeEmployees(Employees employees);
    }

    I hit the exact same error. In my case it was due to missing "@Id" line in Departments.java. I must have accidently deleted it when pasting in some code.
    (my clue was the errors I got when starting imbedded OC4J)
    This section of Departments.java should read as follows:
    public class Departments implements Serializable {
    @Id
    @GeneratedValue(strategy=SEQUENCE, generator="DEPARTMENTS_SEQ")
    @Column(name="DEPARTMENT_ID", nullable = false)
    After fixing this, I ran a "make" of "HRApp", restarted the embedded OC4J server (terminate it, then right click HRAppFacadeBean.java, and click Run).
    Then ran the application...

  • Help: javax.naming.NameNotFoundException

    I am new to EJB and learning the examples in J2EE tutorial.
    I try to run my client from a different machine with my J2EE application server. The client runs fine in the same machine with the application server. I change the code as below and try to make the client work in remote machine:
    Original code:
    Context initial = new InitialContext();
    I changed to:
    Properties env = new Properties();
    env.setProperty("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory" );
    env.setProperty("java.naming.provider.url", "iiop://192.168.1.55:3700");
    InitialContext initial = new InitialContext(env);
    but it can't work even in the local machine. The below exception is occured:
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    The problem must in these two line:
    env.setProperty("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory" );
    env.setProperty("java.naming.provider.url", "iiop://192.168.1.55:3700");
    I am new to EJB and can't find any document that tell me how to set these two properties.
    Anybody can help me please? Any suggestion is welcome, thanks.....

    http://docs.sun.com/source/817-6087/dgjndi.html This will give you hopefully the info that you need

  • Javax.naming.NamingException    Please Helppppp !!

    Hi,
    There is my code :
    "PropertyResourceBundle namingProperties =
    (PropertyResourceBundle) PropertyResourceBundle.getBundle("MyAppNaming");
    Hashtable properties = getPropertyFromRB(namingProperties);
    initContext = new javax.naming.InitialContext(properties);
    java.lang.Object obj = initialContext.lookup(jndiName);"
    The last line returns an Exception :
    javax.naming.NamingException: Error during resolve [Root exception is java.lang.NullPointerException]
    The Application server containing the EJBs is well started, and the JNDI name for the EJbs in the application server and in my application are the same...
    Where am i wrong ??
    Thanks in advance for your help
    Steve

    Help me please, i become crazy with this problem !!
    Thanks
    Steve

  • Help me for  javax.naming.directory.InvalidAttributeValueException

    i change the password by jndi , and administrator of the Active directory
    had changed password of every user ,but the user is not administrator login int,cannot change himself password.why not?please help me!
    Hashtable env = new Hashtable();
    String userName = "CN=test,OU=test,DC=huadi,DC=com";
    String oldPassword = "test";
    String newPassword = "456P@ssw0rd";
    //Access the keystore, this is where the Root CA public key cert was installed
    //Could also do this via command line java -Djavax.net.ssl.trustStore....
    String keystore = "D:/Program Files/Java/jdk1.5.0/jre/lib/security/cacerts";
    System.setProperty("javax.net.ssl.trustStore",keystore);
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    //set security credentials, note using simple cleartext authentication
    env.put(Context.SECURITY_AUTHENTICATION,"simple");
    env.put(Context.SECURITY_PRINCIPAL,userName);
    env.put(Context.SECURITY_CREDENTIALS,oldPassword);
    //specify use of ssl
    env.put(Context.SECURITY_PROTOCOL,"ssl");
    //connect to my domain controller
    String ldapURL = "ldaps://173.16.80.208:636";
    env.put(Context.PROVIDER_URL,ldapURL);
    try {
    // Create the initial directory context
    LdapContext ctx = new InitialLdapContext(env,null);
    //change password is a single ldap modify operation
    //that deletes the old password and adds the new password
    System.out.println("----auth------");
    ModificationItem[] mods = new ModificationItem[2];
    //Firstly delete the "unicdodePwd" attribute, using the old password
    //Then add the new password,Passwords must be both Unicode and a quoted string
    String oldQuotedPassword = "\"" + oldPassword + "\"";
    byte[] oldUnicodePassword = oldQuotedPassword.getBytes("UTF-16LE");
    String newQuotedPassword = "\"" + newPassword + "\"";
    byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
    mods[0] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE,
    new BasicAttribute("unicodePwd", oldUnicodePassword));
    mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE,
    new BasicAttribute("unicodePwd", newUnicodePassword));
    // Perform the update
    ctx.modifyAttributes(userName, mods);
    System.out.println("Changed Password for: " + userName);
    ctx.close();
    }catch (NamingException e) {
    System.err.println("Problem changing password: " + e);
    }catch (UnsupportedEncodingException e) {
    System.err.println("Problem encoding password: " + e);
    }

    the exception is :
    javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 19 - 0000052D: AtrErr: DSID-03190F00, #1:
         0: 0000052D: DSID-03190F00, problem 1005 (CONSTRAINT_ATT_TYPE), data 0, Att 9005a (unicodePwd)
                          thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Javax.naming.NameNotFoundException  plz guys help

    hi am try to create simple ejb prj and i got this exception iam beginner so can u plz help me to knwow hats wrong
    this is my entity bean
    working on netbean 6 glassfish v2
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package doctor;
    import java.io.Serializable;
    import java.math.BigInteger;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.EntityManager;
    import javax.persistence.Id;
    import javax.persistence.NamedQueries;
    import javax.persistence.NamedQuery;
    import javax.persistence.Table;
    import javax.transaction.UserTransaction;
    * @author kriem
    @Entity
    @Table(name = "DOCTOR")
    @NamedQueries({@NamedQuery(name = "Doctor.findByDocFname", query = "SELECT d FROM Doctor d WHERE d.docFname = :docFname"), @NamedQuery(name = "Doctor.findByDocId", query = "SELECT d FROM Doctor d WHERE d.docId = :docId"), @NamedQuery(name = "Doctor.findByDocLname", query = "SELECT d FROM Doctor d WHERE d.docLname = :docLname"), @NamedQuery(name = "Doctor.findByDocPhone", query = "SELECT d FROM Doctor d WHERE d.docPhone = :docPhone"), @NamedQuery(name = "Doctor.findByDocAddress", query = "SELECT d FROM Doctor d WHERE d.docAddress = :docAddress"), @NamedQuery(name = "Doctor.findByDocMobileNo", query = "SELECT d FROM Doctor d WHERE d.docMobileNo = :docMobileNo"), @NamedQuery(name = "Doctor.findByDocSpecialty", query = "SELECT d FROM Doctor d WHERE d.docSpecialty = :docSpecialty"), @NamedQuery(name = "Doctor.findByDocTitle", query = "SELECT d FROM Doctor d WHERE d.docTitle = :docTitle")})
    public class Doctor implements Serializable {
        private static final long serialVersionUID = 1L;
        @Column(name = "DOC_FNAME", nullable = false)
        private String docFname;
        @Id
        @Column(name = "DOC_ID", nullable = false)
        private String docId;
        @Column(name = "DOC_LNAME", nullable = false)
        private String docLname;
        @Column(name = "DOC_PHONE")
        private BigInteger docPhone;
        @Column(name = "DOC_ADDRESS", nullable = false)
        private String docAddress;
        @Column(name = "DOC_MOBILE_NO")
        private BigInteger docMobileNo;
        @Column(name = "DOC_SPECIALTY", nullable = false)
        private String docSpecialty;
        @Column(name = "DOC_TITLE", nullable = false)
        private String docTitle;
        public Doctor() {
        public Doctor(String docId) {
            this.docId = docId;
        public Doctor(String docId, String docFname, String docLname, String docAddress, String docSpecialty, String docTitle) {
            this.docId = docId;
            this.docFname = docFname;
            this.docLname = docLname;
            this.docAddress = docAddress;
            this.docSpecialty = docSpecialty;
            this.docTitle = docTitle;
        public String getDocFname() {
            return docFname;
        public void setDocFname(String docFname) {
            this.docFname = docFname;
        public String getDocId() {
            return docId;
        public void setDocId(String docId) {
            this.docId = docId;
        public String getDocLname() {
            return docLname;
        public void setDocLname(String docLname) {
            this.docLname = docLname;
        public BigInteger getDocPhone() {
            return docPhone;
        public void setDocPhone(BigInteger docPhone) {
            this.docPhone = docPhone;
        public String getDocAddress() {
            return docAddress;
        public void setDocAddress(String docAddress) {
            this.docAddress = docAddress;
        public BigInteger getDocMobileNo() {
            return docMobileNo;
        public void setDocMobileNo(BigInteger docMobileNo) {
            this.docMobileNo = docMobileNo;
        public String getDocSpecialty() {
            return docSpecialty;
        public void setDocSpecialty(String docSpecialty) {
            this.docSpecialty = docSpecialty;
        public String getDocTitle() {
            return docTitle;
        public void setDocTitle(String docTitle) {
            this.docTitle = docTitle;
        @Override
        public int hashCode() {
            int hash = 0;
            hash += (docId != null ? docId.hashCode() : 0);
            return hash;
        @Override
        public boolean equals(Object object) {
            // TODO: Warning - this method won't work in the case the id fields are not set
            if (!(object instanceof Doctor)) {
                return false;
            Doctor other = (Doctor) object;
            if ((this.docId == null && other.docId != null) || (this.docId != null && !this.docId.equals(other.docId))) {
                return false;
            return true;
        @Override
        public String toString() {
            return "doctor.Doctor[docId=" + docId + "]";
        public void persist(Object object) {
            /* Add this to the deployment descriptor of this module (e.g. web.xml, ejb-jar.xml):
             * <persistence-context-ref>
             * <persistence-context-ref-name>persistence/LogicalName</persistence-context-ref-name>
             * <persistence-unit-name>simple-ejbPU</persistence-unit-name>
             * </persistence-context-ref>
             * <resource-ref>
             * <res-ref-name>UserTransaction</res-ref-name>
             * <res-type>javax.transaction.UserTransaction</res-type>
             * <res-auth>Container</res-auth>
             * </resource-ref> */
            try {
                Context ctx = new InitialContext();
                UserTransaction utx = (UserTransaction) ctx.lookup("java:comp/env/UserTransaction");
                utx.begin();
                EntityManager em = (EntityManager) ctx.lookup("java:comp/env/persistence/LogicalName");
                em.persist(object);
                utx.commit();
            } catch (Exception e) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", e);
                throw new RuntimeException(e);
    }my session bean
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package doctor;
    import java.util.List;
    import javax.ejb.Stateless;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    * @author kriem
    @Stateless
    public class DoctorFacade implements DoctorFacadeRemote {
        @PersistenceContext
        (unitName="simple-ejbPU")
        private EntityManager em;
        public void create(Doctor doctor) {
            em.persist(doctor);
        public void edit(Doctor doctor) {
            em.merge(doctor);
        public void remove(Doctor doctor) {
            em.remove(em.merge(doctor));
        public Doctor find(Object id) {
            return em.find(doctor.Doctor.class, id);
        public List<Doctor> findAll() {
            return em.createQuery("select object(o) from Doctor as o").getResultList();
        public void persist(Object object) {
            em.persist(object);
    }myremote interface
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package doctor;
    import java.util.List;
    import javax.ejb.Remote;
    * @author kriem
    @Remote
    public interface DoctorFacadeRemote {
        void create(Doctor doctor);
        void edit(Doctor doctor);
        void remove(Doctor doctor);
        Doctor find(Object id);
        List<Doctor> findAll();
    }and for the clinet side its simple java aplication
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package doctor;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.rmi.PortableRemoteObject;
    * @author kriem
    public class client extends test  {
        public static void main(String [] args) {
        try {
           // NewServiceLocator obj=new NewServiceLocator();
            test simple=new test();
            simple.getDataSource("doctor");
            simple.getSession("DoctorFaca");
                Context jndiContext = getInitialContext( );
                Object ref = jndiContext.lookup("DoctorFacade/remote");
                DoctorFacadeRemote dao = (DoctorFacadeRemote)
                  PortableRemoteObject.narrow(ref,DoctorFacadeRemote.class);
         Doctor doc=new Doctor();
         doc.setDocFname("test");
         doc.setDocAddress("bla bla");
         doc.setDocId("D1005");
         doc.setDocLname("mohamedd");
        // doc.setDocMobileNo(121112223);
         doc.setDocTitle("MD");
         //doc.getDocPhone(2);
                dao.create(doc);
                Doctor doc2 = dao.find("D1002");
                System.out.println(doc2.getDocSpecialty());
                System.out.println(doc2.getDocFname());
                System.out.println(doc2.getDocLname());
                System.out.println(doc2.getDocAddress());
                System.out.println(doc2.getDocMobileNo());
                System.out.println(doc2.getDocPhone());
                System.out.println(doc2.getDocSpecialty());
                System.out.println(doc2.getDocTitle());
        catch (javax.naming.NamingException ne)
        {ne.printStackTrace( );
        public static Context getInitialContext( )
            throws javax.naming.NamingException {
            Properties p = new Properties( );
            // ... Specify the JNDI properties specific to the vendor.
            return new javax.naming.InitialContext(p);
        }and i got this exception knowing that am using entity bean from existing database that i had created
    javax.naming.NameNotFoundException:
            at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
            at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
            at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
            at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:129)
            at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:154)
            at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
            at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
            at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
            at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    run-simple-app-client:guys anyhelp am really lost in this
    Edited by: marwacs on May 19, 2008 9:32 PM

    hey guys i made some updates on my sample and i figure out that as long as am creating enterprise application on netbeans 6 that contain both ejb module and client module i don`t need to write mapedName i only put the @ejb in the client side and it creates an instance of the remote interface
    here is what i have done in the client code /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package enterpriseapplication4;
    import ejb.Doctor;
    import ejb.DoctorFacadeRemote;
    import javax.ejb.EJB;
    import java.math.BigInteger;
    * @author kriem
    public class Main {
        @EJB
        private static DoctorFacadeRemote doctorFacade;
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
    //        Object id="D1002";
    //        Doctor find = doctorFacade.find(id);
    //        find.toString();
    //            System.out.println(find.getDocSpecialty());
    //            System.out.println(find.getDocFname());
    //            System.out.println(find.getDocLname());
    //            System.out.println(find.getDocAddress());
    //            System.out.println(find.getDocMobileNo());
    //            System.out.println(find.getDocPhone());
    //            System.out.println(find.getDocSpecialty());
    //            System.out.println(find.getDocTitle());
                    Doctor doc=new Doctor();
                    BigInteger bi = BigInteger.valueOf(123);
                    BigInteger bh = BigInteger.valueOf(111);
         doc.setDocFname("test");
         doc.setDocAddress("bla bla");
      System.err.print("doc Fname and address");
         doc.setDocId("D1005");
         doc.setDocLname("mohamedd");
    doc.setDocMobileNo(bh);
         doc.setDocTitle("MD");
    doc.setDocMobileNo (bi);
      doctorFacade.create(doc);
      System.err.print("doc was added");
    }but when i run i found this
    May 21, 2008 6:37:08 PM com.sun.enterprise.appclient.MainWithModuleSupport <init>
    WARNING: ACC003: Application threw an exception.
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
            javax.transaction.RollbackException: Transaction marked for rollback.
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
            javax.transaction.RollbackException: Transaction marked for rollback.
            at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:243)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
            at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
            at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)
            at ejb.__DoctorFacadeRemote_Remote_DynamicStub.create(ejb/__DoctorFacadeRemote_Remote_DynamicStub.java)
            at ejb._DoctorFacadeRemote_Wrapper.create(ejb/_DoctorFacadeRemote_Wrapper.java)
            at enterpriseapplication4.Main.main(Main.java:50)
            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:597)
            at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
            at com.sun.enterprise.appclient.Main.main(Main.java:200)
    Caused by: java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
            javax.transaction.RollbackException: Transaction marked for rollback.
            at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.java:251)
            at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1386)
            at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
            at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:210)
            at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
            at $Proxy82.create(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:597)
            at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:154)
            at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
            at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
            at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
            at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
            at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
    Caused by: javax.transaction.RollbackException: Transaction marked for rollback.
            at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:440)
            at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:371)
            at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3792)
            at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
            at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
            ... 19 more
    javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
            javax.transaction.RollbackException: Transaction marked for rollback.
            at ejb._DoctorFacadeRemote_Wrapper.create(ejb/_DoctorFacadeRemote_Wrapper.java)
            at enterpriseapplication4.Main.main(Main.java:50)
            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:597)
            at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
            at com.sun.enterprise.appclient.Main.main(Main.java:200)
    Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:461)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:259)
            at com.sun.enterprise.appclient.Main.main(Main.java:200)
    Caused by: java.lang.reflect.InvocationTargetException
            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:597)
            at com.sun.enterprise.util.Utility.invokeApplicationMain(Utility.java:266)
            at com.sun.enterprise.appclient.MainWithModuleSupport.<init>(MainWithModuleSupport.java:449)
            ... 2 more
    Caused by: javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.RemoteException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.; nested exception is:
            javax.transaction.RollbackException: Transaction marked for rollback.
            at ejb._DoctorFacadeRemote_Wrapper.create(ejb/_DoctorFacadeRemote_Wrapper.java)
            at enterpriseapplication4.Main.main(Main.java:50)
            ... 8 morethe thing is am connecting my sample with oracle db and i debuged my sample it breaks when i try to create(doc) last line in the client code ,i guess its about connecting with the database,i don`t know i also working on netbean 6
    so plaz me guys another question is it possible to create statfule web services and if its plz can u send me examples

  • Help needed - javax.naming.NameNotFoundException:

    Hi,
    I am writing a stateless local session bean that is invoked within an EJB,
    it deploys fine,
    console
    16:52:58,719 INFO [EjbModule] Deploying LocalRuleEngine
    but when I run it I get NameNotFoundException,
    javax.naming.NameNotFoundException: LocalRuleEngine 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.GeneratedMethodAccessor69.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    this is mapping files,
    jboss.xml,
    <?xml version="1.0"?>
    <jboss>
        <enterprise-beans>
            <message-driven>
                <ejb-name>DistributionManager</ejb-name>
                <destination-jndi-name>queue/dr</destination-jndi-name>
                <resource-ref>
                    <res-ref-name>jms/QCF</res-ref-name>
                    <jndi-name>ConnectionFactory</jndi-name>
                </resource-ref>
            </message-driven>
              <session>
                   <ejb-name>LocalRuleEngine</ejb-name>
                   <jndi-name>ejb/LocalRuleEngine</jndi-name>
              </session>
        </enterprise-beans>
    </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>
      <enterprise-beans>
         <message-driven>
               <ejb-name>DistributionManager</ejb-name>
               <ejb-class>com.test.DataDistributionManager</ejb-class>
               <transaction-type>Container</transaction-type>
               <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
               <message-driven-destination>
                 <destination-type>javax.jms.Queue</destination-type>
               </message-driven-destination>
                <ejb-local-ref>
                     <ejb-ref-name>ejb/LocalRuleEngine</ejb-ref-name>
                  <ejb-ref-type>Session</ejb-ref-type>
                  <local-home>com.test.LocalRuleEngineHome</local-home>
                  <local>com.test.LocalRuleEngine</local>
                  <ejb-link>LocalRuleEngine</ejb-link>
                 </ejb-local-ref>
               <resource-ref>
                 <res-ref-name>jms/QCF</res-ref-name>
                 <res-type>javax.jms.QueueConnectionFactory</res-type>
                 <res-auth>Container</res-auth>
               </resource-ref>
        </message-driven>
        <session>
                  <ejb-name>LocalRuleEngine</ejb-name>
                   <local-home>com.test.LocalRuleEngineHome</local-home>
                  <local>com.test.LocalRuleEngine</local>
                  <ejb-class>com.test.RuleEngineBean</ejb-class>
                  <session-type>Stateless</session-type>
                  <transaction-type>Container</transaction-type>
        </session>
      </enterprise-beans>
    </ejb-jar>this is my local home interface
    package com.test;
    import javax.ejb.CreateException;
    import javax.ejb.EJBLocalHome;
    public interface LocalRuleEngineHome extends EJBLocalHome{
         public LocalRuleEngine create() throws CreateException;
    }this is my local interface
    package com.test;
    import java.util.List;
    import javax.ejb.EJBLocalObject;
    import com.raytheon.jetts.domain.DomainClass;
    import com.raytheon.jetts.domain.DomainKey;
    public interface LocalRuleEngine extends EJBLocalObject {
         public List findMatchingRules(DomainClass itemToDistribute);
         public List createRules(DomainKey domainKey, List<Address> addresses);
         public ImAdapter getImAdapter();
         public void setImAdapter(ImAdapter imAdapter);
         public List getAddressesFromRules(List<DistributionRule> distributionRules);
         public void addRule(DistributionRule distributionRule);
         public void removeRule(DomainKey domainKey);
         public String testReturn();
    }this is my bean,
    package com.test;
    import java.rmi.RemoteException;
    import java.util.List;
    import javax.ejb.CreateException;
    import javax.ejb.EJBException;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.EJBLocalObject;
    import javax.ejb.RemoveException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import com.raytheon.jetts.domain.DomainClass;
    import com.raytheon.jetts.domain.DomainKey;
    public class RuleEngineBean implements SessionBean, LocalRuleEngine{
         private static Log log = LogFactory.getLog(DataDistributionManager.class);
         private LocalRuleEngine engine;
         private LocalRuleEngineHome localHome;
         public RuleEngineBean(){}
         public List findMatchingRules(DomainClass itemToDistribute){
              List list = null;
              return list;
         public String testReturn(){
              return new String("is home time");
         public List createRules(DomainKey domainKey, List<Address> addresses){
              List list = null;
              return list;
         public ImAdapter getImAdapter(){
              ImAdapter imAdapter = null;
              return imAdapter;
         public void setImAdapter(ImAdapter imAdapter){
         public List getAddressesFromRules(List<DistributionRule> distributionRules){
              List list = null;
              return list;
         public void addRule(DistributionRule distributionRule){
         public void removeRule(DomainKey domainKey){
         public void ejbCreate(String info){}
         public void setSessionContext(SessionContext context){}
         public void remove(){}
         public void ejbActivate(){}
         public void ejbPassivate(){}
         public void ejbRemove(){}
         public void ejbCreate(){}
         public boolean isIdentical(EJBLocalObject obj)throws EJBException{
              return true;
         public EJBLocalHome getEJBLocalHome(){
              return localHome;
         public Object getPrimaryKey()throws EJBException{
              return new Object();
    }Thanks for any help on this,
    Jp.

    sorry about that,
    I'm doing this,
    InitialContext ctx = new InitialContext();
                  LocalRuleEngineHome localRuleEngineHome  = (LocalRuleEngineHome)ctx.lookup("ejb/LocalRuleEngine");
                 //localRuleEngineHome = (LocalRuleEngineHome)PortableRemoteObject.narrow(objref,  LocalRuleEngineHome.class);
                 LocalRuleEngine lre = localRuleEngineHome.create();
                 log.info(lre.testReturn());

  • Javax.naming.NoInitialContextException! Urgent help needed

    Hi All
    I'm using Oracle Application Server(OC4J) for J2EE. i created an application of Stateless Session Bean & tested on j2sdkee1.3.1, & it is working fine on it. Same Application (an .ear file) i deployed on OC4J. But it is giving an error NoInitialContextException, lookup fails here.
    Application contains method getEchoString(String):String & a index.jsp page calling a bean's method.
    Can anybody tell me the solution to get handle of beans home interface for calling method.
    Already i've wasted many days for this. Plz help. It's urgent
    Thanks in Advance

    To the best of my knowledge, the 'javax.naming.ldap' package is fairly new, and is only included in the most recent distributions of the JNDI API. I know that this package is included with J2SDK 1.3, and I can also confirm that the very latest JNDI distribution (from http://java.sun.com/products/jndi/#download) contains the package.
    Good luck,
    -Derek

  • Can you guys help me with javax.naming.NameNotFoundException:

    Using Oracle App Server 10.1.2, OC4J managed by OPMN
    Which OC4J I am using
    oracle@SUSE-E:~/OracleAS/j2ee/home> java -jar oc4j.jar -version
    Oracle Application Server Containers for J2EE 10g (10.1.2.0.0) (build 041222.1873)
    oracle@SUSE-E:~/OracleAS/j2ee/home>
    /OracleAS/j2ee/home/config/server.xml
    <application name="xPression" path="../applications/xPression.ear" auto-start="true" />
    OracleAS/opmn/conf/opmn.xml
    <opmn xmlns="http://www.oracle.com/ias-instance">
    <notification-server>
    <port local="6100" remote="6200" request="6003"/>
    <log-file path="$ORACLE_HOME/opmn/logs/ons.log" level="4" rotation-size="1500000"/>
    <ssl enabled="true" wallet-file="$ORACLE_HOME/opmn/conf/ssl.wlt/default"/>
    </notification-server>
    <ias-component id="OC4J">
    <process-type id="home" module-id="OC4J" status="enabled">
    </ias-component>
    </opmn>
    Parameters that I used to construct the InitialContext in my Java Code.
    InitialContextFactory=com.evermind.server.rmi.RMIInitialContextFactory
    ProviderURL=opmn:ormi://10.10.5.41:6003:home/xPression
    SECURITY_PRINCIPAL=<user>
    SECURITY_CREDENTIALS=<password>
    Refered:
    http://radio.weblogs.com/0135826/2005/10/06.html
    Logfile extract: OracleAS/opmn/logs/OC4J~home~default_island~1
    53 06/10/19 11:38:04 EL providerUrl: opmn:ormi://10.10.5.41:6003:home/xPression
    54 06/10/19 11:38:04 EL namingFactory: com.evermind.server.rmi.RMIInitialContextFactory
    56 06/10/19 11:38:04 EL Creating the Initial Context
    57 06/10/19 11:38:04 EL jndi Name: com/dsc/uniarch/cr/ejb/CRContentSF
    58 06/10/19 11:38:04 EL Inside Class.forName
    59 06/10/19 11:38:04 EL Class.forName succeeded
    60 06/10/19 11:38:04 PROVIDER_URL =opmn:ormi://10.10.5.41:6003:home/xPression
    61 06/10/19 11:38:04 INITIAL_CONTEXT_FACTORY =com.evermind.server.rmi.RMIInitialContextFactory
    62 06/10/19 11:38:04 SECURITY_PRINCIPAL =user
    63 06/10/19 11:38:04 SECURITY_CREDENTIALS =password
    64 06/10/19 11:38:04 JNDI NAME =com/dsc/uniarch/cr/ejb/CRContentSF
    65 06/10/19 11:38:04 EL Exception Occurred while lookup
    66 06/10/19 11:38:04 EL Exception occurred at PortableRemoteObject.narrow
    67 06/10/19 11:38:04 javax.naming.NameNotFoundException: com/dsc/uniarch/cr/ejb/CRContentSF not found
    68 06/10/19 11:38:04 at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:164)
    69 06/10/19 11:38:04 at javax.naming.InitialContext.lookup(InitialContext.java:347)
    70 06/10/19 11:38:04 at com.dsc.uniarch.com2ejb.COM2EJBBridge._processInitializeCommand(COM2EJBBridge.java:521)
    71 06/10/19 11:38:04 at com.dsc.uniarch.com2ejb.COM2EJBBridge.processInitializeCommand(COM2EJBBridge.java:656)
    72 06/10/19 11:38:04 at com.dsc.uniarch.op.cmpcalwrapper.csetCompose(Native Method)
    73 06/10/19 11:38:04 at com.dsc.uniarch.op.cmpcalwrapper.csetOutput2PDL(cmpcalwrapper.java:96)
    74 06/10/19 11:38:04 at com.dsc.uniarch.op.OutputProfileController.processDocument(OutputProfileController.java:
    orion-ejb-jar.xml
    <session-deployment name="CRContentSF"
    location="com/dsc/uniarch/cr/ejb/CRContentSF">
    </session-deployment>
    ejb-jar.xml
    <session id="CRContentSF">
    <ejb-name>CRContentSF</ejb-name>
    <home>com.dsc.uniarch.cr.ejb.CRContentSFHome</home>
    <remote>com.dsc.uniarch.cr.ejb.CRContentSF</remote>
    <ejb-class>com.dsc.uniarch.cr.ejb.CRContentSFBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    THANKS FOR YOUR TIME AND HELP

    Some more info on from where I am looking up.
    It is a java class in the EAR and OC4J container same as the EJB (Home) class.
    Just highlighting the exception.
    Logfile extract: OracleAS/opmn/logs/OC4J~home~default_island~1
    53 06/10/19 11:38:04 EL providerUrl: opmn:ormi://10.10.5.41:6003:home/xPression
    54 06/10/19 11:38:04 EL namingFactory: com.evermind.server.rmi.RMIInitialContextFactory
    56 06/10/19 11:38:04 EL Creating the Initial Context
    57 06/10/19 11:38:04 EL jndi Name: com/dsc/uniarch/cr/ejb/CRContentSF
    58 06/10/19 11:38:04 EL Inside Class.forName
    59 06/10/19 11:38:04 EL Class.forName succeeded
    60 06/10/19 11:38:04 PROVIDER_URL =opmn:ormi://10.10.5.41:6003:home/xPression
    61 06/10/19 11:38:04 INITIAL_CONTEXT_FACTORY =com.evermind.server.rmi.RMIInitialContextFactory
    62 06/10/19 11:38:04 SECURITY_PRINCIPAL =user
    63 06/10/19 11:38:04 SECURITY_CREDENTIALS =password
    64 06/10/19 11:38:04 JNDI NAME =com/dsc/uniarch/cr/ejb/CRContentSF
    65 06/10/19 11:38:04 EL Exception Occurred while lookup
    66 06/10/19 11:38:04 EL Exception occurred at PortableRemoteObject.narrow
    67 06/10/19 11:38:04 javax.naming.NameNotFoundException: com/dsc/uniarch/cr/ejb/CRContentSF not found
    68 06/10/19 11:38:04 at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:164)
    69 06/10/19 11:38:04 at javax.naming.InitialContext.lookup(InitialContext.java:347)
    70 06/10/19 11:38:04 at com.dsc.uniarch.com2ejb.COM2EJBBridge._processInitializeCommand(COM2EJBBridge.java:521)
    71 06/10/19 11:38:04 at com.dsc.uniarch.com2ejb.COM2EJBBridge.processInitializeCommand(COM2EJBBridge.java:656)
    72 06/10/19 11:38:04 at com.dsc.uniarch.op.cmpcalwrapper.csetCompose(Native Method)
    73 06/10/19 11:38:04 at com.dsc.uniarch.op.cmpcalwrapper.csetOutput2PDL(cmpcalwrapper.java:96)
    74 06/10/19 11:38:04 at com.dsc.uniarch.op.OutputProfileController.processDocument(OutputProfileController.java:

Maybe you are looking for