Naming error: javax.naming.NoInitialContextException

I get the below error message when I try to run the testing class below that. I googled the exception and read:
This exception is thrown when no initial context implementation can be created. The policy of how an initial context implementation is selected is described in the documentation of the InitialContext class.
// then I read this: http://publib.boulder.ibm.com/infocenter/adiehelp/index.jsp?topic=/com.sun.api.doc/javax/naming/NoInitialContextException.html
This exception can be thrown during any interaction with the InitialContext, not only when the InitialContext is constructed. For example, the implementation of the initial context might lazily retrieve the context only when actual methods are invoked on it.
I really dont understand what I read. Could someone please explain what my issue is and why it is occurring and how I could fix it.
Thank you in advance,
Crystal
Naming error: javax.naming.NoInitialContextException: Need to specify class name
in environment or system property, or as an applet parameter, or in an applicat
ion resource file:  java.naming.factory.initial
Exception in thread "main" java.lang.NullPointerException
        at notifier.notifierMethod.SiteManager(notifierMethod.java:230)
        at notifier.testing.main(testing.java:22)
testing.java
class testing {
    public static void main(String[] args) {
        //Display "Hello World!"
        System.out.println("Hello World!");
        notifier notifierInformation = new notifier();
        //session.setAttribute("notifier", notifierInformation);
        //get db connection
        database.DataFactory dbf = database.DataFactory.getDataFactory(database.DataFactory.sybase);
        notifierInterface notifierDB = dbf.getNotifierInterface();
        notifier sitemanager = notifierDB.SiteManager(newID, notifierInformation);  // LINE 22
notifierMethod
public notifier SiteManager(String newID, notifier notifierInformation) {
        try {
            ArrayList sitemgrList = new ArrayList();
            this.conn = database.SybaseDAO.grabConnection();
            cs = conn.prepareCall("{call mt."+newID+"_Notifier_SiteManager()}"); // LINE 230
            rs = cs.executeQuery();
            while(rs.next()) {
                String owner = rs.getString(1);
                    sitemgrList.add(owner);
            notifierInformation.setSitemgrList(sitemgrList);
}

Aleen - Thank you for your help but I just dont get what you are saying at all! I am reading through all the links and its just not clicking with me. Is it possible for you to show me a vague example of what you mean?
What do you mean by system properties/enviroment parameters? Do you mean what is in my web.xml/server.xml, like so?
public static Connection grabConnection() {
        Connection conn = null;
        try {
            Context ctx = (Context)new InitialContext().lookup("java:comp/env");
            DataSource ds = (DataSource)ctx.lookup("jdbc/connectDB");
            conn = ds.getConnection();
        } catch(SQLException e) { System.err.println("SQL error: " + e);
        } catch(NamingException n) { System.err.println("Naming error: " + n);
        return conn;
web.xml
<description>MySQL Test App</description>
<resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/connectDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
</resource-ref>
server.xml
<Context path="/appName" docBase="/appName"
        debug="5" reloadable="true" crossContext="true">
  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_DBPool_log" suffix=".log"
             timestamp="true"/>
<Resource name="jdbc/connectDB" auth="Container" type="javax.sql.DataSource"
               maxActive="5" maxIdle="1" maxWait="10000" removeAbandoned="true"
            removeAbandonedTimeout="60" logAbandoned="true"
               username="myName" password="myPass" driverClassName="sun.jdbc.odbc.JdbcOdbcDriver"
               url="jdbc:odbc:webdev"/>
</Context>I just dont understand why if I have this code in a servlet it works fine but when I try to put it in a java class it doesnt work. And I am sorry in advance, I am not trying to be a pain in the a55 to you.. and I will keep reading
Thanks - Crystal

Similar Messages

  • Oracle10g AppSer..Lookup error: javax.naming.AuthenticationException

    Please help ..
    I have a working EAR on weblogic app server and deployed it on oracle 10g app server release 2 .. the application is developed in struts .. the following error is shown on the console ..
    06/09/22 10:34:28 Start process
    06/09/22 10:34:37 log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
    06/09/22 10:34:37 log4j:WARN Please initialize the log4j system properly.
    06/09/22 10:34:43 INSIDE GET PROPERTY METHOD value for property= org.jnp.interfaces.NamingContextFactory
    06/09/22 10:34:43 INSIDE GET PROPERTY METHOD value for property= localhost:1099
    06/09/22 10:34:43 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized
    06/09/22 11:04:57 ************Inside eCreditSessionListenerClass Session Created: 0
    22 Sep 2006 11:04:57,352 INFO com.ecredit.login.struts.LoginAction - inside getBeanObjec
    22 Sep 2006 11:04:57,384 INFO com.ecredit.login.struts.LoginAction - inside getBeanObjec------>Login
    22 Sep 2006 11:04:57,399 INFO com.ecredit.login.struts.LoginAction - Exception occured in Throwable Action Classjavax.naming.NamingException: Lookup error: javax.naming.AuthenticationException: Invalid username/password for default (); nested exception is:
         javax.naming.AuthenticationException: Invalid username/password for default () [Root exception is javax.naming.AuthenticationException: Invalid username/password for default ()]
    22 Sep 2006 11:04:57,399 INFO com.ecredit.login.struts.LoginAction - after getBeanObjec
    22 Sep 2006 11:04:57,399 INFO com.ecredit.login.struts.LoginAction - after home
    22 Sep 2006 11:04:57,399 INFO com.ecredit.login.struts.LoginAction - Exception occured in Throwable Action Classjava.lang.NullPointerException
    22 Sep 2006 11:04:57,415 DEBUG org.apache.struts.action.RequestProcessor - processForwardConfig(ForwardConfig[name=null,path=null,redirect=false,contextRelative=false,module=null])
    The code snippet where this error probably occurred is >>>>
         private Object getBeanObject(String beanName)
              Object objref = null;
              try
                   System.out.println("inside getBeanObjec");
                   Properties props= new Properties();
                   props.put(Context.INITIAL_CONTEXT_FACTORY, initial_context_factory);
                   props.put(Context.PROVIDER_URL,provider_url);
                   Context initCtx=new InitialContext(props);
                   System.out.println("inside getBeanObjec------>" +beanName);
                   objref=initCtx.lookup(beanName);
              catch(Exception e)
                   e.printStackTrace();
              return objref;
    At the line >>>>>>>>
    objref=initCtx.lookup(beanName);
    Please help me to get rid of this ......
    Thanks in advance
    Gurpreet Singh

    Hi
    private Object getBeanObject(String beanName)
    Object objref = null;
    try
    System.out.println("inside getBeanObjec");
    Context initCtx=new InitialContext();
    System.out.println("inside getBeanObjec------>" +beanName);
    objref=initCtx.lookup(beanName);
    catch(Exception e)
    e.printStackTrace();
    return objref;
    try this pleace
    Asanka Priyanjith

  • JNDI naming exception: javax.naming.ServiceUnavailableException

    Hi,
    I am running a standalone version of WLS 6.1 sp4. When I start WLS, it throws
    this exception:
    <Mar 19, 2004 2:39:11 PM PST> <Critical> <Log Management> <Unable
    to contact managed server - med1d2ms01, at d_conitti/10.0.4.81:7301.
    Domain logfile will notcontain messages from this server.
    java.lang.IllegalArgumentException: JNDI naming exception: javax.naming.ServiceUnavailableException
    [Root exception is java.net.UnknownHostException: d_conitti]
    However, weblogic doesn't shut down after this. It continues and deploys all the
    apps. What intrigues me is, where is weblogic reading the 'd_conitti' managed
    server from. I am not running any cluster. It beats me totally. I searched for
    'd_conitti' on my whole machine. I didn't find any file with that word.
    My environment is:
    Win2k Server
    wls 6.1 sp4
    jdk 1.3.1
    I would appreciate any help.
    Thanks,
    Abbas

    Hi,
    I am running a standalone version of WLS 6.1 sp4. When I start WLS, it throws
    this exception:
    <Mar 19, 2004 2:39:11 PM PST> <Critical> <Log Management> <Unable
    to contact managed server - med1d2ms01, at d_conitti/10.0.4.81:7301.
    Domain logfile will notcontain messages from this server.
    java.lang.IllegalArgumentException: JNDI naming exception: javax.naming.ServiceUnavailableException
    [Root exception is java.net.UnknownHostException: d_conitti]
    However, weblogic doesn't shut down after this. It continues and deploys all the
    apps. What intrigues me is, where is weblogic reading the 'd_conitti' managed
    server from. I am not running any cluster. It beats me totally. I searched for
    'd_conitti' on my whole machine. I didn't find any file with that word.
    My environment is:
    Win2k Server
    wls 6.1 sp4
    jdk 1.3.1
    I would appreciate any help.
    Thanks,
    Abbas

  • Error in EJB client program (javax.naming.NoInitialContextException)

    Hi folks ,
    I'm new to j2ee programming and using Netbeans 5.5 , i created a session bean program and deployed successfully in JOnAS application server but i'm not able to run the client program which invokes session bean (EJB module ).
    when i run client program i'm getting the following error .
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
            at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
            at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
            at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at SimpleSessionClient.Main.main(Main.java:33)
    BUILD SUCCESSFUL (total time: 21 seconds)
    but the same program runnig perfectly when i deploy in Java System Application Server(8.2(JSAS))
    I included j2ee.jar and appserv-rt jar in classpath of client program for JSAS i don't know what are the jar files (which does the same function as j2ee.ar,appserv-rt.jar ) which is to be included for JOnAS .
    i'm struggling with this for the past two weeks . please tell me the solution .
    Thanks in advance

    Thanks for the suggestion artntek.
    I located the jndi.properties file in the %J2EE_HOME%\lib\classes folder, and I copied it to the %J2EE_HOME%\bin directory, but nothing seems to have changed.
    does anyone know what value should be associated with Context.INITIAL_CONTEXT_FACTORY in the properties for the InitialContext object? More specifically, what value should be used for the reference install of the 1.3 j2ee release from sun?
    This error suggests to me that a class name must be specified for the initial naming context factory - but I don't know what to use.

  • Error while running Client Program of Entity Bean (BMP) : javax.naming.Name

    Hi,
    I have tried an entity bean application. I am able to deploy my entity bean in WebLogic 7.0 server. But when I ran the client program I am getting the following error.
    javax.naming.NameNotFoundException : Unable to resolve 'java:comp.env/ejb/AccountBean' Resolved: ' ' unresolved : 'java:comp': remaining name 'java:comp.env/ejb/AccountBean'
    My ejb-jar.xml is as follows:
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>AccountBean</ejb-name>
    <home>AccountHome</home>
    <remote>Account</remote>
    <ejb-class>AccountBean<ejb-class>
    <persistance-type>Bean</persistance-type>
    <prim-key-class>AccountPK</prim-key-class>
    <reentrant>False</reentrant>
    <primkey-field>AccountID</primkey-field>
    <env-entry>
    <env-entry-name>jdbc.drivers</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>oracle.jdbc.driver.OracleDriver</env-entry-value>
         </env-entry>
    <env-entry>
    <env-entry-name>JDBC-URL</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>jdbc:oracle:thin:@erp:1521:Oracle9i</env-entry-value>
         </env-entry>
         <ejb-ref>
                   <ejb-ref-name>ejb/AccountBean</ejb-ref-name>
                   <ejb-ref-type>Entity</ejb-ref-type>
                   <home>AccountHome</home>
                   <remote>Account</Account>
                   <ejb-link>AccountBean</ejb-link>
              <ejb-ref>
              <resource-ref>
                   <resource-ref-name>jdbc/bmp-account</resource-ref-name>
                   <resouce-ref-type>javax.sql.DataSource</resource-ref-type>
                   <res-auth>Container</res-auth>
                   <res-sharing-scope>sharable</res-sharing-sope>
              <resource-ref>
         </entity>
    </enterprise-beans>
    <assembly-descriptor>
    </assembly-descriptor>
    <ejb-jar>
    My weblogic-ejb-jar.xml is as follows:
    <weblogic-ejb-jar>
         <weblogic-enterprise-bean>
              <ejb-name>AccountBean</ejb-name>
              <entity-descriptor>
                   <pool>
                   </pool>
                   <entity-cache>
                        <cache-between-transaction>false</cache-between-transcation>
                   </entity-cache>
                   <persistance>
                   </persistance>
                   <entity-clustering>
                   </entity-clustering>
              </entity-descripto>
              <transaction-descriptor>
              </transaction-descriptor>     
              <reference-descriptor>
                   <resource-descriptor>
                        <res-ref-name>jdbc/bmp-accoun</res-ref-name>
                        <jndi-name>MariJNDI</jndi-name>
                   </resource-descriptor>
                   <ejb-reference-descriptor>
                        <ejb-ref-name>ejb/AccountBean</ejb-ref-name>
                        <jndi-name>AccountBean</jndi-name>
                   </ejb-reference-descriptor>
              </reference-descriptor>
              </weblogic-enterprise-bean>
         </weblogic-ejb-jar>
    My Client Program is as follows:
    import javax.ejb.*;
    public class Client{
    public static void main(String[] args){
    Account account = null;
         try{
         Context = new InitialContext(System.getProperties());
         AccountHome home = (AccountHome) ctx.lookup("java:comp/env/ejb/AccountBean");
         home.create("123-456-7890","John");
         }catch(...){
    Any help is appreciated.
    Thanks in advance.
    Regards,
    Mari.

    Hi,
    My Client Program is as follows:
    import javax.ejb.*;
    public class Client{
    public static void main(String[] args){
    Account account = null;
         try{
    Context = new
    Context = new
    InitialContext(System.getProperties());
    AccountHome home = (AccountHome)
    AccountHome)
    ctx.lookup("java:comp/env/ejb/AccountBean");
         home.create("123-456-7890","John");
         }catch(...){
    }What are the System Properties? Are you running the client remotely? Are you running the client as a stand alone Java app or using the Weblogic's Client Runner? 'java:comp' as the jndi name is usually used when the client runs inside the container... But it doesn't seem to be the case.
    Kexkey

  • Error while starting Instance -javax.naming.NamingException: Cannot bind nu

    Kindly help!!!!!
    Application gets deployed on Oracle Weblogic Server 11g. But while starting its gives the Error
    javax.naming.NamingException: Cannot bind null object to jndi with name.
    All the things seems to be in place. Kindly help

    No I am not getting this error while deploying the application. Application gets successfully deployed.
    Once I start the application I get this error
    <Apr 17, 2010 5:28:46 PM IST> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating
    <Apr 17, 2010 5:28:46 PM IST> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Could not setup environment
    at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1361)
    at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:408)
    at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:182)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
    at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:48)
    Truncated. see log file for complete stacktrace
    javax.naming.NamingException: Cannot bind null object to jndi with name jms/queue/EodBodQueueJNDI
    at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:311)
    at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.java:277)
    at weblogic.deployment.EnvironmentBuilder.addConnectorRef(EnvironmentBuilder.java:233)
    at weblogic.deployment.EnvironmentBuilder.addResourceReferences(EnvironmentBuilder.java:152)
    at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:138)
    Truncated. see log file for complete stacktrace

  • Javax.naming.NameNotFoundException: LDAP: error code 32

    Hey,
    Scenario:
    User ID does not exist. Two months before it was there. But right now user is no more.
    Since I have returned obj1 which is of type LDAP which contains Strings of Name, User ID, Phone etc. What will be the return value? I have just returned like
    attributes = getContextLdap(servletCtx);
    if (attributes.getAll() == null) {
    return obj1;
    and throws me error javax.naming.NameNotFoundException: LDAP: error code 32
    Rgds,
    Jenni

    One of the reason, as per your requirement, may due to PREDOMINANT catch block for javax.naming.NameNotFoundException.
    Catch that exception.

  • Javax.naming.OperationNotSupportedException:[LDAP: error code 12-00000057

    Hi All,
    I getting the below OperationNotSupportedException while searching the LDAP container
    "'ou=Subscriptions,ou=BMCMarimba,DC=marimba,DC=bmc-dns,DC=com'".
    In our application during the initial search i'm able to search the above container and get the results.But during subsequent search getting the below mentioned error.
    javax.naming.OperationNotSupportedException: [LDAP: error code 12 - 00000057: LdapErr: DSID-0C09068F, comment: Error processing control, data 0, vece]; remaining name 'ou=Subscriptions,ou=BMCMarimba,DC=marimba,DC=bmc-dns,DC=com'
         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3048)\
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934)\
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2740)\
         at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1811)\
         at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1734)\
         at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)\
         at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:328)\
         at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:245)\
         at com.marimba.tools.ldap.physical.LDAPConnectionImpl.getResult(LDAPConnectionImpl.java:901)\
         at com.marimba.tools.ldap.physical.LDAPConnectionPoolImpl.searchWithConnection(LDAPConnectionPoolImpl.java:1369)\
         at com.marimba.tools.ldap.physical.LDAPPagedSearchPR.getPage(LDAPPagedSearchPR.java:402)\
         at com.marimba.tools.ldap.physical.LDAPPagedSearchPR.getPage(LDAPPagedSearchPR.java:238)\
         at com.marimba.tools.ldapsync.util.PageResultEnumeration.getNextPage(PageResultEnumeration.java:159)\
         at com.marimba.tools.ldapsync.policy.core.PolicySync.processNewPolicies(PolicySync.java:351)\
         at com.marimba.tools.ldapsync.policy.core.PolicySync.syncPolicies(PolicySync.java:164)\
         at com.marimba.tools.ldapsync.core.TargetSync.syncTargets(TargetSync.java:163)\
         at com.marimba.tools.ldapsync.core.LDAPDBSync.run(LDAPDBSync.java:617)\
         at java.lang.Thread.run(Thread.java:534)
    Any idea why this exception is coming only in the subsequent search.
    Any help would be greatly appriciated.
    Thanks
    Vallinayagam

    Hope this question raised long back and no suitable answers provided. I want to share my solution which worked for this problem to all the developers hitting their heads to thier PC :-)
    You must use single LDAP connection to retrive all the results.
    For example:
    If your query returns around 10000 results, best way to get the results is using paging. Let us assume you set the page size to 500. Once you retrieve the first 500 results LDAP Connection will give you cookie which stores the information on last page. We need to set the cookie to future use i.e., for retrieving next page (next 500 results). If the connection to get next page is new/different (can be new instance or retrieved from pool) you will get "javax.naming.OperationNotSupportedException:[LDAP: error code 12-00000057".
    So, to avoid this you need to use the same LDAP connection (conext) till you retieve all the results.
    Regards,
    Nageswara Rao.V                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Javax.naming.NameNotFoundException: SessionEJBBean not found

    Please help I am getting error: javax.naming.NameNotFoundException: SessionEJBBean not found.
    I am using JDeveloper 10g as editor.
    The embedded server is running, SessionEJBBean is also there. I have restarted the computer, changed 'SessionEJB' from 'SessionEJBBean'. Yet No success. This is what I get.:
    javax.naming.NameNotFoundException: SessionEJBBean not found
    at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:52)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at friends.SessionEJBClient.main(SessionEJBClient.java:11)
    Process exited with exit code 0.
    SessionEJBClient.java
    package friends;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class SessionEJBClient {
    public static void main(String [] args) {
    try {
    final Context context = getInitialContext();
    SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJBBean");
    } catch (Exception ex) {
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException {
    // Get InitialContext for Embedded OC4J
    // The embedded server must be running for lookups to succeed.
    return new InitialContext();
    }Thank you.

    Thanks Karma-9 for your reply. My issue has got resolved as I followed this link:
    http://www.oracle.com/technology/obe/obe1013jdev/10131/10131_ejb_30/ejb_30.htm
    However I have now new problem in hand, when I am trying to insert data in database
    using JSP. I am having problem with request.getParameter(). It is not
    recognised by JSP. A red underline is being shown below
    request.getParameter(). One more thing, in JSP page, if I take cursor over
    'request' in request.getParameter, it shows, 'Name request not found'. When
    I take cursor over 'getParameter' in request.getParameter, it shows, 'Method
    getParameter (java.lang.String) not found in<unknown>'.
    This is my code:
    MyPage.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*, javax.naming.Context,
    javax.naming.InitialContext, javax.naming.NamingException,
    friendspackage.*, java.text.*, java.util.*"%>
    <%!
    public void jspInit () {
    String name, city;
    name = request.getParameter("name");
    city = request.getParameter("city");
    try {
    final Context context = getInitialContext();
    SessionFriends sessionFriends =
    (SessionFriends)context.lookup("SessionFriends");
    sessionFriends.addFriends("name","city");
    //System.out.println( "Success" );
    } catch (Exception ex) {
    ex.printStackTrace();
    private static Context getInitialContext() throws NamingException {
    // Get InitialContext for Embedded OC4J
    // The embedded server must be running for lookups to succeed.
    return new InitialContext();
    %>MyPage.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252"></meta>
    <title>My Friends</title>
    </head>
    <body>
    <form name="MyFriends" action="MyFriends.jsp" method="post">
    Name:
    <input type="text" name="name">
    City:
    <input type="text" name="city">
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>Please let me know if I have to make any changes in web.xml which is:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    </web-app>Thank you again.
    Anurag

  • JNDI lookup from OC4J to weblogic throws javax.naming.NameNotFoundException

    Hi All,
    We have the below setup in our production environment.
    EJB application is deployed in the Weblogic 10.3.4.0 Server on Sun Solaris. The EJB version is 3.0
    OC4J 10.2.0 is running on another Sun Solaris machine.
    There are 2 webservice applications WEBSERV1 & TestSoapEJB running on this OC4J container.
    We need to do lookup the EJBs deployed on the Weblogic server. For this we used the below logic in the web service's Stateless session bean:
    String weblogicURL = "";
    Properties props = new Properties();
    try
    props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("wl.properties"));
    weblogicURL     = props.getProperty("weblogicURL");     
    catch (FileNotFoundException e)
    e.printStackTrace();
    catch (IOException e)
    e.printStackTrace();
    Context ctx = null;
    Hashtable ht = new Hashtable();
    ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.SECURITY_PRINCIPAL,"weblogic");
    ht.put(Context.SECURITY_CREDENTIALS,"weblogic654");
    ht.put(Context.PROVIDER_URL, weblogicURL);
    ctx = NamingManager.getInitialContext(ht) ;
    // tried using //ctx = new InitialContext(ht); same behavior.
    TestEJB.AdministratorEJB ejb = (TestEJB.AdministratorEJB) ctx.lookup("TestEJB#TestEJB.AdministratorEJB");
    ctx.close();
    When we first test first WEBSER1, the lookup is fine.
    But when we test the second webservice WEBSER2, the webservice name itself not able to lookup: It gives the below error:
    javax.naming.NameNotFoundException: remaining name: env/TestSoapEJB
    Below is the stack throws thrown on browser:
    500 Internal Server Error
    javax.naming.NameNotFoundException: remaining name: env/TestSoapEJB     
    at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:35)     
    at weblogic.j2eeclient.SimpleContext.resolve(SimpleContext.java:39)     
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)     
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:59)     
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:64)     
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)     
    at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)     
    at javax.naming.InitialContext.lookup(InitialContext.java:392)     
    at oracle.j2ee.ws.SessionBeanRpcWebService.init(SessionBeanRpcWebService.java:65)     
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.loadServlet(HttpApplication.java:2354)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.findServlet(HttpApplication.java:4795)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2821)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:680)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)     
    at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)     
    at java.lang.Thread.run(Thread.java:662)
    It seems that, the OC4J is looking in Weblogic context. But it should be looking in its own context. How to resolve this issue.
    The same case happens if i restart the OC4J and first test the TestSoapEJB the lookup is fine . But if i test the WEBSERV1 , it throws the same error as above. In short, if one of the webservices lookup is working fine, the other webservice is not working. At the same time only one webservice's lookup is working.
    Kindly help me to resolve this issue.
    regards,
    Zia
    Edited by: PT Expert on Sep 9, 2012 3:16 AM

    I work now more that two days on this error!!!
    -> I remade my complete jdev project, it did not work!
    -> I deleted the jdev/system/j2ee/oc4j/workspace dir
    -> I search for some .lock files
    -> and many more tries!!! But without success...
    Is there a way to reset the Embedded OC4J?

  • Javax.naming.AuthenticationException [Root exception is com.tarantella.tta

    Dear all,
    i am trying to integrate active directory i am getting LDAP connection error
    LDAP Connection Error
    javax.naming.AuthenticationException [Root exception is com.tarantella.tta.webservices.TTAException]
    and cannot proceed.
    i selected on the previous screen as domain controller plus LDAP/Active directory
    right
    but it is not working
    any idea?

    Hi,
    Please try using the User Pricipal Name (UPN) as the username:
    username@domein
    Also make sure you ldap server url are correct:
    ldap://server.domain
    not:
    ldap://domain
    Best Regards,
    Arno Staal
    Divider B.V.

  • EJB javax.naming.NameNotFoundException:

    Hi,
    I have EJB deployed in JRUN. I am trying to run Client program. It is giving the following error
    javax.naming.NameNotFoundException: ejbT.test1Home not found
    at allaire.ejipt._NamingContext.lookup(_NamingContext.java:73)
    at allaire.ejipt._ClientContext.lookup(_ClientContext.java:113)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at ejbT.testClient.main(testClient.java:44)
    I checked <ejb-name> in ejb-jar.xml and jrun-ejb-jar.xml file .. they are the same.
    What can be the problem.
    Can some please help me.
    Thanks in advance.

    Does the JNDI name in your client match that of your EJB?

  • Javax.naming.NameNotFoundException: comp not bound

    When i try to deploy the following error message.. pls help
    Hii all..I am facing some problems with eclipse.If any one know waht the problem is pls help me..
    i cant bulid the work space completely as i get out of memory error continuously. i use 1GB Ram, and my vmargs is "eclipse.exe -vmargs -Duser.language=en -Xms128M -Xmx1024M -XX:PermSize=64M -XX:MaxPermSize=1024M"
    just after the error the building process continues and "successfully built" message is shown ( though i dont know whether it is successful or not and in problem listing it only warnings are shown).
    When i start jboss server i get the error javax.naming.NameNotFoundException: comp not bound
    i have included full server log,
    waiting for your help.
    org.jboss.deployment.DeploymentInfo@bed157bf { url=file:/D:/jboss-4.0.2/server/default/deploy/IA.ear/UTILEJB.jar/ }
    deployer: null
    status: Starting
    state: START_SUBDEPLOYMENTS
    watch: file:/D:/jboss-4.0.2/server/default/deploy/IA.ear/UTILEJB.jar/
    altDD: null
    lastDeployed: 1233122716687
    lastModified: 1233122621468
    mbeans:
    --- Incompletely deployed packages ---
    org.jboss.deployment.DeploymentInfo@5d7b9e6e { url=file:/D:/jboss-4.0.2/server/default/deploy/jboss-ws4ee.sar/jboss-ws4ee.war }
    deployer: org.jboss.web.tomcat.tc5.Tomcat5@174aa60
    status: Deployment FAILED reason: {color:#ff0000}*Error during deploy; - nested throwable: (javax.naming.NameNotFoundException: comp not bound)*{color}
    state: FAILED
    watch: file:/D:/jboss-4.0.2/server/default/deploy/jboss-ws4ee.sar/jboss-ws4ee.war
    altDD: null
    lastDeployed: 1233122713125
    lastModified: 1233122713078
    mbeans:
    Edited by: DEVISARASWATHI on Jan 28, 2009 12:49 AM
    Edited by: DEVISARASWATHI on Jan 28, 2009 1:20 AM

    When i try to deploy the following error message.. pls help
    Hii all..I am facing some problems with eclipse.If any one know waht the problem is pls help me..
    i cant bulid the work space completely as i get out of memory error continuously. i use 1GB Ram, and my vmargs is "eclipse.exe -vmargs -Duser.language=en -Xms128M -Xmx1024M -XX:PermSize=64M -XX:MaxPermSize=1024M"
    just after the error the building process continues and "successfully built" message is shown ( though i dont know whether it is successful or not and in problem listing it only warnings are shown).
    When i start jboss server i get the error javax.naming.NameNotFoundException: comp not bound
    i have included full server log,
    waiting for your help.
    org.jboss.deployment.DeploymentInfo@bed157bf { url=file:/D:/jboss-4.0.2/server/default/deploy/IA.ear/UTILEJB.jar/ }
    deployer: null
    status: Starting
    state: START_SUBDEPLOYMENTS
    watch: file:/D:/jboss-4.0.2/server/default/deploy/IA.ear/UTILEJB.jar/
    altDD: null
    lastDeployed: 1233122716687
    lastModified: 1233122621468
    mbeans:
    --- Incompletely deployed packages ---
    org.jboss.deployment.DeploymentInfo@5d7b9e6e { url=file:/D:/jboss-4.0.2/server/default/deploy/jboss-ws4ee.sar/jboss-ws4ee.war }
    deployer: org.jboss.web.tomcat.tc5.Tomcat5@174aa60
    status: Deployment FAILED reason: {color:#ff0000}*Error during deploy; - nested throwable: (javax.naming.NameNotFoundException: comp not bound)*{color}
    state: FAILED
    watch: file:/D:/jboss-4.0.2/server/default/deploy/jboss-ws4ee.sar/jboss-ws4ee.war
    altDD: null
    lastDeployed: 1233122713125
    lastModified: 1233122713078
    mbeans:
    Edited by: DEVISARASWATHI on Jan 28, 2009 12:49 AM
    Edited by: DEVISARASWATHI on Jan 28, 2009 1:20 AM

  • Javax.naming.NameNotFoundException: java:comp/UserTransaction not found

    Hi,
    trying to obtain UserTransaction from client:
    UserTransaction t = (UserTransaction)context.lookup("java:comp/UserTransaction");
    but I get this error:
    javax.naming.NameNotFoundException: java:comp/UserTransaction not found
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:164)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    Any help?

    The problem has been resolved. It was a usage-related issue. Thank you all.

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

Maybe you are looking for

  • Hard drive upgrade to my Macbook Pro - early 2008

    I want to upgrade my hard drive and saw this one on Amazon.  Western Digital WD Scorpio Black 750 GB SATA 3 GB/s 7200 RPM 16 MB Cache Internal Bulk/OEM 2.5-Inch Mobile Hard Drive.  Can anyone tell me if this will work ok with my setup. thanks DJH

  • New News about slots?  RAM: Is more really better?

    Hi, Ok, two questions in one post but if I can save one tree,... it's worth it... Has there be any new consensus regarding filling one's RAM slots versus leaving 2 empty? I've done my own limited testing in PS4 and AE4 and it seems to make no differe

  • HT201263 iPhone update ends with unknown error occured (14)

    And not only this - it keeps showing the USB - iTunes picture on the screen of the phone. I can not go any forward nor backward. Totally stuck. My first negatuve experience with Apple is really frustrating. I have tried also all of the recommendation

  • I could use some hlep with a simple script to add a contact to a group

    Aloha, I am using Apple's Mail. I have a special email address set up (add-hiker@...) to add someone to my group of hiking friends in my address book. I would like to automate the process. Can someone please give me some guidance? I am a strong progr

  • IOS SSL Vulnerability

    Can anyone point me to the right tech doc that discusses the SSL flaw? My iPod Touch runs the latest version of iOS 5 and I refuse to update to iOS 6.1.6. Does the flaw affect any version of iOS 5?