- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Using Scala classes in a Java Servlet (in Eclipse)
Fri, 2009-12-04, 08:23
Hi all,
I trying to use Scala classes that I've developed in a Java Servlet.
I've set-up my servlet in a Dynamic Web Project (in Eclipse) and linked it to a Scala project in the same workspace (under Build Path > Projects).
I also selected the Scala project under Java EE Module Dependancies.
This works with Java projects, however, for the Scala project, I get the following build warning when building the web application:
Classpath entry ch.epfl.lamp.sdt.launching.SCALA_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
Also, Eclipse can't seem to find my Scala classes from within the Java web app.
What is the meaning of the build error? and what can I do to remove it?
Cheers,Lach
I trying to use Scala classes that I've developed in a Java Servlet.
I've set-up my servlet in a Dynamic Web Project (in Eclipse) and linked it to a Scala project in the same workspace (under Build Path > Projects).
I also selected the Scala project under Java EE Module Dependancies.
This works with Java projects, however, for the Scala project, I get the following build warning when building the web application:
Classpath entry ch.epfl.lamp.sdt.launching.SCALA_CONTAINER will not be exported or published. Runtime ClassNotFoundExceptions may result.
Also, Eclipse can't seem to find my Scala classes from within the Java web app.
What is the meaning of the build error? and what can I do to remove it?
Cheers,Lach
Thu, 2009-12-10, 00:07
#2
Re: Using Scala classes in a Java Servlet (in Eclipse)
Hi Mike,
Thanks for the help. To be honest, I got side tracked and haven't actually tried this yet. In the meantime, I ended just using an embedded Jetty server in my Scala project which is working just fine for development. Eventually I'll probably have to split it up to make it deployable.
Cheers,Lach
On 07/12/2009, at 1:41 AM, Miles Sabin wrote:
Thanks for the help. To be honest, I got side tracked and haven't actually tried this yet. In the meantime, I ended just using an embedded Jetty server in my Scala project which is working just fine for development. Eventually I'll probably have to split it up to make it deployable.
Cheers,Lach
On 07/12/2009, at 1:41 AM, Miles Sabin wrote:
On Fri, Dec 4, 2009 at 7:23 AM, Lachlan Cotter <lach@lachlanc.id.au> wrote:What is the meaning of the build error? and what can I do to remove it?
It means that the Dynamic Web Project tooling doesn't know enough
about Scala to know how to deploy a web application with a dependency
on the Scala library. You'll need to include scala-library.jar
explicitly.
Cheers,
Miles
--
Miles Sabin
tel: +44 (0)7813 944 528
skype: milessabin
http://www.chuusai.com/
http://twitter.com/milessabin
On Fri, Dec 4, 2009 at 7:23 AM, Lachlan Cotter wrote:
> What is the meaning of the build error? and what can I do to remove it?
It means that the Dynamic Web Project tooling doesn't know enough
about Scala to know how to deploy a web application with a dependency
on the Scala library. You'll need to include scala-library.jar
explicitly.
Cheers,
Miles