Details

    • Similar Issues:
      Show 5 results 

      Description

      Hello,

      with trunk (in fact since revision changes 92262 committed on Nov. 2nd) there is a problem with the LDAP import if there are fields that are not mapped. Prior to this, you could e.g. leave the Middle Name field unmapped and the LDAP import would work. Since this revision, you get a NPE on the LDAP import.

      The problem is related to the code redesign in the following method:
      public static String getAttributeString(
      Attributes attributes, String id, String defaultValue)
      throws NamingException {

      Attribute attribute = attributes.get(id);

      if (attribute == null)

      { return defaultValue; }

      Object object = attribute.get();

      if (object == null) { return defaultValue; }

      return object.toString();
      }

      the method call Attribute attribute = attributes.get(id); can throw a NPE and that exception is not catched in the code.

      Prior to this change the code looked like this:
      public static Object getAttributeValueAsObject(
      Attributes attributes, String id, Object defaultValue)
      throws NamingException {

      try

      { Attribute attribute = attributes.get(id); Object obj = attribute.get(); return obj; }

      catch (NullPointerException npe)

      { return defaultValue; }

      }

      here the method call Attribute attribute = attributes.get(id); took place within the try catch statement and the NPE was explicitly catched.

      So simply changing the code like this should solve the problem:

      Attribut attribute = null;
      try

      { attribute = attributes.get(id); }

      catch (NullPointerException npe)

      { return defaultValue; }

        Activity

        Hide
        Traolly Xiong added a comment -

        Thank you. I'll give it try.

        Regards,
        Traolly Xiong

        Show
        Traolly Xiong added a comment - Thank you. I'll give it try. Regards, Traolly Xiong
        Hide
        Traolly Xiong added a comment -

        Trying to download trunk via SVN GUI and running this command I get an error:

        Step:

        Run Build Scripts #

        Verify the path to your tomcat directory is correct or the build will fail (see Configure Trunk). You need to run three separate commands in this order

        cd

        {full path}

        /liferay-code/trunk
        ant -buildfile build-dist.xml unzip-tomcat // Running this command I get an error below
        ant all

        Error:

        C:\Liferay_TRUNK\liferay-code\trunk>ant -buildfile build-dist.xml unzip-tomcat
        Buildfile: build-dist.xml does not exist!
        Build failed

        Am I missing something here?

        Show
        Traolly Xiong added a comment - Trying to download trunk via SVN GUI and running this command I get an error: Step: Run Build Scripts # Verify the path to your tomcat directory is correct or the build will fail (see Configure Trunk). You need to run three separate commands in this order cd {full path} /liferay-code/trunk ant -buildfile build-dist.xml unzip-tomcat // Running this command I get an error below ant all Error: C:\Liferay_TRUNK\liferay-code\trunk>ant -buildfile build-dist.xml unzip-tomcat Buildfile: build-dist.xml does not exist! Build failed Am I missing something here?
        Hide
        Michael Saechang added a comment -

        You are running the command in the wrong directory. The directory you are running that command in should be where the source files are. There should be a build.xml and build-dist.xml.

        Show
        Michael Saechang added a comment - You are running the command in the wrong directory. The directory you are running that command in should be where the source files are. There should be a build.xml and build-dist.xml.
        Hide
        Traolly Xiong added a comment -

        I'm still not too familiar on how we should use the trunk. Should we check out the trunk to our actual bundle NT file install and when
        there's a change to the trunk we can do a svn update to get the latest fix for assets? Or is it just to download/view/compare with the current bundle source files that are currently installed?

        Let me know.

        Regards,
        Traolly Xiong

        Show
        Traolly Xiong added a comment - I'm still not too familiar on how we should use the trunk. Should we check out the trunk to our actual bundle NT file install and when there's a change to the trunk we can do a svn update to get the latest fix for assets? Or is it just to download/view/compare with the current bundle source files that are currently installed? Let me know. Regards, Traolly Xiong
        Hide
        Alex Weirig added a comment -

        Hello Traolly,

        when it comes to trunk, here's what I do:
        1) I check out the code from svn into a dedicated directory
        2) I configure my build.properties and then I build the code
        3) I deploy to a dedicated Tomcat server (not sure what you mean with bundle NT file install)
        4) when I'm working on trunk, I run an svn update every morning to get the latest code, then I build again and deploy to my test Tomcat environment
        5) if appropriate and needed, I deploy my theme, portlets, hooks etc to this test server
        6) also, make sure you have a dedicated test database for trunk, the database structure on trunk is likely to change on a regular base so you'd have to drop and recreate the database

        So basically, when you check out from trunk you get the entire source code with all assets. So you can do whatever you need on that source code (fix bugs, test things ...) and yes, as I said, you can always run an svn update to get the latest. In that case you just have to take care of changes you might have done to the source code (merge them, copy them back from a diff file ...)

        You might also want / have to checkout the plugins SDK from trunk, depending on what you want / need to do.

        That's just what I do ... it works for me hopefully it can help you.

        Regards,

        Alex

        Show
        Alex Weirig added a comment - Hello Traolly, when it comes to trunk, here's what I do: 1) I check out the code from svn into a dedicated directory 2) I configure my build.properties and then I build the code 3) I deploy to a dedicated Tomcat server (not sure what you mean with bundle NT file install) 4) when I'm working on trunk, I run an svn update every morning to get the latest code, then I build again and deploy to my test Tomcat environment 5) if appropriate and needed, I deploy my theme, portlets, hooks etc to this test server 6) also, make sure you have a dedicated test database for trunk, the database structure on trunk is likely to change on a regular base so you'd have to drop and recreate the database So basically, when you check out from trunk you get the entire source code with all assets. So you can do whatever you need on that source code (fix bugs, test things ...) and yes, as I said, you can always run an svn update to get the latest. In that case you just have to take care of changes you might have done to the source code (merge them, copy them back from a diff file ...) You might also want / have to checkout the plugins SDK from trunk, depending on what you want / need to do. That's just what I do ... it works for me hopefully it can help you. Regards, Alex

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 25 weeks, 3 days ago

              Development

                Structure Helper Panel