Spring roo 1.2.2 and GWT 2.5 compatibility - spring

I am trying to deploy an application using Spring Roo and GWT. I am a starter at both GWT and Roo and started by following this tutorial, but there seems to be a ploblem because the sample application cannot be started usin mvn:gwt run.
The result of the above maven command:
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building gwt_crash.ly 0.1.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> gwt-maven-plugin:2.2.0:run (default-cli) # gwt_crash.ly >>>
[INFO]
[INFO] --- aspectj-maven-plugin:1.2:compile (default) # gwt_crash.ly ---
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[WARNING] advice defined in org.springframework.orm.jpa.aspectj.JpaExceptionTranslatorAspect has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in org.springframework.mock.staticmock.AbstractMethodMockingControl has not been applied [Xlint:adviceDidNotMatch]
[WARNING] advice defined in org.springframework.scheduling.aspectj.AbstractAsyncExecutionAspect has not been applied [Xlint:adviceDidNotMatch]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.725s
[INFO] Finished at: Wed Nov 28 18:10:54 EET 2012
[INFO] Final Memory: 10M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project gwt_crash.ly: Compiler errors :
[ERROR] error at return entityManager().createQuery("SELECT COUNT(o) FROM Report o", Long.class).getSingleResult();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Report_Roo_Jpa_ActiveRecord.aj:24:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT o FROM Report o", Report.class).getResultList();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Report_Roo_Jpa_ActiveRecord.aj:28:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT o FROM Report o", Report.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Report_Roo_Jpa_ActiveRecord.aj:37:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT COUNT(o) FROM Employee o", Long.class).getSingleResult();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Employee_Roo_Jpa_ActiveRecord.aj:24:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT o FROM Employee o", Employee.class).getResultList();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Employee_Roo_Jpa_ActiveRecord.aj:28:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT o FROM Employee o", Employee.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Employee_Roo_Jpa_ActiveRecord.aj:37:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT COUNT(o) FROM Expense o", Long.class).getSingleResult();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Expense_Roo_Jpa_ActiveRecord.aj:24:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT o FROM Expense o", Expense.class).getResultList();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Expense_Roo_Jpa_ActiveRecord.aj:28:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] error at return entityManager().createQuery("SELECT o FROM Expense o", Expense.class).setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
[ERROR] ^^
[ERROR] /Users/alexsapran/Documents/workspace_j2ee/gwt_crash.ly/src/main/java/ly/crash/gwt/server/domain/Expense_Roo_Jpa_ActiveRecord.aj:37:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I have tried using both standard eclipse and STS but with no luck and every tutorial I can find is about roo 1.1.1.
So my question is if GWT is compatible with Roo and if yes is there a working sample code-tutorial to use?
Can someone please help me?

You might be coming across some version mismatch.
The documentation is not changed but always refer to latest - https://developers.google.com/web-toolkit/doc/latest/tutorial/roo-sts#install
Latest STS for GWT 2.5 -
http://blog.springsource.org/2012/12/18/spring-roo-1-2-3-release-available/
Also ensure you are using latest gwt-maven-plugin version 2.5

Related

Getting compilation error in jenkins and but not in eclipse and command line

