Close a running application from java........

Hi all
I have opened an application say MSWORD from my java class using Runtime.getRuntime(), Now on close button i need to close the application and on the save button of the application i even want to save the application from java command
The question is HOW????
please reply,
Thanx,
Amitt

can I open the konsole from java??Yes.
First you must figure out how to do that from the command line yourself. That has nothing to do with java.
Note that that how you do that MUST account for the fact that the "command line" is actually a shell. Some commands must be run by running the shell as the actual command and then passing the desired command as an option to the shell (the actual command.)
Again you can google for examples.

Similar Messages

  • How do I close all running applications before launching my java app?

    Does anyone know of anyway I can code to close all running applications, even if I don't know the process names to begin with?
    Is there open source code than anyone has written to do this. Other applications interfere with my app and I need to terminate all running apps/processes before launching my app. Please advise.

    I see we aren't all on the same wavelength here, let
    me rephrase:
    How can I write JAVA code that will terminate all
    running applications so as not to interfere with the
    security of my application's content, as it is
    extremely sensitive content and I need to know that
    no applications are running which could defeat it.
    I would like my application to terminate all running
    applications, is this possible to write in java code.Do you consider all the processes running in the background (launched by the OS) as part of "all running applications"? Do you not consider the OS itself as part of it as well? You're really barking up the wrong tree. But go ahead, I know you won't be convinced regarding the wonkiness of your thinking.

  • Running javafx from java without jfx sdk installed

    I need to run jfx application on client's computer(without jfx sdk installation and outside the browser) from a java code.
    I also need to path parameters from java to javafx and to get return value.
    What i did:
    1) put a.html, a_browser.jnlp and a.jar files on the server.
    2 )run javafx application from java by swt.browser.setUrl(server address/a.html)
    To pass parameter:
    I know single option to pass parameter - create a1.html, a2.html ... an.html for each possible parameter value and javafx will read this parameter by FX.getArgument("parameter"). This solution is ok in my case. But i don't know how to return value back to java.
    thank you

    Problem solved. I used
    Context context = FXLocal.getContext();
    FXClassType instance = context.findClass("loginscrean.PlayerAdapter");
    ObjectValue obj = (ObjectValue)instance.newInstance();
    PlayersObserver po = (PlayersObserver)obj.asObject();
    po.RestartPlayersList();
    in java method which was trying to connect and in RestartPlayersList(); I used FX.deferAction(function() {  method content  });
    I dont't know whether it is a right way of doing it but seems to be working.
    P.S. The reason why application hanged was being careless with synchronization which as a result caused a dead lock.

  • Launching applications from java code

    I have found a solution to launch applications from java.I thought this will be useful for programmers who want to open a
    1. Browser
    2. Player
    3. Files etc.
    There are 2 solutions :
    I)To use a known application :
    eg: to open windows media player
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1] = "/C";
    cmd[2] = "START MPLAYER2.exe "+mediaURL+" /PLAY /CLOSE /FULLSCREEN";
    //eg: mediaURL = "\"D:/project/songs/track1.mp3\""
    // /PLAY /CLOSE /FULLSCREEN this option can be used only for windows media player
    // for any other application use cmd[2] as START apl.exe //apl can be any windows application
    Process p = Runtime.getRuntime().exec(cmd);
    II) To use a default application:
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
    // url can be any url
    ref: [http://forums.sun.com/thread.jspa?threadID=5203313|http://forums.sun.com/thread.jspa?threadID=5203313]
    [http://www.ericphelps.com/batch/rundll/|http://www.ericphelps.com/batch/rundll/]
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????

    To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
    And make up your mind what file type you're having a problem with. Maybe .asx doesn't have a file association on your computer.
    This works just fine for .m3u:import java.awt.Desktop;
    import java.io.File;
    import java.io.IOException;
    public class Playlist {
       public static void main(String[] args) {
          try {
             Desktop.getDesktop().
                   open(new File("E:/Music/Playlists/test.m3u"));
          } catch (IOException ex) {
             ex.printStackTrace();
    }db
    edit Did you try searching the net for the error you got? ("Invalid menu handle")
    Edited by: Darryl.Burke

  • Crashes when running applications from network share - "Windows cannot access the file for one of the following reasons"

    Hi,
    starting a couple of weeks ago, we get the following error(s) when running applications from a network share. We don't know what causes this, we are not aware of any major changes in our network infrastructure or client/Server configuration. We did upgrade
    a lot of machines to Windows 8, but the issue also occurs on older Win7 computers.
    We figured out a workaround though: The applications run fine when launching from a FQDN share (like
    \\share.domain.Company.com) and only cause problems when running from
    \\share directly. They have worked fine for years without FQDN though.
    Any ideas?
    Error Details (the Kind of error differs greatly):
    # 1 #
    Log Name: Application
    Source: Application Error
    Date: ...
    Event ID: 1005
    Task Category: (100)
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: vmDEV
    Description:
    Windows cannot access the file for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program XYZ
    because of this error.
    Program: XYZ
    File:
    The error value is listed in the Additional Data section.
    User Action
    1. Open the file again. This situation might be a temporary problem that corrects itself when the program runs again.
    2. If the file still cannot be accessed and
    - It is on the network, your network administrator should verify that there is not a problem with the network and that the server can be contacted.
    - It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.
    3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt, type CHKDSK /F, and then press ENTER.
    4. If the problem persists, restore the file from a backup copy.
    5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or computer hardware vendor for further assistance.
    Additional data
    Error value: C000020C [ also seen with code C00000C4]
    #2 (German error Messages from now on, we only use German OSes, the above english one is translated based on similar error Messages I found on the web) #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea67c3
    Name des fehlerhaften Moduls: clr.dll, Version: 4.0.30319.34014, Zeitstempel: 0x52e0b784
    Ausnahmecode: 0xc0000006
    Fehleroffset: 0x00026549
    ID des fehlerhaften Prozesses: 0x13ac
    Startzeit der fehlerhaften Anwendung: 0x01d055a854d36445
    Pfad der fehlerhaften Anwendung: \\share\application.exe
    Pfad des fehlerhaften Moduls: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Berichtskennung: 949ea933-c19b-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    Anwendung: XYZ.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: Ausnahmecode c0000006, Ausnahmeadresse 720B6549
    Stapel:
    # 3 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei SP.Forms.AutoCompleteSelectionBase.OnEnter(System.EventArgs)
       bei System.Windows.Forms.Control.NotifyEnter()
       bei System.Windows.Forms.ContainerControl.UpdateFocusedControl()
    # 4 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei System.IO.UnmanagedMemoryStream.ReadByte()
       bei System.IO.BinaryReader.ReadByte()
       bei System.IO.BinaryReader.Read7BitEncodedInt()
       bei System.Resources.ResourceReader._LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.ResourceReader.LoadObject(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean, Boolean)
       bei System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean)
       bei System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo, Boolean)
       bei System.Resources.ResourceManager.GetStream(System.String, System.Globalization.CultureInfo)
    # 5 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei System.Reflection.RuntimeParameterInfo.get_Name()
       bei System.Diagnostics.StackTrace.ToString(TraceFormat)
       bei System.Environment.GetStackTrace(System.Exception, Boolean)
       bei System.Exception.GetStackTrace(Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString()
    # 6 #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea834f
    Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 6.3.9600.17278, Zeitstempel: 0x53eeb460
    Ausnahmecode: 0xe0434352
    Fehleroffset: 0x00012f71
    ID des fehlerhaften Prozesses: 0xa68
    Startzeit der fehlerhaften Anwendung: 0x01d0559cb7ec4ed6
    Pfad der fehlerhaften Anwendung: \\share\XYZ.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\KERNELBASE.dll
    Berichtskennung: 010514d0-c190-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    # 7 #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea7a6e
    Name des fehlerhaften Moduls: ntdll.dll, Version: 6.3.9600.17630, Zeitstempel: 0x54b0d74f
    Ausnahmecode: 0xc0000006
    Fehleroffset: 0x0006db27
    ID des fehlerhaften Prozesses: 0x18dc
    Startzeit der fehlerhaften Anwendung: 0x01d0559cb08529c3
    Pfad der fehlerhaften Anwendung: \\share\xyz.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\ntdll.dll
    Berichtskennung: ef389186-c18f-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:

    Hi,
    >>The applications run fine when launching from a FQDN share
    It sounds like a DNS suffix issue. When this issue occurs, please try to ping share on the client, then check if the corresponding IP address is correct. If the IP address is wrong, please adjust your settings of DNS to make sure that the client can resolve
    the share correctly.
    If it's very hard to change the settings of the DNS for some reason, as a work around, we can add the entry into the clients' hosts file.
    Best Regards.
    Steven Lee Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How to call a VB application from Java

    Hi,
    does anybody know how to call a VB application from java.
    Would appreciate if you can provide me with an example.
    thanks

    try exec()ing the cad program with the name of the file as a command line parameter...
    Runtime.getRuntime().exec("CADProg.exe Test.prt");
    i have no clue if this will work but it seems like it's worth a try.

  • I have iphone 3g, phone is working very slow and even i can not been able to close the running application

    i have the Iphone 3g, OS 4.3.2.1
    My Phone is working terribly slow, and even i can not been able to close the running application
    for closing application Every time i have to restart the phone
    can any 1 help me solve this problem
    with best regards,
    prakash

    You must have an iPhone 3GS then if its running 4.3.2
    The iPhone 3G can only update to 4.2.1 iOS.
    Reset the iPhone
    Hold the top silver button and the home button (just below the display of the iPhone)
    Do this at the same time for about 10 seconds until you see an Apple.
    The iPhone then should take 1-3 minutes to restart and it should be fine

  • Running a Linux application from Java

    Hy,
    I am working at a faculty project and I need your help
    What I want to do is by clicking a button, in a JFrame I want to open an application ,for example Mysql Query browser. I am using FC 6 and Netbeans 5.5
    Can you help me??
    Thanks

    can I open the konsole from java??Yes.
    First you must figure out how to do that from the command line yourself. That has nothing to do with java.
    Note that that how you do that MUST account for the fact that the "command line" is actually a shell. Some commands must be run by running the shell as the actual command and then passing the desired command as an option to the shell (the actual command.)
    Again you can google for examples.

  • How to run Other application from Java

    I want to run other applications such as IE.exe, notepad.exe from Java? How can I run?

    Dear Friend, the following is the code to open IExplorer from Java Program
    class RunTimeTest {
    public static void main(String args[]) {
    try {
    Runtime.getRuntime().exec("C:\\Program Files\\Internet Explorer\\IEXPLORE.exe");
    catch(Exception e) {
    [\code]
    ALL THE BEST
    Shiva                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Running JMS simple application from java standalone program stucks

    Hi All, i`m new to JMS service, and tried to code a simple application from the J2EE guide. They use standalone j2ee client application there, and i did not
    dound any way to debug it from eclipse .. so i have coded following standalone app (not j2ee client JAR) to produce simple messages
    public class producerMain {
         public static void main(String argv[]) throws NamingException, JMSException
              Properties jndiProp = new Properties();
              jndiProp.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
              jndiProp.put(javax.naming.Context.PROVIDER_URL, "localhost:3920");
              InitialContext context =new InitialContext(jndiProp);
              ConnectionFactory factory = (ConnectionFactory)context.lookup("sashaConnectionFactory");
              Queue queue = (Queue)context.lookup("jms/Queue");
              System.out.println("Got here");
              Connection connection = factory.createConnection();
    Session session = connection.createSession(
    false,
    Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer(queue);
    TextMessage message = session.createTextMessage();
    for (int i = 0; i < 5; i++) {
    message.setText("This is message " + (i + 1));
    System.out.println("Sending message: " + message.getText());
    producer.send(message);
    producer.send(session.createMessage());
    producer.close();
    session.close();
    connection.close();
    factory = null;
         context.close();
         System.out.println("Quiting application");
    application works .. it sends a messages .. but it does not quit .. (dozens of new threads get opened, besides the main thread, which quits, but other threads
    does not quit .. and the application stucks .. )
    Does anyone know, why does it stuck .. what are those threads ? and why does not they finish ?
    Thanks, Regards Sasha.

    Thanks.
    changing to
    exp.append("\n");and flushing the writer stream and closing the stream fixed the problem.
    Why do we have to flush the stream?
    and, why do we have to close the writer before reading? what if I want to continue writting in to the writer?
    thanks again.

  • Running application from installer in vista prevents drag and drop

    Running a desktop application from Vista and Windows 7 through a wizzard, prevents doing a drag and drop from the desktop or another windows explorer to our java application.
    We are using a windows wizard to install the application once it finishes it launches the application within the application the drag and drop work perfectly, but I can not drag from desktop or external windows explorer into my application, dragging from the application to the desktop or to another windows explorer is working fine.
    If we run the application by clicking directly on the exe file (generated by the installer app), the application launches and do not present the anomaly (Drag and drop into a out side the applications work fine).
    So the issue might be related to the way the installer executes the application, that maybe have a different configuration or windows permissions are not set correctly when started by the installer.
    Both ways of launching the application have the same working directory the only difference i found was in the system environment (System.getenv()) the one that works has a SESSIONNAME key with a CONSOLE value in it, could this be the problem?
    Any idea on how to workaround this issue or some idea to look at the installer will be kindly appreciated.

    One idea is to use [Java Webstart|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp] *(<- link)* as your installer. It might not fix the D'n'D problem, but at least if you get to the point of telling Sun about it, they will care (at least) one iota about fixing it.

  • How to close a running exe through java code

    hai friends,
    i need to close a running exe file through code...
    i tried
    Runtime r;
    Process p;
    try {
                r = Runtime.getRuntime();
                p=r.exec("d:\\aaa");
            } catch (IOException ex)
    p.destroy();but its not closing the application properly...
    pls anyone help me

    ksnagendran26 wrote:
    how to exit the application which is running in quick launchWell my guess, since you are not providing specific information, is that java is in fact closing the application that it ran. What you are seeing is some other application that was spawned by whatever it is that you did. And java isn't going to close that because it doesn't even know it exists.

  • Can not Run Application from Client PC.

    Hi,
    I have a pc running on WinXP called "PC1". I have installed Oracle9i Database, Developer Suite 10g and services. I can run my application smoothly on "PC1".
    My problem is that i can not run my application from client pc running on WinXP called "PC2". I have installed JINIT.exe on "PC2". I started OC4J also on "PC2". IE shows "Page can not be displayed" message.
    What settings i have to do to run my application on Client i.e. "PC2".
    Waiting for any kind of help.
    Thanks.

    Hi all,
    Thanks for the reply.
    I have already install same JINI.exe on Client "PC2" which is on Server "PC1". And the version of the IE and JINI are same on Server "PC1" and Client "PC2".
    I start OC4J on Server.
    Should i make some settings on JINI Control Panel on Client ? Like Proxies.
    I have enable all check box on "Basic" Tab of JINI.
    Further, On client, the check Box of "Show Java Console" is also on, but when i try to connect my application from IE, the Java console does not appear.
    I would like to inform u that, when i start additional Proxy driver like Analog proxy on my server and then i give that proxy address and port in Client IE connection LAN setting, i am able to run my application from that Client.
    But i think that is not the solution.
    Waiting for reply.

  • Executing a Java application from JAVA

    Hello all,
    I have a problem spawning a Java IRC client from another Java application. The client only manages to execute itself properly [join a specific channel] once the original parent application has been closed. Any ideas?
    The code is as follows:
    public void run(){
         String[] cmd = {"java", "IRC"};
         try {
               Process p = Runtime.getRuntime().exec(cmd);
              p.waitFor();
         } catch (Exception exc){
              print ("Could not run the IRC session file" + exc);
      }

    Well, if you ask me, it's not very good Java style to try to access the command line to run ANOTHER Java application.
    My suggestion is simply call the IRC program's methods to get it started. Don't bother with Runtime.exec.

  • Error while running EJB from java client on JBOSS

    Hi
    As i am new to EJB i have created a helloworld application in ejb which is working fine when i try to call it from servlet but when i try to invoke the same ejb from java client (i.e from diff jvm) on jboss i got the following error:
    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]]
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1399)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.gl.TestClient.main(TestClient.java:39)
    Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254)
         at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370)
         ... 4 more
    Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused]
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228)
         ... 5 more
    Caused by: java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at java.net.Socket.connect(Socket.java:469)
         at java.net.Socket.<init>(Socket.java:366)
         at java.net.Socket.<init>(Socket.java:266)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
         at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
         at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224)
         ... 5 more
    Following is my code:
    Home Interface:
    package com.gl;
    import javax.ejb.CreateException;
    public interface testHome extends EJBHome {
         String JNDI_NAME = "testBean";
         public     test create()
         throws java.rmi.RemoteException,CreateException;
    Remote Interface:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBObject;
    public interface test extends EJBObject {
         public String welcomeMessage() throws RemoteException;
    Bean:
    package com.gl;
    import java.rmi.RemoteException;
    import javax.ejb.EJBException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    public class testbean implements SessionBean {
         public void ejbActivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbPassivate() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void ejbRemove() throws EJBException, RemoteException {
              // TODO Auto-generated method stub
         public void setSessionContext(SessionContext arg0) throws EJBException,
                   RemoteException {
              // TODO Auto-generated method stub
         public void ejbCreate(){}
         public String welcomeMessage(){
              return "Welcome to the World of EJB";
    ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>testBean</ejb-name>
    <home>com.gl.testHome</home>
    <remote>com.gl.test</remote>
    <ejb-class>com.gl.testbean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    jboss.xml:
    <?xml version='1.0' ?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
    <jboss>
    <enterprise-beans>
    <entity>
    <ejb-name>testBean</ejb-name>
    <jndi-name>testBean</jndi-name>
    </entity>
    </enterprise-beans>
    </jboss>
    Client code:
    package com.gl;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.rmi.PortableRemoteObject;
    public class TestClient {
         public static void main(String[] args) throws Exception{
                   try{
                   /*     Properties props=new Properties();
                        props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                        props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                        props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
                   Properties props = new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    props.put(Context.PROVIDER_URL, "localhost:1099");
                        System.out.println("Properties ok");
                        //env.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingContextFactory");
                        //env.put(Context.PROVIDER_URL,"http://localhost:8080");
                        //env.put(Context.SECURITY_PRINCIPAL, "");
                        //env.put(Context.SECURITY_CREDENTIALS, "");
                        Context ctx=new InitialContext(props);
                        System.out.println("context ok");
                        //testHome home = (testHome)ctx.lookup("testBean");
                        Object obj = ctx.lookup ("testBean");
                        System.out.println("ojb = " + obj);
                        testHome ejbHome = (testHome)PortableRemoteObject.narrow(obj,testHome.class);
                   test ejbObject = ejbHome.create();
                   String message = ejbObject.welcomeMessage();
                        System.out.println("home ok");
                        System.out.println("remote ok");
                        System.out.println(message);
                        catch(Exception e){e.printStackTrace();}
    I am able to successfully deployed my ejb on JBOSS but i m getting above error when i am trying to invoke ejb from java client.
    kindly suggest me something to solve this issue.
    Regards
    Gagan
    Edited by: Gagan2914 on Aug 26, 2008 3:28 AM

    Is it a remote lookup? Then maybe this will help:
    [http://wiki.jboss.org/wiki/JBoss42FAQ]
    - Roy

Maybe you are looking for

  • Change customer reconcilliation account

    Hi guru's, i received the requirement to report sales for 2 customers no longer as "intercompany sales" but as "sales 3rd". In our G/L we have a differentation in accounts.  Therefor I would like to change the reconcilliation account for the 2 custom

  • How to move music library from old pc to new Mac air

    How to move music library from old pc to new Mac air

  • Running OS command from PL/SQL

    Hi All, Is there any way of running a Operating System command thru the PL/SQL Procedure. I am using oracle on the Unix Platform. Do help me. Thanks In advance, Nitin Jain

  • Getting message for every record while pressing down arrow key:apps form

    Hi, when i query the form and when I am going through the records by pressing the down arrow of the keyboard I am getting the message 'Do you want to Save the records' for every record even though i did not update any record How to avoid the message?

  • No optical output with alsa after upgrade

    After doing a system upgrade, my digital audio has stopped working. I can still get sound from my headphones, and my reciever does notice when i turn the IEC958 switch on and off in GNOME volume controll. $ lsmod|grep '^snd' | column -t snd_usb_audio