2 Replies Latest reply on Feb 9, 2005 2:53 AM by Carlo de Wolf

    javax.naming.NameNotFoundException

    Olcay Hasanoglu Newbie

      Hi,

      if i deploy my wsr in my ear and call localhost:8080/jboss-net/servlet/AxisServlet

      I get the following error:
      Could not find home in JNDI; nested exception is:
      javax.naming.NameNotFoundException: DefecttrackServiceLocal not bound

      Here is my web-service.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!-- -->
      <!-- This JBoss.Net Web Service Descriptor has been generated by XDoclet -->
      <!-- and is brought to you by F. M. Brier, C. G. Jung and J. Essington -->
      <!-- -->
      
      <deployment
       name="DefectEJB"
       xmlns="http://xml.apache.org/axis/wsdd/"
       targetNamespace="http://net.jboss.org/defectEJB"
       xmlns:defectEJB="http://net.jboss.org/defectEJB"
       xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
      
      <!-- The following are declarations of service endpoints targetted to
       session beans -->
      
       <service name="CfcDefectService" provider="Handler">
       <parameter name="handlerClass" value="org.jboss.net.axis.server.EJBProvider"/>
       <parameter name="beanJndiName" value="DefecttrackServiceLocal"/>
       <parameter name="homeInterfaceName" value="DefecttrackServiceLocalHome"/>
       <parameter name="allowedMethods" value="getUnitHeaderByKey "/>
       <requestFlow name="CfcDefectServiceRequest">
      
       </requestFlow>
       <responseFlow name="CfcDefectServiceResponse">
      
       </responseFlow>
       <!-- Operation mapping results -->
      
       <operation name="getUnitHeaderByKey" returnQName="getUnitHeader">
       <parameter name="pk"/>
       </operation>
      
       </service>
      
      <!-- The following are typemappings for entity beans for implementing
       the implicit web-service value-object pattern -->
      
      <!-- The following are typemappings for bean-type value-objects -->
      
      <!-- There follow merged custom web service descriptions -->
      
      </deployment>
      


      My Application.xml looks like this:
      <application>
       <display-name>CFCDefecttrackEAR</display-name>
       <description>EAR for CFC Defect tracking System</description>
      
       <module>
       <web>
       <web-uri>Defectadmin.war</web-uri>
       <context-root>/Defectadmin</context-root>
       DefectEJB.wsr
       </web>
       </module>
       <module>
       <ejb>DefecttrackMgr.jar</ejb>
       </module>
       <module>
       <java>DefectEJB.wsr</java>
       </module>
      
      </application>
      


      My SessionBean looks like this:
      
      package com.motorola.cfcdefect.ejb.cfcservice;
      
      import javax.ejb.CreateException;
      import javax.ejb.SessionBean;
      
      import org.apache.log4j.Logger;
      
      import com.motorola.cfcdefect.ejb.category.CategoryUtil;
      import com.motorola.cfcdefect.ejb.category.WipLocationUtil;
      import com.motorola.cfcdefect.ejb.manager.DefectAccessBean;
      import com.motorola.cfcdefect.ejb.measuredfn.MeasureDfnUtil;
      import com.motorola.cfcdefect.ejb.unit.UnitHeaderLocal;
      import com.motorola.cfcdefect.ejb.unit.UnitHeaderLocalHome;
      import com.motorola.cfcdefect.ejb.unit.UnitHeaderUtil;
      import com.motorola.cfcdefect.ejb.unit.UnitHeaderValue;
      import com.motorola.cfcdefect.ejb.unit.UnitMeasureDfnUtil;
      import com.motorola.cfcdefect.ejb.unit.UnitMeasureValue;
      
       /**
       * <!-- begin-xdoclet-definition -->
       * @ejb.bean name="DefecttrackService"
       * jndi-name="DefecttrackServiceBean"
       * type="Stateless"
       * transaction-type="Container"
       * view-type="local"
       *
       * @ejb.ejb-ref ejb-name="DefecttrackService"
       * view-type="local"
       * ref-name="ejb/DefecttrackService"
       *
       * @ejb.ejb-ref ejb-name="UnitHeader"
       * view-type="local"
       * ref-name="ejb/UnitHeaderLocal"
       *
       * @jboss-net.web-service
       * urn="CfcDefectService"
       *
       * <!-- end-xdoclet-definition -->
       * @generated
       */
      public abstract class DefecttrackServiceBean implements javax.ejb.SessionBean
      {
       private UnitHeaderLocalHome uhLocalHome;
       private static Logger log = Logger.getLogger(DefecttrackServiceBean.class);
      
       /**
       * @ejb.create-method
       * @throws CreateException
       */
       public void ejbCreate()throws CreateException
       {
       try
       {
       uhLocalHome = UnitHeaderUtil.getLocalHome();
       }
       catch(Exception e)
       {
       log.error("ejbCreate :"+e);
       }
       }
      
       /**
       * @ejb.interface-method view-type="local"
       * @jboss-net.web-method returnQName="getUnitHeader"
       * @param pk
       * @return
       */
       public UnitHeaderValue getUnitHeaderByKey(String pk)
       {
       log.debug("Entering DefecttrackServiceBean.getUnitHeaderByKey");
       UnitHeaderValue uhVO = null;
      
       try
       {
       UnitHeaderLocal ul = uhLocalHome.findByPrimaryKey(pk);
       uhVO = ul.getUnitHeaderValue();
       }
       catch(Exception e)
       {
       log.error("DefecttrackServiceBean.getUnitHeaderByKey :"+e);
       }
       return uhVO;
       }
      }
      


      Can somebody tell me, what i am doing wrong?

        • 1. javax.naming.NameNotFoundException
          Olcay Hasanoglu Newbie

          Hi,

          if i deploy my wsr in my ear and call localhost:8080/jboss-net/servlet/AxisServlet

          I get the following error:
          Could not find home in JNDI; nested exception is:
          javax.naming.NameNotFoundException: DefecttrackServiceLocal not bound

          Here is my web-service.xml

          <?xml version="1.0" encoding="UTF-8"?>
          
          <!-- -->
          <!-- This JBoss.Net Web Service Descriptor has been generated by XDoclet -->
          <!-- and is brought to you by F. M. Brier, C. G. Jung and J. Essington -->
          <!-- -->
          
          <deployment
           name="DefectEJB"
           xmlns="http://xml.apache.org/axis/wsdd/"
           targetNamespace="http://net.jboss.org/defectEJB"
           xmlns:defectEJB="http://net.jboss.org/defectEJB"
           xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
          
          <!-- The following are declarations of service endpoints targetted to
           session beans -->
          
           <service name="CfcDefectService" provider="Handler">
           <parameter name="handlerClass" value="org.jboss.net.axis.server.EJBProvider"/>
           <parameter name="beanJndiName" value="DefecttrackServiceLocal"/>
           <parameter name="homeInterfaceName" value="DefecttrackServiceLocalHome"/>
           <parameter name="allowedMethods" value="getUnitHeaderByKey "/>
           <requestFlow name="CfcDefectServiceRequest">
          
           </requestFlow>
           <responseFlow name="CfcDefectServiceResponse">
          
           </responseFlow>
           <!-- Operation mapping results -->
          
           <operation name="getUnitHeaderByKey" returnQName="getUnitHeader">
           <parameter name="pk"/>
           </operation>
          
           </service>
          
          <!-- The following are typemappings for entity beans for implementing
           the implicit web-service value-object pattern -->
          
          <!-- The following are typemappings for bean-type value-objects -->
          
          <!-- There follow merged custom web service descriptions -->
          
          </deployment>
          


          My Application.xml looks like this:
          <application>
           <display-name>CFCDefecttrackEAR</display-name>
           <description>EAR for CFC Defect tracking System</description>
          
           <module>
           <web>
           <web-uri>Defectadmin.war</web-uri>
           <context-root>/Defectadmin</context-root>
           DefectEJB.wsr
           </web>
           </module>
           <module>
           <ejb>DefecttrackMgr.jar</ejb>
           </module>
           <module>
           <java>DefectEJB.wsr</java>
           </module>
          
          </application>
          


          My SessionBean looks like this:
          
          package com.motorola.cfcdefect.ejb.cfcservice;
          
          import javax.ejb.CreateException;
          import javax.ejb.SessionBean;
          
          import org.apache.log4j.Logger;
          
          import com.motorola.cfcdefect.ejb.category.CategoryUtil;
          import com.motorola.cfcdefect.ejb.category.WipLocationUtil;
          import com.motorola.cfcdefect.ejb.manager.DefectAccessBean;
          import com.motorola.cfcdefect.ejb.measuredfn.MeasureDfnUtil;
          import com.motorola.cfcdefect.ejb.unit.UnitHeaderLocal;
          import com.motorola.cfcdefect.ejb.unit.UnitHeaderLocalHome;
          import com.motorola.cfcdefect.ejb.unit.UnitHeaderUtil;
          import com.motorola.cfcdefect.ejb.unit.UnitHeaderValue;
          import com.motorola.cfcdefect.ejb.unit.UnitMeasureDfnUtil;
          import com.motorola.cfcdefect.ejb.unit.UnitMeasureValue;
          
           /**
           * <!-- begin-xdoclet-definition -->
           * @ejb.bean name="DefecttrackService"
           * jndi-name="DefecttrackServiceBean"
           * type="Stateless"
           * transaction-type="Container"
           * view-type="local"
           *
           * @ejb.ejb-ref ejb-name="DefecttrackService"
           * view-type="local"
           * ref-name="ejb/DefecttrackService"
           *
           * @ejb.ejb-ref ejb-name="UnitHeader"
           * view-type="local"
           * ref-name="ejb/UnitHeaderLocal"
           *
           * @jboss-net.web-service
           * urn="CfcDefectService"
           *
           * <!-- end-xdoclet-definition -->
           * @generated
           */
          public abstract class DefecttrackServiceBean implements javax.ejb.SessionBean
          {
           private UnitHeaderLocalHome uhLocalHome;
           private static Logger log = Logger.getLogger(DefecttrackServiceBean.class);
          
           /**
           * @ejb.create-method
           * @throws CreateException
           */
           public void ejbCreate()throws CreateException
           {
           try
           {
           uhLocalHome = UnitHeaderUtil.getLocalHome();
           }
           catch(Exception e)
           {
           log.error("ejbCreate :"+e);
           }
           }
          
           /**
           * @ejb.interface-method view-type="local"
           * @jboss-net.web-method returnQName="getUnitHeader"
           * @param pk
           * @return
           */
           public UnitHeaderValue getUnitHeaderByKey(String pk)
           {
           log.debug("Entering DefecttrackServiceBean.getUnitHeaderByKey");
           UnitHeaderValue uhVO = null;
          
           try
           {
           UnitHeaderLocal ul = uhLocalHome.findByPrimaryKey(pk);
           uhVO = ul.getUnitHeaderValue();
           }
           catch(Exception e)
           {
           log.error("DefecttrackServiceBean.getUnitHeaderByKey :"+e);
           }
           return uhVO;
           }
          }
          


          Can somebody tell me, what i am doing wrong?

          • 2. Re: javax.naming.NameNotFoundException
            Carlo de Wolf Master

            The jndi-name from web-service.xml doesn't match the jndi-name from the SessionBean xdoclet tags.