Created
May 17, 2010 16:43
-
-
Save maxaf/403961 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
target/ | |
reports/ | |
lib_managed/ | |
src_managed/ | |
project/boot/ | |
embedded-repo | |
logs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<log> | |
filename = "./logs/akka.log" | |
roll = "daily" # Options: never, hourly, daily, sunday/monday/... | |
level = "info" # Options: fatal, critical, error, warning, info, debug, trace | |
console = on | |
# syslog_host = "" | |
# syslog_server_name = "" | |
</log> | |
<akka> | |
version = "0.9" | |
# FQN to the class doing initial active object/actor | |
# supervisor bootstrap, should be defined in default constructor | |
boot = ["com.bumnetworks.hello.Boot"] | |
<actor> | |
timeout = 5000 # default timeout for future based invocations | |
serialize-messages = on # does a deep clone of (non-primitive) messages to ensure immutability | |
</actor> | |
<stm> | |
service = off | |
fair = on # should transactions be fair or non-fair (non fair yield better performance) | |
max-nr-of-retries = 1000 # max nr of retries of a failing transaction before giving up | |
timeout = 10000 # transaction timeout; if transaction has not committed within the timeout then it is aborted | |
distributed = off # not implemented yet | |
</stm> | |
<rest> | |
service = off | |
</rest> | |
<remote> | |
compression-scheme = "zlib" # Options: "zlib" (lzf to come), leave out for no compression | |
zlib-compression-level = 6 # Options: 0-9 (1 being fastest and 9 being the most compressed), default is 6 | |
<cluster> | |
service = off | |
</cluster> | |
<server> | |
service = off | |
hostname = "localhost" | |
port = 9999 | |
connection-timeout = 1000 # in millis (1 sec default) | |
<server> | |
<client> | |
reconnect-delay = 5000 # in millis (5 sec default) | |
read-timeout = 10000 # in millis (10 sec default) | |
<client> | |
</remote> | |
</akka> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bumnetworks.hello | |
import se.scalablesolutions.akka.actor.Actor._ | |
import se.scalablesolutions.akka.actor.SupervisorFactory | |
import se.scalablesolutions.akka.config.ScalaConfig._ | |
class Boot { | |
val factory = SupervisorFactory( | |
SupervisorConfig( | |
RestartStrategy(OneForOne, 3, 100, List(classOf[Exception])), | |
Supervise(actorOf[HelloActor], LifeCycle(Permanent)) :: | |
Supervise(actorOf[HelloService], LifeCycle(Permanent)) | |
:: Nil)) | |
factory.newInstance.start | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.organization=com.bumnetworks | |
project.name=hello | |
project.version=0.0.1 | |
sbt.version=0.7.4 | |
def.scala.version=2.7.7 | |
build.scala.versions=2.8.0.Beta1 | |
project.initialize=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
class HelloProject(info: ProjectInfo) extends DefaultWebProject(info) { | |
// copy of Akka's embedded repo | |
val embeddedrepo = "embedded repo" at (info.projectPath / "embedded-repo").asURL.toString | |
val bum = "bum" at "http://nexus.bumnetworks.com/nexus/content/groups/public" | |
val scala_tools_snapshots = "scala-tools snapshots" at "http://scala-tools.org/repo-snapshots" | |
val scala_tools_releases = "scala-tools releases" at "http://scala-tools.org/repo-releases" | |
val akka_core = "se.scalablesolutions.akka" %% "akka-core" % "0.9" | |
val akka_http = "se.scalablesolutions.akka" %% "akka-http" % "0.9" | |
val servlet = "javax.servlet" % "servlet-api" % "2.5" % "provided->default" | |
val jetty7 = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.v20100331" % "test" | |
val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bumnetworks.hello | |
import se.scalablesolutions.akka.actor.Transactor | |
class HelloActor extends Transactor { | |
def receive = { | |
case HelloWorld => self.reply("World") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bumnetworks.hello | |
import se.scalablesolutions.akka.actor.Transactor | |
import se.scalablesolutions.akka.actor.Actor._ | |
import javax.ws.rs.{GET, Path, Produces} | |
case object HelloWorld | |
@Path("/hello") | |
class HelloService extends Transactor { | |
@GET | |
@Produces(Array("text/plain")) | |
@Path("/world") | |
def world: String = "Hello, " + (actorOf[HelloActor] !! HelloWorld).get + "!" | |
def receive = { | |
case HelloWorld => self.reply("World") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> jetty-run | |
[info] | |
[info] == compile == | |
[info] Source analysis: 0 new/modified, 0 indirectly invalidated, 0 removed. | |
[info] Compiling main sources... | |
[info] Nothing to compile. | |
[info] Post-analysis: 7 classes. | |
[info] == compile == | |
[info] | |
[info] == copy-resources == | |
[info] == copy-resources == | |
[info] | |
[info] == prepare-webapp == | |
[info] == prepare-webapp == | |
[info] | |
[info] == jetty-run == | |
2010-05-17 16:36:19.975:INFO::Logging to StdErrLog::DEBUG=false via org.eclipse.jetty.util.log.StdErrLog | |
[info] jetty-7.0.2.v20100331 | |
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet | |
INF [20100517-16:36:22.455] config: Config loaded from the application classpath. | |
INF [20100517-16:36:22.498] servlet: | |
INF [20100517-16:36:22.498] servlet: ============================== | |
INF [20100517-16:36:22.498] servlet: __ __ | |
INF [20100517-16:36:22.498] servlet: _____ | | _| | _______ | |
INF [20100517-16:36:22.498] servlet: \__ \ | |/ / |/ /\__ \ | |
INF [20100517-16:36:22.498] servlet: / __ \| <| < / __ \_ | |
INF [20100517-16:36:22.498] servlet: (____ /__|_ \__|_ \(____ / | |
INF [20100517-16:36:22.498] servlet: \/ \/ \/ \/ | |
INF [20100517-16:36:22.498] servlet: Running version 0.9 | |
INF [20100517-16:36:22.498] servlet: ============================== | |
INF [20100517-16:36:22.499] servlet: Starting Akka... | |
INF [20100517-16:36:22.500] servlet: Loading boot class [com.bumnetworks.hello.Boot] | |
INF [20100517-16:36:22.611] camel: Camel context initialized | |
log4j:WARN No appenders could be found for logger (org.apache.camel.impl.DefaultCamelContext). | |
log4j:WARN Please initialize the log4j system properly. | |
INF [20100517-16:36:22.977] camel: Camel context started | |
INF [20100517-16:36:22.985] servlet: Akka started successfully | |
[info] Started SelectChannelConnector@0.0.0.0:8080 | |
[info] == jetty-run == | |
[success] Successful. | |
[info] | |
[info] Total time: 3 s, completed May 17, 2010 4:36:23 PM | |
> INF [20100517-16:36:28.268] core: Scanning for root resource and provider classes in the Web app resource paths: | |
INF [20100517-16:36:28.268] core: /WEB-INF/lib | |
INF [20100517-16:36:28.268] core: /WEB-INF/classes | |
INF [20100517-16:36:30.613] core: Root resource classes found: | |
INF [20100517-16:36:30.613] core: class com.bumnetworks.hello.HelloService | |
INF [20100517-16:36:30.614] core: Provider classes found: | |
INF [20100517-16:36:30.614] core: class org.atmosphere.jersey.BroadcasterInjector | |
INF [20100517-16:36:30.614] core: class org.atmosphere.jersey.AtmosphereResourceConfigurator | |
INF [20100517-16:36:30.614] core: class se.scalablesolutions.akka.rest.ListWriter | |
INF [20100517-16:36:30.614] core: class org.atmosphere.jersey.AtmosphereResourceInjector | |
INF [20100517-16:36:30.614] core: class com.sun.jersey.scala.NodeWriter | |
INF [20100517-16:36:30.614] core: class org.atmosphere.jersey.BroadcasterLookupInjector | |
INF [20100517-16:36:30.706] application: Initiating Jersey application, version 'Jersey: 1.1.5 01/20/2010 03:55 PM' | |
INF [20100517-16:36:30.710] application: Adding the following classes declared in META-INF/services/jersey-server-components to the resource configuration: | |
INF [20100517-16:36:30.710] application: class org.atmosphere.jersey.BroadcasterInjector | |
INF [20100517-16:36:30.710] application: class org.atmosphere.jersey.AtmosphereProviders$BroadcasterProvider | |
INF [20100517-16:36:30.710] application: class org.atmosphere.jersey.BroadcasterLookupInjector | |
INF [20100517-16:36:30.710] application: class org.atmosphere.jersey.AtmosphereResourceInjector | |
INF [20100517-16:36:30.710] application: class org.atmosphere.jersey.AtmosphereResourceConfigurator | |
FAT [20100517-16:36:31.823] application: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container | |
FAT [20100517-16:36:31.823] application: java.lang.IllegalArgumentException: object is not an instance of declaring class | |
FAT [20100517-16:36:31.823] application: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
FAT [20100517-16:36:31.823] application: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
FAT [20100517-16:36:31.823] application: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | |
FAT [20100517-16:36:31.823] application: at java.lang.reflect.Method.invoke(Method.java:597) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:149) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:259) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:990) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451) | |
FAT [20100517-16:36:31.823] application: at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632) | |
FAT [20100517-16:36:31.823] application: at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:426) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:931) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:361) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) | |
FAT [20100517-16:36:31.823] application: at org.eclipse.jetty.server.Server.handle(Server.java:337) | |
FAT [20100517-16:36:31.823] application: (...more...) | |
[warn] /hello/world | |
java.lang.IllegalArgumentException: object is not an instance of declaring class | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | |
at java.lang.reflect.Method.invoke(Method.java:597) | |
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:149) | |
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67) | |
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:259) | |
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133) | |
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:83) | |
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:133) | |
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:71) | |
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:990) | |
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:941) | |
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:932) | |
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:384) | |
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:451) | |
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:632) | |
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) | |
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:530) | |
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:426) | |
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) | |
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:494) | |
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229) | |
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:931) | |
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:361) | |
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) | |
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:867) | |
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) | |
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) | |
at org.eclipse.jetty.server.Server.handle(Server.java:337) | |
at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581) | |
at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1005) | |
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:560) | |
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:222) | |
at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:417) | |
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:474) | |
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:437) | |
at java.lang.Thread.run(Thread.java:619) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://java.sun.com/xml/ns/javaee" | |
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" | |
version="2.5"> | |
<listener> | |
<listener-class>se.scalablesolutions.akka.servlet.Initializer</listener-class> | |
</listener> | |
<servlet> | |
<servlet-name>AkkaServlet</servlet-name> | |
<servlet-class>se.scalablesolutions.akka.rest.AkkaServlet</servlet-class> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>AkkaServlet</servlet-name> | |
<url-pattern>/*</url-pattern> | |
</servlet-mapping> | |
</web-app> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment