Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unresolved compilation problem during runtime!?

268 views
Skip to first unread message

nik...@cc.gatech.edu

unread,
Jun 10, 2002, 3:28:02 AM6/10/02
to
Hi there! :)

I'm facing a very peculiar problem; the compilation goes through
successfully, but I get the following error message during runtime:

"Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructo
rAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at
edu.gatech.ecl.augoffice.common.KimuraProperties.get(KimuraProperties.java:100)
at
edu.gatech.ecl.augoffice.interpreter.Interpreter.<init>(Interpreter.java:24)
at edu.gatech.ecl.augoffice.test.UtilsTest.<init>(UtilsTest.java:210)
at edu.gatech.ecl.augoffice.test.UtilsTest.main(UtilsTest.java:732)"

KimuraProperties is a class that is never instantiated, but is statically
initialized when its first static method is called (via a static { } block).

Does anyone have any ideas what would possibly be causing this?

P.S. To make things even more complicated, if I run the application
through Eclipse, it runs OK!? The problem only appears if I run it on the
command line.

Thanx :)

Nikitas Liogas

rc

unread,
Jun 10, 2002, 9:58:12 AM6/10/02
to
Try compiling it completely outside your development environment,
using only the command line. I don't have hard evidence, but it
smells like you are trying to run classes that were not updated when
other classes were changed, and your Eclipse environment has the
updates but your command line environment does not.

rc

Jim Sculley

unread,
Jun 10, 2002, 10:11:26 AM6/10/02
to
nik...@cc.gatech.edu wrote:
> Hi there! :)
>
> I'm facing a very peculiar problem; the compilation goes through
> successfully, but I get the following error message during runtime:
>
> "Exception in thread "main" java.lang.Error: Unresolved compilation problem:
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
> orAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructo
> rAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> at
> edu.gatech.ecl.augoffice.common.KimuraProperties.get(KimuraProperties.java:100)
> at
> edu.gatech.ecl.augoffice.interpreter.Interpreter.<init>(Interpreter.java:24)
> at edu.gatech.ecl.augoffice.test.UtilsTest.<init>(UtilsTest.java:210)
> at edu.gatech.ecl.augoffice.test.UtilsTest.main(UtilsTest.java:732)"
>
> KimuraProperties is a class that is never instantiated, but is statically
> initialized when its first static method is called (via a static { } block).
>
> Does anyone have any ideas what would possibly be causing this?

Hmmm, when eclipse compiles a class that contains a method which is not
normally compilable, due to a syntax error or whatnot, the bytecode for
the offending method isn't included. Instead, the compiler inserts some
boilerplate code so that if the method is called, an Error is thrown as
shown above. This feature allows classes with compile-time errors to be
executed, provided that the 'bad' code isn't called.

There is no reason (aside from a bug perhaps) why Eclipse would run such
code, while some other VM would not. Can you boil the code down to a
small test case?

Jim S.

0 new messages