Xcode debugger not showing my instance variables!!

I hate asking questions like this.
I set a breakpoint in an IBAction method 'pushed:' inside FooViewController.  At runtime I pressed a GUI button and processing stopped in pushed:.
In the data-viewing pane of xcode, I see
{code}
self = (FooViewController *) 0x... etc.
{code}
Indented under this is
{code}
UIViewController = (UIViewController) { ...
{code}
Nowhere do I see any of my instance variables!!
Now, they were synthesized from properties, but that doesn't matter, does it?
The code that proceeds to set some instance variables runs fine.
Why isn't xcode displaying self's instance vars?
Thanks,
Chap

Yes, yours looks like I was expecting mine to look.
Note that viewDidLoad (below) does work correctly, producing the expected results in the simulator!
Hangman3ViewController.h:
@interface Hangman3ViewController : UIViewController {
@property (         nonatomic )           NSInteger  wordLength;
@property ( retain, nonatomic )           NSString  *alphabet;
@property (         nonatomic )           unichar    guess;
@property (         nonatomic )           NSInteger  guessNo;
@property ( retain, nonatomic )           NSMutableString *board;
@property ( retain, nonatomic ) IBOutlet  UILabel   *boardLabel;
@property ( retain, nonatomic ) IBOutlet  UILabel   *guessNumberLabel;
@property ( retain, nonatomic ) IBOutlet  NSArray   *keyboardButtons;
- (IBAction)letter:(id)sender;
- (void)showBoard;
@end
and, Hangman3ViewController.m:
#import "Hangman3ViewController.h"
@implementation Hangman3ViewController
@synthesize wordLength       = _wordLength;  // preprocessor command to gen getter/setter and instance variable
@synthesize boardLabel       = _boardLabel;  // preprocessor command to gen getter/setter and instance variable
@synthesize guessNumberLabel = _guessNumberLabel;  // Guess #n
@synthesize keyboardButtons  = _keyboardButtons;   // array of buttons
@synthesize alphabet         = _alphabet;    // A-Z unichars
@synthesize guess            = _guess;       // unichar
@synthesize guessNo          = _guessNo;     // int
@synthesize board            = _board;
- (IBAction)letter:(id)sender
            Get letter from sender - driven when key button is pressed.
            The button's tag is an int from 0-25, identifying what letter of the alphabet it is.
            Extract that unichar from ALPHABET as 'guess'.  Then, disable the button,
            which has been defined to have its text turn white (invisible) when disabled.
    UIButton *button = (UIButton *)sender;
    self.guess = [self.alphabet characterAtIndex: button.tag];
    NSLog(@"Received keystroke: %C", self.guess);
    [button setEnabled:NO];
- (void)showBoard
    self.boardLabel.text = self.board;
    self.guessNumberLabel.text = [NSString stringWithFormat:@"Guess #%d", self.guessNo];
- (void)dealloc
    [_boardLabel release];
    [_guessNumberLabel release];
    [_keyboardButtons release];
    [super dealloc];
- (void)didReceiveMemoryWarning
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
#pragma mark - View lifecycle
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
    NSLog(@"Hello from viewDidLoad");
    [super viewDidLoad];
    self.alphabet   = @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // unichar string
    self.wordLength = 7;  // temp - will be set from flipside later on
    self.guessNo    = 1;
    [self.board setString:@"_______"]; // actually dynamic based on wordLength
    self.board = @"_______";
    [self showBoard];
- (void)viewDidUnload
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
@end

Similar Messages

  • Listener not showing the instance for informix.

    Hi All,
    I am using oracle gateway 11g and here I just discovered that the one of the database listener not showing the instance for the informix gatways, though it has already configured. whereas on other database , the listner is showing the instances for informix database. it was running fine few days back though.
    would appriciate , if you coule let me know that why it suddenly stop responding ?
    ----------------- OK Listener ----------------------------
    ptmsap> lsnrctl status LISTENER_PTMSAP
    LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 29-JUL-2012 05:07:07
    Copyright (c) 1991, 2011, Oracle.  All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=10.222.68.34)(Port=1621))
    STATUS of the LISTENER
    Alias                     LISTENER_PTMSAP
    Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
    Start Date                19-JUL-2012 10:25:25
    Uptime                    9 days 18 hr. 41 min. 41 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /db/ptmsap11/oracle/product/11.2.0/network/admin/listener.ora
    Listener Log File         /db/ptmsap11/oracle/diag/tnslsnr/tbx4new/listener_ptmsap/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.222.68.34)(PORT=1621)))
    Services Summary...
    Service "MSCARD4" has 1 instance(s).
      Instance "MSCARD4", status UNKNOWN, has 1 handler(s) for this service...
    Service "as400" has 1 instance(s).
      Instance "as400", status UNKNOWN, has 1 handler(s) for this service...
    Service "db2test" has 1 instance(s).
      Instance "db2test", status UNKNOWN, has 1 handler(s) for this service...
    Service "ptmsap" has 1 instance(s).
      Instance "ptmsap", status UNKNOWN, has 1 handler(s) for this service...
    Service "tg4ifmx" has 1 instance(s).
      Instance "tg4ifmx", status UNKNOWN, has 1 handler(s) for this service...
    Service "tg4trai" has 1 instance(s).
      Instance "tg4trai", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    LISTENER_PTMSAP =
      (ADDRESS_LIST =
            (ADDRESS =
              (PROTOCOL = TCP)
              (Host = host_ip)
              (Port = 1621)
    SID_LIST_LISTENER_PTMSAP =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = ptmsap)
          (ORACLE_HOME = /db/ptmsap11/oracle/product/11.2.0)
          (PRESPAWN_MAX = 10)
       (SID_DESC=
         (SID_NAME=tg4ifmx)
         (ORACLE_HOME=/db/ptmsap11/oracle/product/11.2.0)
         (PROGRAM=dg4ifmx)
       (SID_DESC=
          (SID_NAME=tg4trai)
          (ORACLE_HOME=/db/ptmsap11/oracle/product/11.2.0)
          (PROGRAM=dg4ifmx)
       (SID_DESC=
         (SID_NAME=db2test)
         (ORACLE_HOME=/db/ptmsap11/oracle/product/11.2.0)
         (PROGRAM=dg4db2)
       (SID_DESC=
         (SID_NAME=as400)
         (ORACLE_HOME=/db/ptmsap11/oracle/product/11.2.0)
         (ENV="LD_LIBRARY_PATH=/db/ptmsap11/oracle/product/11.2.0/dg4db2/driver/lib:/db/ptmsap11/oracle/product/11.2.0/lib")
         (PROGRAM=dg4db2)
      (SID_DESC=
        (SID_NAME=MSCARD4)
        (ORACLE_HOME=/db/ptmsap11/oracle/product/11.2.0)
        (PROGRAM=dg4odbc)
        (ENVS=LD_LIBRARY_PATH=/opt/minisoft:/db/ptmsap11/oracle/product/11.2.0)
    +++++++ Not OK Listener++++++++++++++++++
    LISTENER_SMI =
      (ADDRESS_LIST =
            (ADDRESS =
              (PROTOCOL = TCP)
              (Host = host_ip)
              (Port = 1821)
    SID_LIST_LISTENER_SMI =
      (SID_LIST =
         (SID_DESC=
         (SID_NAME=SMICAN)
         (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
         (ENV="LD_LIBRARY_PATH=/pdsdev/ptmqa/oracle/product/11.2.0/db/dg4db2/driver/lib:/pdsdev/ptmqa/oracle/product/11.2.0/db/lib")
         (PROGRAM=dg4db2)
            (SID_DESC=
            (SID_NAME=SMIINTL)
            (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
            (ENV="LD_LIBRARY_PATH=/pdsdev/ptmqa/oracle/product/11.2.0/db/dg4db2/driver/lib:/pdsdev/ptmqa/oracle/product/11.2.0/db/lib")
            (PROGRAM=dg4db2)
            (SID_DESC=
            (SID_NAME=SMIMEL)
            (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
            (ENV="LD_LIBRARY_PATH=/pdsdev/ptmqa/oracle/product/11.2.0/db/dg4db2/driver/lib:/pdsdev/ptmqa/oracle/product/11.2.0/db/lib")
            (PROGRAM=dg4db2)
            (SID_DESC=
            (SID_NAME=SMIMRKTS)
            (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
            (ENV="LD_LIBRARY_PATH=/pdsdev/ptmqa/oracle/product/11.2.0/db/dg4db2/driver/lib:/pdsdev/ptmqa/oracle/product/11.2.0/db/lib")
            (PROGRAM=dg4db2)
    LISTENER_PTMQA11 =
      (ADDRESS_LIST =
            (ADDRESS =
              (PROTOCOL = TCP)
              (Host = host_ip)
              (Port = 1521)
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = ptmqa11)
          (ORACLE_HOME = /pdsdev/ptmqa/oracle/product/11.2.0/db)
          (PRESPAWN_MAX = 10)
       (SID_DESC=
         (SID_NAME=tg4ifmx)
         (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
         (PROGRAM=dg4ifmx)
       (SID_DESC=
          (SID_NAME=tg4trai)
          (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
          (PROGRAM=dg4ifmx)
       (SID_DESC=
         (SID_NAME=db2test)
         (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
         (PROGRAM=dg4db2)
       (SID_DESC=
         (SID_NAME=as400)
         (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
         (ENV="LD_LIBRARY_PATH=/pdsdev/ptmqa/oracle/product/11.2.0/db/dg4db2/driver/lib:/pdsdev/ptmqa/oracle/product/11.2.0/db/lib)
         (PROGRAM=dg4db2)
      (SID_DESC=
        (SID_NAME=MSCARD4)
        (ORACLE_HOME=/pdsdev/ptmqa/oracle/product/11.2.0/db)
        (PROGRAM=dg4odbc)
        (ENVS=LD_LIBRARY_PATH=/opt/minisoft:/pdsdev/ptmqa/oracle/product/11.2.0/db)
    )Regards
    Edited by: 937853 on Jul 29, 2012 2:10 AM

    thanks all, I was able to solve the issue. it was indeed a port no , which caused this issue.

  • F4 not showing values for Variable

    Hi Everyone,
    In BEx Web analyzer, the one of variable not showing values after pressing F4 but for the same query if we execute in BEx analyzer it shows the variable values.
    How we can rectify this issue for BEx Web Analyzer?
    Please suggest..
    Thanks
    Kind Regards
    Anukul

    Hi,
    Just check following setting are also done.
    transaction RSA1 -> Query-infoprovider -> "display" -> look for the relevant infoobject -> right-mouse-click -> "provider-specific Properties" -> "Query Exec. FilterVal"
    Set this option to "Master Data" and recheck the behaviour.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20ecb78c-374a-2d10-c6af-f024f19b785d?QuickLink=index&overridelayout=true
    If above doesn't help pl check for sap note.
    Thanks and regards

  • Sync group does not show local instance

    I cannot find my local sql server listed when I add a new sync group. The hub dialog is ok, but the reference database does not show databases registered using the Data Sync Agent. Those local databases are SQL 2008 SQLExpress, 2012 SQLExpress and 2014
    SQL Server.  None show up. I have successfully done this earlier in the year. Prerequisites are installed. What might be wrong?

    Hi,
    Please have a check on the below link and check if it helps.
    http://msdn.microsoft.com/en-us/library/azure/hh667321.aspx#bkmk_cantfinddb
    Regards,
    Mekh.

  • Why doesn't Xcode 4.3.3 debugger not showing all my ivars (like those defined in @implementation)?

    I have the latest Xcode build and I commonly place ivars in both the @interface section and the @implementation section.  This is actually very useful to bridge from Objective-C to C++.  I keep all the C++ definintions in the .mm, allowing the .h file to be imported in both .m and .mm files.  However, the debugger seems to only list the ivars that are defined in the @interface section.  I understand that the ivars in the @implementation section are "private" but the debugger should still be able to see them right?
    Any plans to fix this?  Or is there some secret option I have to enable to make it work?
    Thanks.

    'task bar'...?
    Drag 4.3.3 from the .dmg to your /Applications folder.
    Eject the .dmg when done. Run Xcode from /Applications
    Use the Xcode menu to install other tools from Apple, and Preferences to load components and docs as needed.
    Use Organizer to submit apps....Application Loader can be downloaded like other tool, tho, if you want it instead.
    Afghanistan, eh?
    Photos would be cool, thanks
    Ken

  • Trace not showing Global container variable at mapping test time.

    Hi Folks ,
    I have a scenario file to Proxy scenario. At mapping time I am doing a lookup inside a UDF using JCO connections.
    Lookup is taking 2 fields(ex X an dY) as input and coming up with couple of fields in output.
    Output fileds I am storing in global container and want to access in further mapping .
    I am using trace to see variable values at mapping tijme
    Surprisingly :
    1. For a particular "X" field in Input, No output fields are coming at trace . On testing it end to end I can see fields getting populated at run time at lookup table . but not getting reflected at mapping trace . what could be the possible cause ?
    2.  For few input fields like "Z" . It is showing all the output values at Trace. But when I go and place a value in lookup table for the same Input field "Z" . this new value is not coming up at trace Level while rest of teh values are coming up. Can anyone hint where I am going wrong  ?
    End to end Debugging sahows values populating and being sent across . Where I need to look at ?
    Regards ,
    Santosh

    Hi Horia ,
    By trace do you mean display queue or running the mapping completely in the ESR ?
    --->I am talking about running the mapping at IR and getting the values of trace by using messagetype.traceinfo() in UDF functionality. I am working on Pi 7.0
    Regards ,
    Santosh

  • Debugger not showing dictionary during binary serialization

    When I am in the debugger and I step into the DataContext serialization constructor the _regionsDictionary has a count of zero. However, in main program Deserialize method (Program.Deserialize()) the DataContext has the proper items.  Why is the debugger
    showing no objects in the DataContext(Serialization info, StreamingContext context) constructor?
    class Program
    static void Main(string[] args)
    Serialize();
    Deserialize();
    static void Serialize()
    var appContext = new DataContext();
    List<IShapeRegion> rectRegions = new List<IShapeRegion>();
    rectRegions.Add(new RectangleRegion(5, 3));
    rectRegions.Add(new RectangleRegion(2, 2));
    appContext.Insert("RectangularRegions", rectRegions);
    FileStream fs = new FileStream("DataFile.dat", FileMode.Create);
    BinaryFormatter formatter = new BinaryFormatter();
    try
    formatter.Serialize(fs, appContext);
    catch (SerializationException e)
    Console.WriteLine("Failed to serialize. Reason: " + e.Message);
    throw;
    finally
    fs.Close();
    static void Deserialize()
    DataContext context = null;
    FileStream fs = new FileStream("DataFile.dat", FileMode.Open);
    try
    BinaryFormatter formatter = new BinaryFormatter();
    context = (DataContext)formatter.Deserialize(fs);
    catch (SerializationException e)
    Console.WriteLine("Failed to deserialize. Reason: " + e.Message);
    throw;
    finally
    fs.Close();
    var rectangularRegions = context.GetRegionByName("RectangularRegions");
    foreach (var region in rectangularRegions)
    Console.WriteLine(region.ToString());
    [Serializable]
    public class DataContext : ISerializable
    private Dictionary<string, List<IShapeRegion>> _regionsDictionary;
    public DataContext()
    _regionsDictionary = new Dictionary<string, List<IShapeRegion>>();
    public void Insert(string regionName, List<IShapeRegion> regions)
    _regionsDictionary.Add(regionName, regions);
    public List<IShapeRegion> GetRegionByName(string regionName)
    var regions = _regionsDictionary.FirstOrDefault(x => x.Key == regionName).Value;
    return regions;
    public void GetObjectData(SerializationInfo info, StreamingContext context)
    info.AddValue("RegionsDictionary", _regionsDictionary);
    protected DataContext(SerializationInfo info, StreamingContext context)
    SerializationInfoEnumerator e = info.GetEnumerator();
    while (e.MoveNext())
    switch (e.Name)
    case "RegionsDictionary":
    _regionsDictionary = (Dictionary<string, List<IShapeRegion>>)e.Value;
    break;
    public interface IShapeRegion
    double Area();
    [Serializable]
    public class RectangleRegion : IShapeRegion, ISerializable
    private double _length_in;
    private double _width_in;
    public RectangleRegion(double length_in, double width_in)
    _length_in = length_in;
    _width_in = width_in;
    public double Area()
    return _length_in * _width_in;
    public void GetObjectData(SerializationInfo info, StreamingContext context)
    info.AddValue("Length", _length_in);
    info.AddValue("Width", _width_in);
    protected RectangleRegion(SerializationInfo info, StreamingContext context)
    SerializationInfoEnumerator e = info.GetEnumerator();
    while (e.MoveNext())
    switch (e.Name)
    case "Length":
    _length_in = Convert.ToDouble(e.Value);
    break;
    case "Width":
    _width_in = Convert.ToDouble(e.Value);
    break;
    public override string ToString()
    return String.Format("Rectangle: Length = {0}, Width = {1}", _length_in, _width_in);

    According to one article, the deserialization operation is a complex process which is not always well documented.
    Try this workaround:
    case
    "RegionsDictionary":
    _regionsDictionary = (Dictionary<string,
    List<IShapeRegion>>)e.Value;
    _regionsDictionary.OnDeserialization( this);
    break;
    By the way, it is not always necessary to implement ISerializable. For example, if you simplify
    RectangleRegion removing ISerializable and two special serialisation members, then it will work too.

  • Infoset BI - not showing created on - variable in a query

    Hi
    I created an infoset based on two cubes, in one of the cubes used in the infoset - the Billing cube I have my document dates-created on (0createdon) infoobject.
    When I try to create a query reporting of the infoset, I can see the infoobject but not all the variables in the created on. At least 4 variables are missing from the Created on object.
    Any thoughts?

    Hi Michelle,
    If you have created four variables and selected all four variables and you still can't it all, it could be because the criteria of your variables are similar and the system ignore some of them. have you check the messages from the BEx status area? it is on the bottom left hand corner of your BEx.
    cheers.

  • Data manager package log does not show Global variables!!

    Hello Experts,
    We are using BPC 10 sp14 Microsoft version with SQL Server 2008 R2. We are seeing an issue where datamanager package log does not show the Global variables defined in package script whereas in BPC 7.5 Global variable were visible in package log.
    Please let us know is this behavior changed in BPC 10?
    Below is the package script having Global variables and Package log not showing any of them.
    Thanks & Regards,
    Rohit
    Package Script:
    Package Log:

    Hi Ergin,
    As far as I remember it's by design...
    Vadim

  • Do synthesized instance variables work in iPhone SDK?

    I tried using Obj-C properties to synthesize not only the accessor methods, but also the instance variable. I ended up with an error saying something like "...must explicitly name an ivar...".
    I was under the impression the iPhone ran the modern (64-bit) Objective-C runtime. I'm using xCode 3.x and iPhone SDK 2.2. Are synthesized instance variables not supported, or do I need to change some xCode/project configuration settings to activate this support (I'd really like to use it)?
    Does the fact that I'm linking to the Sen Test Kit Framework, or running on a relatively old Intel MacBook Pro cause this problem? If the 2.2 SDK does not support synthesized instance variables, does iPhone SDK 3.0 beta support them?
    Note that I would need the synthesized ivar support to work on the iPhone simulator too (obviously) so that I can do testing. Hopefully the iPhone simulator supports the modern Obj-C 2.0 runtime.
    Thank You,
    Eric

    orangekay wrote:
    A. I don't see that anywhere in the Objective-C 2.0 language specification, so I don't believe this has anything to do with the iPhone SDK.
    B. I don't see any point in adding such a thing to the language as it accomplishes nothing that could not be handled with a standard ivar declaration.
    This sounds like a feature you imagined.
    Yeah, right I imagined it. Get a clue, will you?
    http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/oc Properties.html#//apple_ref/doc/uid/TP30001163-CH17-SW3
    In general the behavior of properties is identical on all runtimes (see Runtime Versions and Platforms in Objective-C 2.0 Runtime Programming Guide). There is one key difference: the modern runtime supports instance variable synthesis whereas the legacy runtime does not.
    For @synthesize to work in the legacy runtime, you must either provide an instance variable with the same name and compatible type of the property or specify another existing instance variable in the @synthesize statement. With the modern runtime, if you do not provide an instance variable, the compiler adds one for you. For example, given the following class declaration and implementation:
    @interface MyClass : NSObject {
    float sameName;
    float otherName;
    @property float sameName;
    @property float differentName;
    @property float noDeclaredIvar;
    @end
    @implementation MyClass
    @synthesize sameName;
    @synthesize differentName=otherName;
    @synthesize noDeclaredIvar;
    @end
    the compiler for the legacy runtime would generate an error at @synthesize noDeclaredIvar; whereas the compiler for the modern runtime would add an instance variable to represent noDeclaredIvar.

  • Stateful session bean destroying instance variables?

    I'm trying to use a stateful session bean as some kind of login controller and to maintain the login id and access level across JSPs and HTMLs so that once logged in, all the JSPs can obtain the login name of the current user (String) and his access level (int).
    I use the login.jsp to login and it successfully reports logging in with the correct access level retrieved from database. However, if I go to another JSP (testlogin.jsp), these 2 EJB instance variables are always destroyed and set to null and 0 when I access them again.
    What am I missing that my stateful session bean is not saving these instance variables? Do I need to put them in some serializable value objects (create a help VO class?)
    I suspected that on different JSP, I call the MemberControllerHome.create() method, it creates a new instance or something but if I don't use the create method how do I get a handle to MemberController at all?
    MemberControllerBean.java
    public class MemberControllerBean implements SessionBean {
         //initialize in ejbCreate.
         private MemberHome memberHome;
         SessionContext context;
         //Member currentLogin;
         //Current Login
         private String loginID;
         private int accessLevel;
         // Constructor
         public MemberControllerBean() {}
    ...some code in between...
    public void login(String id, String password){
              try{
                   Member member = null;
                   member = memberHome.findByPrimaryKey(id);
                   if(member.getMPassword().equals(password)){
                        this.loginID = member.getMID();
                        this.accessLevel = member.getMAccessLevel();
                   else{
                        throw new EJBException("Login failed. Invalid member ID and/or password.");
              } catch (FinderException ex) {
                   throw new EJBException("Login failed. Invalid member ID and/or password.");
         public void logout(){
              this.loginID = null;
              this.accessLevel = 4;
         public String getLoginID(){
              return this.loginID;
         public int getLoginAccessLevel(){
              return this.accessLevel;
    login.jsp
    String mID = request.getParameter("mID");
    String mPassword = request.getParameter("mPassword");
    out.println("20:" + mID + ":" + mPassword);
    if(mID != null && mPassword != null){
         out.println("22:" + mID + ":" + mPassword);
         try{
              InitialContext ic = new InitialContext();
              MemberControllerHome home = (MemberControllerHome) ic.lookup("java:comp/env/ejb/MemberController");
              MemberController mc = home.create();
              out.println("26:Logging in as " + mID + " with " + mPassword);
              mc.login(mID, mPassword);
              out.println("28:" + mc.getLoginID() + "logged in successfully at level " +
                   mc.getLoginAccessLevel() + ".");
         } catch (NamingException ex) {
              out.println("java:comp/env/ejb/MemberController not found.");
         } catch (EJBException ex) {
              out.println(ex.getMessage());
         } catch (Exception ex) {
              out.println(ex.getMessage());
    testlogin.jsp
    <%
    try{
         InitialContext ic = new InitialContext();
         MemberControllerHome home = (MemberControllerHome) ic.lookup("java:comp/env/ejb/MemberController");
         MemberController mc = home.create();
         out.println("You are logged in as <b>" + mc.getLoginID() +
              "</b> at level <b>" + mc.getLoginAccessLevel() + "</b>.");
    } catch (NamingException ex) {
         out.println("java:comp/env/ejb/MemberController not found.");
    } catch (EJBException ex) {
         out.println(ex.getMessage());
    } catch (Exception ex) {
         out.println(ex.getMessage());
    %>

    The key to the problem is that in testlogin.jsp a new stateful session bean is created. The new bean instance of course doesn't know the log-in information you stored in the old session bean. That is why the method returns null and 0 when called.
    There are couple of ways to solve the issue. The easiest solution is to store the bean instance created in Login.jsp in the jsp's implicit HttpSession object. Because login.jsp and testlogin.jsp share the same session, the bean instance can be easily stored and retrieved.
    Here is the code you need to have:
    1. in login.jsp
    session.setAttribute("MemberControllerBeanInstance", mc);
    2. in testlogin.jsp
    MemberController mc =
    (MemberController) session.getAttribute("MemberControllerBeanInstance");
    Hope it helps.

  • My SAP MMC is not showing server instance01

    Hello Experts,
    My SAP MMC is not showing server instance01.
    I am running Netweaver 2004s SP17.
    It was working fine earlier, and after a system reboot, I tried to start the server again, but MMC does not show server instance in NSP node.
    I had tried starting the server from Administrative tools->Services   SAPNSP_01
    but, its not starting and showing and message as
           Could not start the SAPNSP_01 service on Local Computer.
           Error 5: Access is denied.
    where as SAPNSP_00 in  Administrative tools->Services started and showing that in MMC console also.
    Is there a way for me to fix this?
    Regards
    Sunil

    I managed to fix the problem - I ran sapstartsrv.exe from windows explorer (located in \usr\sap\NSP\DVEBMGS00\exe)
    Here I entered the following:
    Operation: -Install Service and register COM interface & Start Service
    SID: NSP
    NR: 00
    Start Profile: C:\usr\sap\NSP\SYS\profile\START_DVEBMGS00_<ServerName> (where <ServerName> is your computer name)
    User: <ServerName>\<UserName> (where <ServerName> is your computer name, and <UserName> is your windows login name)
    Password: windows login password
    Startup Type: Automatic

  • Accessing Instance Variables

    Hi,
    I am trying to make a presentation that shows all instance variables of a determined process's instance.
    In order to do that, I have created a Gloabal Interactivity Activity with a presentation that ask for a key.
    So, I want to show in the next presentation all the instance variables of the instance processes that has the key informed by the user on the previous presentation.
    How can I do that?
    Thanks very much
    Marcos

    <script language="JavaScript">
    var scriptVar = "<%= jspVar %>";
    </script>

  • Servlet Instance Variable scope

    Just want to clarify my understanding of instance variables in regards to Servlets.
    public class TestServlet extends HttpServlet
        public String instVariable = "";
    public void processRequest(HttpServletRequest request, HttpServletResponse response)
          instVariable = request.getParameter("param");
          response.sendRedirect( instVariable ) ;
    }If two users both enter the processRequest logic at the same time, is it possible that they will both get the same
    result? My understanding of this was that if they each execute the first line, then each execute the second
    line, each user would be redirected to the same instVariable that was set by the second request.
    What would be the easiest way to stop this from happening? syncronized? ThreadSafe?
    I just want a simple clarification.
    Thanks for the insight.

    If two users both enter the processRequest logic at
    the same time, is it possible that they will both get
    the same
    result? My understanding of this was that if they
    each execute the first line, then each execute the
    second
    line, each user would be redirected to the same
    instVariable that was set by the second request. Yes, it is possible, since there is only one instVariable.
    What would be the easiest way to stop this from
    happening? syncronized? ThreadSafe? The easiest way to avoid that is to simply not use an instance variable. Use a local variable, declared within your processRequest method. Each thread (i.e. each user of the servlet) has its own set of local variables.

  • Scope of instance variables in servlets..

    Hi all,
              Sorry for asking a dumb question..
              What is the scope of instance variables in a servlet? Is the scope is
              limited to thread?
              In other words, in the following example, i am setting "testStr", in one
              request and when i tried to access the same instance variable from another
              request, i am getting it as null. Does it mean instance variable is limited
              to that particular thread/request?
              thanks in advance..
              -ramu
              

    Oops ... I had misunderstood and had the problem backwards ;-)
              > Is it known behavior? With registered servlet its working fine (a
              > instance variable is shared by all requests)
              I believe so; I typically deploy in a WAR so have not seen the problem that
              you describe. Servlets can be reloaded, so what you saw could have been
              caused bye a date/time mismatch between the .class file and the server's
              current time. On the other hand, that could be how WebLogic works.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Ramu" <[email protected]> wrote in message
              news:[email protected]...
              > Hi Purdy,
              >
              > I got it. I am testing the servlet as a unregistered servlet, which is
              > creating instance for every new request!!!, which created this whole
              > confusion. Is it known behavior? With registered servlet its working fine
              (a
              > instance variable is shared by all requests)
              >
              > > What theory? ;-) Instance variables are on the object, and the object
              can
              > > be used by multiple threads, thus allowing multiple threads to access
              the
              > > same instance variables.
              > what i mean by theory here is, all instance variables in servlet should
              be
              > shared by all requests. Now i got it sir.
              >
              > Thank you..
              > -ramu
              >
              >
              > >
              > > Peace,
              > >
              > > --
              > > Cameron Purdy
              > > Tangosol, Inc.
              > > http://www.tangosol.com
              > > +1.617.623.5782
              > > WebLogic Consulting Available
              > >
              > >
              > > "Ramu" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > Hi,
              > > >
              > > > > No, an instance variable in a servlet class is not limited to a
              > thread.
              > > > There
              > > > > is exactly one copy of the servlet created in memory and all
              requests
              > > pass
              > > > > through the same instance, thus sharing any instance variables. A
              > > couple
              > > > of
              > > > > things to remember:
              > > > I totally agree with you, But i am wondering why my sample servlet(i
              am
              > > > attaching the file) is not sharing the instance variables across
              > > > threads/reqs. (in 1st request set some string to "testStr" instance
              > > > variable, in next request if you read the same instance variable, you
              > will
              > > > get null!!)
              > > > Our current code is having instance variables. But right now we are
              not
              > > > getting any problems. But as per theory, instance variables should be
              > > shared
              > > > across threads/requests..
              > > >
              > > > Any how we are changing our code to remove all instance variables.
              > > >
              > > > thanks,
              > > > -ramu
              > > >
              > > > >
              > > > > 1.) Using instance or class variables in servlets that are not
              > read-only
              > > > is not
              > > > > a good thing to do. This makes the servlet not thread-safe. To
              > > maintain
              > > > > variables across requests, sessions, etc., use the servlet-defined
              > > objects
              > > > to
              > > > > store the state (e.g., request, session, etc.).
              > > > >
              > > > > 2.) If you modify the servlet class on disk, WebLogic will reload
              the
              > > > servlet
              > > > > class thus discarding the old instance and creating a new one (of
              > > course,
              > > > this
              > > > > depends on some configuration parameters for servlet reloading).
              > > > >
              > > > > Hope this helps,
              > > > > Robert
              > > > >
              > > > > Ramu wrote:
              > > > >
              > > > > > Hi,
              > > > > > thanks for quick reply.
              > > > > > I am not at all using SingleThreadModel. See the following code.
              > > > > > In first request i am passing "abc" value to testStr. But in
              second
              > > > request,
              > > > > > I am getting null for testStr in second request. It looks like
              (for
              > > me)
              > > > for
              > > > > > non single threaded model also, scope of instance variables is
              > > limited
              > > > to
              > > > > > Thread/Request.. But as per theory, because its not single
              threaded
              > > > model,
              > > > > > only one instance should be there AND testStr(instace variables)
              > > should
              > > > be
              > > > > > shared across the all threads. But i am not able see that
              behaviour
              > > > here.
              > > > > > But if declare instance variable as static, o am able to share
              it
              > > > across
              > > > > > all threads/requests.
              > > > > >
              > > > > > note:
              > > > > > From browser i am setting testStr to "abc" with URL like
              > > > > > "localhost/test1?testStr=abc"
              > > > > > And 2nd req from browser is like "localhost/test1" (on server
              > output
              > > i
              > > > am
              > > > > > getting null for testStr)
              > > > > >
              > > > > > Any ideas?
              > > > > >
              > > > > > thanks,
              > > > > > -ravi
              > > > > >
              > > > > > import java.io.*;
              > > > > > import javax.servlet.*;
              > > > > > import javax.servlet.http.*;
              > > > > >
              > > > > > public class test1 extends HttpServlet
              > > > > > {
              > > > > > public String testStr;
              > > > > >
              > > > > > public void doGet (HttpServletRequest req, HttpServletResponse
              res)
              > > > > > throws ServletException, IOException
              > > > > > {
              > > > > > doPost(req, res);
              > > > > > }
              > > > > >
              > > > > > public void doPost (HttpServletRequest req,
              HttpServletResponse
              > > res)
              > > > > > throws ServletException, IOException
              > > > > > {
              > > > > > try {
              > > > > > res.setContentType("text/html");
              > > > > > PrintWriter out = res.getWriter();
              > > > > > if(req.getParameter("testStr") != null)
              > > > > > {
              > > > > > testStr = req.getParameter("testStr");
              > > > > > System.out.println("set testStr = " + testStr);
              > > > > > }
              > > > > > else{
              > > > > > System.out.println("get testStr = " + testStr);
              > > > > > }
              > > > > >
              > > > > > }
              > > > > > catch(Exception e){
              > > > > > e.printStackTrace();
              > > > > > }
              > > > > >
              > > > > > }
              > > > > > }
              > > > > >
              > > > > > "Cameron Purdy" <[email protected]> wrote in message
              > > > > > news:[email protected]...
              > > > > > > Yes or no, depending on if your servlet implements
              > > SingleThreadModel.
              > > > > > >
              > > > > > > See the servlet 2.2 spec for documentation on how many instances
              > of
              > > a
              > > > > > > servlet will be created. See the doc for the SingleThreadModel
              > > > interface.
              > > > > > >
              > > > > > > Peace,
              > > > > > >
              > > > > > > --
              > > > > > > Cameron Purdy
              > > > > > > Tangosol, Inc.
              > > > > > > http://www.tangosol.com
              > > > > > > +1.617.623.5782
              > > > > > > WebLogic Consulting Available
              > > > > > >
              > > > > > >
              > > > > > > "Ramu" <[email protected]> wrote in message
              > > > > > > news:[email protected]...
              > > > > > > > Hi all,
              > > > > > > >
              > > > > > > > Sorry for asking a dumb question..
              > > > > > > >
              > > > > > > > What is the scope of instance variables in a servlet? Is the
              > scope
              > > > is
              > > > > > > > limited to thread?
              > > > > > > >
              > > > > > > > In other words, in the following example, i am setting
              > "testStr",
              > > in
              > > > one
              > > > > > > > request and when i tried to access the same instance variable
              > from
              > > > > > another
              > > > > > > > request, i am getting it as null. Does it mean instance
              variable
              > > is
              > > > > > > limited
              > > > > > > > to that particular thread/request?
              > > > > > > >
              > > > > > > > thanks in advance..
              > > > > > > >
              > > > > > > > -ramu
              > > > > > > >
              > > > > > > >
              > > > > > > >
              > > > > > >
              > > > > > >
              > > > >
              > > >
              > > >
              > > >
              > >
              > >
              >
              >
              

Maybe you are looking for

  • BI Publisher: how to get Oracle database data row as interval in report

    Dear everyone, I am new to BI publisher and trying to get a data from Oracle table and display it as cumulative columns in a report. But stuck at this, please help, detail as below: Example: this is a sample of database table taken from Primavera app

  • How to i get the client the user is working with?

    Hi in the inbound-container is the field syncuser which specifies the username a client is synchronizing with. is there also a way to see the client? when i start external debugging the rfc request comes in over client 011 but when the abap code is c

  • Calling form in query mode

    Hello friends, I want to call a form B from Form A in query mode. And my all atributes r like new_record_instance of block IF :a.order_no IS NOT NULL AND :SYSTEM.RECORD_STATUS = 'QUERY' THEN      SELECT COUNT(1)      INTO n_cnt      FROM a      WHERE

  • Google Images Not Showing past Page 1

    Since installing FireFox 4, I have received a Google Redirect Virus, that I finally fixed after weeks of research AND, I can only see images in the 1st page of search results. I see that there are multiple pages available but the images are grayed ou

  • Adjustment Brush really, really slow in LR 3.3

    Hi, Don't know if anyone else has this problem, but when I use the adjustment brush with the photo in 1:1 ratio, my computer becomes really, really slow to respond.  It becomes so slow, that I have to shut down LR 3.3 and restart.  I'm using Windows