java.lang.InstantiationException

tip

This happens when you try to instantiate a class that can't be instantiated, either because the class object is abstract, an interface, an array class, a primitive type, void, or because the class has no nullary constructor.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • InvocationTargetException acting odd
    via by 843797,
  • ant-core crashes with InstantiationException
    via by erik.bergmann,
  • JAX-RPC type mapping problem
    via by 843834,
  • Saving JSP output to a file
    via by 843835,
  • InstantiationException with ANT 1.6.2
    via by PNS Subramanian,
    • java.lang.InstantiationException: Main$BadThrow at java.lang.Class.newInstance0(Class.java:291) at java.lang.Class.newInstance(Class.java:259) at Main.foo(Main.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at Main.main(Main.java:17)

    Users with the same issue

    Unknown User
    178 times, last one,
    Andreas Häber
    2 times, last one,
    filpgame
    8 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    38 more bugmates