Questions about the compiler

32 views
Skip to first unread message

Raman Gupta

unread,
Jan 27, 2012, 11:46:09 PM1/27/12
to scala...@googlegroups.com
Using Scala 2.9.1. I have a simple java bean class with an annotation e.g.

@Foo
public class FooBean {
    ...
}

I have some scala code that calls a method on FooBean.

The Foo annotation class is in a jar that is not accessible to the scala compiler, but FooBean is available in the compiler's classpath. When the scala compiler tries to compile my scala code, it gives me a "Missing dependency" error:

scala> new FooBean
error: error while loading FooBean, Missing dependency 'class package.to.Foo', required by /home/raman/test/jars/foobean.jar(FooBean.class)
<console>:8: error: FooBean does not have a constructor
              new FooBean

This seems very similar to https://issues.scala-lang.org/browse/SI-1135, which is marked as Fixed.

Has SI-1135 been broken in Scala 2.9.1?

Also, on a side note, I noticed that the subsequent times the compilation is executed, the "Missing dependency" error is no longer shown (which can be confusing):

scala> new FooBean
<console>:8: error: FooBean does not have a constructor
              new FooBean

Regards,
Raman

Jason Zaugg

unread,
Jan 28, 2012, 4:01:15 AM1/28/12
to scala...@googlegroups.com
On Sat, Jan 28, 2012 at 5:46 AM, Raman Gupta <rocke...@gmail.com> wrote:
Using Scala 2.9.1. I have a simple java bean class with an annotation e.g.

@Foo
public class FooBean {
    ...
}

I have some scala code that calls a method on FooBean.

The Foo annotation class is in a jar that is not accessible to the scala compiler, but FooBean is available in the compiler's classpath. When the scala compiler tries to compile my scala code, it gives me a "Missing dependency" error:

I believe this was fixed once and for all as SI-5343 [1] in commit 1684baef [2]. This is not available yet in a released version of Scala, but is available in 2.10.0-M1.

-jason

Raman Gupta

unread,
Jan 28, 2012, 12:40:53 PM1/28/12
to scala...@googlegroups.com
My google-fu failed me this time. Thank you!

Regards,
Raman

Jason Zaugg

unread,
Jan 28, 2012, 12:49:45 PM1/28/12
to scala...@googlegroups.com
Apparently your problem will still occur -- these changes go in the right direction, but aren't sufficient. Can you raise an new issue?

-jason

Regards,
Raman

Raman Gupta

unread,
Jan 28, 2012, 1:10:10 PM1/28/12
to scala...@googlegroups.com
Ok, trying to do that, but unable to login to JIRA:

You do not have a permission to log in. If you think this is incorrect, please contact your JIRA administrators.

And the "JIRA administrators" page is not configured either.

Regards,
Raman

Raman Gupta

unread,
Jan 29, 2012, 6:19:28 PM1/29/12
to scala...@googlegroups.com
On Saturday, January 28, 2012 12:49:45 PM UTC-5, Jason Zaugg wrote:
On Sat, Jan 28, 2012 at 6:40 PM, Raman Gupta <rocke...@gmail.com> wrote:
On Saturday, January 28, 2012 4:01:15 AM UTC-5, Jason Zaugg wrote:
On Sat, Jan 28, 2012 at 5:46 AM, Raman Gupta <rock...@gmail.com> wrote:
The Foo annotation class is in a jar that is not accessible to the scala compiler, but FooBean is available in the compiler's classpath. When the scala compiler tries to compile my scala code, it gives me a "Missing dependency" error:

I believe this was fixed once and for all as SI-5343 [1] in commit 1684baef [2]. This is not available yet in a released version of Scala, but is available in 2.10.0-M1.

-jason


My google-fu failed me this time. Thank you!

Apparently your problem will still occur -- these changes go in the right direction, but aren't sufficient. Can you raise an new issue?

-jason

I verified a similar problem does indeed still occur on 2.10.0.M1. I created: https://issues.scala-lang.org/browse/SI-5420.

Regards,
Raman

Reply all
Reply to author
Forward
0 new messages