title: GWT, Maven, Spring - Getting com.thoughtworks.qdox.parser.ParseException: syntax error on Maven Build
body: <p>I am trying to integrate the code from this demo: <a href="http://code.google.com/p/gwt-spring-starter-app/" rel="nofollow">http://code.google.com/p/gwt-spring-starter-app/</a> into my main Spring application. I am able to run the gwt-spring-start-app as itself but when I integrate it into an existing Spring app that has a lot of non-GWT classes I am getting the error (on maven build): <code>com.thoughtworks.qdox.parser.ParseException: syntax error</code> 
  I've spent a while searching on this and seems others have the same problem but I just can't comprehend what they say to do to fix it.. I believe its an issue with the pom and some sort of dependency declaration that shouldn't be there or something but can't figure out what.. I would greatly appreciate if anyone can take a look at the pom below and let me know if you know what could be causing this. Thanks</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;org.krams.tutorial&lt;/groupId&gt;
      &lt;artifactId&gt;spring-hibernate-mysql&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;spring-hibernate-mysql Maven Webapp&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
      &lt;properties&gt;
  
          &lt;!-- convenience to define GWT version in one place --&gt;
          &lt;gwt.version&gt;2.0.4&lt;/gwt.version&gt;
          &lt;spring.version&gt;3.0.4.RELEASE&lt;/spring.version&gt;
  
          &lt;!-- tell the compiler we can use 1.5 --&gt;
          &lt;maven.compiler.source&gt;1.5&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.5&lt;/maven.compiler.target&gt;
  
      &lt;/properties&gt;
  
  
      &lt;dependencies&gt;
          &lt;!-- GWT dependencies (from central repo) --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.gwt&lt;/groupId&gt;
              &lt;artifactId&gt;gwt-servlet&lt;/artifactId&gt;
              &lt;version&gt;${gwt.version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.gwt&lt;/groupId&gt;
              &lt;artifactId&gt;gwt-user&lt;/artifactId&gt;
              &lt;version&gt;${gwt.version}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.8.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sf.flexjson&lt;/groupId&gt;
              &lt;artifactId&gt;flexjson&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.14&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jstl&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;taglibs&lt;/groupId&gt;
              &lt;artifactId&gt;standard&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-digester&lt;/groupId&gt;
              &lt;artifactId&gt;commons-digester&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-collections&lt;/groupId&gt;
              &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;
              &lt;version&gt;3.2.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;3.3.2.GA&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;c3p0&lt;/groupId&gt;
              &lt;artifactId&gt;c3p0&lt;/artifactId&gt;
              &lt;version&gt;0.9.1.2&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;cglib&lt;/groupId&gt;
              &lt;artifactId&gt;cglib-nodep&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt;
              &lt;version&gt;3.4.0.GA&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;jboss&lt;/groupId&gt;
              &lt;artifactId&gt;javassist&lt;/artifactId&gt;
              &lt;version&gt;3.7.ga&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.14&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.5&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;build&gt;
          &lt;finalName&gt;spring-hibernate-mysql&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;gwt-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.2&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                              &lt;goal&gt;generateAsync&lt;/goal&gt;
                              &lt;!-- This will include "gwt:test" during "integration-test" --&gt;
                              &lt;goal&gt;test&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                      &lt;execution&gt;
                          &lt;id&gt;gwt-clean&lt;/id&gt;
                          &lt;phase&gt;clean&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;clean&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;servicePattern&gt;**/I*Service.java&lt;/servicePattern&gt;
                      &lt;module&gt;${gwt.module}&lt;/module&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;!-- If you want to use the target/web.xml file mergewebxml produces, 
                  tell the war plugin to use it. Also, exclude what you want from the final 
                  artifact here. &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; 
                  &lt;configuration&gt; &lt;webXml&gt;target/web.xml&lt;/webXml&gt; &lt;warSourceExcludes&gt;.gwt-tmp/**&lt;/warSourceExcludes&gt; 
                  &lt;/configuration&gt; &lt;/plugin&gt; --&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.0.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;${maven.compiler.source}&lt;/source&gt;
                      &lt;target&gt;${maven.compiler.target}&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.1-beta-1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;warSourceDirectory&gt;war&lt;/warSourceDirectory&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Stack Trace:</p>
  
  <pre><code>[INFO] [gwt:generateAsync {execution: default}]
  [INFO] using GWT jars from project dependencies : 2.0.4
  [INFO] ------------------------------------------------------------------------
  [ERROR] FATAL ERROR
  [INFO] ------------------------------------------------------------------------
  [INFO] syntax error @[163,64] in file:/home/user/Desktop/JFDemoGWTFork/src/main/java/org/apache/lucene/queryParser/QueryParser.java
  [INFO] ------------------------------------------------------------------------
  [INFO] Trace
  com.thoughtworks.qdox.parser.ParseException: syntax error @[163,64] in file:/home/user/Desktop/JFDemoGWTFork/src/main/java/org/apache/lucene/queryParser/QueryParser.java
      at com.thoughtworks.qdox.parser.impl.Parser.yyerror(Parser.java:987)
      at com.thoughtworks.qdox.parser.impl.Parser.yyparse(Parser.java:1293)
      at com.thoughtworks.qdox.parser.impl.Parser.parse(Parser.java:968)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:317)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:349)
      at com.thoughtworks.qdox.JavaDocBuilder.addSource(JavaDocBuilder.java:345)
      at com.thoughtworks.qdox.JavaDocBuilder$2.visitFile(JavaDocBuilder.java:435)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:43)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk(DirectoryScanner.java:34)
      at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan(DirectoryScanner.java:52)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:432)
      at com.thoughtworks.qdox.JavaDocBuilder.addSourceTree(JavaDocBuilder.java:421)
      at org.codehaus.mojo.gwt.GenerateAsyncMojo.createJavaDocBuilder(GenerateAsyncMojo.java:340)
      at org.codehaus.mojo.gwt.GenerateAsyncMojo.execute(GenerateAsyncMojo.java:111)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3 seconds
  [INFO] Finished at: Mon Feb 14 13:35:08 MST 2011
  [INFO] Final Memory: 28M/596M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>The <code>/home/user/Desktop/JFDemoGWTFork/src/main/java/org/apache/lucene/queryParser/QueryParser.java</code> is just some apache lib file that I included as source.. from the other posts I found that were sort of for the same issue it seems it will do this for many / all (?) classes that aren't the specific GWT RPC related classes</p>