XFire
  1. XFire
  2. XFIRE-905

Aegis trying to instantiate abstract class

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.4
    • Fix Version/s: 1.2.7
    • Component/s: Aegis Module
    • Labels:
      None
    • Environment:
      Windows XP Professional 32bits
      Java 5.0
      Eclipse
      Maven2
    • Number of attachments :
      1

      Description

      I have a big problem, look my example:

      public abstract TemplateNode {}

      public class FieldTemplate extends TemplateNode{};
      public class FieldGroupTemplate extends TemplateNode{};

      public class Template {
      private List<TemplateNode> nodes;
      ..
      }

      Template t = new Template();
      t.add(new FieldTemplate());
      t.add(new FieldGroupTemplate());
      // get service

      service.insertTemplate( template );

      ****
      I get error, 'cannot instantiate class null'.
      In debug, i found this:
      if(isInterface) {

      } else if (isException) {

      } else {
      object = clazz.newInstance(); // but is abstract!!!
      }
      Xfire is trying to instantiate TemplateNode but he can't, because is abstract.
      What i need to do?

      Tkz.

        Activity

        Hide
        Paulo Cesar Silva Reis added a comment -

        my service configuration:

        <service>
        <name>BasicService</name>
        <namespace>http://inovarconsult.com.br/senhas/BasicService</namespace>
        <serviceClass>br.com.inovarconsult.senhas.services.BasicService</serviceClass>
        <implementationClass>br.com.inovarconsult.senhas.web.services.BasicServiceImpl</implementationClass>
        <scope>request</scope>
        </service>

        Show
        Paulo Cesar Silva Reis added a comment - my service configuration: <service> <name>BasicService</name> <namespace> http://inovarconsult.com.br/senhas/BasicService </namespace> <serviceClass>br.com.inovarconsult.senhas.services.BasicService</serviceClass> <implementationClass>br.com.inovarconsult.senhas.web.services.BasicServiceImpl</implementationClass> <scope>request</scope> </service>
        Hide
        Paulo Cesar Silva Reis added a comment -

        Run this test and ull see.
        Tkz.

        Show
        Paulo Cesar Silva Reis added a comment - Run this test and ull see. Tkz.
        Hide
        Dan Diephouse added a comment -

        Its not possible to instantiate abstract classes currently with Aegis. I think we could add it as a feature at some point in the future though.

        Show
        Dan Diephouse added a comment - Its not possible to instantiate abstract classes currently with Aegis. I think we could add it as a feature at some point in the future though.
        Hide
        Paulo Cesar Silva Reis added a comment -

        Ok, so what can i do to work?!
        Can u give me a way?!
        I really need finish it!
        Any tricks?

        Tkz.

        Show
        Paulo Cesar Silva Reis added a comment - Ok, so what can i do to work?! Can u give me a way?! I really need finish it! Any tricks? Tkz.
        Hide
        Dan Diephouse added a comment -

        Well you could add the feature yourself and submit a patch.

        If you are trying to use object inheritance with Aegis, check out the section in the user's guide: http://xfire.codehaus.org/Aegis+Inheritance. This way if you send Foo which extends AbstractFoo, it will be correctly reconstructed on the other side.

        Show
        Dan Diephouse added a comment - Well you could add the feature yourself and submit a patch. If you are trying to use object inheritance with Aegis, check out the section in the user's guide: http://xfire.codehaus.org/Aegis+Inheritance . This way if you send Foo which extends AbstractFoo, it will be correctly reconstructed on the other side.
        Hide
        Bob Bueckers added a comment -

        I have this same issue using 1.2.5, has there been any workaround/patch created for this? I did follow the instructions on Aegis in the user's guide and still have same issue. I guess at this point one of our alternatives is to use JaxB, but we have spent a lot of time on configuring Aegis for the webservice and from our XFire client within Mule.

        Thoughts on how we can proceed?

        Show
        Bob Bueckers added a comment - I have this same issue using 1.2.5, has there been any workaround/patch created for this? I did follow the instructions on Aegis in the user's guide and still have same issue. I guess at this point one of our alternatives is to use JaxB, but we have spent a lot of time on configuring Aegis for the webservice and from our XFire client within Mule. Thoughts on how we can proceed?

          People

          • Assignee:
            Dan Diephouse
            Reporter:
            Paulo Cesar Silva Reis
          • Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated: