Slick @StaticDatabaseConfig annotation does not compile in ScalaIDE but does in SBT

208 views
Skip to first unread message

Daniel Toone

unread,
Apr 6, 2016, 1:36:20 PM4/6/16
to Scala IDE User
I wanted to report a bug, but didn't want to sign up for an account with Assembla.

When I use this code (forked from a an activator tutorial template), it compiles fine and runs in SBT, but I get the following error in ScalaIDE:

Description    Resource    Path    Location    Type
Cannot load @StaticDatabaseConfig("file:src/main/resources/application.conf#tsql"): No configuration setting found for key 'tsql'    TypedSQL.scala    /slick_debug/src/main/scala    line 14    Scala Problem

Is there a way to understand what is going on? Or possibly a workaround?

Thanks

Daniel Toone

unread,
Apr 6, 2016, 1:37:04 PM4/6/16
to Scala IDE User
BTW....I'm using the latest version of scalaIDE, but it didn't work in the previous stable either.

Simon Schäfer

unread,
Apr 6, 2016, 4:10:56 PM4/6/16
to scala-i...@googlegroups.com
Looks like a macro that does not see the config file. The compiler in the IDE starts to search for files with a relative path based on the location of the project, which is probably not what sbt is doing. I guess sbt starts to search from the root of the sbt build, which would explain the difference in behavior. You could try to add an absolute path in the string. If that is not suitable, I think one can even configure in sbt where the command line compiler should start looking for files don't ask me how to do that.

Thanks
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/f67123ef-c2da-4069-9038-4b21128f0022%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Toone

unread,
Apr 6, 2016, 6:30:27 PM4/6/16
to Scala IDE User
Wouldn't the compiler in the IDE be able to find them with the same relative path , given that the project root is the same as the sbt root?

Here is a sample repo that reproduces the condition:

https://github.com/saosebastiao/slick_debug

wpopie...@virtuslab.com

unread,
Apr 7, 2016, 2:25:39 AM4/7/16
to Scala IDE User
Hello Daniel,

I try to look at it today, thanks for project to test

Regards
Wieslaw

Simon Schäfer

unread,
Apr 14, 2016, 10:48:06 AM4/14/16
to scala-i...@googlegroups.com


On 04/07/2016 12:30 AM, Daniel Toone wrote:
Wouldn't the compiler in the IDE be able to find them with the same relative path , given that the project root is the same as the sbt root?
The project root doesn't seem to be the same. I couldn't figure out where Eclipse starts to search for the files but I could fix it in Eclipse by using absolute paths. I think it is best when you ask the on a slick mailing list or on their gitter channel if someone had a similar problem and if they came up with a solution that doesn't use absolute paths.
Reply all
Reply to author
Forward
0 new messages