1 Reply Latest reply on Feb 11, 2011 11:08 AM by Sean Jensen

    Required component not being created

    Sean Jensen Newbie

      I'm trying to get a project that my predecessor started developing so that I can continue to work on it.  My challenge is greater because while I'm using Eclipse the creator of the project was using Netbeans.  I've downloaded the 8 projects involved and recreated the dependencies so Eclipse doesn't complain about them.  However when I deploy the application it fails on login giving me a null pointer exception.  I've added some logging and discovered that I'm failing in my authorization process because my authenticator class is initialing with a null component.  The original creator of the application didn't put any null tests in the code and the .ear file that was originally created from the source code works correctly so there is something in my configuration that is wrong.  I've spent quite a bit of time on this and could use some help.

      The component seems to be defined in the components.xml properly and the component that should be passed to it is defined immediately after and they seem to be well formed. 

      <component auto-create="false"
        name="authenticator" scope="session">
        <property name="authTypeName">@authTypeName@</property>
       <component auto-create="true"
        name="authInfo" scope="application">
        <property name="roleMandatory">@roleMandatory@</property>
        <property name="roleMutuallyExclusive">@roleMutuallyExclusive@</property>
        <property name="adminRole">@adminRole@</property>
        <property name="adminPassword">@adminPassword@</property>
        <property name="adminUsernames">
        <property name="powerUserRole">@powerUserRole@</property>
        <property name="powerUserPassword">@powerUserPassword@</property>
        <property name="powerUsernames">
        <property name="userRole">@userRole@</property>
        <property name="userPassword">@userPassword@</property>
        <property name="usernames">
        <property name="observerRole">@observerRole@</property>
        <property name="observerPassword">@observerPassword@</property>
        <property name="observerUsernames">

      My DefaultAuthenticator class has a private field for AuthInfo but it is always a null and causes failures of course.  Is there a way for me to see why this component did not get created?  I doubt the code has bugs because I can run the finished .ear file I just can't make the copy I need to work on function and I don't know why.

      Any advice would be appreciated.  Anyone commenting on my lack of skills is welcome to trade places with me and show me how it's done.  :)

        • 1. Re: Required component not being created
          Sean Jensen Newbie

          Is there any way to see a failure on the component creation when the component is declared in the components.xml?  What I would like to check on is whether the class file for the component is out of sync with the components.xml.  If I understand this correctly I will need to have my components.xml definition of the component exactly matching the fields in my class definition right?