Vaadin and Scala

The current status of 3.0 branch is that codes from 2.1 branch are fixed to compile with a snapshot release of Vaadin 7, tests are made to pass by disabling a few of them and that’s pretty much all. Almost all new classes introduced in Vaadin 7 are still missing. Well, the new UI class is already there :slight_smile:

-Henri

Hi, thanks for the info, we’ve been busy developing with Scaladin 2(.1) for Vaadin 6 so I forgot to answer earlier :slight_smile:

There is a remote possibility that we would have time in the near future to poke around Vaadin 7 + Scaladin 3 to see if we can be of assistance. I’ll contact you if we find the time.

  • Matti

Would be great to hear your feedback about Scaladin.

-Henri

@Henri,

Hi,

I am a Scala newbie, looking to use your Scaladin plugin for a new project. I started by installing your Scaladin example demo code, which I now have running with jetty under an older version of Scala/eclipse (very nice!).

I need / want to use the new Slick DB driver for this project:

http://slick.typesafe.com/

The above driver requires Scala 2.10.0 here:

http://www.scala-lang.org/downloads#

When I update Eclipse to the new compiler, per the link above, the demo code no longer works. I think it’s related the the ‘reflect’ jar, but I’m not sure why, as you are not calling this code:
Jetty server returns:

"Caused by:

java.lang.NoClassDefFoundError: scala/reflect/ClassManifest
at com.example.VaadinScalaApplication.(VaadinScalaApplication.scala:16)"

Do you have Scaladin working with Scala 2.10.0? How do I get your demo code to build with this new version of the compiler?

Hi Patrick,

Your problem is that the jar file available in Vaadin Directory is compiled against Scala 2.9 and it’s not binary compatible with Scala 2.10. So, you should checkout the source codes of Scaladin and recompile it with Scala 2.10 and after that it should work.

-Henri

Thanks very much – I’ll give that a try.

@Henri,

Hi,
Sorry, (new to sbt) this is probably a rather simple change, but I tried compiling Scaladin Jar with Scala 2.10 compiler, by cloning the Scaladin git repo and changing the following
2 lines
in the project’s Build.scala file :

object BuildSettings {
val buildOrganization = “vaadin.scala”
val buildName = “Scaladin”
val buildVersion = “2.2.0-SNAPSHOT”

val buildScalaVersion = “2.10.0”

.
.

object Dependencies {
val vaadinVersion = “6.8.3”
val jettyVersion = “7.3.0.v20110203”

val scalaTestVersion = “2.10.0”

when I run sbt at the root directory, I’m seeing:
sbt.ResolveException: unresolved dependency: org.scalatest#scalatest_2.10;2.10.0: not found
[error]
(addon/*:update) sbt.ResolveException: unresolved dependency: org.scalatest#scalatest_2.10;2.10.0: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i

What am I missing? Was hoping that changing the compiler reference in both places would build it with version 2.10.

Hi,

I was able to build a jar with the following changes:

val buildScalaVersion = "2.10.0"
val scalaTestVersion = "2.0.M5b"

-Henri

Easy to use and extend for example to wrap Vaadin plugins, low learning curve (if you understand Vaadin, you will understand Scaladin) etc.

The only drawback is that since everything is wrapped anonymously, JRebel has to recompile almost everything on save but that affects only my co-workers since I’m not currently using JRebel :slight_smile:

  • Matti

Nice.

Thanks very much Henri!

@Henri

Hi Henri,
Last night I took the new Scala 2.10.0 jar that I built yesterday (thanks again for the correct compiler parameters); when I plug the new jar into my original eclipse project, the one hosting your Scaladin demo code, after updating the compiler to 2.10, inside Eclipse, I’m now getting back:

vaadin.scala.Window$.init$default$1()Lcom/vaadin/ui/Window;

In the browser, via Jetty, I’m getting:

java.lang.NoSuchMethodError: vaadin.scala.Window$.init$default$1()Lcom/vaadin/ui/Window;

Is this a configuration issue with my Eclipse, do you think, or does the demo example code not work with a Scala 2.10.0 jar? As I am a Scala newbie, I cannot tell at this point.

Could you please do a test of your demo code with a 2.10 jar and confirm?

I’m hoping to wire up the new Scala Slick driver to your code as a starting place, just want to confirm it’s not my configuration.

Thanks.

I wasn’t able to reproduce your problem but I simplified the demo app in 2.2 branch because it was not compiling at all and I am able to run it. Please note that the code in the master branch is very old (1.0 version of Scaladin), and to clarify Scaladin 2.x is for Vaadin 6 and Scaladin 3.x is for Vaadin 7.

Good to know… thank you, I will check out from 2.x first and recompile. I appreciate your help!

@Henri

Hi Henri,

Sorry in advance for being a pest. :rolleyes:

The bug I was speaking to (above) relates to the demo code you originally wrote on the Master branch, not the 'hello world" demo code snippet now on the 2.x branch::

Would it be possible to port the original demo code from the master branch to the 2.x branch?

I’ve tried and tried with no success.

Not sure if this is the best place to post this question as I haven’t been able to locate anywhere dedicated to discussing Scaladin library usage.

We are currently in the process of porting our web architecture to a new technology stack which includes Vaadin and Scala as key components. As we want to start on current versions, we are in the process of prototyping with Vaadin 7 and the Scaladin 3.0 branch.

When deploying under Tomcat, even with the most basic application we are getting a java.io.NotSerializableException on vaadin.scala.UI$delayedInit$body when Tomcat attempts to serialize the session as it shuts down.

Is this a known issue with core Vaadin 7, or something introduced with Scaladin. If not, then I presume it’s something we’ve introduced?

Not causing us any problem at the moment as our proof-of-concept application has no issues so far. However, if it’s something we’ve introduced that is causing the serialization issue, then I’d like to resolve it before we propagate the problem further :frowning:

TIA for any pointers.

Also, please let me know if there is a better place to discuss these issues.

REGARDS

Hi Peter,

Vaadin forums is the correct place for discussion about Scaladin. I think I should add a link to here to Github’s README file.

The serialization issue is a bug in Scaladin, I created an issue about it:
UI class is not serializable
. Thanks for reporting!

Cheers,

-Henri

Thanks for the response; glad to know it’s not something I’ve stuffed up here.

BTW is there a way to get notifications of thread updates in this forum? Took me a couple of days to do a manual check and find your response.

I recently discovered an incompatibility of Scala 2.10 or higher and vaadin. The Scala rejects to compile some vaadin projects because of broken class files (com/vaadin/ui/ClientWidget$LoadStyle.class). I reported the bug on https://issues.scala-lang.org/browse/SI-2464?focusedCommentId=63036&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-63036
and attached an example vaadin project illustrating the compilation error. Unfortunately the Scala development team did not react on my post. They probably don’t feel responsible for handling broken class files. Is there anything vaadin can do to fix this problem?

I have a query in relation to using Scaladin 3.x with Vaadin BeanContainer. However, rather than continuing to extend this thread I’ve posted in the
Add-On Forum
with a new thread to keep things modular rather than one big miscellaneous discussion thread. Hope that’s OK?

Just updated this thread so that people familiar with the topic have a pointer to it.

THANKS

ah, the broken class problem, reported as fixed, but the latest 2.11 snapshot from today gives me the “stub”, not a npe.
https://issues.scala-lang.org/browse/SI-7439