I am setting up my project in jenkins and i see a strange error. I am getting compilation error in jenkins, however i dont see the same compilation error in eclipse and command line.
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[9,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[10,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[27,24] cannot find symbol
symbol: class Logger
location: class com.pamp.services.messaging.MessageEndpoint
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[8,32] package org.apache.commons.lang3 does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[9,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[10,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[19,29] package net.jodah.expiringmap does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[20,29] package net.jodah.expiringmap does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[21,29] package net.jodah.expiringmap does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[17,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[18,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[39,24] cannot find symbol
symbol: class Logger
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[41,11] cannot find symbol
symbol: class ExpiringMap
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[52,24] cannot find symbol
symbol: class Logger
location: class com.pamp.services.messaging.MessageConsumer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[119,46] cannot find symbol
symbol: class ExpirationListener
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[12,32] package org.apache.commons.lang3 does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[13,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[14,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[32,24] cannot find symbol
symbol: class Logger
location: class com.pamp.services.messaging.MessageProducer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[10,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[11,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[15,23] cannot find symbol
symbol: class Logger
location: class com.pamp.services.messaging.util.PropertyLoader
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[27,53] cannot find symbol
symbol: variable LoggerFactory
location: class com.pamp.services.messaging.MessageEndpoint
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[39,53] cannot find symbol
symbol: variable LoggerFactory
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[42,25] cannot find symbol
symbol: variable ExpirationPolicy
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[41,60] cannot find symbol
symbol: variable ExpiringMap
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[51,9] cannot find symbol
symbol: variable StringUtils
location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[121,5] method does not override or implement a method from a supertype
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[52,43] cannot find symbol
symbol: variable LoggerFactory
location: class com.pamp.services.messaging.MessageConsumer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[32,37] cannot find symbol
symbol: variable LoggerFactory
location: class com.pamp.services.messaging.MessageProducer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[49,9] cannot find symbol
symbol: variable StringUtils
location: class com.pamp.services.messaging.MessageProducer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[15,42] cannot find symbol
symbol: variable LoggerFactory
location: class com.pamp.services.messaging.util.PropertyLoader
[INFO] 32 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.041 s
[INFO] Finished at: 2019-07-08T11:16:17+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project messagingservice: Compilation failure: Compilation failure:
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[9,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[10,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[27,24] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.pamp.services.messaging.MessageEndpoint
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[8,32] package org.apache.commons.lang3 does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[9,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[10,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[19,29] package net.jodah.expiringmap does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[20,29] package net.jodah.expiringmap does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[21,29] package net.jodah.expiringmap does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[17,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[18,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[39,24] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[41,11] cannot find symbol
[ERROR] symbol: class ExpiringMap
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[52,24] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.pamp.services.messaging.MessageConsumer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[119,46] cannot find symbol
[ERROR] symbol: class ExpirationListener
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[12,32] package org.apache.commons.lang3 does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[13,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[14,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[32,24] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.pamp.services.messaging.MessageProducer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[10,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[11,17] package org.slf4j does not exist
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[15,23] cannot find symbol
[ERROR] symbol: class Logger
[ERROR] location: class com.pamp.services.messaging.util.PropertyLoader
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageEndpoint.java:[27,53] cannot find symbol
[ERROR] symbol: variable LoggerFactory
[ERROR] location: class com.pamp.services.messaging.MessageEndpoint
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[39,53] cannot find symbol
[ERROR] symbol: variable LoggerFactory
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[42,25] cannot find symbol
[ERROR] symbol: variable ExpirationPolicy
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[41,60] cannot find symbol
[ERROR] symbol: variable ExpiringMap
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[51,9] cannot find symbol
[ERROR] symbol: variable StringUtils
[ERROR] location: class com.pamp.services.messaging.MessageComponent
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageComponent.java:[121,5] method does not override or implement a method from a supertype
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageConsumer.java:[52,43] cannot find symbol
[ERROR] symbol: variable LoggerFactory
[ERROR] location: class com.pamp.services.messaging.MessageConsumer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[32,37] cannot find symbol
[ERROR] symbol: variable LoggerFactory
[ERROR] location: class com.pamp.services.messaging.MessageProducer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/MessageProducer.java:[49,9] cannot find symbol
[ERROR] symbol: variable StringUtils
[ERROR] location: class com.pamp.services.messaging.MessageProducer
[ERROR] /var/lib/jenkins/workspace/MessagingService/src/main/java/com/pamp/services/messaging/util/PropertyLoader.java:[15,42] cannot find symbol
[ERROR] symbol: variable LoggerFactory
[ERROR] location: class com.pamp.services.messaging.util.PropertyLoader
I am using maven 3.6.0. Also i have configured JAVA_HOME, but not sure why i am getting this error. I somehow feel that jenkins is not compiling the java class files. Any help here would be appreciated

Project build failed while testing project with maven and jvmdump file is created which shows nullpointerexception which is in Freemarker

java.lang.NullPointerException
at freemarker.template.TemplateException.getFTLInstructionStack(TemplateException.java:233)
at freemarker.template.TemplateException.printStackTrace(TemplateException.java:363)
at freemarker.template.TemplateException.printStackTrace(TemplateException.java:339)
at freemarker.template.TemplateException.printStackTrace(TemplateException.java:327)
at org.testng.internal.Utils.buildStackTrace(Utils.java:535)
at org.testng.internal.Utils.longStackTrace(Utils.java:519)
at org.testng.reporters.TestHTMLReporter.generateTable(TestHTMLReporter.java:155)
at org.testng.reporters.TestHTMLReporter.generateLog(TestHTMLReporter.java:311)
at org.testng.reporters.TestHTMLReporter.onFinish(TestHTMLReporter.java:40)
at org.testng.TestRunner.fireEvent(TestRunner.java:772)
at org.testng.TestRunner.afterRun(TestRunner.java:741)
at org.testng.TestRunner.run(TestRunner.java:509)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:193)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:386)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:323)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:143)
This error comes while i run test by maven, but when i run test individually, its fine. Error is dumped in target/surefire-reports and the dump file is 2019-07-18T15-47-53_893-jvmRun1.dump. This error comes up when i try to catch exception in unit test that is passed. I have Freemerker Dependency in my project and this exception is of freemarker. here is the unit test.
#Test(expectedExceptions = TemplateException.class)
public void getTemplate_Unsuccessfull_TemplateException() throws IOException, TemplateException {
//GIVEN
//WHEN
Mockito.when(configuration.getTemplate("someFile.ftl")).thenReturn(template);
Mockito.doThrow(TemplateException.class).when(template).process(Mockito.any(Map.class),Mockito.any(Writer.class));
//THEN
TemplateService.getTemplate("abcd#gmail.com","123456");
}
And this is console output
Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.743 s
[INFO] Finished at: 2019-07-18T16:42:41+05:30
[INFO] Final Memory: 47M/382M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project ***: There are test failures.
[ERROR]
[ERROR] Please refer to F:\*****\Project\****\branches\Authentication_20190508\Service\***\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] There was an error in the forked process
[ERROR] null
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
[ERROR] null
I expect to successfully run all tests by maven.

Suddenly getting "NoSuchMethodError: org.codehaus.plexus.compiler.CompilerConfiguration.isParameters" in CI build

I'm suddenly seeing a CI Maven build failing with something like this:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project CheckoutMs: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile: java.lang.NoSuchMethodError: org.codehaus.plexus.compiler.CompilerConfiguration.isParameters()Z
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:3.6.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/jenkins/.m2/repository/org/apache/maven/plugins/maven-compiler-plugin/3.6.1/maven-compiler-plugin-3.6.1.jar
[ERROR] urls[1] = file:/home/jenkins/.m2/repository/org/codehaus/groovy/groovy-eclipse-compiler/3.3.0-01/groovy-eclipse-compiler-3.3.0-01.jar
[ERROR] urls[2] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar
[ERROR] urls[3] = file:/home/jenkins/.m2/repository/org/apache/xbean/xbean-reflect/3.7/xbean-reflect-3.7.jar
[ERROR] urls[4] = file:/home/jenkins/.m2/repository/com/google/collections/google-collections/1.0/google-collections-1.0.jar
[ERROR] urls[5] = file:/home/jenkins/.m2/repository/org/codehaus/groovy/groovy-eclipse-batch/2.5.5-01/groovy-eclipse-batch-2.5.5-01.jar
[ERROR] urls[6] = file:/home/jenkins/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[7] = file:/home/jenkins/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[8] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
[ERROR] urls[9] = file:/home/jenkins/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[10] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[11] = file:/home/jenkins/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[12] = file:/home/jenkins/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[13] = file:/home/jenkins/.m2/repository/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar
[ERROR] urls[14] = file:/home/jenkins/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
[ERROR] urls[15] = file:/home/jenkins/.m2/repository/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
[ERROR] urls[16] = file:/home/jenkins/.m2/repository/org/ow2/asm/asm/6.0_ALPHA/asm-6.0_ALPHA.jar
[ERROR] urls[17] = file:/home/jenkins/.m2/repository/com/thoughtworks/qdox/qdox/2.0-M5/qdox-2.0-M5.jar
[ERROR] urls[18] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-compiler-api/2.8.1/plexus-compiler-api-2.8.1.jar
[ERROR] urls[19] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-compiler-manager/2.8.1/plexus-compiler-manager-2.8.1.jar
[ERROR] urls[20] = file:/home/jenkins/.m2/repository/org/codehaus/plexus/plexus-compiler-javac/2.8.1/plexus-compiler-javac-2.8.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
From some analysis, I can see that the "isParameters" method is available in version 2.8.3 of the plexus-compiler-api, but not in 2.8.1, which is being used here. This is not a dependency, direct or indirect, of the project being built.
This error is repeatable in the project where it's happening. It started happening at 2 minutes after midnight starting on 1/26. The previous build of this, which ran 6 minutes before that, on the previous day, did not see this symptom.
I also looked at the git commit ids of every repository pulled from for this build, and they are identical between the last successful build and this first (and continuing) failure.
This means that something must have changed in the infrastructure. I don't maintain that. A different team does. What I'd like to get from this posting is any clues I can pass on about what might have changed that could have caused this.
This is caused by plexus-compiler-eclipse not properly resolving its dependency on plexus-compiler-api. Not sure why - here's its pom.xml.
It's currently resolving the version of that dependency via the Maven Compiler Plugin, which is why updating it to latest e.g.:
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
fixes the dependency, e.g. it will cause:
< [INFO] org.codehaus.plexus:plexus-compiler-api:jar:2.8.1
< [INFO] org.codehaus.plexus:plexus-compiler-manager:jar:2.8.1
< [INFO] org.codehaus.plexus:plexus-compiler-javac:jar:2.8.1
---
> [INFO] org.codehaus.plexus:plexus-compiler-api:jar:2.8.4
> [INFO] org.codehaus.plexus:plexus-compiler-manager:jar:2.8.4
> [INFO] org.codehaus.plexus:plexus-compiler-javac:jar:2.8.4
The API change that causes the issue was introduced in this commit, first released in the plugin 2.8.2, which is why referencing latest e.g 2.8.6 without triggering the API dependency transitively via maven-compiler-plugin latest causes this problem.
FYI openjdk17
NoSucMethodError: 'void org.codehaus.plexus.compiler.eclipse.EclipseJavaCompiler.logCompiling
<plexus.version>2.13.0</plexus.version>
<compiler.version>3.10.1</compiler.version>
Use 2.12.1

Maven Error Building MILO OPC-UA

I am trying to build Milo to run the standalone examples. From the project root I run mvn clean install but maven complaints about all org.opcfoundation.* dependencies both in bsd-parser-core and bsd-parser-gson.
Error message:
[INFO] 45 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Eclipse Milo Build Tools ........................... SUCCESS [ 1.134 s]
[INFO] Eclipse Milo - OPC-UA (IEC 62541) .................. SUCCESS [ 1.420 s]
[INFO] opc-ua-stack ....................................... SUCCESS [ 1.026 s]
[INFO] stack-core ......................................... SUCCESS [ 13.145 s]
[INFO] stack-client ....................................... SUCCESS [ 1.195 s]
[INFO] opc-ua-sdk ......................................... SUCCESS [ 0.985 s]
[INFO] sdk-core ........................................... SUCCESS [ 1.842 s]
[INFO] bsd-parser ......................................... SUCCESS [ 0.240 s]
[INFO] bsd-parser-core .................................... FAILURE [ 1.274 s]
[INFO] sdk-client ......................................... SKIPPED
[INFO] stack-server ....................................... SKIPPED
[INFO] sdk-server ......................................... SKIPPED
[INFO] milo-examples ...................................... SKIPPED
[INFO] server-examples .................................... SKIPPED
[INFO] client-examples .................................... SKIPPED
[INFO] standalone-examples ................................ SKIPPED
[INFO] bsd-parser-gson .................................... SKIPPED
[INFO] stack-examples ..................................... SKIPPED
[INFO] stack-tests ........................................ SKIPPED
[INFO] sdk-tests .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.517 s
[INFO] Finished at: 2018-03-16T15:16:34+00:00
[INFO] Final Memory: 43M/575M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (java-compile) on project bsd-parser-core: Compilation failure: Compilation failure:
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[50,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[51,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[52,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[169,19] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[171,29] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[352,29] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[374,36] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[398,68] cannot find symbol
[ERROR] symbol: class SwitchOperand
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[419,42] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericStructCodec.java:[23,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericStructCodec.java:[27,31] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.GenericStructCodec
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericEnumCodec.java:[21,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericEnumCodec.java:[25,19] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.GenericEnumCodec
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericEnumCodec.java:[27,29] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.GenericEnumCodec
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[22,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[23,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[24,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[25,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[78,65] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[86,67] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericBsdParser.java:[18,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericBsdParser.java:[19,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericBsdParser.java:[24,56] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.GenericBsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericBsdParser.java:[29,58] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.GenericBsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[182,25] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[186,13] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[259,25] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[263,13] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[391,13] cannot find symbol
[ERROR] symbol: class SwitchOperand
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[392,44] cannot find symbol
[ERROR] symbol: variable SwitchOperand
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[400,18] cannot find symbol
[ERROR] symbol: variable EQUALS
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[402,18] cannot find symbol
[ERROR] symbol: variable NOT_EQUAL
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[404,18] cannot find symbol
[ERROR] symbol: variable GREATER_THAN
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[406,18] cannot find symbol
[ERROR] symbol: variable GREATER_THAN_OR_EQUAL
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[408,18] cannot find symbol
[ERROR] symbol: variable LESS_THAN
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[410,18] cannot find symbol
[ERROR] symbol: variable LESS_THAN_OR_EQUAL
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[43,55] cannot find symbol
[ERROR] symbol: class ObjectFactory
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[45,9] cannot find symbol
[ERROR] symbol: class TypeDictionary
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[45,42] cannot find symbol
[ERROR] symbol: class TypeDictionary
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[48,67] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[50,17] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[50,50] cannot find symbol
[ERROR] symbol: class EnumeratedType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[59,67] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[61,17] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/parser/BsdParser.java:[61,50] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.parser.BsdParser
Do I need to fetch something from additional repositories?
I am using Maven 3.3.9 and Java JDK version: 1.8.0_111, from Oracle Corporation.
EDIT 1
After execute git pull the project built run nicely, as show below:
Results :
Tests run: 12, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-failsafe-plugin:2.19.1:verify (default) # sdk-tests ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # sdk-tests ---
[INFO] Installing D:\PRODUTECH\Workspace\milo\opc-ua-sdk\sdk-tests\target\sdk-tests-0.2.2-SNAPSHOT.jar to C:\Users\User\.m2\repository\org\eclipse\milo\sdk-tests\0.2.2-SNAPSHOT\sdk-tests-0.2.2-SNAPSHOT.jar
[INFO] Installing D:\PRODUTECH\Workspace\milo\opc-ua-sdk\sdk-tests\pom.xml to C:\Users\User\.m2\repository\org\eclipse\milo\sdk-tests\0.2.2-SNAPSHOT\sdk-tests-0.2.2-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Eclipse Milo Build Tools ........................... SUCCESS [ 1.207 s]
[INFO] Eclipse Milo - OPC-UA (IEC 62541) .................. SUCCESS [ 1.337 s]
[INFO] opc-ua-stack ....................................... SUCCESS [ 1.146 s]
[INFO] stack-core ......................................... SUCCESS [ 19.878 s]
[INFO] stack-client ....................................... SUCCESS [ 1.471 s]
[INFO] opc-ua-sdk ......................................... SUCCESS [ 1.037 s]
[INFO] sdk-core ........................................... SUCCESS [ 2.381 s]
[INFO] bsd-parser ......................................... SUCCESS [ 0.227 s]
[INFO] bsd-parser-core .................................... SUCCESS [ 3.927 s]
[INFO] sdk-client ......................................... SUCCESS [ 8.032 s]
[INFO] stack-server ....................................... SUCCESS [ 1.538 s]
[INFO] sdk-server ......................................... SUCCESS [ 13.693 s]
[INFO] milo-examples ...................................... SUCCESS [ 0.203 s]
[INFO] server-examples .................................... SUCCESS [ 3.474 s]
[INFO] client-examples .................................... SUCCESS [ 1.059 s]
[INFO] standalone-examples ................................ SUCCESS [ 0.756 s]
[INFO] bsd-parser-gson .................................... SUCCESS [ 2.253 s]
[INFO] stack-examples ..................................... SUCCESS [ 1.168 s]
[INFO] stack-tests ........................................ SUCCESS [01:40 min]
[INFO] sdk-tests .......................................... SUCCESS [ 20.385 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:06 min
[INFO] Finished at: 2018-03-20T15:03:53+00:00
[INFO] Final Memory: 88M/2061M
[INFO] ------------------------------------------------------------------------
However, when I try to build the standalone examples, running mvn package -P standalone from the project root, the previous error shows up again, as shown below:
[INFO] 45 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Eclipse Milo Build Tools ........................... SUCCESS [ 1.034 s]
[INFO] Eclipse Milo - OPC-UA (IEC 62541) .................. SUCCESS [ 1.414 s]
[INFO] opc-ua-stack ....................................... SUCCESS [ 0.948 s]
[INFO] stack-core ......................................... SUCCESS [ 14.015 s]
[INFO] stack-client ....................................... SUCCESS [ 0.972 s]
[INFO] opc-ua-sdk ......................................... SUCCESS [ 0.935 s]
[INFO] sdk-core ........................................... SUCCESS [ 1.679 s]
[INFO] bsd-parser ......................................... SUCCESS [ 0.187 s]
[INFO] bsd-parser-core .................................... FAILURE [ 1.222 s]
[INFO] sdk-client ......................................... SKIPPED
[INFO] stack-server ....................................... SKIPPED
[INFO] sdk-server ......................................... SKIPPED
[INFO] milo-examples ...................................... SKIPPED
[INFO] server-examples .................................... SKIPPED
[INFO] client-examples .................................... SKIPPED
[INFO] standalone-examples ................................ SKIPPED
[INFO] bsd-parser-gson .................................... SKIPPED
[INFO] stack-examples ..................................... SKIPPED
[INFO] stack-tests ........................................ SKIPPED
[INFO] sdk-tests .......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.650 s
[INFO] Finished at: 2018-03-20T15:06:43+00:00
[INFO] Final Memory: 44M/1294M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (java-compile) on project bsd-parser-core: Compilation failure: Compilation failure:
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[50,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[51,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[52,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[169,19] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[171,29] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[352,29] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[374,36] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[398,68] cannot find symbol
[ERROR] symbol: class SwitchOperand
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/AbstractCodec.java:[419,42] cannot find symbol
[ERROR] symbol: class FieldType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.AbstractCodec<StructureT,MemberT>
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericStructCodec.java:[23,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericStructCodec.java:[27,31] cannot find symbol
[ERROR] symbol: class StructuredType
[ERROR] location: class org.eclipse.milo.opcua.binaryschema.GenericStructCodec
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericEnumCodec.java:[21,44] package org.opcfoundation.opcua.binaryschema does not exist
[ERROR] /D:/PRODUTECH/Workspace/milo/opc-ua-stack/bsd-parser/bsd-parser-core/src/main/java/org/eclipse/milo/opcua/binaryschema/GenericEnumCodec.java:[25,19] cannot find symbol
...
The org.opcfoundation.* sources are generated during the 'generate-sources' phase and placed in ../target/generated-sources. In Eclipse, you have to add this folder to the build-path.
Open the properties dialog for bsd-parser-core, open the build path folder and add the source folder.
Have you fetched/updated recently? There were some issues with version numbers that broke the build recently: https://github.com/eclipse/milo/issues/230
They have been fixed on HEAD

sql-maven-plugin throws SQL syntax error for H2 stored procedure definition

I try to install a stored procedure in an h2 database (v. 1.3.170) using the sql-maven-plugin version 1.5.
The offending SQL statement looks like this:
CREATE ALIAS GET_DATA AS $$
ResultSet getData(Connection conn, String id) {
return null;
}
$$;
This has been adapted from User-Defined Functions and Stored Procedures from the H2 website.
The maven error I get is this:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dummy 0.5.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # X4PAAsql ---
[INFO] Deleting D:\Data\Git\x4paa\SQL\target
[INFO]
[INFO] --- sql-maven-plugin:1.5:execute (createTables) # X4PAAsql ---
[INFO] Executing file: C:\Users\THOMAS~1\AppData\Local\Temp\prepareDB.331774647sql
[INFO] Executing file: C:\Users\THOMAS~1\AppData\Local\Temp\storedProc.2069356353sql
[ERROR] Failed to execute: CREATE ALIAS GET_DATA AS $$
#CODE
static ResultSet getData(Connection conn, String id) {
return null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.717s
[INFO] Finished at: Wed Aug 07 11:16:40 CEST 2013
[INFO] Final Memory: 4M/122M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (createTables) on project X4PAAsql: Syntax
Fehler in SQL Befehl " CREATE ALIAS GET_DATA AS [*]$$
[ERROR] #CODE
[ERROR] static ResultSet getData(Connection conn, String id) {
[ERROR] return null"
[ERROR] Syntax error in SQL statement " CREATE ALIAS GET_DATA AS [*]$$
[ERROR] #CODE
[ERROR] static ResultSet getData(Connection conn, String id) {
[ERROR] return null" [42000-170]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I use the following pom contents to configure the sql-maven-plugin.
<properties>
<h2db.version>1.3.170</h2db.version>
<sql-maven-plugin.version>1.5</sql-maven-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>${sql-maven-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2db.version}</version>
</dependency>
</dependencies>
<configuration>
<driver>org.h2.Driver</driver>
<url>jdbc:h2:SQL/target/H2DB/x4</url>
<username>sa</username>
<password>sa</password>
</configuration>
<executions>
<execution>
<id>createTables</id>
<phase>compile</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<forceMojoExecution>true</forceMojoExecution>
<srcFiles>
<srcFile>scripts/h2/prepareDB.sql</srcFile>
<srcFile>scripts/h2/storedProc.sql</srcFile>
</srcFiles>
</configuration>
</execution>
</executions>
</plugin>
Is there a way to work around the syntactical problem with the '$$'?
Update: I tried to run the query in SQuirrel and get the same error. So the problem is probably not related to the sql-maven-plugin but to the way the jdbc driver is used by the plugin or SQuirrel?
The sql-maven-plugin splits the SQL statement at the ";". The original statement was
CREATE ALIAS GET_DATA AS $$
ResultSet getData(Connection conn, String id) {
return null;
}
$$;
however, the exception message of the database only shows the first part, until the ";":
CREATE ALIAS GET_DATA AS [*]$$
#CODE
static ResultSet getData(Connection conn, String id) {
return null
(The marker [*] just before the $$ is the position where the parsing fails, because the parser doesn't see the end token $$.)
The "good" solution would be to change the sql-maven-plugin to support quoted data, but I guess that will not be easy. As a workaround, you could try changing the statement to:
CREATE ALIAS GET_DATA AS $$
ResultSet getData(Connection conn, String id) {
return null; } $$;

Resources