Substitution HEADER not found

DEAR GURUS,
WHEN i POSTING IN MB1B   TCODE  309 MVT IT SHOWS ERROR "Substitution HEADER not found" .
kINDLY CLEAR THE ERROR .
SRITHAR K

Dears ,
I found.
post goods issue
Srithar K

Similar Messages

  • Substitution ZREF01 not found

    Dear Experts,
    When we are planning to do the F-47 (Advance Request),we are unable to proceed the request. system is given message
    " In company code number range 17 is not maintained". so we maintained number range 17 in FBN1. now it is showing the error  
    " Substitution ZREF01 not found ". COPA is activated in this company.
    Message no. GB127
    Please suggest me
    Regards,
    Krishna.v
    Edited by: chaituvaleti on Dec 20, 2011 2:32 PM

    Thanku Ajay,
    i did mistake in GGB1.
    Edited by: chaituvaleti on Dec 21, 2011 8:25 AM
    Edited by: chaituvaleti on Dec 21, 2011 8:26 AM

  • Swap header not found! on Hibernation

    I have Arch installed on an Asus UX32VD and I want to use suspend to disk.
    Unfortunaly I didn't create a swap partition so I tried it with a swap file.
    Activating suspend to disk doesn't work. dmesg gives me the error "PM: Swap header not found!"
    The swap file is at /var/cache/swap/swap0
    filefrag -v /var/cache/swap/
    Gives me the output:
    Filesystem type is: ef53
    File size of /var/cache/swap/ is 4096 (1 block, blocksize 4096)
    ext logical physical expected length flags
       0       0  2629764               1 eof
    /var/cache/swap/: 1 extent found
    So I added "resume=/dev/sda2 resume_offset=2629764" to the kernel parameters
    Have I forgotten something else?
    Thanks a lot for your help
    br DX

    The argument passed to filefrag should be the actual swap file, not the directory that it is in:
    filefrag -v /var/cache/swap/swap0

  • [Solved]PM: swap header not found attempting to suspend encrypted disk

    Hi all,
    I have my root partition set up as a dm-crypt encrypted volume, and I followed the instructions here to set up a swap file.
    I also followed these instructions to add the resume hook to my mkinitcpio.conf between encrypt and filesystems.
    I modified the /etc/default/grub file like so:
    GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=/dev/disk/by-uuid/0cb6b266-ce81-4b2f-9958-722c788c46ef:cryptroot cryptkey=/dev/disk/by-uuid/18868ab9-e0dd-4634-9f9e-69f3d3686d3f:ext2:/laptopkey root=/dev/mapper/cryptroot resume=/dev/mapper/cryptroot resume_offset=4952064"
    I determined the offset using the swap-offset tool provided by the uswsusp package.
    And I ran
    mkinitcpio -p linux
    and
    grub-mkconfig
    When I type "systemctl hibernate" the system begins to hibernate, then comes back up immediately. Journalctl -xn gives this:
    Jan 08 23:38:57 lefty-laptop systemd[1]: systemd-hibernate.service: main process exited, code=exited, status=1/FAILURE
    Jan 08 23:38:57 lefty-laptop systemd[1]: Failed to start Hibernate.
    -- Subject: Unit systemd-hibernate.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
    -- Unit systemd-hibernate.service has failed.
    -- The result is failed.
    Jan 08 23:38:57 lefty-laptop systemd[1]: Dependency failed for Hibernate.
    -- Subject: Unit hibernate.target has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
    -- Unit hibernate.target has failed.
    -- The result is dependency.
    Jan 08 23:38:57 lefty-laptop systemd[1]: Service sleep.target is not needed anymore. Stopping.
    Jan 08 23:38:57 lefty-laptop systemd[1]: Unit systemd-hibernate.service entered failed state.
    Jan 08 23:38:57 lefty-laptop systemd[1]: Stopping Sleep.
    -- Subject: Unit sleep.target has begun shutting down
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Unit sleep.target has begun shutting down.
    Jan 08 23:38:57 lefty-laptop systemd[1]: Stopped target Sleep.
    -- Subject: Unit sleep.target has finished shutting down
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/9d1aaa27d60140bd96365438aad20286
    -- Unit sleep.target has finished shutting down.
    Jan 08 23:38:58 lefty-laptop kernel: Freezing user space processes ... (elapsed 0.001 seconds) done.
    Jan 08 23:38:57 lefty-laptop wpa_actiond[1017]: Interface 'wlan0' lost connection to network 'braains'
    Jan 08 23:38:58 lefty-laptop kernel: PM: Marking nosave pages: [mem 0x0009d000-0x000fffff]
    Jan 08 23:38:58 lefty-laptop kernel: PM: Basic memory bitmaps created
    Jan 08 23:38:58 lefty-laptop kernel: PM: Preallocating image memory... done (allocated 294215 pages)
    Jan 08 23:38:58 lefty-laptop kernel: PM: Allocated 1176860 kbytes in 0.22 seconds (5349.36 MB/s)
    Jan 08 23:38:58 lefty-laptop kernel: Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
    Jan 08 23:38:58 lefty-laptop kernel: e1000e 0000:00:19.0: setting latency timer to 64
    Then a bunch more stuff, then this:
    Jan 08 23:38:58 lefty-laptop kernel: PM: thaw of devices complete after 955.701 msecs
    Jan 08 23:38:58 lefty-laptop kernel: PM: writing image.
    Jan 08 23:38:58 lefty-laptop kernel: PM: Using 1 thread(s) for compression.
    PM: Compressing and saving image data (197765 pages)...
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 0%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 10%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 20%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 30%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 40%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 50%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 60%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 70%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 80%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 90%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving progress: 100%
    Jan 08 23:38:58 lefty-laptop kernel: PM: Image saving done.
    Jan 08 23:38:58 lefty-laptop kernel: PM: Wrote 791060 kbytes in 4.67 seconds (169.39 MB/s)
    Jan 08 23:38:58 lefty-laptop kernel: PM: S
    Jan 08 23:38:58 lefty-laptop kernel: PM: Swap header not found!
    Jan 08 23:38:58 lefty-laptop kernel: |
    Jan 08 23:38:58 lefty-laptop kernel: PM: Basic memory bitmaps freed
    Jan 08 23:38:58 lefty-laptop kernel: Restarting tasks ... done.
    Jan 08 23:38:58 lefty-laptop kernel: video LNXVIDEO:00: Restoring backlight state
    Jan 08 23:38:58 lefty-laptop laptop-mode[28617]: Laptop mode
    Jan 08 23:38:58 lefty-laptop laptop-mode[28618]: enabled, not active [unchanged]
    Jan 08 23:38:58 lefty-laptop laptop-mode[28622]: Laptop mode
    Jan 08 23:38:58 lefty-laptop laptop-mode[28623]: enabled, not active [unchanged]
    Perhaps the "PM: swap header not found" is not the primary error?
    Last edited by LeftyAce (2014-01-12 06:08:55)

    LeftyAce wrote:
    ROOKIE: which UUID do you use? If I list /dev/disk/by-uuid I get two results:
    total 0
    lrwxrwxrwx 1 root root 10 Jan 11 18:06 06f4c97e-fe09-45a8-a937-dedb6b18339b -> ../../dm-0
    lrwxrwxrwx 1 root root 10 Jan 11 18:06 a0eb0a15-6d5d-4df2-a0d3-6f7fb00885c6 -> ../../sda1
    I think one of them is the actual device, the other is the dm-crypt container? I guess I could try both...I'll report back.
    Usually I use the output of blkid to find out the correct uuid. The uuid to use for / or swap is the one pointing to one of /dev/dm*.
    LeftyAce wrote:For the record I am using resume=/dev/mapper/cryptroot. I think since the swapfile is a file not a block device in my case that's important. Since the encrypt hook runs first, that mapper volume is present and unlocked by the time resume comes around.
    In my case the same happens but for some reason it doesn't seem to work, and I've been procrastinating submitting a bug (I use hibernation very rarely and I know of a way that works).

  • Assets Accounting: Message: GB127: "Substitution ZT000 not found"

    I ´m trying to post in the transaction F-92, Retirement with revenue , with customer,
    and when I´m entrying the second position , I cannot enter the cost center, appear the message number GB127: "Substitution ZT000 not found".
    Could somebody help me plaese ?
    Olga

    Hi Olga,
    Check in OBBH transaction, if you have substitution defined. Apparently, you have one called ZT000. You should transport it from development system (substitutions are not added automatically to change request, you have to add them manually).
    Regards,
    Eli

  • 9KE0 "Substitution not found"

    Hi,
    I would like to move a balance from one profit center to another profit center within PCA.  So, I am using transaction 9KE0.  In this transaction, I gave the sender profit center, receiver profit center and same GL account for both of them.  Now when I try to save the document I am getting a message that Substitution is not found".  Error message number is GB 127.  I am not able to proceed further.
    So, could you please let me know what could be the reason here and how to rectify this.  I know to some extent that 9KE0 transaction will look into FI-SL substitution rules.  I checked the substitution rules in transaction GGB1.  Nothing is there in the category of Special Purpose Ledger.  In fact for another company code, this transaction of 9KE0 is working fine.  It is not giving any error message like GB 127.  Only for this company code it is giving this error message GB 127.
    Warm regards,
    Sridhar

    Hello Vikas,
    Thank you for the reply.
    My client is intending to use the new transaction 9KE0 instead of the old one 1KEL.  SAP has also recommened in one of previous situations to use the new transaction 9KE0 as the new development of posting logic for balance check,etc are not developed for 1KEL.
    So, my client has been using this transaction for long and they are not keen to change the process.  Thus can you please help me to identify the reason why I am getting this error message.  Accordingly I can go round the situtation to make necessary changes to the settings.
    Thanks for your understanding.
    Warm regards,
    Sridhar

  • FI Substitution not found

    Hi Sap Gurus,
    While in MIGO an error message appeared saying:
    "Substitution ZZ_FIAP not found"
    Can anyone help on what might have happened and an alternative to solve it?
    Thanks a lot
    Roger

    Goto t.code OBBH
    check for the step for subsitution name ZZ_FIAP, also check for the subsitute value/ table that have been specified.
    looks like subsitution value is not found in MIRO
    hope this helps

  • Error: Variable not found in variable substitution table

    Hi,
    I am getting following error in file adapter receiver communication channel.
    error:Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: java.text.ParseException: Variable 'file' not found in variable substitution table
    <b>variable substitution values:</b>
    Variable name: File
    reference       :payload:MT_DC_Recr,1,Target,1,Filename,1
    file name scheme : %File%.txt
    <b>inpu file:</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_DC_Send xmlns:ns0="http://urn:psr/ff/DC">
       <Source>
          <Filename>dat1</Filename>
          <Record>
             <Name1>123</Name1>
             <Name2>abc</Name2>
             <Name3>XYZ</Name3>
          </Record>
       </Source>
    </ns0:MT_DC_Send>
    Regards,
    Srini

    Hi varun,
    This is the error i am getting now..
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: File
    what i am trying to get is reading filename from the message payload.
    Reg,
    Srini

  • Strange Console message: GetMenuRefTable not found in header

    I noticed many references to "GentMenuRefTable" in console.log. I did search this string in Google, but came up empty. Has anyone else seen this? Is this a problem? I think that only Apple's applications are writing this message, so I'm afraid it could be serious.
    <pre>
    Mail[266]: [FC] GetMenuRefTable not found in header
    Property List Ed[281]: [FC] GetMenuRefTable not found in header
    Property List Ed[281]: [FC] GetMenuRefTable not found in header
    Safari[301]: [FC] GetMenuRefTable not found in header
    Safari[301]: [FC] GetMenuRefTable not found in header
    Keynote[391]: [FC] GetMenuRefTable not found in header
    Keynote[391]: [FC] GetMenuRefTable not found in header
    Keynote[394]: [FC] GetMenuRefTable not found in header
    Keynote[394]: [FC] GetMenuRefTable not found in header
    Pages[398]: [FC] GetMenuRefTable not found in header
    Pages[398]: [FC] GetMenuRefTable not found in header
    Keynote[402]: [FC] GetMenuRefTable not found in header
    Keynote[402]: [FC] GetMenuRefTable not found in header
    System Profiler[467]: [FC] GetMenuRefTable not found in header
    System Profiler[467]: [FC] GetMenuRefTable not found in header
    System Profiler[494]: [FC] GetMenuRefTable not found in header
    System Profiler[494]: [FC] GetMenuRefTable not found in header
    iTunes[498]: [FC] GetMenuRefTable not found in header
    iTunes[498]: [FC] GetMenuRefTable not found in header
    iTunes[498]: [FC] GetMenuRefTable not found in header
    Property List Ed[527]: [FC] GetMenuRefTable not found in header
    Property List Ed[527]: [FC] GetMenuRefTable not found in header
    Finder[731]: [FC] GetMenuRefTable not found in header
    Finder[731]: [FC] GetMenuRefTable not found in header
    Finder[731]: [FC] GetMenuRefTable not found in header
    Finder[731]: [FC] GetMenuRefTable not found in header
    Console[1225]: [FC] GetMenuRefTable not found in header
    Console[1225]: [FC] GetMenuRefTable not found in header
    </pre>
    Macbook Pro   Mac OS X (10.4.8)  

    Hi, BanzaiMan. Welcome to the Discussions.
    I've not seen the GetMenuRefTable message and, like you, I've been unable to find any documentation for it.
    1. It's possible that the cause is related to some errant Startup or Login Item, perhaps some third-party code you've installed. My "Troubleshooting Startup and Login Items" FAQ can help you pin that down if such an item is causing the problem.
    2. Check asl.log (available under the /var/log list in the Logs list in Console) to see if there are any corresponding entries containing GetMenuRefTable. If so, the Level value will tell you if this is a problem.
    For example, the system.log message:
    Dec 17 10:24:10 PMG5 lookupd[435]: lookupd (version 369.5) starting - Sun Dec 17 10:24:10 2006
    has the following corresponding entry in asl.log:
    [Time 2006.12.17 16:24:10 UTC] [Facility netinfo] [Sender lookupd] [PID 434] [Message lookupd (version 369.5) starting - Sun Dec 17 10:24:10 2006] [Level 5] [UID -2] [GID -2] [Host PMG5]
    The time stamps are different as messages recorded in asl.log are posted in GMT (Zulu) time, not local time.
    The [Level 5] value indicates it is a Notice type message, i.e. a normal but significant condition, sort of a "strong FYI." Generally, messages with a Level of 5 or more can be ignored. The value of Facility may also provide more info concerning what is generating the message.
    Note that messages recorded in console.log may not have a corresponding entry in asl.log, but it's worth a look.
    Note that some of the information above is from the "System Logging"" appendix of my book, Troubleshooting Mac® OS X, Tiger Edition.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X
    Note: The information provided in the link(s) above is freely available. However, because I own The X Lab™, a commercial Web site to which some of these links point, the Apple Discussions Terms of Use require I include the following disclosure statement with this post:
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • Header file 'dlfcn.h' not found

    Hi,
    I am trying to compile some dynamic library stuff in my application. I am getting the error "header file 'dlfcn.h' not found". I searched for the file dlfcn.h in directory "/usr/include" and "/usr/local/include" but unable to find the file.
    Please help me how to download this file?
    Thanks

    Hi header file........................etc
    You could make your own.
    Script is here;
    http://www.koders.com/c/fid7E0BB9E61334ACD4F547A739488E20E0F68C502E.aspx
    Just leave out the line numbers at the start of each line.
    regards roam

  • Error Occurred: PDF header signature not found.

    Receiving error on 2 different computers when trying to open pdf documents to print. One computer has Adobe Acrobat X and the other has Adobe Reader XL 11.0.05,
    Following is the error:
         Error Occurred: PDF header signature not found.
    What is causing the error and what changes need to be made to allow the documents selected to be opened?
    Thanks in advance,

    What software is issuing the warning or error?
    Is this form created in LiveCycle?
    That is the Adobe product that creates an XML form.

  • IHC errors valid clearing partner not found and no header details found while idoc creation after f110

    IHC errors :valid clearing partner not found and no header details found while idoc creation after f110
    Please let me know where the config is missing for ihc automatic payment program.in we02 status is not 53.
    Please help

    Hi
    Please share the error message in the IDOC.
    If the error message is IHC204 "No valid clearing partner was found", it may be due to the missing correct configuration in Set Up Creation of Payment Requests for Inbound IDoc in FI, which links the clearing partner, ALE logical system partner type and IHC account number.
    Cheers
    taro

  • Error:Administration header could not found for support message

    Hi All,
    we are creating the support message in CRMD_ORDER transaction. we are getting an error, "Administration header could not found for support message" while saving. And also it is coming out of the transaction.
    The transaction type is SLFN.
    Please advise.
    Regards
    kumar

    Did you find the solution to this error? I am also getting this error and need to solve the same. Can you please help?

  • Shared library: function is not found and recognized in header file

    Hello,
    I am trying to use Java methods into LV. I am doing so by creating Java Invocation Interface, usind which I can call Java methods into C++ and then create a shared library that can be called into LV.
    When I am importing my shared library into Labview, I am getting the following error messages:
    The shared library contains 3 function(s). But no function is found and recognized in the header file. The following function(s) cannot be wrapped. If you want to import these functions, please review the warning messages next to the functions below. You will need to fix the problems before you can continue with the wizard.
    jclass invokeJavaClass(JNIEnv* jenv, string className);
    The following symbols are not defined:
    jclass;
    Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add preprocessor definitions. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").
    The following header file was not found in the specified header file or one of the referenced header files:
    -  string
    -  iostream
    -  cstring
    -  jni.h
    To fix, click the Back button to go to the previous page and add the header file path to the Include Paths list.
     Please advise.
    Regards,
    H
    Attachments:
    SharedLibError.png ‏51 KB

    Hello Vivek,
    The LabVIEW dll that I am trying to import does not include any third-party device..all my code is fully based on LabVIEW. Maybe this helps you to guess what is happening: once I've parsed the dll' header appears an error
    like this one:
    void
    __cdecl Zdmt(LVBoolean *stop, double P, char channelName[],
        TD1
    *errorIn, TD14 *FFTOptions, TD12 *Calibration, char FileName[],
    int32_t minRecordLength, TD26 *InstrumentHandler, LVRefNum
    sessionRefArray[],
        LVRefNum *queueIN, TD1 *errorOut, LVBoolean
    *averagingDone,
        HWAVES LastRecordFetched, TD24 *Impedance, TD17
    *ColeColeCluster,
        TD18 *FFTcluster, TD5
    *InstrumentHandleOutputCluster, LVRefNum *queueOut,
        int32_t
    *Acquired, TD6 *FreqTimeInfoCluster, double *averagesCompleted,
    int32_t len);
    The following symbols are not defined:
    LVBoolean;
    int32_t; LVRefNum;
    Undefined symbols can prevent the wizard
    from recognizing functions and parameters. To correct this problem,
    check the header file to determine if you must add predefined symbols.
    Click the Back button to return to the previous page of the wizard to
    add a preprocessor definitionsl (for example, "NIAPI_stdcall =
    __stdcall" or "NIAPIDefined = 1").
    The following header file was
    not found in the specified header file or one of the referenced header
    files:
    -  extcode.h
    To fix, click the Back button to go to the
    previous page and add the header file path to the Include Paths list.
    I have replaced the first line #include "extcode.h" of
    the dll header file for #include "C:\Program Files\National
    Instruments\LabVIEW 8.6\cintools\extcode.h" that is the full path where
    the header file is located. However, new libraries seems to be missed:
    -  stdint.h
    -  MacTypes.h
    As far as I know,  Mactypes.h contains basic mac os data types and it doesn't have any relation with stdint.h...
    I have created both of them and stored into the same folder as extcode.h, but then other libraries are missed!!!
    Do you know if it would be possible to create the .dll generating all the header files associated for its data structures???
    And if this is not factible, then what do you suggest me? because I hope to not having to create all the header files until it stops giving me an error!
    thanks for four time,
    ben

  • File not found error

    I get the following error, but don't know why it can't find the file. Is there anything in this script that would call "\" instead of "/"? Is there any line of code that will switch a wayward "\" back?
    01-09-24 09:37:02 - path="" :jsp: init
    2001-09-24 09:43:42 - path="" :LoginServlet: init
    2001-09-24 09:44:15 - path="" :CourseServlet: init
    2001-09-24 09:46:48 - path="" :LessonServlet: init
    2001-09-24 09:46:54 - path="" :Error: /usr/local/apache/sites/tesco.spinweb.net/htdocs/cmi/courses\Food Service/Intro/AU00.html (No such file or directory)
    The script is below. Thanks for any help anyone can provide me.
    import cmi.xml.AU;
    import cmi.xml.Block;
    import cmi.xml.CourseReader;
    import cmi.xml.CSFElement;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.PrintWriter;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.http.HttpServlet;
    import org.jdom.JDOMException;
    public class LessonServlet extends HttpServlet
    public void init (ServletConfig config) throws ServletException
    super.init (config);
    try {
                   Class.forName (GlobalData.DatabaseDriverName);
                   _jdbcConnection = DriverManager.getConnection (GlobalData.DatabaseName, "tesco", "scorm");
    _jdbcConnection.setAutoCommit (true);
    //should I do this?
    //_jdbcConnection.setAutoCommit (false);
    //load serialized course data
    loadCourseData();
              catch (Exception xcp) {
                   xcp.printStackTrace();     
                   getServletContext().log("Error: " + xcp.getMessage());     
    public void doGet( HttpServletRequest request,
                             HttpServletResponse response)
              throws ServletException, IOException
    boolean normalMode = true;
    try {
    HttpSession session = request.getSession (true);
    //can I load the session given the id??
    //System.out.println ("Lesson.valid session " + session.getId() + ": " + request.isRequestedSessionIdValid());
    response.setContentType ("text/html");
    JDBCHelper dbHelper = new JDBCHelper (_jdbcConnection);
    //get student ID
    Integer studentID = (Integer) session.getAttribute ("studentID");
    //get course ID
    Integer courseID = (Integer) session.getAttribute ("courseID");
    //get lesson ID
    String lessonID = request.getParameter ("lessonID");
    if (lessonID == null) {
    lessonID = (String) session.getAttribute ("lessonID");
    if (studentID == null || courseID == null || lessonID == null) {
    //reset session data by re-logging the user
    sendProfileError (response.getOutputStream());
    return;
    //store lesson ID in session
    session.setAttribute ("lessonID", lessonID);
    String auID = request.getParameter ("auID");
    String mode = request.getParameter ("mode");
    if (mode != null) {
    session.setAttribute ("mode", mode);
    else {
    mode = (String) session.getAttribute ("mode");
    if (mode.equalsIgnoreCase ("review")) {
    normalMode = false;
    else {
    normalMode = true;
    //synchronize access to course hash table
    synchronized (_courseHash)
    //make sure _courseHash is in tact
    if (_courseHash == null) {
    //try reloading it....
    loadCourseData();
    if (_courseHash == null) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data");
    if (! _courseHash.containsKey (courseID.toString())) {
    //try reloading it....
    loadCourseData();
    if (! _courseHash.containsKey (courseID.toString())) {
    //error
    response.getOutputStream().close();
    throw new IOException ("Corrupt course data (course not found)");
    if (auID == null) {
    //show course menu
    Hashtable hash = (Hashtable) _courseHash.get (courseID.toString());
    sendAvailableAUs (hash, studentID.intValue(), courseID.intValue(), lessonID, response.getOutputStream(), response, dbHelper);
    return;
    //if AU has not been attempted, initialize it
    Integer auDataID = new Integer (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper));
    //if (getAUDataID (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper) == -1) {
    if (auDataID.intValue() == -1) {
    int newID = initializeAUData (studentID.intValue(), courseID.intValue(), lessonID, auID, dbHelper);
    dbHelper.addAUToPath (studentID.intValue(), courseID.intValue(), lessonID, auID);
    auDataID = new Integer (newID);
    session.setAttribute ("AUID", auID);
    session.setAttribute ("AUDataID", auDataID);
    sendAU (studentID.intValue(), courseID.intValue(), lessonID, auID, auDataID.intValue(), normalMode, response.getOutputStream(), dbHelper);
    //to do: detailed messages should be sent to the client depending on which
    // exception was thrown. Don't have one try/catch....have one for each situation
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    public void destroy()
              try {
                   if (_jdbcConnection != null) {
                        _jdbcConnection.close();
              catch (Exception ignored) {}
    private int initializeAUData (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    String sqlQuery = null;
    ResultSet results = null;
    try {
    //get student's name
    sqlQuery = "SELECT Full_Name" +
    " FROM " + GlobalData.StudentTable +
    " WHERE Student_ID = " + studentID;
    results = dbHelper.doQuery (sqlQuery);
    if (! results.next()) {
    //error
    return -1;
    String studentName = results.getString (1);
    results.close();
    //the lock prevents CMIServlet from reading AU_ID before it's committed
    //sqlQuery = "LOCK TABLES " + GlobalData.AUDataTable + " WRITE;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    sqlQuery = "Insert Into " + GlobalData.AUDataTable +
    "(Course_ID, Lesson_ID, AU_ID, student_id, student_name, lesson_location, credit," +
    " lesson_status, entry, exit, score_raw, score_max, score_min, total_time," +
    " session_time, lesson_mode, suspend_data, launch_data, Evaluation_ID, Objective_ID)" +
    " Values (" + courseID + ", '" + lessonID + "', '" + auID + "', " + studentID + ", '" + studentName + "'," +
    " 'NA', 'credit'," + " 'not attempted', 'ab-initio', " + "'NA', " + 0 + ", " + 0 + ", " + 0 +
    ", '00:00:00.0', '00:00:00.0', " + " 'normal'" + ", 'NA', " + "'NA', " + 0 + ", " + 0 + ");";
    dbHelper.executeUpdate (sqlQuery);
    return getAUDataID (studentID, courseID, lessonID,auID, dbHelper);
    //sqlQuery = "UNLOCK TABLES;";
    //System.out.println (sqlQuery);
    //dbHelper.executeUpdate (sqlQuery);
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    return -1;
    private int getAUDataID (int studentID, int courseID, String lessonID, String auID, JDBCHelper dbHelper)
    throws SQLException
    String sqlQuery = "SELECT AUData_ID, lesson_status, lesson_mode, exit" +
                                  " FROM " + GlobalData.AUDataTable +
                                  " WHERE student_id = " + studentID +
                                  " AND Course_ID = " + courseID +
    " AND Lesson_ID = " + "'" + lessonID + "'" +
    " AND AU_ID = '" + auID + "';";
    ResultSet results = dbHelper.doQuery (sqlQuery);
    if (results.next()) {
    return results.getInt ("AUData_ID");
    return -1;
    private void sendAU (int studentID, int courseID, String lessonID, String auID, int auDataID, boolean normalMode, ServletOutputStream htmlOut, JDBCHelper dbHelper)
    throws IOException, ClassNotFoundException
    Hashtable hash = null;
    synchronized (_courseHash)
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));       
    if (hash == null) {
    loadCourseData();
    hash = (Hashtable) _courseHash.get (String.valueOf (courseID));
    if (hash == null) {
    throw new IOException ("Corrupt course data (course not found)");
    AU au = (AU) hash.get (auID);
    try {
    if (! normalMode) {
    dbHelper.setReviewMode (auDataID);
    String courseFileName = getFileName (String.valueOf (courseID), dbHelper);
    File file = new File (courseFileName);
    //create absolute path to file so we can resolve relative URLs
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();
                   BufferedReader buf = new BufferedReader (new FileReader (newFileName));
    PrintWriter htmlWriter = new PrintWriter (htmlOut);
                   String temp;
    htmlWriter.write (getAUHtml (au.getLaunchParams()));
    htmlWriter.flush();
    htmlWriter.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getAUHtml (String path){
    path = path.replace ('\\','/');
    String response;
    response = "<html>\n" +
                        "<head>\n" +
    "</head>\n" +
    "<body>\n" +
    "<script language=\"JavaScript\">\n" +
    "document.location = \"/cmi/courses/" + path + "\"\n" +
    //"win = window.open ('','displayWindow','menubar=yes,scrollbars=yes,status=yes,width=300,height=300');\n" +
    //"window.onload = \"win.close();\"" +
    "</script>\n" +
    "</body>\n" +
    "</html>\n";
    return response;
    private void sendAvailableAUs (Hashtable hash, int studentID, int courseID, String lessonID, ServletOutputStream out, HttpServletResponse response, JDBCHelper dbHelper)
    StringBuffer buf = new StringBuffer (200);
    Block block = (Block) hash.get (lessonID);
    AU au = null;
    try {
    Vector completedAUs = dbHelper.getCompletedAUs (studentID, courseID, lessonID);
    buf.append ("<html>\n" +
                        "<head>\n" +
    "<title>" + block.getTitle() + " units</title>\n" +
    "<script language=\"JavaScript\">\n" +
    "function go() {\n" +
    " var form = document.goForm;\n" +
    " var index = form.gotoSelect.selectedIndex;\n" +
    " if (index == 0) {\n" +
    " document.location = \"/servlet/CourseServlet?courseID=" + courseID + "\";\n" +
    " }\n" +
    " else if (index == 1) {\n" +
    " top.restart();\n" +
    " }\n" +
    "}\n" +
    "</script>\n" +
    "</head>\n" +
    "<body background=\"/cmi/images/marble.jpg\">\n" +
    "<center><h1><b><u>" + block.getTitle() + "</u></b></h1></center>\n" +
    "<p></p>\n<p></p>\n" +
    "<b>" + block.getTitle() + " contains the following units: </b>\n" +
    "<dl>\n");
    Enumeration enum = block.getChildren();
    while (enum.hasMoreElements()) {
    String temp = (String) enum.nextElement();
    CSFElement element = (CSFElement) hash.get (temp);
    if (element.getType().equals ("au")) {
    au = (AU) element;
    if (completedAUs.contains (au.getID())) {
    buf.append ("<dt><p><img src=\"/cmi/images/node2.gif\"><a href=\"/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=review\">" + au.getTitle() + " (<i>review</i>) </a></p></dt>\n");
    else {
    buf.append ("<dt><p><img src=\"/cmi/images/node.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + block.getID() + "&auID=" + au.getID() + "&mode=normal") + "\">" + au.getTitle() + "</a></p></dt>\n");
    else if (element.getType().equals ("block")) {
    buf.append ("<dt><p><img src=\"/cmi/images/folder.gif\"><a href=\"" + response.encodeURL ("/servlet/LessonServlet?lessonID=" + element.getID() + "&mode=normal") + "\">" + element.getTitle() + "</a></p></dt>\n");
    buf.append ("</dl>\n" +
    "<br><br>\n" +
    "<form name=\"goForm\">\n" +
    "<select name=\"gotoSelect\">\n" +
    " <option value=\"lesson\">Lesson Menu</option>\n" +
    " <option value=\"exit\">Exit LMS</option>\n" +
    "</select>\n" +
    "<input type=\"button\" value=\"Go\" onClick=\"go()\">\n" +
    "</form>\n" +
    "</body>\n" +
    "</html>");
    PrintWriter writer = new PrintWriter (out);
    writer.write (buf.toString());
    writer.flush();
    writer.close();
    catch (Exception e) {
    e.printStackTrace();
                   getServletContext().log("Error: " + e.getMessage());
    private String getFileName (String courseID, JDBCHelper dbHelper)
    throws ClassNotFoundException, SQLException
              ResultSet results = null;
              String fileName = null;
    String sqlQuery = "SELECT CourseFile" +
                                  " FROM Course" +
                                  " WHERE Course_ID = " + Integer.parseInt (courseID) + ";";
    results = dbHelper.doQuery (sqlQuery);
              if (results.next()) {
                   fileName = results.getString (1);
              else {
    //need to do more than this :)
                   System.out.println("crap");
    results.close();
    return fileName;
    private void loadCourseData()
    throws IOException, ClassNotFoundException
    //load serialized course data
    File file = new File (GlobalData.DataFileName);
    if (! file.exists()) {
    //error
    throw new FileNotFoundException (GlobalData.DataFileName + " not found.");
    FileInputStream fis = new FileInputStream (GlobalData.DataFileName);
    ObjectInputStream ois = new ObjectInputStream (fis);
    _courseHash = (Hashtable) ois.readObject();
    ois.close();
    private void sendProfileError (ServletOutputStream out)
    String html = "<html>\n" +
    "<body>\n" +
    "<p>An error has occurred with your profile. Please " +
    "<a href=\"\" onClick=\"top.restart(); return true\">login again</a>" +
    "</body>\n" +
    "</html>\n";
    PrintWriter writer = new PrintWriter (out);
    writer.write (html);
    writer.flush();
    writer.close();
    private Connection _jdbcConnection;
    private Hashtable _courseHash;

    I know that is where my error is, but why and where is
    the script calling it up way?You wrote it right? check out the sendAU() method, there is line
    String newFileName = file.getParent() + "\\" + au.getLaunchParams();

Maybe you are looking for

  • Weather icon wont find local weather

    my local weather will not update on the weather app.

  • 3rd generation iPod touch syncing issues

    The last time I tried to sync my iTunes account through a wired connection between my Macbook Pro and 3rd generation iPod touch, I had some major issues. First: It deleted the YouTube, iBooks, Netflix, Dropbox, Facebook, and Kindle apps from my iPod

  • Adobe edge 2014.1.1 freeze

    iMac (21.5-inch, Late 2013) 2,7 GHz Intel Core i5 8 GB 1600 MHz DDR3 Intel Iris Pro 1536 MB mac version : 10.10.2 (14C109) hello all, I get a freeze with adobe edge 2014.1.1 with the above configuration . any clue ? as animation i took only a fade in

  • HT3258 Upgraded to Lion and now I can't get my monitor to work

    I just upgraded to Lion and now I can't connect to my Dell monitor. I am using a MacAir. I have tried chaning the input. But that didn't work. Any suggestions?

  • Report, FICO

    Does table BSIK holds Invoices of type input error, Inconsistent Payment Method or Company Code/Invalid Bank Account, Pending Status, long outstanding invoices. Do they come into open invoices. Can anybody help on this. Regards, Naseer.