score:3
there is no such thing as a main
method for webapps and wars.
if you want something to startup when the deployment is complete, you'll want to create, setup, and configure a custom javax.servlet.servletcontextlistener where your implementation of contextinitialized(servletcontextevente sce)
performs your twitter storm topology.
or
you can skip the entire deploy of a war on a standalone jetty process. to do that you would setup an embedded jetty instance where you can do whatever you want in your own custom main
, from starting up jetty itself, to adding your webapp, to executing your own custom code.
see the onewebapp embedded example.
in your use case, you would initialize your 'twitter storm topology' after the server.start();
and before the server.join();
Source: stackoverflow.com
Related Query
- Jetty does not launch deployed war
- Why does start-all.sh from root cause "failed to launch org.apache.spark.deploy.master.Master: JAVA_HOME is not set"?
- Heroku does not seem to run most recent version of deployed play application
- RESTful service deployed on JBoss does not respond
- Why does pattern matching in Scala not work with variables?
- Any reason why scala does not explicitly support dependent types?
- Editor does not contain a main type
- Eclipse, Android, Scala made easy but still does not work
- scala string.split does not work
- Why to use empty parentheses in Scala if we can just use no parentheses to define a function which does not need any arguments?
- Why does Scala not have a return/unit function defined for each monad (in contrast to Haskell)?
- Why does sbt build fail with "MissingRequirementError: object scala.runtime in compiler mirror not found."?
- Passing enum parameter to a case class does not work
- Why does `Array(0,1,2) == Array(0,1,2)` not return the expected result?
- Why does the andThen of Future not chain the result?
- Why does Future's recover not catch exceptions?
- Scala Slick, how to create Schema ONLY if it does not exist
- Why does 2.11.1 fail with error: not found: type Application?
- Why does this compile under Java 7 but not under Java 8?
- Why does Option not extend the Iterable trait directly?
- Scala: illegal inheritance; self-type Y does not conform to X's selftype SELF
- Why does Haskell's foldr NOT stackoverflow while the same Scala implementation does?
- Type parameter does not extend given type
- Scala String toInt - Int does not take parameters
- Field "features" does not exist. SparkML
- Why does this Scala function compile when the argument does not conform to the type constraint?
- IntelliJ IDEA Hotkey for comment does not work with Scala
- scala: why does underscore (_) initialization work for fields but not method variables?
- Intellij: SBT-based Scala project does not build with Java 9
- Why does sbt console not see packages from subproject in multi-module project?
More Query from same tag
- Play JSON Reads/Writes with single-parameter case classes
- `error: Could not deserialize` when importing a JAR file
- Partitioning by column in Apache Spark to S3
- What is this Scala 'new' syntax
- How to perofrm a try and catch in ZIO?
- Summarizing/aggregating a Scala Slick object into another
- MissingRequirementError when Compiling Scala code with Global.Run
- How does sbt choose which Scala version to use?
- How to take the first element of each element of a RDD[Double,Double] and create a diagonal matrix with it?
- Scala: Create a new list where each element is the elemnt of old list repeated with different suffix
- How to check if Stream has only elements from Seq
- Do self: T => and this: T => have the same meaning when defining a trait?
- Scala and HTML parsing
- scala mixing view and strict collection in for expression
- PrivateMethodTester and Inheritance
- Can you add parameters to Actions?
- sbt-scalariform plugin - can't resolve settings
- fail to load a native library using activator (Play Framework)
- Scala nested case class self-bounding inheritance
- Building up an RDD with a recursive Union in Scala within Spark
- Scala: How do I programmatically create an XML tag and insert a value in it?
- Same function returns different result when running in console or spec2
- Understanding Future in Scala
- How to Add a unique value in RDD spark
- runtime logger exception with dotty
- Deprecating a class constructor parameter
- Compare 2 dataframes in Apache Spark Scala
- Why there is need to provide injected arguments while creating object of class?
- Where should javah fit into an SBT build?
- Copy method of case class seems to be missing