java.lang.ClassNotFoundException when running under SBT

1,683 views
Skip to first unread message

Connor

unread,
Feb 8, 2012, 10:18:00 PM2/8/12
to Akka User List
I was wrestling with a problem where my project worked OK if invoked
directly using the `scala` or `java` binaries but threw a
ClassNotFoundException for some classes which were certainly on the
classpath when they were sent as Akka messages.

After lots of Google time and trying all sorts of workarounds, I found
an answer in this sbt group thread:
http://groups.google.com/group/simple-build-tool/browse_thread/thread/fc15b0bcc4ee6506

I put the line
fork in run := true
in my build.sbt file and all is good again.

Hopefully this saves someone else from similar frustration.
--
Connor

Patrik Nordwall

unread,
Feb 9, 2012, 1:42:42 AM2/9/12
to akka...@googlegroups.com
Thanks for sharing, are you using Akka 2.0-M4?

--
Connor

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.




--

Patrik Nordwall
Typesafe The software stack for applications that scale
Twitter: @patriknw


Michael Slinn

unread,
Feb 9, 2012, 1:47:05 AM2/9/12
to akka...@googlegroups.com
I also posted a query to that thread that might be of interest to this ML.

Mike

Connor

unread,
Feb 10, 2012, 1:07:34 PM2/10/12
to Akka User List
I'm only up to M3 so far. I can confirm this was an issue for my
project in M2 as well. I plan on making the switch to M4 the near
future.

FWIW, the project is here:
http://github.com/ConnorDoyle/EnMAS

Thanks,
--
Connor

On Feb 9, 12:42 am, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> Thanks for sharing, are you using Akka 2.0-M4?
>
>
>
>
>
>
>
>
>
> On Thu, Feb 9, 2012 at 4:18 AM, Connor <connor....@gmail.com> wrote:
> > I was wrestling with a problem where my project worked OK if invoked
> > directly using the `scala` or `java` binaries but threw a
> > ClassNotFoundException for some classes which were certainly on the
> > classpath when they were sent as Akka messages.
>
> > After lots of Google time and trying all sorts of workarounds, I found
> > an answer in this sbt group thread:
>
> >http://groups.google.com/group/simple-build-tool/browse_thread/thread...
>
> > I put the line
> > fork in run := true
> > in my build.sbt file and all is good again.
>
> > Hopefully this saves someone else from similar frustration.
> > --
> > Connor
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Akka User List" group.
> > To post to this group, send email to akka...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > akka-user+...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/akka-user?hl=en.
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  The software stack for applications that
> scale
> Twitter: @patriknw

√iktor Ҡlang

unread,
Feb 10, 2012, 1:09:34 PM2/10/12
to akka...@googlegroups.com
Hi Connor,

have you've tried the fork := true in SBT (as discussed on the mailinglist)?

Cheers,

--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Connor

unread,
Feb 10, 2012, 1:12:47 PM2/10/12
to Akka User List
Hey Viktor, that post was just to answer Patrik -- I'm also the OP of
this thread. Telling SBT to fork did solve my issue.
Thanks!
> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.

√iktor Ҡlang

unread,
Feb 10, 2012, 1:15:15 PM2/10/12
to akka...@googlegroups.com
Excellent,

happy hAkking

Patrik Nordwall

unread,
Feb 10, 2012, 1:18:35 PM2/10/12
to akka...@googlegroups.com
The reason I asked for the version is that we have been adjusting how the context classloader is used. I think it is different in M4. It would be great if you continue to report how it works with M4 and the also with upcoming RC.

/Patrik

√iktor Ҡlang

unread,
Feb 10, 2012, 1:22:03 PM2/10/12
to akka...@googlegroups.com
Sorry for the weird reply, somehow GMail was threading the last email
wrong. sigh

Patrik's right, check with M4, and even better RC1 (when it's out)
because we've harmonized the way classloading is handled internally.

Cheers,

--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Reply all
Reply to author
Forward
0 new messages