Strange! null reference in a String witch shouldn't be null

I have a bug that really I dont understand. I get un Id from a database with a select query. and i check that is correctly gotten. then i set this Id in a static attribute of a class. fro example: Test.setId(_id);
when i want to insert this id in a second table a get an sqlexception saying that the id can't be null.
When debugging, I add a println to print this Id, and misteriously the id is not null and the insert request is correctly executed.
Can you help me please, i spend 3 days to think about this problem and i have no explanation

Post the failing code & point us to the line that fails. Would also help to to post the table definition that includes the column the DBMS is complaining about.

Similar Messages

  • Strange Null file in Trash that wont delete.

    I have a strange file in my Trash that I can't delete. It has a name of "␀␀␀␀␀␀␀.␀␀␀". It appears as if all the characters are Null.
    These are the actions I have taken:
    1. Using Tech Tool Pro, performed file system check. Now problems found.
    2. Using Terminal, changed directory to .Trash, performed ls -A and no files were found.
    3. Attempted a delete (rm) of all files in trash. No luck. File remains.
    4. When I select file and do a Get Info, the file disappears and the Trash Icon shows empty, but opening the trash again brings this strange file back.
    5. Tried renaming the file but the rename fails with an error -43.
    6. I booted from another disk and rand Disk utility which found and corrected incorrect file count problem. Still the file persists, and the verify of the disk now returns no errors.
    7. Ran verify disk permissions. No problems found.
    I believe the file first appeared after installing Leopard 10.5.3 update, but I'm not sure if this is related.
    Any help would be appreciated.
    Jeff Cameron

    Thank you! That was it.
    Although my Windows Partition is FAT32 instead of NTFS, after booting XP, I found a null file in C:\.Trashes\501\. I could not delete it there either. My next step was to run CHKDSK C: /F, which converted the 501 folder into a file, which I could delete.
    Booting back into OSX, the null file was now gone.
    Thanks again for your help.
    Jeff

  • Reference Attribute to String

    So I am trying to take a reference attribute "Assistant" and convert it to a String to populate msexchAssistantName.
    I thought I might be able to do it with an outbound sync rule in the FIM Portal, but I cannot seem to get the custom expression right. "Assistant".Value.ToString
    I found alot of String to Reference docs online but not Reference to String.
    any help is appreciated.
    Thanks
    Russ
    Russell Lema

    Hi,
    you can do it the "simple" way if you want by just modify the RCDC for user create/view like this:
    <my:Control my:Name="DirectReports" my:TypeName="UocListView" my:ExpandArea="false" my:Caption="DirectReports">
    <my:Properties>
    <my:Property my:Name="ColumnsToDisplay" my:Value="DisplayName,Description" />
    <my:Property my:Name="EmptyResultText" my:Value="There are no groups according to the filter definition." />
    <my:Property my:Name="PageSize" my:Value="7" />
    <my:Property my:Name="ShowTitleBar" my:Value="false" />
    <my:Property my:Name="ShowActionBar" my:Value="false" />
    <my:Property my:Name="ShowPreview" my:Value="false" />
    <my:Property my:Name="ShowSearchControl" my:Value="false" />
    <my:Property my:Name="EnableSelection" my:Value="false" />
    <my:Property my:Name="SingleSelection" my:Value="false" />
    <my:Property my:Name="ListFilter" my:Value="/Person[(Manager='%ObjectID%')]" />
    </my:Properties>
    </my:Control>
    This will give you a list of all poeple who have the current user set as the Manager.
    Regards
    Peter
    Peter Stapf - ExpertCircle GmbH - My blog:
    JustIDM.wordpress.com

  • Strange assembly reference error...wrong version?

    Post Author: redwing19
    CA Forum: General
    I'm using Crystal Reports with Visual Studio 2005 and I get an error when I try to run my app that says: "The type
    initializer for 'CrystalDecisions.ReportSource.ReportSourceFactory'
    threw an exception." with an InnerException of "The type initializer
    for 'CrystalDecisions.Shared.SharedUtils' threw an exception.".I'm pretty sure this is due to the version and targeted runtime of the assemblies.  When I first created my "Crystal Reports Application" the references that are added are as follows:CrystalDecisions.CrystalReports.EngineCrystalDecisions.Enterprise.FrameworkCrystalDecisions.Enterprise.InfoStoreCrystalDecisions.ReportSourceCrystalDecisions.SharedCrystalDecisions.Windows.FormsBut for some reason the Framework and InfoStore assemblies are version 9.2.3300.0 and target the v1.0 .Net runtime, while the rest of the dlls are 10.2.3600.0 and target the v2.0 runtime.If I delete those two references, they will automatically be re-added when I create another report or drag a Crystal Reports component onto a form.  And these re-added references will be the correct version of 10.2.3600.0, but in the properties window, it still says they target the v1.0 .Net runtime.Anyone know what's going on here?  How can I get the 10.2.3600.0 version of these two assemblies, and have them target the v2.0 runtime? 

    Post Author: dynocomp
    CA Forum: General
    Try changing the company name in your AssemblyInfo.vb:
    <Assembly: AssemblyCompany("Company Name")>
    to
    <Assembly: AssemblyCompany("Anything Else")>

  • Strange behavior when emptying long strings

    The attached vi is supposed to clear a string indicator after its length becomes greater than a specified threshold length, with led indicators following the process.  It works fine at threshold 262268, but increasing it to 262269 causes it to periodically freeze.  The indicator lights do not update appropriately either.  Also if you set the threshold much higher, like around 1,000,000, the temporary freeze becomes even longer.  Is there a way to fix this?
    Message Edited by AntLee29 on 05-16-2007 06:14 AM
    Message Edited by AntLee29 on 05-16-2007 06:16 AM
    Attachments:
    string clearing.vi ‏15 KB
    string clearing.PNG ‏20 KB

    Hi AntLee,
    this is NOT a problem of memory handling - you are playing with 256kB of memory, pretty easy for modern computers.
    The problem comes from your LineFeed constant together with the string indicator!
    If you replace the LF by a Tab constant your example runs fine even with a treshhold of 1000000 (one million).
    So I suspect the string indicator has problems to show more than 262286 (~2^18) lines of text because of rendering all those line breaks - maybe NI should investigate this more deeply...
    Message Edited by GerdW on 05-16-2007 04:38 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    string clearing.vi ‏15 KB

  • Strange problem with unflatten from string

    Hi all,
    Attached are the VIs that make me crazy.
    The problem is simple, Creat fake signal creats datas and uses a strict type def control (cluster) then this cluster is flatten to a string and written into a text file.
    Test read opens one of that file and unflatten the datas with the same stric type def. There is the problem it does not work!
    If I wire a cst arry into the data terminal of the bundle by name, then there is no problem. By if I wire other array it does not work always... It seems random.....
    I hope that somebody can help me. Even people reproducing the error are welcome, to know if it comes from my computer.
    Thanks a lot for the help
    Attachments:
    vis.zip ‏43 KB

    I changed the write to binary sting file with write to binary file and it seemed to fix the problem. I had to change it in your gen fake data file too.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    vis.zip ‏44 KB

  • How to reference template substitution string in PL/SQL condition

    hi -- I need to conditionally display an item based on the value of #TITLE#. I'm currently trying a pl/sql expression function body returning boolean
    DECLARE
    page_type VARCHAR2(1000);
    BEGIN
    page_type := lower(substr(:TITLE,instr(:TITLE,'Query')));
    if (page_type = 'query') then
    return TRUE;
    else
    return FALSE;
    end if;
    END;
    There are no errors, but the condition is not being met when it should be.
    I tried setting some app items to the value of #TITLE# and I'm obviously not referencing it correctly; they're all null:
    :TEST_VALUE := &TITLE.;
    :TEST_VALUE2 := :TITLE;
    :TEST_VALUE3 := V('TITLE');
    Help?
    Thanks,
    Carol

    Hi,
    You can use javascript on page HTML header
    <script>
    function getDocTitle(pItem){
      $x_Value(pItem, document.title);
    </script>And page body
    onload=" getDocTitle('Px_YOUR_ITEM');"Br, Jari

  • Object reference with a String. Is it Possible?

    Hi all
    I know this is a long shot but I'm taking my chances.
    I have the following boring code
    if (labelNo==1) userField1Label.setText(labelText[labelNo]);
    if (labelNo==2) userField2Label.setText(labelText[labelNo]);
    if (labelNo==3) userField3Label.setText(labelText[labelNo]);
    if (labelNo==4) userField4Label.setText(labelText[labelNo]);
    if (labelNo==5) userField5Label.setText(labelText[labelNo]);
    if (labelNo==6) userField6Label.setText(labelText[labelNo]);which I wish to convert to something on the lines of this pseudo code. Is this somehow possible? - Thanks.
    for (int i=1; i<=noOfLabels; i++) {
        labelObject="userField"+i+"Label";
         ((((labelObject)))).setText(labelText)

    Why not just put the fields into an array?
    for ( i = 0; i < 6; i++ )
      userFieldLabels.setText( labelText[i] );
    And no, by the way, you cannot "userfield"+i - that's a trick from interpreted languages such as Basic. Won't work in java.

  • Null reference converted to a String

    I read somewhere that when a null reference is converted to a string, the result is the String "null", hence a null reference can be used freely within any string concatenation expression.
    for example:
    String str1 = null;
    String str2 = null;
    System.out.println(str1+=str2);//outputs "nullnull"
    Before I read about this, I would have thought that a NullPointerException would have been thrown.
    Can anyone explain the rationale behind this?

    This is not a property of String, its the property of
    the println method in the PrintStream class.No, that's not correct.
    Whenever Strings are concatenated, non-Strings are converted to Strings and null Strings are converted to the String "null". This is a property of the Java language itself.
    The expression a + b, where either a or b is a String, is converted into the expression:
    new StringBuffer().append(a).append(b).toString();
    It is the append method of StringBuffer that calls the toString method of non-String objects, calls String.valueOf on primitives, and converts null String references into the String "null". Even though it's an API call that technically produces this behavior, it is actually a feature of the Java language itself as is therefore explained in the JLS. See http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#39990 for details.

  • Oracle, Null and empty Strings

    Currently I'm facing problems with a class, which contains a String, which
    is set to "" (empty String).
    When the class is persistent, oracle writes null to the table column
    (which seems to be common oracle behaviour) and when retrieving the class,
    the field is set to null as well, giving me a lot of null-pointer
    exceptions.
    Anyway ... I can cope with that (just a lot of extra work)
    far worse is the problem, wenn searching objects, that have this field set
    to "" oder null.
    Oracle can't find the records because JDO creates Querys "where
    string=null" or "where string=''" , where oracle expects "where string is
    null" to find the records.
    Is there a workaround or solution ?

    Yeah, that would work as well, thx, but since I have to cope with
    null-Strings now everywhere in my program, it doesn't hurt just to forbid
    empty strings on the program side.
    In future times I'll test on Oracle first, then porting to DB/2 - this way
    I suppose work is far less to garant compability.
    Nevertheless ... having to set the bankcode into quotes is a kodo bug in
    my opinion.
    Kodo knows the type of classfields (in this case string) and shouldn't
    send the parameter as a BigDecimal to the database.
    Given that, and having only bankcodes of null (only neccesary when using
    Oracle), the method would look like:
    public Collection getAccounts (String bankCode)
    throws Exception
    return getAccounts (Account.class, "bankcode=="+bankcode);
    which is how a transparent persistent layer, um, should be , um , I mean
    ... just transparent ;-D
    Marc Prud'hommeaux wrote:
    Stefan-
    Couldn't you just do something like:
    public Collection getAccounts (String bankCode)
    throws Exception
    String filter;
    if (bankCode == null || bankCode.length () == 0)
    filter = "(bankCode == null || bankCode == "")";
    else
    filter = "bankCode == "" + bankCode + """;
    return getAccounts (Account.class, filter);
    If I understand the problem correctly, this should work for all the
    databases.
    In article <[email protected]>, Stefan wrote:
    What operations are you performing to cause this SQL to be issued? You
    say you are having trouble removing objects, but this is clearly not a
    DELETE statement. Is this the SQL that is issued when looking up
    objects by identity?I'm not removing objects, I was removing just quotes from parameters ;-)
    A string column... is it also represented as a string field in your class?Yeah ... just to give you an impression of the code:
    First we have a class, representing a bank account:
    public class Account {
    private AccountMgr myAccountMgr;
    private String bankCode;
    private String id;
    Note, that in nearly all cases bankCode will be a number or null.
    I have a second class "AccountMgr", which does all of the persistant stuff
    (seaching, making persistent etc.)
    This class has two methods, one versatile (protected) to retrieve accounts
    by a given filterString and one who just returns accounts by bankCode,
    building the expected filterstring. Here is my current working version:
    public class AccountMgr {
    public Collection getAccounts(String bankCode) throws Exception {
    if (bankCode!=null) {
    if (bankCode.equals("")) {
    throw new Exception("check code, bankCode='' not allowed to get
    same behavior from DB2 and Oracle");
    // if set, quote the bankCode
    bankCode="""+bankCode+""";
    return getAccounts(Account.class,"bankCode=="+bankCode);
    protected Collection getAccounts(Class accountClass, String filterAdd)
    throws Exception {
    PersistenceManager pm = MyHelper.getPersistenceManager();
    String filter="";
    if (filterAdd!=null && !filterAdd.trim().equals("")) {
    filter+=filterAdd + " && ";
    filter += "myAccountMgr==_accMgr";
    Query query = pm.newQuery(accountClass, filter);
    query.declareParameters("AccountMgr _accMgr");
    return (Collection) query.execute(this);
    As you can see, in the first method I have to set the bankCode into
    quotes, when it's not null.
    This is because otherwise a filter like "bankCode=1234" will be translated
    in a way, where 1234 is send as a BigDecimal to the database:
    [...] executing statement <4239745>: (SELECT [...] FROM JDO_ACCOUNT t0
    WHERE t0.BANKCODE = ? : [reused=1;params={(BigDecimal) 1234}]
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • What is difference between Null String and Empty String ?

    Hi
    Just i have little confusion that the difference bet'n NULL String and Empty String ..
    Please clear my doubte.
    Thankx

    For the same reason I think it's okay to say "null
    String" and "empty String "as long as you know they
    really mean "null String reference" and "empty String
    object" respectively. Crap. It's only okay to say that as long as *the one you're talking to" knows what it really means. Whether you know it or not is absolutely irrelevant. And there is hardly any ambiguity about the effects that a statement like "assign an object to a reference" brings. "Null String" differs in that way.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reference to string from another class

    I've searched google and this forum a bit, but can't seem to find an answer. I'd say the thing I'm looking for is really simple and essential, so I must be a moron. But anyways; I want to get the output of the "process" thing in another class. How do I reference to that string fomr outside it's class?
    Thanks.
    public class ReadInput {
         private static void printCommands() {
             System.out.println("blabla");
             System.out.println("blabla");
             System.out.println("blabla");
    public static void process(String in) {
              Do something with the String "in" here. Say, eventually rename it to "output".
    public static void doReadFromStdin() {
         try {
             BufferedReader inStream = new BufferedReader (
                                             new InputStreamReader(System.in)
             String inLine = "";
             String in = inLine;
             while ( !(in.equalsIgnoreCase("quit"))
                     !(in.equalsIgnoreCase("exit")) ) {
                 System.out.print("prompt> ");
                 in = inStream.readLine();
                 process(in);
         } catch (IOException e) {
             System.out.println("IOException: " + e);
    public static void main(String[] args) {
          printCommands();
         doReadFromStdin();
    }

    Maybe this might help
    Igor_Pavlove wrote:
    public static void process(String in) {     
    Do something with the String "in" here. Say, eventually rename it to "output".
    public static String process(String in){
      //Do something, e.g.
      String temp = "ifeeltired";
      return temp;  //Returns the String temp when this method is called.
    public static void main(String[] args) {
         printCommands();
    doReadFromStdin();
    public static void main(String[] args){
      String temp = "thisisaroughexamples";
      String result = this.process(temp); //Returns a string and stores it in result
      CreatePlural.print(result);  //This is possible because the method print() in CreatePlural is static and an instance of CreatePlural is not required.
    }Edited by: Melanie_Green on Feb 2, 2009 6:46 AM
    Edited by: Melanie_Green on Feb 2, 2009 6:47 AM

  • Cannot pass String by reference !

    I have the same problem. I understood that if you pass "jxxxarray" or "String" they are passed by reference but I could not make it working. Here are the 2 parts of my code:
    JAVA (The call to native function):
    String toto = new String("toto");
    int nativeCodeReturned = finreadGetFCRAProperties(toto)
    System.out.println("fcra name: " + toto);
    ==> this prints "toto" but should print "FCRA1" !!!
    C (The native function):
    JNIEXPORT jint JNICALL
    Java_com_trustedlogic_qa_CBridge_finreadGetFCRAProperties(JNIEnv
    *env, jobject obj, jstring FCRAName) {
    FCRAName is modified and now contains "FCRA1" in jstring format (I used the appropriate method to do that, and verified the content)
    Please help !!!
    Thx in advance,
    Eg\\*

    Please help !!!You can't modify the string, that is why strings are immutable.
    So what you are doing is trying to change the reference (not the string that the reference points to.) And the reference is passed by value.
    This is exactly the same thing that happens in java. It has nothing to do with JNI.

  • Two string references pointing to the same object

    Look at the following code snippet         String   s1 = "hello";
            String   s2 = "world";
            String   s3 = "welcome";
            String   s4 = "here";
            String   s5 = "hello";
      They say that references s1 and s5 point to the same object "hello".
    At run time after creating objects from s1 to s4 how the Java run time knows that there is already an object "hello" and assigns a differernt reference.

    When the jvm load the class file, all suchconstants
    found in the class are loaded in a global constant
    pool. when you assign the constant to a variable,it
    uses the same one from the constant pool.Suppose I intialize a string by getiing input
    nput from the console which already exists, in that
    case a new object will be created or the existing one
    be used.A new object will always be created in that case, but you can get a reference to the string in the pool by calling intern. See the javadoc for intern in the String class.
    Kaj

  • Behaviour of String as reference type

    I tried this simple code to find out how a String behaves. It does not work as you could expect from a reference type. On the other hand the keyword new is leftout but I expect it is used in the background.
    Can anyone explain !
    Thanks.
    class Te {
    public static void main (String arg[]){
         int[] a = new int [1];
         a[0] = 1;
         int[] b = a;
         a[0] = 2;
         System.out.println("a[0]="+a[0]+" b[0]="+b[0]);
         String c = "AA";
         String d = c;
         c = "BB";
         System.out.println("c="+c+" d="+d);
    And the printout is:
    a[0]=2 b[0]=2
    c=BB d=AA

    I I understand it correctly, the line
    c = "BB";is realy
    c = new String("BB");otherwise c and d should have reference to the same
    String.On some level, yes, but in reality...
    If you know C++, it is should be enough just to say that java's references are really pointers - there are also references in C++ but they mean another things.
    So, c = "BB" just assigns the "reference variable" (pointer) c to a new reference of a String object, but the value of the "reference variable" (pointer) d remains the same. So basicallyString c = "AA";
    String d = c;
    c = "BB";is the same thing asint c = 1;
    int d = 2;
    c = 1;Strings in Java have this nice little extra feature... saying that String c = "BB" and String c = new String("BB") are totally different things. You can check this with code like:String a = "xyzzy";
    String b = "xyzzy";
    String c = new String("xyzzy");
    if (a == b) System.out.println("a and b refer to the same object");
    if (a != c) System.out.println("a and c don't refer to the same object");The literal Strings are stored in a literal String pool, so each occurence of "BB" refers to the same object. But new String("BB") creates a whole new String object, different from the literal "BB".

Maybe you are looking for

  • Sound is not working

    sound is not working

  • Same apple id can locate iphone but not ipod touch

    I have find my iphone installed on both devices, location services are on, wifi is on, icloud is on and find my iphone is on within icloud in settings, but I cannot locate the ipod touch only the iphone. Any ideas??

  • About forms builder 6i's tab page

    when tab page is changed from one to another which triggers will be fired in order?? (click the topmost Tab Page ) thanks Edited by: user650991 on Apr 16, 2009 6:11 PM

  • ASCMD CP -R not working

    Hi We use Grid Infrastrcture in 11.2.0.1 on AIX with ASM I want to copy a folder from ASM to FS with command cp over asmcmd but It does not work for folder ASMCMD> cp -r MYDB /myfs/ ASMCMD-08012: can not determine file type for file->'+MYASMDG/MYDB'

  • Flash Paper dans un document flash

    Allo tout le monde, J'ai converti mes fichiers pdf en flash paper 2 format swf : ça au moins c'est très facile ! Méthode: - Ouvrir un fichier pdf - Aller à la fonction imprimer - Choisir l'imprimante qui est Flash Paper 2 et pouf !, tout ce fait auto