I wrote the following code.
import scala.reflect.runtime.currentMirror
import scala.reflect.runtime.universe._
import scala.tools.reflect.ToolBox
class A
object Main extends App {
val tb = currentMirror.mkToolBox()
tb.eval(tb.parse("new A"))
}
This simple code try to instantiate class A, but scala throw an exception.
[error] (run-main-0) scala.tools.reflect.ToolBoxError: reflective compilation has failed:
[error]
[error] not found: type A
[error] scala.tools.reflect.ToolBoxError: reflective compilation has failed:
[error]
[error] not found: type A
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.throwIfErrors(ToolBoxFactory.scala:331)
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.wrapInPackageAndCompile(ToolBoxFactory.scala:213)
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.compile(ToolBoxFactory.scala:267)
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.$anonfun$compile$13(ToolBoxFactory.scala:444)
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.apply(ToolBoxFactory.scala:370)
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.compile(ToolBoxFactory.scala:437)
[error] at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.eval(ToolBoxFactory.scala:459)
[error] at Main$.delayedEndpoint$Main$1(Main.scala:9)
[error] at Main$delayedInit$body.apply(Main.scala:5)
[error] at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error] at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error] at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error] at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error] at scala.collection.immutable.List.foreach(List.scala:392)
[error] at scala.App.main(App.scala:80)
[error] at scala.App.main$(App.scala:78)
[error] at Main$.main(Main.scala:5)
[error] at Main.main(Main.scala)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.lang.reflect.Method.invoke(Method.java:498)
[error] Nonzero exit code: 1
[error] (Compile / run) Nonzero exit code: 1
However, not user defined class like Map can instantiate; tb.eval(tb.parse("Map[String, Int]()")) works well.
How can I instantiate user defined class with ToolBox?
You need to declare class A "in that scope":
import scala.reflect.runtime.currentMirror
import scala.tools.reflect.ToolBox
object Main extends App {
val tb = currentMirror.mkToolBox()
tb.eval(tb.parse("class A; new A"))
}
As the title suggests, I am trying to create a Scala macro that generates a class definition. Basically I want to eventually do the following:
classify("StandardEvent", Map("name" -> String, "id" -> Int))
// should at compile-time expand to
case class StandardEvent(name: String, id: Int) extends Event
Is that even possible? And if so, could anyone point me into the right direction on how to do so? Actually, I cannot even get the following simple macro to work:
// Macro definition:
def classify(): Unit =
macro classifyImpl
def classifyImpl(c: Context)(): c.Tree = {
import c.universe._
q"class SomeClass"
}
// Macro usage in seperate compilation unit
classify()
val s = new SomeClass
This gets me the following error message:
[error] ClassifyTest.scala:6: not found: type SomeClass
[error] val s = new SomeClass
[error] ^
[trace] Stack trace suppressed: run last app/compile:compileIncremental for the full output.
[error] (app/compile:compileIncremental) java.lang.AssertionError: assertion failed:
[error] class SomeClass extends scala.AnyRef {
[error] def <init>() = {
[error] super.<init>();
[error] ()
[error] }
[error] }
[error] while compiling: ClassifyTest.scala
[error] during phase: typer
[error] library version: version 2.11.8
[error] compiler version: version 2.11.8
[error] reconstructed args: -bootclasspath // ...
[error]
[error] last tree to typer: type SomeClass
[error] tree position: line 5 of ClassifyTest.scala
[error] symbol: <none>
[error] symbol definition: <none> (a NoSymbol)
[error] symbol package: <none>
[error] symbol owners:
[error] call site: <none> in <none>
[error]
[error] == Source file context for tree position ==
[error]
[error] 2 object ClassifyTest extends App {
[error] 3
[error] 4 classify()
[error] 5 val s = new SomeClass
[error] 6
[error] 7 }
Can anyone make sense of this? Help is much appreciated.
I'm trying to build the sphinx source using eclipse IDE.
But it is getting failed when I try to run the build.xml file. It is resulting in 100 compilation errors.
Can someone please help?
Buildfile: C:\Users\vasu\workspace\Sphinx-4\build.xml
all:
check_jsapi_default_present:
copy_jsapi_jar:
check_jsapi_jar_present:
issue_jsapi_warning:
set_patternset_to_compile:
set_patternset_to_doc:
handle_jsapi:
compile_src:
[javac] Compiling 32 source files to C:\Users\vasu\workspace\Sphinx-4\bld
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseAudioManager.java:21: error: BaseAudioManager is not abstract and does not override abstract method isSameChannel(AudioManager) in AudioManager
[javac] public class BaseAudioManager implements AudioManager {
[javac] ^
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:107: error: waitEngineState(long) in BaseEngine cannot implement waitEngineState(long) in Engine
[javac] public void waitEngineState(long state)
[javac] ^
[javac] return type void is not compatible with long
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:264: error: resume() in BaseEngine cannot implement resume() in Engine
[javac] public void resume() throws AudioException, EngineStateError {
[javac] ^
[javac] return type void is not compatible with boolean
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:379: error: constructor EngineEvent in class EngineEvent cannot be applied to given types;
[javac] new EngineEvent(
[javac] ^
[javac] required: Engine,int,long,long,Throwable
[javac] found: BaseEngine,int,long,long
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:399: error: cannot find symbol
[javac] el.engineAllocated(event);
[javac] ^
[javac] symbol: method engineAllocated(EngineEvent)
[javac] location: variable el of type EngineListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:417: error: constructor EngineEvent in class EngineEvent cannot be applied to given types;
[javac] new EngineEvent(
[javac] ^
[javac] required: Engine,int,long,long,Throwable
[javac] found: BaseEngine,int,long,long
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:437: error: cannot find symbol
[javac] el.engineAllocatingResources(event);
[javac] ^
[javac] symbol: method engineAllocatingResources(EngineEvent)
[javac] location: variable el of type EngineListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:454: error: constructor EngineEvent in class EngineEvent cannot be applied to given types;
[javac] new EngineEvent(
[javac] ^
[javac] required: Engine,int,long,long,Throwable
[javac] found: BaseEngine,int,long,long
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:474: error: cannot find symbol
[javac] el.engineDeallocated(event);
[javac] ^
[javac] symbol: method engineDeallocated(EngineEvent)
[javac] location: variable el of type EngineListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:492: error: constructor EngineEvent in class EngineEvent cannot be applied to given types;
[javac] new EngineEvent(
[javac] ^
[javac] required: Engine,int,long,long,Throwable
[javac] found: BaseEngine,int,long,long
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:513: error: cannot find symbol
[javac] el.engineDeallocatingResources(event);
[javac] ^
[javac] symbol: method engineDeallocatingResources(EngineEvent)
[javac] location: variable el of type EngineListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:529: error: constructor EngineEvent in class EngineEvent cannot be applied to given types;
[javac] new EngineEvent(
[javac] ^
[javac] required: Engine,int,long,long,Throwable
[javac] found: BaseEngine,int,long,long
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:549: error: cannot find symbol
[javac] el.enginePaused(event);
[javac] ^
[javac] symbol: method enginePaused(EngineEvent)
[javac] location: variable el of type EngineListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:565: error: constructor EngineEvent in class EngineEvent cannot be applied to given types;
[javac] new EngineEvent(
[javac] ^
[javac] required: Engine,int,long,long,Throwable
[javac] found: BaseEngine,int,long,long
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\BaseEngine.java:585: error: cannot find symbol
[javac] el.engineResumed(event);
[javac] ^
[javac] symbol: method engineResumed(EngineEvent)
[javac] location: variable el of type EngineListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\EngineMonitor.java:62: error: cannot find symbol
[javac] engine.addEngineListener(getEngineListener());
[javac] ^
[javac] symbol: method addEngineListener(EngineListener)
[javac] location: variable engine of type Engine
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseGrammar.java:23: error: BaseGrammar is not abstract and does not override abstract method setActivatable(boolean) in Grammar
[javac] public class BaseGrammar
[javac] ^
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseGrammar.java:49: error: cannot find symbol
[javac] activationMode = RECOGNIZER_FOCUS;
[javac] ^
[javac] symbol: variable RECOGNIZER_FOCUS
[javac] location: class BaseGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseGrammar.java:93: error: cannot find symbol
[javac] if ((mode != GLOBAL)
[javac] ^
[javac] symbol: variable GLOBAL
[javac] location: class BaseGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseGrammar.java:94: error: cannot find symbol
[javac] && (mode != RECOGNIZER_MODAL)
[javac] ^
[javac] symbol: variable RECOGNIZER_MODAL
[javac] location: class BaseGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseGrammar.java:95: error: cannot find symbol
[javac] && (mode != RECOGNIZER_FOCUS)) {
[javac] ^
[javac] symbol: variable RECOGNIZER_FOCUS
[javac] location: class BaseGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseGrammar.java:186: error: cannot find symbol
[javac] rl.trainingInfoReleased(event);
[javac] ^
[javac] symbol: method trainingInfoReleased(ResultEvent)
[javac] location: variable rl of type ResultListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:715: error: constructor RecognizerEvent in class RecognizerEvent cannot be applied to given types;
[javac] SpeechEventUtilities.postSpeechEvent(this, new RecognizerEvent(this,
[javac] ^
[javac] required: Recognizer,int,long,long,Throwable,GrammarException,long
[javac] found: BaseRecognizer,int,long,long,GrammarException
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:729: error: cannot find symbol
[javac] ((RecognizerListener) el).changesCommitted(event);
[javac] ^
[javac] symbol: method changesCommitted(RecognizerEvent)
[javac] location: interface RecognizerListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:739: error: cannot find symbol
[javac] RecognizerEvent.FOCUS_GAINED, oldState, newState, null));
[javac] ^
[javac] symbol: variable FOCUS_GAINED
[javac] location: class RecognizerEvent
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:752: error: cannot find symbol
[javac] ((RecognizerListener) el).focusGained(event);
[javac] ^
[javac] symbol: method focusGained(RecognizerEvent)
[javac] location: interface RecognizerListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:762: error: cannot find symbol
[javac] RecognizerEvent.FOCUS_LOST, oldState, newState, null));
[javac] ^
[javac] symbol: variable FOCUS_LOST
[javac] location: class RecognizerEvent
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:775: error: cannot find symbol
[javac] ((RecognizerListener) el).focusLost(event);
[javac] ^
[javac] symbol: method focusLost(RecognizerEvent)
[javac] location: interface RecognizerListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:785: error: constructor RecognizerEvent in class RecognizerEvent cannot be applied to given types;
[javac] new RecognizerEvent(this,
[javac] ^
[javac] required: Recognizer,int,long,long,Throwable,GrammarException,long
[javac] found: BaseRecognizer,int,long,long,<null>
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:800: error: cannot find symbol
[javac] ((RecognizerListener) el).recognizerProcessing(event);
[javac] ^
[javac] symbol: method recognizerProcessing(RecognizerEvent)
[javac] location: interface RecognizerListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:811: error: cannot find symbol
[javac] RecognizerEvent.RECOGNIZER_SUSPENDED, oldState,
[javac] ^
[javac] symbol: variable RECOGNIZER_SUSPENDED
[javac] location: class RecognizerEvent
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:825: error: cannot find symbol
[javac] ((RecognizerListener) el).recognizerSuspended(event);
[javac] ^
[javac] symbol: method recognizerSuspended(RecognizerEvent)
[javac] location: interface RecognizerListener
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:867: error: cannot find symbol
[javac] String grammarName = ruleGrammar.getName();
[javac] ^
[javac] symbol: method getName()
[javac] location: variable ruleGrammar of type RuleGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:925: error: cannot find symbol
[javac] for (RuleName ruleName : grammar.listImports()) {
[javac] ^
[javac] symbol: method listImports()
[javac] location: variable grammar of type RuleGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:959: error: cannot find symbol
[javac] String rule = grammar.getRuleInternal(ruleName).toString();
[javac] ^
[javac] symbol: method getRuleInternal(String)
[javac] location: variable grammar of type RuleGrammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1005: error: cannot find symbol
[javac] if (!grammar.isEnabled()) {
[javac] ^
[javac] symbol: method isEnabled()
[javac] location: variable grammar of type Grammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1007: error: cannot find symbol
[javac] } else if (grammar.getActivationMode() == Grammar.GLOBAL) {
[javac] ^
[javac] symbol: variable GLOBAL
[javac] location: interface Grammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1009: error: cannot find symbol
[javac] } else if (testEngineState(FOCUS_ON)) {
[javac] ^
[javac] symbol: variable FOCUS_ON
[javac] location: class BaseRecognizer
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1010: error: cannot find symbol
[javac] if (grammar.getActivationMode() == Grammar.RECOGNIZER_MODAL) {
[javac] ^
[javac] symbol: variable RECOGNIZER_MODAL
[javac] location: interface Grammar
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1083: error: cannot find symbol
[javac] case RecognizerEvent.FOCUS_GAINED:
[javac] ^
[javac] symbol: variable FOCUS_GAINED
[javac] location: class RecognizerEvent
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1086: error: cannot find symbol
[javac] case RecognizerEvent.FOCUS_LOST:
[javac] ^
[javac] symbol: variable FOCUS_LOST
[javac] location: class RecognizerEvent
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRecognizer.java:1092: error: cannot find symbol
[javac] case RecognizerEvent.RECOGNIZER_SUSPENDED:
[javac] ^
[javac] symbol: variable RECOGNIZER_SUSPENDED
[javac] location: class RecognizerEvent
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:28: error: BaseRuleGrammar is not abstract and does not override abstract method getRoot() in RuleGrammar
[javac] public class BaseRuleGrammar extends BaseGrammar implements RuleGrammar,
[javac] ^
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:96: error: inconvertible types
[javac] if (rule instanceof RuleAlternatives) {
[javac] ^
[javac] required: RuleAlternatives
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:97: error: inconvertible types
[javac] RuleAlternatives ruleAlternatives = (RuleAlternatives) rule;
[javac] ^
[javac] required: RuleAlternatives
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:99: error: cannot find symbol
[javac] for (Rule r : ruleAlternatives.getRules()) {
[javac] ^
[javac] symbol: method getRules()
[javac] location: variable ruleAlternatives of type RuleAlternatives
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:112: error: inconvertible types
[javac] if (rule instanceof RuleSequence) {
[javac] ^
[javac] required: RuleSequence
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:113: error: inconvertible types
[javac] RuleSequence ruleSequence = (RuleSequence) rule;
[javac] ^
[javac] required: RuleSequence
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:115: error: cannot find symbol
[javac] for (Rule r : ruleSequence.getRules()) {
[javac] ^
[javac] symbol: method getRules()
[javac] location: variable ruleSequence of type RuleSequence
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:121: error: inconvertible types
[javac] if (rule instanceof RuleCount) {
[javac] ^
[javac] required: RuleCount
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:122: error: inconvertible types
[javac] RuleCount ruleCount = (RuleCount) rule;
[javac] ^
[javac] required: RuleCount
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:123: error: cannot find symbol
[javac] return new JSGFRuleCount(convert(ruleCount.getRule()), ruleCount
[javac] ^
[javac] symbol: method getRule()
[javac] location: variable ruleCount of type RuleCount
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:124: error: cannot find symbol
[javac] .getCount());
[javac] ^
[javac] symbol: method getCount()
[javac] location: variable ruleCount of type RuleCount
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:127: error: inconvertible types
[javac] if (rule instanceof RuleTag) {
[javac] ^
[javac] required: RuleTag
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:128: error: inconvertible types
[javac] RuleTag ruleTag = (RuleTag) rule;
[javac] ^
[javac] required: RuleTag
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:129: error: cannot find symbol
[javac] return new JSGFRuleTag(convert(ruleTag.getRule()), ruleTag.getTag());
[javac] ^
[javac] symbol: method getRule()
[javac] location: variable ruleTag of type RuleTag
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:132: error: inconvertible types
[javac] if (rule instanceof RuleToken) {
[javac] ^
[javac] required: RuleToken
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:133: error: inconvertible types
[javac] RuleToken ruleToken = (RuleToken) rule;
[javac] ^
[javac] required: RuleToken
[javac] found: Rule
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:175: error: no suitable constructor found for RuleAlternatives(Rule[],float[])
[javac] return new RuleAlternatives(subrules, weights);
[javac] ^
[javac] constructor RuleAlternatives.RuleAlternatives(String[]) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] constructor RuleAlternatives.RuleAlternatives(RuleComponent[],int[]) is not applicable
[javac] (actual argument Rule[] cannot be converted to RuleComponent[] by method invocation conversion)
[javac] constructor RuleAlternatives.RuleAlternatives(RuleComponent[]) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:186: error: no suitable constructor found for RuleSequence(Rule[])
[javac] return new RuleSequence(subrules);
[javac] ^
[javac] constructor RuleSequence.RuleSequence(String[]) is not applicable
[javac] (actual argument Rule[] cannot be converted to String[] by method invocation conversion)
[javac] constructor RuleSequence.RuleSequence(RuleComponent[]) is not applicable
[javac] (actual argument Rule[] cannot be converted to RuleComponent[] by method invocation conversion)
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:191: error: no suitable constructor found for RuleCount(Rule,int)
[javac] return new RuleCount(convert(ruleCount.getRule()), ruleCount
[javac] ^
[javac] constructor RuleCount.RuleCount(RuleComponent,int,int,int) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] constructor RuleCount.RuleCount(RuleComponent,int,int) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] constructor RuleCount.RuleCount(RuleComponent,int) is not applicable
[javac] (actual argument Rule cannot be converted to RuleComponent by method invocation conversion)
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:197: error: constructor RuleTag in class RuleTag cannot be applied to given types;
[javac] return new RuleTag(convert(ruleTag.getRule()), ruleTag.getTag());
[javac] ^
[javac] required: Object
[javac] found: Rule,String
[javac] reason: actual and formal argument lists differ in length
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:202: error: incompatible types
[javac] return new RuleToken(ruleToken.getText());
[javac] ^
[javac] required: Rule
[javac] found: RuleToken
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseRuleGrammar.java:424: error: cannot find symbol
[javac] tokens[i] = rt[i].getSpokenText();
[javac] ^
[javac] symbol: method getSpokenText()
[javac] location: interface ResultToken
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseResult.java:29: error: BaseResult is not abstract and does not override abstract method getNumTokens() in Result
[javac] public class BaseResult
[javac] ^
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseResult.java:210: error: getAudio(ResultToken,ResultToken) in BaseResult cannot implement getAudio(ResultToken,ResultToken) in FinalResult
[javac] public AudioClip getAudio(ResultToken from, ResultToken to)
[javac] ^
[javac] return type AudioClip is not compatible with AudioSegment
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseResult.java:203: error: getAudio() in BaseResult cannot implement getAudio() in FinalResult
[javac] public AudioClip getAudio() throws ResultStateError {
[javac] ^
[javac] return type AudioClip is not compatible with AudioSegment
[javac] C:\Users\vasu\workspace\Sphinx-4\src\jsapi\com\sun\speech\engine\recognition\BaseResult.java:77: error: cannot find symbol
[javac] copy.nTokens = result.numTokens();
[javac] ^
[javac] symbol: method numTokens()
[javac] location: variable result of type Result
[javac] 100 errors
BUILD FAILED
C:\Users\vasu\workspace\Sphinx-4\build.xml:223: The following error occurred while executing this line:
C:\Users\vasu\workspace\Sphinx-4\build.xml:244: Compile failed; see the compiler error output for details.
Total time: 26 seconds
You shouldn't use build.xml in eclipse, it's for building using ant. You need to use Eclipse to build sphinx4:
Import sphinx4 project into Eclipse (Import.. -> Existing project
into workspace)
Run build
It will build fine.
My Play 2.1.1 project uses SBT 0.12.3, and when compiling it on my dev machine, everything's fine, I get no errors, and the app runs without any issues. When I try to compile it on an EC2 instance used for testing, I get the superlong error message below. The only possibly relevant difference between the two environments is that I have java 6 (1.6.0_45) on my dev machine, and java 7 (1.7.0_19) on EC2, but I can't currently change neither. Have you ever seen something like this? What can this be about? Thanks!
[error] uncaught exception during compilation: java.lang.AssertionError
[error] (compile:compile) java.lang.AssertionError: assertion failed:
[error] while compiling: /home/ec2-user/chat/target/scala-2.10/src_managed/main/routes_routing.scala
[error] during phase: jvm
[error] library version: version 2.10.0
[error] compiler version: version 2.10.0
[error] reconstructed args: -classpath /home/ec2-user/chat/target/scala-2.10/classes:/home/ec2-user/play-2.1.1/repository/local/play/play_2.10/2.1.1/jars/play_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/play/sbt-link/2.1.1/jars/sbt-link.jar:/home/ec2-user/play-2.1.1/repository/local/org.javassist/javassist/3.16.1-GA/jars/javassist.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-exceptions/2.1.1/jars/play-exceptions.jar:/home/ec2-user/play-2.1.1/repository/local/play/templates_2.10/2.1.1/jars/templates_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.github.scala-incubator.io/scala-io-file_2.10/0.4.2/jars/scala-io-file_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.github.scala-incubator.io/scala-io-core_2.10/0.4.2/jars/scala-io-core_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.jsuereth/scala-arm_2.10/1.3/jars/scala-arm_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-iteratees_2.10/2.1.1/jars/play-iteratees_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/org.scala-stm/scala-stm_2.10.0/0.6/jars/scala-stm_2.10.0.jar:/home/ec2-user/play-2.1.1/repository/local/com.typesafe/config/1.0.0/bundles/config.jar:/home/ec2-user/play-2.1.1/repository/local/org.slf4j/jul-to-slf4j/1.6.6/jars/jul-to-slf4j.jar:/home/ec2-user/play-2.1.1/repository/local/org.slf4j/jcl-over-slf4j/1.6.6/jars/jcl-over-slf4j.jar:/home/ec2-user/play-2.1.1/repository/local/com.typesafe.akka/akka-actor_2.10/2.1.0/bundles/akka-actor_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/com.typesafe.akka/akka-slf4j_2.10/2.1.0/bundles/akka-slf4j_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/joda-time/joda-time/2.1/jars/joda-time.jar:/home/ec2-user/play-2.1.1/repository/local/org.joda/joda-convert/1.2/jars/joda-convert.jar:/home/ec2-user/play-2.1.1/repository/local/org.apache.commons/commons-lang3/3.1/jars/commons-lang3.jar:/home/ec2-user/play-2.1.1/repository/local/com.ning/async-http-client/1.7.6/jars/async-http-client.jar:/home/ec2-user/play-2.1.1/repository/local/oauth.signpost/signpost-core/1.2.1.2/jars/signpost-core.jar:/home/ec2-user/play-2.1.1/repository/local/oauth.signpost/signpost-commonshttp4/1.2.1.2/jars/signpost-commonshttp4.jar:/home/ec2-user/play-2.1.1/repository/local/org.apache.httpcomponents/httpcore/4.0.1/jars/httpcore.jar:/home/ec2-user/play-2.1.1/repository/local/org.apache.httpcomponents/httpclient/4.0.1/jars/httpclient.jar:/home/ec2-user/play-2.1.1/repository/local/commons-logging/commons-logging/1.1.1/jars/commons-logging.jar:/home/ec2-user/play-2.1.1/repository/local/org.codehaus.jackson/jackson-core-asl/1.9.10/jars/jackson-core-asl.jar:/home/ec2-user/play-2.1.1/repository/local/org.codehaus.jackson/jackson-mapper-asl/1.9.10/jars/jackson-mapper-asl.jar:/home/ec2-user/play-2.1.1/repository/local/net.sf.ehcache/ehcache-core/2.6.0/jars/ehcache-core.jar:/home/ec2-user/play-2.1.1/repository/local/javax.transaction/jta/1.1/jars/jta.jar:/home/ec2-user/play-2.1.1/repository/local/org.scala-lang/scala-reflect/2.10.0/jars/scala-reflect.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-jdbc_2.10/2.1.1/jars/play-jdbc_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/play/play-java_2.10/2.1.1/jars/play-java_2.10.jar:/home/ec2-user/play-2.1.1/repository/local/org.yaml/snakeyaml/1.10/bundles/snakeyaml.jar:/home/ec2-user/play-2.1.1/repository/local/org.hibernate/hibernate-validator/4.3.0.Final/jars/hibernate-validator.jar:/home/ec2-user/play-2.1.1/repository/local/javax.validation/validation-api/1.0.0.GA/jars/validation-api.jar:/home/ec2-user/play-2.1.1/repository/local/org.jboss.logging/jboss-logging/3.1.0.CR2/jars/jboss-logging.jar:/home/ec2-user/play-2.1.1/repository/local/org.springframework/spring-context/3.1.2.RELEASE/jars/spring-context.jar:/home/ec2-user/play-2.1.1/repository/local/org.springframework/spring-core/3.1.2.RELEASE/jars/spring-core.jar:/home/ec2-user/play-2.1.1/repository/local/org.springframework/spring-beans/3.1.2.RELEASE/jars/spring-beans.jar:/home/ec2-user/play-2.1.1/repository/local/org.reflections/reflections/0.9.8/jars/reflections.jar:/home/ec2-user/play-2.1.1/repository/local/com.google.guava/guava/13.0.1/jars/guava.jar:/home/ec2-user/play-2.1.1/repository/local/com.google.code.findbugs/jsr305/2.0.1/jars/jsr305.jar:/home/ec2-user/play-2.1.1/repository/local/javax.servlet/javax.servlet-api/3.0.1/jars/javax.servlet-api.jar:/home/ec2-user/play-2.1.1/repository/local/com.jolbox/bonecp/0.7.1.RELEASE/bundles/bonecp.jar:/home/ec2-user/play-2.1.1/repository/local/com.h2database/h2/1.3.168/jars/h2.jar:/home/ec2-user/play-2.1.1/repository/local/tyrex/tyrex/1.0.1/jars/tyrex.jar:/home/ec2-user/play-2.1.1/repository/local/play/anorm_2.10/2.1.1/jars/anorm_2.10.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/play2-reactivemongo_2.10/jars/play2-reactivemongo_2.10-0.9.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/reactivemongo_2.10/jars/reactivemongo_2.10-0.9.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/reactivemongo-bson-macros_2.10/jars/reactivemongo-bson-macros_2.10-0.9.jar:/home/ec2-user/play-2.1.1/repository/cache/org.reactivemongo/reactivemongo-bson_2.10/jars/reactivemongo-bson_2.10-0.9.jar:/home/ec2-user/play-2.1.1/framework/sbt/boot/scala-2.10.0/lib/scala-compiler.jar:/home/ec2-user/play-2.1.1/repository/cache/io.netty/netty/bundles/netty-3.6.5.Final.jar:/home/ec2-user/play-2.1.1/repository/cache/ch.qos.logback/logback-core/jars/logback-core-1.0.11.jar:/home/ec2-user/play-2.1.1/repository/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.0.11.jar:/home/ec2-user/play-2.1.1/repository/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.7.4.jar:/home/ec2-user/play-2.1.1/repository/cache/org.scribe/scribe/jars/scribe-1.3.3.jar:/home/ec2-user/play-2.1.1/repository/local/commons-codec/commons-codec/1.4/jars/commons-codec.jar -encoding utf8 -deprecation -bootclasspath /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/netx.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/plugin.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/rhino.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/classes:/home/ec2-user/play-2.1.1/framework/sbt/boot/scala-2.10.0/lib/scala-library.jar -unchecked -d /home/ec2-user/chat/target/scala-2.10/classes
[error]
[error] last tree to typer: Literal(Constant(String))
[error] symbol: null
[error] symbol definition: null
[error] tpe: Class(classOf[java.lang.String])
[error] symbol owners:
[error] context owners: anonymous class anonfun$routes$1 -> package <empty>
[error]
[error] == Enclosing template or block ==
[error]
[error] Template( // val <local $anonfun>: <notype>, tree.tpe=anonfun$routes$1
[error] "scala.runtime.AbstractPartialFunction", "scala.Serializable" // parents
[error] ValDef(
[error] private
[error] "_"
[error] <tpt>
[error] <empty>
[error] )
[error] // 5 statements
[error] DefDef( // final override def applyOrElse(x$1: play.api.mvc.RequestHeader,default: Function1): Object
[error] <method> final override <triedcooking>
[error] "applyOrElse"
[error] []
[error] // 1 parameter list
[error] ValDef( // x$1: play.api.mvc.RequestHeader
[error] <param> <synthetic> <triedcooking>
[error] "x$1"
[error] <tpt> // tree.tpe=play.api.mvc.RequestHeader
[error] <empty>
[error] )
...fifteen hundred lines more of such gibberish, and finally...
[error] )
[error] )
[error] DefDef( // def <init>(): anonfun$routes$1
[error] <method> <triedcooking>
[error] "<init>"
[error] []
[error] List(Nil)
[error] <tpt> // tree.tpe=anonfun$routes$1
[error] Block( // tree.tpe=Unit
[error] Apply( // def <init>(): scala.runtime.AbstractPartialFunction in class AbstractPartialFunction, tree.tpe=scala.runtime.AbstractPartialFunction
[error] Routes$$anonfun$routes$1.super."<init>" // def <init>(): scala.runtime.AbstractPartialFunction in class AbstractPartialFunction, tree.tpe=()scala.runtime.AbstractPartialFunction
[error] Nil
[error] )
[error] ()
[error] )
[error] )
[error] )
[error]
[error] == Expanded type of tree ==
[error]
[error] ConstantType(value = Constant(String))
[error]
[error] how can getCommonSuperclass() do its job if different class symbols get the same bytecode-level internal name: models/messages/package$Open
The reason of such behaviour described a bit here.
In my case I've just move some classes from package object to normal object, and this is solved the problem. I think you should consider transformation of models/messages/package.scala to normal object.
I want to package my GWT 2.3 Application to a war file and deploy it on a weblogic server. I found this solution with ANT http://www.rubiconred.com/blog/build-package-a-gwt-app-to-war-using-ant/. But there is a Problem. The compile target throws an error and it looks to me like ANT is using the wrong Java version. But when I do Run As -> Ant Build... -> JRE The version is correct (1.6.0_11). So the solution from this question did not work. And I am yet not so sure if the java version is the problem.
The console output looks like this:
Buildfile: C:\projects\logdashboard\LogDashboard\warbuilder.xml
prepare:
compile:
[javac] Compiling 124 source files to C:\projects\logdashboard\LogDashboard\build
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\dto\ApplicationDto.java:22: package javax.validation.constraints does not exist
[javac] import javax.validation.constraints.Pattern;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\dto\UserDto.java:20: package javax.validation.constraints does not exist
[javac] import javax.validation.constraints.Pattern;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\ValidatorFactory.java:18: cannot find symbol
[javac] symbol : class Validator
[javac] location: package javax.validation
[javac] import javax.validation.Validator;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\ValidatorFactory.java:36: cannot access javax.validation.ValidatorFactory
[javac] class file for javax.validation.ValidatorFactory not found
[javac] public class ValidatorFactory extends AbstractGwtValidatorFactory {
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\ValidatorFactory.java:71: cannot find symbol
[javac] symbol : class Validator
[javac] location: class com.roche.research.logdashboard.client.ValidatorFactory
[javac] public interface GwtValidator extends Validator {
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\activity\ApplicationAddPresenter.java:22: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: package javax.validation
[javac] import javax.validation.ConstraintViolation;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\activity\ApplicationAddPresenter.java:23: cannot find symbol
[javac] symbol : class Validator
[javac] location: package javax.validation
[javac] import javax.validation.Validator;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationAddViewImpl.java:25: cannot find symbol
[javac] symbol : class Validation
[javac] location: package javax.validation
[javac] import javax.validation.Validation;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationEditViewImpl.java:25: cannot find symbol
[javac] symbol : class Validation
[javac] location: package javax.validation
[javac] import javax.validation.Validation;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserAddViewImpl.java:23: cannot find symbol
[javac] symbol : class Validation
[javac] location: package javax.validation
[javac] import javax.validation.Validation;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserEditViewImpl.java:23: cannot find symbol
[javac] symbol : class Validation
[javac] location: package javax.validation
[javac] import javax.validation.Validation;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:23: package com.ibm.icu.text does not exist
[javac] import com.ibm.icu.text.SimpleDateFormat;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\LogFileUtil.java:22: package org.apache.commons.lang.time does not exist
[javac] import org.apache.commons.lang.time.DateUtils;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\AutoinjectingRemoteServlet.java:19: package javax.servlet does not exist
[javac] import javax.servlet.ServletConfig;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\AutoinjectingRemoteServlet.java:20: package javax.servlet does not exist
[javac] import javax.servlet.ServletException;
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\AutoinjectingRemoteServlet.java:38: cannot access javax.servlet.http.HttpServlet
[javac] class file for javax.servlet.http.HttpServlet not found
[javac] public class AutoinjectingRemoteServlet extends RemoteServiceServlet {
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\AutoinjectingRemoteServlet.java:55: cannot find symbol
[javac] symbol : class ServletConfig
[javac] location: class com.roche.research.logdashboard.shared.AutoinjectingRemoteServlet
[javac] public void init(ServletConfig config) throws ServletException {
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\AutoinjectingRemoteServlet.java:55: cannot find symbol
[javac] symbol : class ServletException
[javac] location: class com.roche.research.logdashboard.shared.AutoinjectingRemoteServlet
[javac] public void init(ServletConfig config) throws ServletException {
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\ValidationUtil.java:43: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: class com.roche.research.logdashboard.shared.ValidationUtil<T>
[javac] public String getErrorMessage(Set<ConstraintViolation<T>> violations) {
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\dto\ApplicationDto.java:46: cannot find symbol
[javac] symbol : class Pattern
[javac] location: class com.roche.research.logdashboard.shared.dto.ApplicationDto
[javac] #Pattern(regexp = "^(http|ftp|https){1}://.*$", message = "This is no correct url.")
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\shared\dto\UserDto.java:47: cannot find symbol
[javac] symbol : class Pattern
[javac] location: class com.roche.research.logdashboard.shared.dto.UserDto
[javac] #Pattern(regexp = "^.+\\..+#roche.com$", message = "This is no roche email adresse.")
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\ValidatorFactory.java:40: method does not override or implement a method from a supertype
[javac] #Override
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\activity\ApplicationAddPresenter.java:118: cannot find symbol
[javac] symbol : class Validator
[javac] location: class com.roche.research.logdashboard.client.activity.ApplicationAddPresenter
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\activity\ApplicationAddPresenter.java:119: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: class com.roche.research.logdashboard.client.activity.ApplicationAddPresenter
[javac] Set<ConstraintViolation<ApplicationDto>> violations = validator.validate(applicationDto);
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationAddViewImpl.java:174: cannot find symbol
[javac] symbol : class Validator
[javac] location: class com.roche.research.logdashboard.client.view.ApplicationAddViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationAddViewImpl.java:174: cannot find symbol
[javac] symbol : variable Validation
[javac] location: class com.roche.research.logdashboard.client.view.ApplicationAddViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationAddViewImpl.java:175: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: class com.roche.research.logdashboard.client.view.ApplicationAddViewImpl
[javac] Set<ConstraintViolation<ApplicationDto>> violations = validator.validateProperty(application, "url");
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationEditViewImpl.java:182: cannot find symbol
[javac] symbol : class Validator
[javac] location: class com.roche.research.logdashboard.client.view.ApplicationEditViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationEditViewImpl.java:182: cannot find symbol
[javac] symbol : variable Validation
[javac] location: class com.roche.research.logdashboard.client.view.ApplicationEditViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\ApplicationEditViewImpl.java:183: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: class com.roche.research.logdashboard.client.view.ApplicationEditViewImpl
[javac] Set<ConstraintViolation<ApplicationDto>> violations = validator.validateProperty(application, "url");
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserAddViewImpl.java:149: cannot find symbol
[javac] symbol : class Validator
[javac] location: class com.roche.research.logdashboard.client.view.UserAddViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserAddViewImpl.java:149: cannot find symbol
[javac] symbol : variable Validation
[javac] location: class com.roche.research.logdashboard.client.view.UserAddViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserAddViewImpl.java:150: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: class com.roche.research.logdashboard.client.view.UserAddViewImpl
[javac] Set<ConstraintViolation<UserDto>> violations = validator.validateProperty(user, "email");
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserEditViewImpl.java:155: cannot find symbol
[javac] symbol : class Validator
[javac] location: class com.roche.research.logdashboard.client.view.UserEditViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserEditViewImpl.java:155: cannot find symbol
[javac] symbol : variable Validation
[javac] location: class com.roche.research.logdashboard.client.view.UserEditViewImpl
[javac] Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\client\view\UserEditViewImpl.java:156: cannot find symbol
[javac] symbol : class ConstraintViolation
[javac] location: class com.roche.research.logdashboard.client.view.UserEditViewImpl
[javac] Set<ConstraintViolation<UserDto>> violations = validator.validateProperty(user, "email");
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:50: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGFILE_EXTENSION_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:50: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGFILE_EXTENSION_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:67: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGFILE_EXTENSION_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:67: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGFILE_EXTENSION_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:78: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGLINE_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:78: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGLINE_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:95: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGLINE_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\DateUtil.java:95: cannot find symbol
[javac] symbol : class SimpleDateFormat
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.DateUtil
[javac] SimpleDateFormat format = new SimpleDateFormat(ServerProp.get().getProperty("LOGLINE_DATE_PATTERN"));
[javac] ^
[javac] C:\projects\logdashboard\LogDashboard\src\main\java\com\roche\research\logdashboard\server\domain\logparser\LogFileUtil.java:65: cannot find symbol
[javac] symbol : variable DateUtils
[javac] location: class com.roche.research.logdashboard.server.domain.logparser.LogFileUtil
[javac] || DateUtils.isSameDay(logFile.getDate(), since)) {
[javac] ^
BUILD FAILED
C:\projects\logdashboard\LogDashboard\warbuilder.xml:31: Compile failed; see the compiler error output for details.
Total time: 7 seconds
So my question is:
Is the Java version from ant the problem?
Or:
Is there an easier way to package the GWT application to a war file, then an ant script?
I tried some things, but nether did work.
Is the Java version from ant the problem?
No.
It looks like you're missing dependencies from the classpath (specifically the Bean Validation API, ICU4j, Apache Commons Lang and the Servlet API).
Is there an easier way to package the GWT application to a war file, then an ant script? I tried some things, but nether did work.
It depends how you build your project. If you're using Ant already, then use Ant to package your WAR; if you're using Maven, then use Maven; if you're using Make, then use Make; if you're using a shell script, then continue with it; etc.
If you don't have a build script and only rely on your IDE, then you have a more severe problem than packaging a WAR. But still, you can do that from within Eclipse (I know it can be done, I don't know how however).