Running a vi using run vi invoke method

Hello,
I have a question about the run vi invoke method.
I have a start vi and a stop vi.  When I run the start vi, it uses the run vi invoke method to call a third vi.  I want the third vi to run until I call the stop vi which sets a global causing the third vi to stop.  Now this seems to work ok when I have the third vi open.  But if the third vi is not open, it will stop running when the start vi stops.  Is there any way to make it run past the execution time of the start vi without having it open?
Thanks for any help!

The attached VIs (LV v7.1.1) will do what you describe.
Attachments:
Run Test Stop.zip ‏28 KB

Similar Messages

  • Run Time error using create_popup_to_confirm in Post_Exit Method

    Hi,
    I am trying to use the create_popup_to_confirm method to display a popup box in order to create a simple confirmation popup box. The transaction is failing with an exception. Following is the Error analysis from ST22
    An exception occurred which is explained in detail below.                      
    The exception, which is assigned to class 'CX_WDR_RT_EXCEPTION', was not caught
    and therefore caused a runtime error.
    The reason for the exception is:
    Component ID_0001000300140017 Not Found
    Nothing I tried seem to work. I even copied the following code directly from SAP Help in order to try to get the popup box working:
    DATA: l_cmp_api TYPE REF TO if_wd_component,
          l_window_manager TYPE REF TO if_wd_window_manager,
          l_popup TYPE REF TO if_wd_window,
          l_text TYPE string_table.
    l_cmp_api = wd_this->wd_get_api( ).
    l_window_manager = l_cmp_api->get_window_manager( ).
    INSERT `Data where changed`   INTO TABLE l_text.        "#EC *
    INSERT `Do you want to save?` INTO TABLE l_text.        "#EC *
    l_popup = l_window_manager->create_popup_to_confirm(
              text            = l_text
              button_kind     = if_wd_window=>co_buttons_yesnocancel
              message_type    = if_wd_window=>co_msg_type_question
              window_title    = 'Test: Popup to confirm'
              window_position = if_wd_window=>co_center ).
    l_popup->open( ).
    Now there is one thing that I am wondering that might be causing this, but I don't know for sure. I am executing this code from a Post_Exit method of a method in the COMPONENTCONTROLLER. Since enhancements are in their own container, I don't know if this may be confusing the Web Dynpro App. However the purpose of this enhancement is to show the end user a simple confirmation popup box so that they are informed that they did a particular action. Please let me know if you any ideas. Point will be awarded for helpful answers.

    hi,
    use following code.
    DATA: lt_text type string_table.
      DATA: mr_popup_window TYPE REF TO if_wd_window.
    pop a confirmation window for display purpose
    DATA: l_window_manager TYPE REF TO if_wd_window_manager,
    l_cmp_api        TYPE REF TO if_wd_component,
    l_window         TYPE REF TO if_wd_window.
    l_cmp_api        = wd_comp_controller->wd_get_api( ).
    l_window_manager = l_cmp_api->get_window_manager( ).
    append 'DO YOU WANNA SAVE DATA' to lt_text.
    CALL METHOD l_window_manager->create_popup_to_confirm
       EXPORTING
        text                 = lt_text
        button_kind          = if_wd_window=>CO_BUTTONS_YESNO
        CLOSE_BUTTON        = ' '
        WINDOW_TITLE        = 'POPUP WINDOW'
        WINDOW_WIDTH        = '25'
        WINDOW_HEIGHT       = '50'
        WINDOW_LEFT_POSITION = 10
        WINDOW_TOP_POSITION  = 10
        WINDOW_POSITION      = '25'
    RECEIVING
        result               =    mr_popup_window      .
    associated the action handling methods with the window
    DATA: view_controller TYPE REF TO if_wd_view_controller.
    view_controller = wd_this->wd_get_api( ).
    CALL METHOD mr_popup_window->SET_WINDOW_SIZE
    EXPORTING
      WIDTH   = '150'
      HEIGHT  = '150'.
    CALL METHOD mr_popup_window->subscribe_to_button_event
       EXPORTING
         button            = if_wd_window=>co_button_yes
         action_name       =   'ON_DELETE_POPUP_YES'
         action_view       =  view_controller      .
    CALL METHOD mr_popup_window->subscribe_to_button_event
    EXPORTING
      button            = if_wd_window=>co_button_no
      action_name       = 'ON_DELETE_POPUP_NO'
      action_view       =  view_controller
      is_default_button = abap_true    .
    mr_popup_window->open( ).

  • Problem in using the MBean.invoke() method

    I am using the method call:
    MBeanServer.invoke() which calls an appropriate method on the Remote MBean which is a synchronous call. However if the remote method takes longer than 5 seconds to execute, I get the following error
    javax.management.ReflectionException
         at org.jingle.jmxremote.server.RemoteDynamicMBean.invoke(RemoteDynamicMBean.java:317)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(Unknown Source)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(Unknown Source)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(Unknown Source)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(Unknown Source)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
         at com.sun.jmx.remote.ws.server.actions.JMXInvokeManagedResourceOperationAP.processAction(JMXInvokeManagedResourceOperationAP.java:80)
         at javax.management.remote.ws.JMXManagementProcessor.processManagement(JMXManagementProcessor.java:268)
         at javax.management.remote.ws.JMXManagementProcessor.processManagement(JMXManagementProcessor.java:203)
         at javax.management.remote.ws.JMXServiceEndpoint.invoke(JMXServiceEndpoint.java:127)
         at javax.management.remote.ws.JMXServiceEndpoint.invoke(JMXServiceEndpoint.java:55)
         at com.sun.xml.ws.server.provider.ProviderPeptTie._invoke(ProviderPeptTie.java:63)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.invokeEndpoint(SOAPMessageDispatcher.java:278)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher$SoapInvoker.invoke(SOAPMessageDispatcher.java:586)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:141)
         at com.sun.xml.ws.server.Tie.handle(Tie.java:88)
         at com.sun.xml.ws.transport.http.server.WSHttpHandler.process(WSHttpHandler.java:171)
         at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:119)
         at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:95)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
         at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:56)
         at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
         at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:513)
         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.InterruptedException
         at org.jingle.jmxremote.server.ResultContainer.hasException(ResultContainer.java:89)
         at org.jingle.jmxremote.server.RemoteDynamicMBean.invoke(RemoteDynamicMBean.java:306)
         ... 35 more
    Could you please help me in resolving this issue:
    Is this 5 second time out configurable?
    Is there some way I can by pass this problem?

    jingle is an implementation of the jmx-remote interface.
    The jingle implementation allows you to create an proxy of the MBeanServer on the MBean side. So the MBeanServer methods can be called using this proxy object rather than the the MBeanServerConnection object.
    The reason i am using this proxy object is because i want to register the mbean to the remote mbean server.

  • Problem with "Run Web Layout" using own template

    When I run a report (using Run Web Layout) which uses my own template (a modified version of rwblue.tdf), it outputs a plain page on the browser (as though it has no template).
    When running the same report (using Run Paper Layout), the output is as it should be.
    Can anyone help? Thank you in anticipation.

    Hi John
    Take a look at Reports product site on otn site. It has an example on how to create a web template for Reports Web View. In addtion to tdf file, for web layout, you need to have a .css file as well as a html code template.
    Hope this will help.
    Thanks
    Rohit

  • JAWIN & its generic "Invoke" method

    Hi all,
    I'm currently using JAWIN to invoke a function from a 3rd party C++ DLL.
    The C++ function takes 0 input arguments and returns an argument of type char *.
    The problem is, I'm not exactly sure how to use the generic "Invoke" method, in particular the 'instructions' argument.
    public byte[] invoke(java.lang.String instructions,
    int stackSize,
    int argStreamSize,
    byte[] argStream,
    java.lang.Object[] objectArgs,
    ReturnFlags flags)
    throws COMException
    Can anyone shed some light on this? Thanks very much in advance.

    Hi,
    Is it really a C++ DLL ?
    How have you created an instance of your C++ class ?
    I'm very interested with this since I can't do it with JNative (the new MyObject()).
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                               

  • Invoke Method: Run VI produces error when run as an application

    Hello,
    I have upgraded from LabView 7.0 to 2009. One test program uses Run VI Invoke Method to start the main UI. On LabView 7.0 it works OK , when build as an application, but with LabView 2009 it gives error 1003: Invoke Node xxx.vi <APPEND> VI Path: xxx. (I have checked that the path to "Open VI Reference" is correct.)
    When run on LabView 2009 development environment (.vi) - no problem. I used the "Convert built script.." tool to convert to LabView 2009 built specifications. I have tried numerous different variations building application with LabView 2009 (including main UI files, different setups, etc.), but no luck. If someone has any ideas...
    -timo

    Maybe it helps you for debugging:
    I checked the property for the broken arrow. You need a property node and go Select Class 'Vi Server'->'VI' (skip this in your Application but navigate to the VI via the server and feed it to the node). Then it is Execution->State.
    I need to draw some code to do it for me as well, once I'm done I'll post it here.
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • Getting class not found error running java application using OIM libraries

    Hi,
    I have created a java application in which I access OIM libraries to fetch user list and then assign user roles. As i run the application it generates exception and program crashes. However, I am using the same libraries in OIM adapters and it is working fine. Following is the exception message i am getting.
    Caused by: java.lang.NoClassDefFoundError: org/springframework/jndi/JndiTemplate
    at oracle.iam.platform.OIMClient.<init>(OIMClient.java:83)
    at RoleAssignment.RoleAssignment.getUserAndChangePassword(RoleAssignment.java:143)
    at RoleAssignment.RoleAssignment.execute(RoleAssignment.java:81)
    at RoleAssignment.RoleAssignment.main(RoleAssignment.java:36)
    ... 5 more
    Caused by: java.lang.ClassNotFoundException: org.springframework.jndi.JndiTemplate
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

    Hi,
    I resolved the problem by making spring.jar part of my executable jar file. I have added oimclient.jar, spring.jar, wlfullclient.jar, commons-logging.jar, and eclipselink.jar part of my executable jar. Now I am getting the error below. I googled it and it mentioned that i should add path of authwl.conf in my run configuration in eclipse. So i added the following line in " -Djava.security.auth.login.config=/u01/oracle/Middleware/Oracle_IDM1/server/CustomExec/authwl.conf " under the VM Arguments section of run configuration, but it continues to give the same error.
    java.lang.SecurityException: Unable to locate a login configuration
         at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:93)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
         at java.lang.Class.newInstance0(Class.java:355)
         at java.lang.Class.newInstance(Class.java:308)
         at javax.security.auth.login.Configuration$3.run(Configuration.java:247)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.Configuration.getConfiguration(Configuration.java:242)
         at javax.security.auth.login.LoginContext$1.run(LoginContext.java:237)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.login.LoginContext.init(LoginContext.java:234)
         at javax.security.auth.login.LoginContext.<init>(LoginContext.java:403)
         at Thor.API.Security.LoginHandler.weblogicLoginHandler.login(weblogicLoginHandler.java:58)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:134)
         at oracle.iam.platform.OIMClient.login(OIMClient.java:129)
         at com.infotech.tra.organization.RoleAssignment.getUserAndChangePassword(RoleAssignment.java:213)
         at com.infotech.tra.organization.RoleAssignment.execute(RoleAssignment.java:149)
         at com.infotech.tra.organization.RoleAssignment.main(RoleAssignment.java:49)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
    Caused by: java.io.IOException: Unable to locate a login configuration
         at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:250)
         at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:91)
         ... 24 more

  • Which case in LV Oper. Intf. will do "Run Selected Steps using single pass" for me?

    I added a button to simulate "Run Selected Steps", but I really want a button that will "Run Selected Steps Using Single Pass". Which case in the Complex Labview Operator Interface does this for me? What I really want is the report to be generated which happens when I use "Run Selected Steps Using Single Pass" but no report when I select "Run Selected Steps".
    Thanks!

    I figured out how to make this work.  Instead of calling the Sequence File View Manager ConnectCommand method using the Run Selected Steps button and the CommandKind_RunSelectedSteps command kind, you use the CommandKind_RunSelectedStepsUsingEntryPoints_Set command kind.  The tricky part is that before you can use the ConnectCommand method with the CommandKind_RunSelectedStepsUsingEntryPoints_Set command kind, you have to create a set of new commands.  Do this by first invoking the Application Manager method NewCommands.  This method returns an empty set of commands.  You must then add a new command to that set.  Do this by invoking the InsertKind method on the empty set of commands using CommandKind_RunEntryPointOnSelectedSteps for cmdKind, Sequence File View Manager for managerControl, -1 for insertBefore, and empty strings for currentMenuName and allMenuNames parameters.  Once you have made these calls, then you can call the Sequence File View Manager ConnectCommand method using the CommandKind_RunSelectedStepsUsingEntryPoints_Set command kind.
    The previous instructions work just the same for the Loop On Selected Steps button.  Just substitute the CommandKind_RunEntryPointOnSelectedSteps and CommandKind_RunSelectedStepsUsingEntryPoints_Set command kind constants with CommandKind_LoopEntryPointOnSelectedSteps and CommandKind_LoopOnSelectedStepsUsingEntryPoints_Set command kinds (and of course use the Loop On Selected Steps button reference instead of the Run on Selected Steps button reference when invoking the ConnectCommand method).
    There is one mystery with this solution that I haven't figured out yet, besides the fact that it is so laborious and non-intuitive to me (but at least it works).  Nowhere in any of the calls detailed above did I ever see a parameter to specify which execution entry point to use.  I am using the default sequential model entry points Test UUTs and Single Pass.  Typically you specify which entry point you want to use (such as when invoking the ConnectCommand method) in the form of an index to a set of entry points where the Test UUTs entry point corresponds to a set index of 0 and Single Pass corresponds to a set index of 1.  How did the previous calls determine which entry point to use when I didn't specify anywhere which one to use?  Do this just work because you can only run or loop on selected steps using no process model or the Single Pass entry point?

  • Pass control references to subVI using Invoke Method

    Hi guys,
    Can I use <Control Value Set invoke method> to pass some control references to a sub VI, then use the <Run VI invoke method> to run the sub VI with the previously passed data?  The control refnums are for some frontpanel controls in the Main VI.
    I was able to pass other data but the refnum didn’t work.
    Thanks

    Hi there, There are a couple examples that use the same method. Check them here:
    - Set Control Values and Trigger UI Events in Another VI        
    - Set Values and Properties of Controls in a SubVI
    - Save and retrieve front panel control values
    Alejandro | Academic Program Engineer | National Instruments

  • How to set the File Path to run a javascript using Plugin Code?

    Hi All,
    Im new to Indesign Plugin Development.Can any one help me out with my problem.
    What i want to do is to run a javascript using Plugin Code.When i went through this forum i was able to find out that i should use the IscriptRunner Class to automate this.I could also figure out that the Member Function to use is "CanHandleFile" &"RunFile".
    The first parameter in CanHandleFile & RunFile Member Function is to specify the path of the JavaScript File i suppose!I could also find out that IDFile has to used to set the file path Information.
    But im clueless how to set the Javascript FilePath using IDFile.Can any one help me how to do this?Any Code Snippets Please?
    Waiting for reply.
    Thanks
    myRiaz

    Hi,  Andreas<br /><br />  Can you explain this in detail? I found it in your post before.<br /><br />  The content of elements are returned through the Characters callback function:<br /><br />From ISaxContentHandler.h:<br /><br />/**<br />        Receives character data<br /><br />The parser will call this method to report each chunk of<br />        character data. SAX parsers may return all contiguous<br />        character data in a single chunk, or they may split it into<br />        several chunks. But all characters in any single<br />        event must come from the same external entity so the<br />        Locator provides useful information.<br /><br />Note some parsers will report whitespace using the<br />        IgnorableWhitespace() method rather than this one (validating<br />        parsers must do so).<br /><br />@param Chars The characters from the XML document.<br />        */<br />virtual void Characters(const PMString& chars) = 0; <br /><br />  What i have done is implement my own SAXContentHandlerServiceBoss, and in my file XXXSAXContentHandler.cpp, I override the fonctions StartElement, EndElement, and Characters() like below: I add the PMString xmlData to collect the file content:<br /><br />class XXXSAXContentHandler : public CSAXContentHandler<br />{<br />void XXXSAXContentHandler::Characters(const WideString& chars)<br />{<br />xmlData.Append(chars);<br />}<br /><br />void XXXSAXContentHandler::StartElement(const WideString& uri, const WideString& localname, const WideString& qname, ISAXAttributes* attrs)<br />{<br />xmlData.Append("<"); xmlData.Append(localname); xmlData.Append(">");<br />}<br />void XXXSAXContentHandler::EndElement(const WideString& uri, const WideString& localname, const WideString& qname)<br />{<br />xmlData.Append("</"); xmlData.Append(localname); xmlData.Append(">");<br />}<br /><br />}<br /><br />and in my program, I use the code below to call the fonction I overrided, but I dont know how I can get the String xmlData I defined in the XXXSAXContentHandler.cpp<br /><br />InterfacePtr<IK2ServiceRegistry> serviceRegistry(gSession, UseDefaultIID());<br /><br />InterfacePtr<IK2ServiceProvider> xmlProvider(serviceRegistry->QueryServiceProviderByClassID(kXMLParserService, kXMLParserServiceBoss));<br /><br />InterfacePtr<ISAXServices> saxServices(xmlProvider, UseDefaultIID());<br />InterfacePtr<ISAXContentHandler> saxHandler(::CreateObject2<ISAXContentHandler>(kXXXSAXContentHandlerServiceBoss));<br />saxHandler->Register(saxServices);<br />bool16 parseFailed = saxServices->ParseStream(readStream, saxHandler);<br /><br />Can you give me any help?<br /><br />Thanks and regards!

  • Cannot run a servlet using Tomcat. Urgent

    I have a webapplication which uses some jsp's and servlets. The jsp pages work fine when I use
    http://hostname:8080/MyWebapp/Filename.jsp
    However, when I developed a java servlet and put the class file in WEB-INF/classes directory of my web application and tried to access it.
    I got a resource not found error.
    The strange thing is that when I put the file in the web-inf/classes folder of examples webapplication (which comes with Tomcat) I am able to run the servlet using
    http://hostname:8080/examples/servlet/Class file
    I am not sure what is wrong.
    Can someone help me.
    Thanks in advance
    Vamsi.

    It's predictable. The Servlet and JSP specifications mandate that you cannot directly access resources under WEB-INF directory. You have to set up servlet mapping configuration in your web.xml to specify how to access the resources, both Servlet and JSP, there.
    When you copied your files in a demo webapp of Tomcat, the web.xml of the demo app already set up the mapping like following for you. So you could use http://hostname:8080/examples/servlet/Class to visit the servlet.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    The default setting since Tomcat 4.1 turned off servlet invoker in web.xml under conf directory. You can uncomment the above lines in this file to turn it on. Then you are able to visit your servlet without <servlet-mapping> configured using the following syntax,
    http://hostname:8080/<your_app_name>/servlet/<your_servlet_name>

  • How to run excel macros using lookout

    Hi,
    I want use Excel macros for generating custom reports.Is it possible to run macros using run object in lookout
    thanks

    Hi,
    I am pretty sure you can activate macros in Excel using the Run object in Lookout. I can think of two ways you can do this:
    1. You can setup your Excel to run macros on startup using the Auto_Activate method. In this case, you will just launch excel with your workbook using the Run object and that should run the macros automatically. No brainer!
    2. To better control as to when the macros are run we can assign in Excel some shortcut keys for their launching. We then would need to simulate these keystrokes to launch our macros. This can be done using the SendKeys method and some scripting, WHS Scripting for instance. See this pos
    t for a scripting example which simulates Alt+Tab keys to bring-to-front an app.
    You will launch the script from the Run object and this in turn launches Excel and then simulates the keys for luanching the appropriate macros. I admit this is kinda involved, but hey it works!
    Hope this helps,
    Khalid

  • Running external program using java

    hi
    i am trying to run an external program using the runtime.exec() method. my problem is that the external program only runs when i press ctrl-c to exit my program. does anyone know how i can execute the external program while my program is still running without having to quit the program?should i be using threads?
    thanks

    As per the api doc exec will be executed as a seperate process
    Process exec(String command) ------Executes the specified string command in a separate process.
    Can you able to share that code what you have written ?

  • How to run servlet by using main?

    How can I use main to run servlet?
    I cannot put request and response object into doGet(request, response) method
    I want this because I want to run this servlet daily and I plan to put it in cron job
    Calvin

    Hi
    Perhaps you cannot run servlet without using browser. But you can make that program as an application in order to run in Dos or Unix shell.
    But still you can run servlet without using browser How?
    You can debug servlets with the same jdb commands you use to debug an applet or an application. The JavaTM Servlet Development Kit (JSDK) provides a standalone program
    called servletrunner that lets you run a servlet without a web browser. On most systems, this program simply runs the java sun.servlet.http.HttpServer command. You
    can, therefore, start a jdb session with the HttpServer class.
    A key point to remember when debugging servlets is that Java Web server and servletrunner achieve servlet loading and unloading by not including the servlets directory on
    the CLASSPATH. This means the servlets are loaded using a custom classloader and not the default system classloader.
    Running servletrunner in Debug Mode
    Running Java Web ServerTM in Debug Mode
    Running servletrunner in Debug Mode
    In this example, the servlets examples directory is included on the CLASSPATH. You can configure the CLASSPATH for debug mode as follows:
    Unix
    $ export CLASSPATH=./lib/jsdk.jar:./examples:$CLASSPATH
    Windows
    $ set CLASSPATH=lib\jsdk.jar;examples;%classpath%
    To start the servletrunner program you can either run the supplied startup script called servletrunner or just supply the servletrunner classes as a parameter to jdb. This
    example uses the parameter to servletrunner.
    $ jdb sun.servlet.http.HttpServer
    Initializing jdb...
    0xee2fa2f8:class(sun.servlet.http.HttpServer)
    > stop in SnoopServlet.doGet
    Breakpoint set in SnoopServlet.doGet
    > run
    run sun.servlet.http.HttpServer
    running ...
    main[1] servletrunner starting with settings:
    port = 8080
    backlog = 50
    max handlers = 100
    timeout = 5000
    servlet dir = ./examples
    document dir = ./examples
    servlet propfile = ./examples/servlet.properties
    To run SnoopServlet in debug mode, enter the following URL in a browser where yourmachine is the machine where you started servlet runner and 8080 is the port number
    displayed in the settings output.
    http://yourmachine:8080/servlet/SnoopServlet
    In this example jdb stops at the first line of the servlet's doGet method. The browser will wait for a response from your servlet until a timeout is reached.
    main[1] SnoopServlet: init
    Breakpoint hit: SnoopServlet.doGet (SnoopServlet:45)
    Thread-105[1]
    We can use the list command to work out where jdb has stopped in the source.
    Thread-105[1] list
    41 throws ServletException, IOException
    42 {
    43 PrintWriter out;
    44
    45 => res.setContentType("text/html");
    46 out = res.getWriter ();
    47
    48 out.println("<html>");
    49 out.println("<head>
    <title>Snoop Servlet
    </title></head>");
    Thread-105[1]
    The servlet can continue using the cont command.
    Thread-105[1] cont
    Running Java Web Server in Debug Mode
    The JSDK release does not contain classes available in the Java Web server and it also has its own special servlet configuration. If you cannot run your servlet from
    servletrunner, then the other option is to run the Java Web server in debug mode.
    To do this add the -debug flag for the first parameter after the java program. For example in the script bin/js change the JAVA line to look like the following. In releases prior
    to the Java 2 platform release, you will also need to change the program pointed to by the variable $JAVA to java_g instead of java.
    Before:
    exec $JAVA $THREADS $JITCOMPILER $COMPILER $MS $MX \
    After:
    exec $JAVA -debug $THREADS $JITCOMPILER
    $COMPILER $MS $MX \
    Here is how to remotely connect to the Java Web Server. The agent password is generated on the standard output from the Java Web Server so it can be redirected into a file
    somewhere. You can find out where by checking the Java Web Server startup scripts.
    jdb -host localhost -password <the agent password>
    The servlets are loaded by a separate classloader if they are contained in the servlets directory, which is not on the CLASSPATH used when starting the Java Web server.
    Unfortunately, when debugging remotely with jdb, you cannot control the custom classloader and request it to load the servlet, so you have to either include the servlets
    directory on the CLASSPATH for debugging or load the servlet by requesting it through a web browser and then placing a breakpoint once the servlet has run.
    In this next example, the jdc.WebServer.PasswordServlet is included on the CLASSPATH when Java Web server starts. The example sets a breakpoint to stop in the service
    method of this servlet, which is the main processing method of this servlet.
    The Java Web Server standard output produces this message, which lets you proceed with the remote jdb session:
    Agent password=3yg23k
    $ jdb -host localhost -password 3yg23k
    Initializing jdb...
    > stop in jdc.WebServer.PasswordServlet:service
    Breakpoint set in jdc.WebServer.PasswordServlet.service
    > stop
    Current breakpoints set:
    jdc.WebServer.PasswordServlet:111
    The second stop lists the current breakpoints in this session and shows the line number where the breakpoint is set. You can now call the servlet through your HTML page. In
    this example, the servlet is run as a POST operation
    <FORM METHOD="post" action="/servlet/PasswordServlet">
    <INPUT TYPE=TEXT SIZE=15 Name="user" Value="">
    <INPUT TYPE=SUBMIT Name="Submit" Value="Submit">
    </FORM>
    You get control of the Java Web Server thread when the breakpoint is reached, and you can continue debugging using the same techniques as used in the Remote Debugging
    section.
    Breakpoint hit: jdc.WebServer.PasswordServlet.service
    (PasswordServlet:111) webpageservice Handler[1] where
    [1] jdc.WebServer.PasswordServlet.service
    (PasswordServlet:111)
    [2] javax.servlet.http.HttpServlet.service
    (HttpServlet:588)
    [3] com.sun.server.ServletState.callService
    (ServletState:204)
    [4] com.sun.server.ServletManager.callServletService
    (ServletManager:940)
    [5] com.sun.server.http.InvokerServlet.service
    (InvokerServlet:101)
    A common problem when using the Java WebServer and other servlet environments is that Exceptions are thrown but are caught and handled outside the scope of your servlet.
    The catch command allows you to trap all these exceptions.
    webpageservice Handler[1] catch java.io.IOException
    webpageservice Handler[1]
    Exception: java.io.FileNotFoundException
    at com.sun.server.http.FileServlet.sendResponse(
    FileServlet.java:153)
    at com.sun.server.http.FileServlet.service(
    FileServlet.java:114)
    at com.sun.server.webserver.FileServlet.service(
    FileServlet.java:202)
    at javax.servlet.http.HttpServlet.service(
    HttpServlet.java:588)
    at com.sun.server.ServletManager.callServletService(
    ServletManager.java:936)
    at com.sun.server.webserver.HttpServiceHandler
    .handleRequest(HttpServiceHandler.java:416)
    at com.sun.server.webserver.HttpServiceHandler
    .handleRequest(HttpServiceHandler.java:246)
    at com.sun.server.HandlerThread.run(
    HandlerThread.java:154)
    This simple example was generated when the file was not found, but this technique can be used for problems with posted data. Remember to use cont to allow the web server
    to proceed. To clear this trap use the ignore command.
    webpageservice Handler[1] ignore java.io.IOException
    webpageservice Handler[1] catch
    webpageservice Handler[1]
    I hope this will help you.
    Thanks
    Bakrudeen

  • How to run the program using specific classpath

    Recently I installed Javamail 1.2 and JAF1.0.1 on my NT Box and set up the classpath. I can compile my java email code by using: javac myEmail.java. But when I tried to run the code using java myEmail, it always gives the error: Exception in thread "main" java.lang.NoClassDefFoundError: myEmail.
    when I use -verbose and found that it always goes to:
    C:\Program Files\JavaSoft\JRE\1.3.1\lib\rt.jar to find classes even I use -cp option to point Javamail\mail.jar and activation.jar.
    what is wrong with it? Thank you in advance!!!!!!

    What does this have to do with JMS. I suggest that this should have been posted to the Java Programming forum where you would have gotten a quick response as this is a simple problem to diagnose.
    The problem is that the class myEmail, which you created, is not on the class path so it cannot find it. It has nothing to do with the location of mail.jar and activation.jar, although this may cause problems later.
    What you need to do is check the classpath in the environment variables section of the System dialog box. Make sure it refers to . (the current directory) as well as the locations of mail.jar and activation.jar. Also when you invoke myEmail ensure you are in the same directory.
    Hope this helps

Maybe you are looking for

  • HT2688 How to play same song of two different computers at the same time

    Hi I have turned on Home Sharing. So one computer can play music on another.  Is there any way to have one computer play what the other computer is playing at the same time.  Other than just starting the same song as close in time as possible on each

  • Create custom short cut key for colon

    I have a Macbook Pro 10.8.4 Lion, but when I upgraded from Mountain Lion, my keyboard went a little wacky. I could of spilled something withnot noticing, but honestly I think I would remember. The help support had no ideas to fix the issues despite o

  • Increasing no of culumns in a BEx report

    Hi all, I want to increase the number of culumns in our BI report so that all the fields are visible on the first page itself. Can you please help me on this ?

  • ASDM and privilege level (using TACACS)

    Hi experts, Initial question:     How can I force ASDM to ask for the enable password when the user click on Apply ? Environment description: I have an ASA 5510 connected to an ACS 5.0. Security policy: I want the user defined on my ACS to be able to

  • Question regarding bulk binding

    Gurus, How does oracle try to differentiate whether the query should use the concept of bulk binding and a normal query ? Is the key word FOR ALL makes the difference ? Or is there any other difference ?? Please help Regards