playframework - package javax.persistence does not exist - java

I have Issue with using database
I was going with this tutorial
http://vimeo.com/58969923# (one from playframework.com page)
in the model:
play-2.2.1/jcirs/app/models/MedicalIncident.java
public class MedicalIncident extends Model{}
I am trying to use Entity. For that I have to import:
javax.persistence.* and play.db.ebean.*
but none of them can be found.
The error is
package javax.persistence does not exist
What should I do?
Use any other database engine? Or should download some dependency.
I would like to go with playframework best way.
Please help.
My configuration
application.conf:
db.default.driver=org.h2.Driver
db.default.url="jdbc:h2:mem:play"
ebean.default="models.*"
stack trace:
[jcirs] $ run 8081
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:8081
(Server started, use Ctrl+D to stop and go back to the console...)
[info] Compiling 5 Scala sources and 5 Java sources to /home/daniel/play-2.2.1/jcirs/target/scala-2.10/classes...
[error] /home/daniel/play-2.2.1/jcirs/app/models/MedicalIncident.java:4: error: package javax.persistence does not exist
[error] import javax.persistence.*;
[error] ^
[error] /home/daniel/play-2.2.1/jcirs/app/models/MedicalIncident.java:6: error: package play.db.ebean does not exist
[error] import play.db.ebean.*;
[error] ^
[error] /home/daniel/play-2.2.1/jcirs/app/models/MedicalIncident.java:14: error: cannot find symbol
[error] public class MedicalIncident extends Model {
[error] ^
[error] symbol: class Model
[error] /home/daniel/play-2.2.1/jcirs/app/models/MedicalIncident.java:13: error: cannot find symbol
[error] #Entity
[error] ^
[error] symbol: class Entity
[error] /home/daniel/play-2.2.1/jcirs/app/models/MedicalIncident.java:15: error: cannot find symbol
[error] #id
[error] ^
[error] symbol: class id
[error] location: class MedicalIncident
[error] /home/daniel/play-2.2.1/jcirs/app/controllers/MedicalIncident.java:21: error: cannot find symbol
[error] MedicalIncident medical_incident = Form.form(MedicalIncident.class).bindFormRequest().get();
[error] ^
[error] symbol: variable Form
[error] location: class MedicalIncident
[error] 6 errors
[error] (compile:compile) javac returned nonzero exit code
[error] application -
! #6gfjpj0cf - Internal server error, for (GET) [/] ->
play.PlayExceptions$CompilationException: Compilation error[error: package javax.persistence does not exist]
at play.PlayReloader$$anon$1$$anonfun$reload$2$$anonfun$apply$14$$anonfun$apply$16.apply(PlayReloader.scala:304) ~[na:na]
at play.PlayReloader$$anon$1$$anonfun$reload$2$$anonfun$apply$14$$anonfun$apply$16.apply(PlayReloader.scala:304) ~[na:na]
at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
at play.PlayReloader$$anon$1$$anonfun$reload$2$$anonfun$apply$14.apply(PlayReloader.scala:304) ~[na:na]
at play.PlayReloader$$anon$1$$anonfun$reload$2$$anonfun$apply$14.apply(PlayReloader.scala:298) ~[na:na]
at scala.Option.map(Option.scala:145) ~[scala-library.jar:na]
[warn] play - No application found at invoker init

Have you updated your project dependencies in Build.scala?
Not sure if anything has changed in Play 2.2.1 but for Play 2.1.3 dependencies in Build.scala would look like this:
val appDependencies = Seq(
javaCore,
javaJdbc,
javaEbean
)
EDIT:
Once you update your dependencies in Build.scala don't forget to update dependencies in your IDEA or Eclipse by running corresponding play command, e.g.
play idea

Playframework is generating the IDEA specific files when you run "play idea" (if you're using Eclipse, run "play eclipse"). If you imported the project in the same way the tutorial explained, you should have the necessary JARs already available in the project.
If it's still not working, verify if IDEA correctly assigned a JDK to your project.
Try to understand what this framework is doing under the hood, don't just try to make it work and ignore the important stuff.

I had the same problem and I was using Eclipse. I included #Entity, e.g. and in my project console I typed eclipse with-source=true. After a "Refresh" in my Eclipse project and a "Clean", it brings me all JARs and then I clicked on the issue and the IDE offered the possibility to include javax.persistence.*, play.db.ebean.Model, etc.

I was having the same problem, while using a heavily modified version of Eclipse Neon. The clue to solving it for me, was that the only place I was seeing the errors was during a Maven build. The Eclipse IDE was able to compile and run the program just fine.I was able to solve it by adding a couple of dependencies to the project's pom.xml file. See below for the xml code for the dependencies.I was able to get the groupId's and artifactId's versions by drilling down the directories out on Maven Central. I just walked the tree until I found the metadata.xml files for the persistence.core and the persistence.jpa artifacts.
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
<version>2.6.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.jpa</artifactId>
<version>2.6.4</version>
<scope>compile</scope>
</dependency>

Related

I'm not able to use an external library in Java

I'm having trouble adding a .jar externally, notice that the .jar in the correct location, apparently has been added to the project, is ms-azure-cs-faceapi.jar, I added by clicking on add external JARs.
I'm using this library in a class only, and after adding it to the path the errors are gone, there are no errors in the system, at least red dots are not appearing in any folder, apparently everything is all right.
However, when I run the "clean install" appear these errors in the console:
[ERROR]/I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[26,67] package com.microsoft.azure.cognitiveservices.vision.faceapi.models does not exist
[ERROR] /I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[190,31] cannot find symbol
[ERROR] symbol: class FaceAPI
[ERROR] location: class TestFaceapi
[ERROR] /I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[239,38] cannot find symbol
[ERROR] symbol: class FaceAPI
[ERROR] location: class TestFaceapi
As I said, in the class there is no error, everything is ok, but I can not climb the application due to this error ... does anyone have an idea of what might be missing when importing .jar externally?

Maven error on using Websockets in JHipster

I am trying to run a project generated using jhipster. I opted to use Spring Websockets while generating the project. However on running the mvn command on the folder. I get the following error:
[ERROR] diagnostic: C:\java_dev\workspaces\pmilive\pmi\trunk\src\main\java\id\co\allianz\pension\config\WebsocketSecurityConfiguration.java:10: error:
cannot access org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer
public class WebsocketSecurityConfiguration extends AbstractSecurityWebSocketMessageBrokerConfigurer {
^
class file for org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer not found
[ERROR] error on execute: error during compilation
Is there any other additional setting that I should add?
No nothing special is required, I suspect that you had an error during maven dependency resolution phase. maybe something is wrong in your ~/.m2 local repository: try deleting ~/.m2/respository/org/springframework and re-run mvn.
If you're on Windows, path is %USERPROFILE%\.m2\repository\org\springframework.

dependencyClasspath error on Play! 2.2 as play.db.ebean cannot be found

I am running Play! 2.2 and want my models to extend play.db.ebean. I have one model called Event which extends play.db.ebean.Model. I get the following compilation errors when I try to generate Eclipse files (from the play command line) because the application cannot find the play.db.ebean package:
[info] About to create Eclipse project files for your project(s).
[info] Compiling 6 Scala sources and 7 Java sources to C:\Users\nickc\gatherme\target\scala-2.10\classes... error: cannot find symbol
[error] public abstract class Event_ extends play.db.ebean.Model_ {
[error] symbol: class Model_
[error] location: package play.db.ebean
[error] 1 error
[error] Could not create Eclipse project files:
[error] Error evaluating task 'dependencyClasspath': error
I have the following in my build.sbt file:
import play.Project._
name := "forms"
version := "1.0"
val appDependencies ++= Seq(
javaEbean,
jdbc
)
playJavaSettings
This is as suggested here and in the Zentasks sample project. I am guessing that my build.sbt file must be wrong? Or not getting picked up?
Any suggestions would be greatly appreciated!
Thank you,
Nick

Adding Apache common dependency to Play Framework 2.0

i want to import org.apache.commons.io but i'm getting this error:
[info] Compiling 1 Java source to /home/ghost/Bureau/app/play-2.0.1/waf/target/scala-2.9.1/classes...
[error] /home/ghost/Bureau/app/play-2.0.1/waf/app/controllers/Application.java:9: error: package org.apache.commons.io does not exist
[error] import org.apache.commons.io.*;
[error] ^
[error] /home/ghost/Bureau/app/play-2.0.1/waf/app/controllers/Application.java:41: error: cannot find symbol
[error] FileUtils.copyFile(file, destinationFile);
[error] ^
[error] symbol: variable FileUtils
[error] location: class Application
[error] 2 errors
[error] {file:/home/ghost/Bureau/app/play-2.0.1/waf/}waf/compile:compile: javac returned nonzero exit code
[error] application -
Play can't find package org.apache.commons.io .
How can i add apache io as a dependency ?
To add the dependencies
Edit project Build.scala file : /project/Build.scala and add dependency for commons-io
val appDependencies = Seq(
// Add your project dependencies here,
"commons-io" % "commons-io" % "2.4"
)
using play console check dependency resolved or not use command: play dependencies
Tip: If you're not familiar with SBT syntax mvnrepository.com allows you to copy proper one in SBT tab: commons-io sample

Jenkins not showing maven compiler errors

When building our multi-module maven 3 project in Jenkins, if there's a build error we get this cryptic message that the maven compiler plugin failed. This only just started happening within the last week:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:22.340s
[INFO] Finished at: Fri Feb 10 09:44:02 CET 2012
[INFO] Final Memory: 171M/318M
[INFO] ------------------------------------------------------------------------
mavenExecutionResult exceptions not empty
message : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project me.activity.impl: Compilation failure
cause : Compilation failure
Stack trace :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project me.activity.impl: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:104)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 27 more
Maven schlug mit Fehlern fehl.
An attempt to send an e-mail to empty list of recipients, ignored.
When building from the command-line we get the normal build errors:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5:24.906s
[INFO] Finished at: Fri Feb 10 08:17:31 EST 2012
[INFO] Final Memory: 173M/328M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project me.activity.impl: Compilation failure: Compilation failure:
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[1018,12] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[200,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[234,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[263,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[294,20] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[311,16] cannot find symbol
[ERROR] symbol : class ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[1023,47] cannot find symbol
[ERROR] symbol : variable ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[ERROR] \p4views\VM\Base\main\modules\activity\impl\src\main\java\com\sap\me\activity\impl\ExtensionConfigurationService.java:[1025,67] cannot find symbol
[ERROR] symbol : variable ActivityRuntimeType
[ERROR] location: class com.sap.me.activity.impl.ExtensionConfigurationService
[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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :me.activity.impl
We're using maven-3.0.4 both for local builds and on Jenkins. Jenkins version was 1.3ish, but I upgraded to 1.450 to see if the issue would go away - it didn't. This happened about the time we moved from maven-2.2.1 to maven-3.0.4, but I could swear (although I don't have evidence) that I was getting normal build errors on Jenkins just after the maven upgrade, so I don't think that's it, but it's the only change I can think of that would cause this. The compiler plugin version is 2.0.2.
I saw a similar posting here but his issue had to do with eclipse builds, not Jenkins.
Got an answer, which may not work for you as it seems rather dependent on many things and circumstances, BUT I suspect it is indeed relevant for most people here.
Troubleshooting
(Skip if you don't care about how I figured this out for my setting, but it may help for yours. The Solution 1 bit is what you want if you're impatient.)
How it Started...
Current working-directory of an actively developed project started to spit out logs showing this behavior today, when there had been no errors for a while. I was using Windows 7, Maven 3.0.4, compiler plugin 2.4, and java(c) 1.6.0_31.
When reaching a specific sub-module, maven would spit out some error messages and fail the build, except the error messages were unrelated (reporting use of proprietary com.sun.* APIs) and there would be no sign of an actual compilation error.
Things get Weird...
At this point I find this thread, and I also try to re-build with different java versions and maven-compiler-plugin versions. Here's the fun part:
with compiler-plugin 2.5, I'd get a similar issue, and no valid error report;
with compiler plugin 2.3, I'd get a similar issue with a nonsensical error report complaining about a missing package (that is present and on classpath, though!);
with compiler plugin 2.3.2, I'd get a similar issue with a nonsensical error report complaining about a missing package (that is present and on classpath, though!) BUT ** at a different point **in the test-classes' compilation of the module (previously it happened during the normal classes' compilation).
From Weird to Weirder
Getting suspicious, I switched to another directory with a clean checkout of the project and re-built everything.
Everything worked FINE. Puzzlement and despair here.
So I realized I was working on a rather huge and complex class in the other workspace, in the faulty module. And I do mean rather huge, complex, and fairly poorly written. The type of beast that makes you tell your boss "please don't make me touch this" and that makes your DELETE key tickle you every time you have the misfortune of running across it in your IDE. In fact, this thing looks so much like the offspring of a dark margic experiment and weirdly unethical bioresearch that you wonder if it didn't come right out of RTC Wolfenstein or Doom, if the antagonists were bits of code. The class you don't want to be left alone to code on at night, and for which Sonar quietly reports close to 1000 code quality violations, including complexity indexes that make you wonder if PMD, JDepend and other tools are not actually all having a stroke at the same time).
But I digress...
I copied it over to this clean and seemingly working workspace (luckily for me, it didn't impact other files, so it was rather simple to do: just copy over).
Then I rebuild with Maven and it gets all cranky when it reaches the module containing this file again, except this time it prints out a load of errors a stacktrace that nevers ends. So I want to try to re-run the same build, this time saving the output to a log file to have a closer look and (here's the new odd thing, because so far that wasn't bizarre enough) ... it again doesn't show any error.
So, I'm figuring something is obviously very nasty, for javac to go belly up with what looks like a stack overflow, and look for the bit of stacktrace I could see in my log the first time around. Here's a chunk of it (as I suspect some may come across this and find this answer useful):
[ERROR] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
[ERROR] at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:377)
[ERROR] at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1241)
[ERROR] at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1210)
[ERROR] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
[ERROR] at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1799)
[ERROR] at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
[ERROR] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
[ERROR] at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:377)
[ERROR] at com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1241)
[ERROR] at com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1210)
[ERROR] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
[ERROR] at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1799)
[ERROR] at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
And Google nicely points me to... StackOverflow, of course :)
Maven compilation: Failure executing javac
Where I can see an easy thing to try (see below).
Of course, this would have been way easier to troubleshoot, had the stacktrace appeared in all situations and in all cases, and shown the obvious StackOverflowException. Especially considering I have otherwise already seen this error and know what it means, but it's a hell of a lot harder to figure out when you **can't see* the error.
Not sure why Maven swallowed that one, but maybe javac simply crashed without notice and there's a screw-up in the log management and it doesn't get flushed out properly.
That would also explain why this bug happens relatively randomly: it would be impact by your hardware settings, and slight changes to the classes javac is given to process.
So, now what??? Well, if there's a crazy stack overflow exception or an OutOfMemoryException when java tries to process your code, obviously you need to do something akin to what's explained below...
Solutions
Solution 1 (aka "short-term / quick-n-dirty / please-make-it-work")
Upgrade your memory settings. Simplest way is with something like (for a bash-like shell):
export MAVEN_OPTS="-Xss1024k -Xms512m -Xmx1024m"
BEWARE: These settings will depend on your platform's hardware, obviously (and on your shell).
In my case, I actually used to have:
export MAVEN_OPTS="-Xss128k -Xms384m -Xmx384m"
... because I have a pretty heavy project and a not so memory-capable workstation, so I need to squeeze every bit of RAM I can out of it to have multiple Eclipse instances running, multiple application servers, etc... So my JAVA_OPTS, ANT_OPTS and MAVEN_OPTS are set with a bunch of options, including these.
This is not necessarily what you want!! The default xss for a 64 bits JVM on Windows is actually 1024, so I use something considerably smaller. I'm just saying it as it may help others in the same situation. Try to raise it accordingly and sensibly for you configuration.
So, eventually, to fix this particular issue in my project, I had to change the above to:
export MAVEN_OPTS="-Xss256k -Xms384m -Xmx384m"
And now everything works peachy.
Maybe some other things are different for you. Let me know.
Solution 2 (aka "long-term / zen")
You know what's better than fiddling with memory settings that others won't know to fiddle with and may not have the chance to, and that make your builds less portable? [audience screams here]
You refactor the hell out of that butt-ugly class that makes javac cry for its mommy.
It's that simple. No thousands and thousands of lines long classes, with crazy static initializers, super long methods and stuff like these. If your code looks complicated to you, it sure does for poor javac as well.
Save a javac process today: refactor your code!!
The maven compiler plugin version I use is 2.3.2. From the output below you can see that I am getting errors as you would expect.
07:16:37 [INFO] Copying 0 resource
07:16:37 [INFO]
07:16:37 [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) # fusion-common ---
07:16:38 [INFO] Compiling 49 source files to /opt/jss/hudson/work/jobs/FMWJavaCommon/workspace/target/classes
07:16:42 [INFO] -------------------------------------------------------------
07:16:42 mojoFailed org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile)
07:16:42 [ERROR] COMPILATION ERROR :
07:16:42 [INFO] -------------------------------------------------------------
07:16:42 [ERROR] /opt/jss/hudson/work/jobs/FMWJavaCommon/workspace/src/main/java/au/gov/qld/jag/jss/fusion/services/InvokeAuditLoggerService.java:[107,8] cannot find symbol
07:16:42 symbol : method setGeneratedTimestamp(javax.xml.datatype.XMLGregorianCalendar)
07:16:42 location: class au.gov.qld.jag.jss.fusion.services.client.auditservice.AuditLogType
07:16:42 [INFO] 1 error
0
The pom configuration for the plugin is
<!-- Compiler Version to use for Compiling Java Code -->
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
There are no other special configurations. I am using Hudson 2.2.0-BETA and the Hudson::Maven (legacy) plugin 2.2.0-BETA.
Not sure if this will fix your problem but I had the exact same issue because a parent pom had a plugin definition for the compiler plugin. I copied the same plugin definition to the actual project pom. This fixes the problem for me, i.e. Jenkins is now showing the compiler errors properly. Not sure why this fixed the problem but it does. Maybe it has something to do with the fact that maven forks a process to compile sub-modules and that terminal is not piped to the jenkins console. I will explore more when I get time.
Let me know if this works for you. I have copied my plugin definition below its fairly standard:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
You should check where the class ActivityRuntimeType is located. Most likely it's not on the compiler's build or class path. This usually happens when a class you depend on is in a dependency that changes unexpectedly.

Categories