How to get rid of  "javax.naming.NoInitialContextException"

Hi,
Iam learning ejb. I was practicing the stateless session bean. I wrote a sample hello world application. While executing the client am getting the following error.
{color:#ff0000}Exception in thread "main" 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(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at hw.HelloClient.main(HelloClient.java:20){color}
My Client program:
{color:#ff0000}package hw;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.*;
import java.util.*;
public class HelloClient {
public static void main(String[] args)throws Exception {
Properties prop = System.getProperties();
Context ctx= new InitialContext(prop); {color}{color:#ff0000}{color:#800000}// (Line no :20) here only error is pointing
{color:#ff0000}Object obj = ctx.lookup("HelloHome");
HelloHome home = (HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}{color}{color}
{color}
please suggest me a solution. what has gone wrong!!

At a guess, I would say you "Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file". But I'm just guessing.

Similar Messages

  • Javax.naming.NoInitialContextException - jndi.properties

    I created an Enterprise application and deployed an Ejb project to the JBoss server.When I try to connect to the JNDI like this:
    Object o = initialContext.lookup(JNDI_NAME); I get this exception:
    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
    I put the jndi.properties file both into the client app and the bean project, near the .java files.
    here is the jndi.properties file:
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=http://localhost:1099
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    I'm really confused...
    thanks..

    xyzt wrote:
    I put the jndi.properties file both into the client app and the bean project, near the .java files.
    here is the jndi.properties file:
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=http://localhost:1099
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    I think that goes in
    ${JBOSS_HOME}/server/default/deploy/jms/jms-ds.xml

  • 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

  • I've got OSX/Genieo.A virus on my mac and don't know how to get rid of it and why I have it

    I've got OSX/Genieo.A virus on my mac and don't know how to get rid of it and w I have it

    There is no need to download anything to solve this problem.
    You installed the "Genieo" malware. The product is a fraud, and the developer knowingly distributes an uninstaller that doesn't work. I suggest the procedure below to disable Genieo. This procedure may leave a few small files behind, but it will permanently deactivate the malware (as long as you never reinstall it.)
    Malware is always changing to get around the defenses against it. These instructions are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data before proceeding.
    Step 1
    Triple-click anywhere in the line below on this page to select it:
    /Library/Frameworks/GenieoExtra.framework
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.
    If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder should open with an item named "GenieoExtra.framework" selected. Move that item to the Trash. You'll be prompted for your administrator password.
    Move each of these items to the Trash in the same way:
    /Applications/Genieo.app
    /Applications/Reset Search.app
    /Applications/Uninstall Genieo.app
    /Library/LaunchAgents/com.genieo.completer.update.plist
    /Library/LaunchAgents/com.genieo.engine.plist
    /Library/LaunchAgents/com.genieoinnovation.macextension.plist
    /Library/LaunchDaemons/com.genieoinnovation.macextension.client.plist
    /Library/PrivilegedHelperTools/com.genieoinnovation.macextension.client
    /usr/lib/libgenkit.dylib
    /usr/lib/libgenkitsa.dylib
    /usr/lib/libimckit.dylib
    /usr/lib/libimckitsa.dylib
    ~/Library/Application Support/com.genieoinnovation.Installer
    ~/Library/LaunchAgents/com.genieo.completer.download.plist
    ~/Library/LaunchAgents/com.genieo.completer.update.plist
    If there are other items with a name that includes "Genieo" or "genieo" alongside any of those listed above, move them as well. Some of these items will be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    Restart and empty the Trash. Don't try to empty the Trash until you have restarted.
    Step 2
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including ones called "Genieo" or "Omnibar," and any that have the word "Spigot" or "InstallMac" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    Your web browser(s) should now be working, and you should be able to reset the home page and search engine. If not, stop here and post your results.
    Make sure you don't repeat the mistake that led you to install this trojan. Chances are you got it from an Internet cesspit such as "Softonic" or "CNET Download." Never visit either of those sites again. You might also have downloaded it from an ad in a page on some other site. The ad has a large green button labeled "Download" or "Download Now" in white letters. The button is designed to confuse people who intend to download something else on the same page. If youever download a file that isn't obviously what you expected, delete it immediately.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that this Internet criminal has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    Finally, be forewarned that when Genieo is mentioned on this site, the attacker sometimes shows up under the name "Genieo support." He will tell you to run a fake "uninstaller." As he intends, the uninstaller does not completely remove the malware, and is in fact malware itself.

  • How to get rid of the weblogic.kernel.Default errors and warning?

    Hi there,
    When i'm running my application deployed on WLS8.1 SP3 and the application is running fine, but the following error and warnings were thrown.
    2004-08-05 11:26:30,453 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] ERROR com.bea.wlw.runtime.core.util.Config - Failed to obtain connection to datasource=cgDataSource, using generic DB properties
    <Aug 5, 2004 11:26:30 AM SGT> <Error> <WLW> <000000> <Failed to obtain connection to datasource=cgDataSource, using generic DB properties>
    2004-08-05 11:27:12,281 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN org.apache.jcs.config.OptionConverter - Could not find value for key jcs.default.elementattributes
    2004-08-05 11:27:12,282 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN org.apache.jcs.engine.control.CompositeCacheConfigurator - Could not instantiate eAttr named 'jcs.default.elementattributes', using defaults.
    2004-08-05 11:27:12,308 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN org.apache.jcs.config.OptionConverter - Could not find value for key jcs.system.groupIdCache.elementattributes
    2004-08-05 11:27:12,308 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN org.apache.jcs.engine.control.CompositeCacheConfigurator - Could not instantiate eAttr named 'jcs.system.groupIdCache.elementattributes', using defaults.
    2004-08-05 11:27:12,386 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN org.apache.jcs.config.OptionConverter - Could not find value for key jcs.region.CodeTableCache.elementattributes
    2004-08-05 11:27:12,386 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN org.apache.jcs.engine.control.CompositeCacheConfigurator - Could not instantiate eAttr named 'jcs.region.CodeTableCache.elementattributes', using defaults.
    2004-08-05 11:27:13,527 [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] WARN com.bea.wlw.netui.script.el.NetUIReadVariableResolver - Could not create a ContextFactory for type "com.bea.netuix.servlets.script.PortalVariableResolver$PortalContextFactory" because the ContextFactory implementation class could not be found.
    May i know why this is so? How to get rid of these error and warnings?
    Thanks
    Derek
    Message was edited by derekchan at Aug 4, 2004 8:41 PM
    Message was edited by derekchan at Aug 4, 2004 8:42 PM

    you didnt seem to have configured the datasource / connection pool / database control with proper db properties
    you should check your configuration to see if you have done it right and then you should check your application and the properties settings in the controls to ensure they are right.

  • Exception in thread "main" javax.naming.NoInitialContextException: Need to

    Hey,
    I am exploring the technique 'JMS'. I found an sample code on the Internet (https://www.redhat.gl/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configuration_Guide/JMS_Examples-A_Point_To_Point_Example.html).
    But unfortunately, by running the code on my local computer, I got an NoInitialContextException (Exception in thread "main" javax.naming.NoInitialContextException: Need to ...Application resource file: java.naming.factory.initial). After searching on the Internet, I discovered I need to configure some JNDI values. But, also after passing on the variables to the class by parameter (-Djava.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactory), I still get the same error.
    What have I forgotten? Hope someone can help. Thanks!
    Tongue78.
    public void setupPTP()
    throws JMSException,
    NamingException
    InitialContext iniCtx = new InitialContext();
    Object tmp = iniCtx.lookup("ConnectionFactory"); // exception occurs here..
    QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
    conn = qcf.createQueueConnection();
    que = (Queue) iniCtx.lookup("queue/testQueue");
    session = conn.createQueueSession(false,
    QueueSession.AUTO_ACKNOWLEDGE);
    conn.start();
    ....

    Refer to the Sun App Server documentation.
    http://docs.sun.com/source/819-0079/dgacc.htmlIt lists down the steps you need to follow.

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

  • Somehow i have got mackeeper and the smartsearchnet on mac air. I do not know how to get rid of it! please help me

    I have got mackeeper and smart search.net on my Mac air. I am new to mac's so i am so lost in how to get rid of things. Im not sure how i got it but i just want it gone now   mac book is only a couple months old so running all latest programmes on it. Can anyone help me please?

    You may have installed a variant of the "VSearch" ad-injection malware. Follow Apple Support's instructions to remove it.
    If you have trouble following those instructions, see below.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable string of characters, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes it's a meaningless string such as "e8dec5ae7fc75c28" rather than a word. Sometimes the string is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the string something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same string you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name; it doesn't vary. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • I keep getting a community toolbar error message. I am running Yosemite. I have no idea what it is referring to. Any help on how to get rid of it?

    I am getting a community toolbar error message on Safari. Does anyone know how to get rid of it? I am running Yosemite. Thank you!

    To remove the "Conduit" spyware, take the steps below.
    Triple-click the line below on this page to select it:
    ~/Library/Application Support/Conduit
    Copy the selected text to the Clipboard by pressing the key combination command-C. From the Finder menu bar, select
              Go ▹ Go to Folder…
    Paste into the box that opens (command-V), then press return. A Finder window should open with a folder named "Conduit" selected. If it does, delete the selected item.
    Repeat with these lines:
    ~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin /Applications/Toolbars
    You may be prompted for your login password. Next, copy this line:
    /Library
    Select Go to Folder… again and paste. Don't delete the Library folder. Delete only the following items inside it, if they exist.
              Application Support/Conduit
              InputManagers/CTLoader
              LaunchAgents/com.conduit.loader.agent.plist
              ScriptingAdditions/ct_scripting.osax
    Close the Finder windows you opened. Log out and log back in.
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Remove any extensions with the word "Conduit" in the description, and any others you don't know you need. If in doubt, remove all of them.

  • EJB ERR: Namingexception caught:javax.naming.NoInitialContextException

    Hi,
    I am trying to deploy a sample ejb on Jboss and trying to call it from a client.
    I am getting the following error.
    *********Before LookUP*********
    Namingexception caught:javax.naming.NoInitialContextException: Need to specify c
    lass name in environment or system property, or as an applet parameter, or in an
    application resource file: java.naming.factory.initial
    This is my client code for the ejb where I have specified the INITIAL_CONTEXT_FACTORY and PROVIDER_URL..
    Am I missing something here?
    Is there any other way to go about this. Any help would be greatly appreciated.
    Thanks and Regards,
    Ajith
    THE CLIENT CODE IS AS GIVEN BELOW
    package simple_bean_client;
    import javax.ejb.*;
    import simpleBean.*;
    import javax.naming.Context;
    import java.util.Properties;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    class SalaryClient
         public static void main(String args[])
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
              env.put(Context.PROVIDER_URL, "localhost:1099");
              env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
         /*Properties pro = System.getProperties();
         pro.put( "java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory" );
         pro.put( "java.naming.provider.url","localhost:1099" );*/
              try{
                   InitialContext ctx=new InitialContext();
                   System.out.println("*********Before LookUP*********");
                   Object objRef=ctx.lookup("SalaryHome");
                   System.out.println("*********After LookUP*********");
                   SalaryHome home=(SalaryHome)javax.rmi.PortableRemoteObject.narrow(
                   objRef,SalaryHome.class);
                   Salary bean=home.create();
                   System.out.println("monthly net salary:"+bean.calculateSalary(28000,2,500));
              }catch(javax.naming.NamingException ne){
                   System.out.println("Namingexception caught:"+ne);
              }catch(javax.ejb.CreateException ce){
                   System.out.println("Create exeption caught:"+ce);
              }catch(java.rmi.RemoteException re){
                   System.out.println("Remote Exception caught:"+re);               
         }//closing main
    }//closing the class

    Found this . . .
    The following works for JBOSS, jndi.properties -file:
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=jnp://your.host.com:1099
    The client code is as follows:
    Properties prop = new Properties();
    InputStream is = this.getClass().getClassLoader().getResourceAsStream(jndi_property_file);
    prop.load(is);
    Context ctx = new InitialContext(prop);
    anEJBHome =(EJBHome)PortableRemoteObject.narrow(ctx.lookup(homeClass.getName()),homeClass);

  • Javax.naming.NoInitialContextException: Cannot instantiate

    IHi,
    Iam trying to run my first application on WEBLOGIC SERVER 8.1. I have already deploed class file on server.i have already set path for my client jar .
    When I use my client run on JDK to access the application.
    I got following errror::::
    Naming Error: catch block of getInitalContext()
    javax.naming.NoInitialContextException: Cannot instantiate
    class: weblogic.jndi.WLInitialContextFactory [Root exception is
    java.lang.ClassNotFoundException:
    weblogic.jndi.WLInitialContextFactory]
    from catch block of jMenuItem1
    error from NamingException.getMessage()is: Cannot instantiate
    class: weblogic.jndi.WLInitialContextFactory
    HERE IS THE CODE FOR CLIENT:
    import java.awt.event.*;
    import javax.rmi.*;
    import java.rmi.*;
    import javax.swing.event.*;
    import javax.swing.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    import java.util.Hashtable;
    import java.util.Properties;
    import javax.ejb.CreateException;
    import org.omg.CosNaming.*;
    import java.util.Hashtable;
    import weblogic.jndi.*;
    //import javax.weblogic.jndi.WLInitialContext;
    public class Client {
    public static void main(String[] args){
              Context context= null;
              Hashtable h = new Hashtable();
              h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              h.put(Context.PROVIDER_URL,"t3://localhost:7001");
              try{
                   context = new InitialContext(h);
                        Object obj = context.lookup("ServerObject"); //Server ejb-name
    System.out.println(obj.getClass());
              ServerHome serverhome =(ServerHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("ServerObject"),ServerHome.class);
              Server server = serverhome.create();
              String Message = JOptionPane.showInputDialog("Enter Your Message");
              JOptionPane.showMessageDialog(null, server.performAction(Message) );
         catch(Exception e){
              JOptionPane.showMessageDialog(null ,"Exception is " +e);
    code for bean:::::::
    //package EJBExample;
    import javax.ejb.*;
    import java.rmi.*;
    import javax.swing.*;
    public class ServerBean implements SessionBean
    private SessionContext stx;
    //In following five methods create is by contract others to be implemented by Container
    public void ejbCreate(){}
    public void ejbRemove(){}
    public void ejbActivate(){}
    public void ejbPassivate(){}
    public void setSessionContext(SessionContext ctx)

    hi
    Am facing the problem whenever i run the client jsp definitly run the first time but next time i get the particular error please let me clear about this error i m attaching the client code and also error screen..
    client jsp
    <%UserInfoSB objUserInfoSB;
         System.out.println("########## 2 #########");
         Properties props= System.getProperties();
         System.out.println("########## 3 #########");
         Context ctx = new InitialContext(props);
         System.out.println("########## 4 #########");
         props.put(Context.INITIAL_CONTEXT_FACTORY, "Weblogic.jndi.WlInitialContextFactory");
         props.put(Context.PROVIDER_URL,"t3://localhost:7001");
         System.out.println("########## 5 #########");
         UserInfoSBHome objUserInfoSBHome =(UserInfoSBHome) ctx.lookup("UserInfoSBHome");
         System.out.println("########## 6 #########");
         objUserInfoSB = objUserInfoSBHome.create();
         System.out.println("########## 7 #########");
         //objUserInfoSB.processInterfaceUserHistoryDetails(objUserDetailVO);
    ArrayList alResult = objUserInfoSB.processInterfaceGetAllUserDetail();
         objUserInfoSB.remove();
         System.out.println("########## 8 #########");
    %>
    It is error which i am facing plz let me clear
    NoInitialContextException: Cannot instantiate class: Weblogic.jndi.WlInitialContextFactory. Root exception is java.lang.ClassNotFoundException: Weblogic.jndi.WlInitialContextFactory
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:186)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:62)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:41)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:217)
         at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:42)
         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:649)
         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
         at javax.naming.InitialContext.init(InitialContext.java:219)
         at javax.naming.InitialContext.(InitialContext.java:195)
         at jsp_servlet._jsp._epfindia._mydata.__userdisplayall._jspService(__userdisplayall.java:374)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)

  • How to get rid of pop-ups on my macBook air?

    One of my roommates recently downloaded torrent on my macbook air to watch a movie, and since then I have been experiencing popups every time I open a new page on safari. Also, my search engine has switched to something known as search-quick? I've tried a few different mac detox sites to no avail. Very frustrated. Any suggestions on how to get rid of this "virus" and pop-ups would be much appreciated!

    There is no need to download anything to solve this problem. You may have installed a variant of the "VSearch" ad-injection malware.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable word, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes the word is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the word something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same word you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • How do get rid of the google search box when I first open Firefox?

    How do get rid of the google search box when I first open Firefox?

    Firefox 4 and later versions use a new build-in home page named <b>about:home</b> with a Google search bar on it.
    That about:home page only shows some snippets and has a button to restore the previous session if applicable.
    If you want a home page with extras then set another page as the home page like www.google.com as used in Firefox 3 versions.
    *https://support.mozilla.com/kb/How+to+set+the+home+page
    See also:
    *Tools > Options > General > Startup: "When Firefox Starts": "Show my home page" "Show a blank page"

  • Jndi.properties - javax.naming.NoInitialContextException

    hi
    i'm new to netbeans (5.5) and the Sun 9 appserver. I've been using JBoss & Eclipse to date.
    I'm getting the javax.naming.NoInitialContextException and I believe it's because I'm not using jndi.properties like in jboss.
    The problem is that I cannot seem to find where it should go and what it should look like.
    Can someone please help ?
    Thanks

    All the documentation you need is here:
    http://docs.sun.com/app/docs/coll/1343.3
    I would particularly point you to http://docs.sun.com/app/docs/doc/819-3659/6n5s6m5bn?a=view

  • Can anyone tell me how to get rid of tlb search? it unfortunately entered into my mac. Whenever I use safari, a pop-up window opens with some ads. Please help me to find a way to remove this malware.

    Can anyone tell me how to get rid of tlb search? It unfortunately entered into my mac. Whenever I use safari, a pop-up window opens with some ads. Please help me to find a way to remove this malware.

    You installed the "DownLite" trojan, perhaps under a different name. Remove it as follows.
    Malware is constantly changing to get around the defenses against it. The instructions in this comment are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "VSearch" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    /Library/LaunchDaemons/Jack.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /Library/PrivilegedHelperTools/Jack
    /System/Library/Frameworks/VSearch.framework
    ~/Library/Internet Plug-Ins/ConduitNPAPIPlugin.plugin
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot" or "Conduit" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    This trojan is distributed on illegal websites that traffic in pirated movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect much worse to happen in the future.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the DownLite developer has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight is inexcusable and has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

Maybe you are looking for