Error Compiling Netty latest (Master) version - maven

I would like to test some of the latest features locate in netty Master branch at github.
(git://github.com/netty/netty.git)
I'm doing the following steps:
Open new empty directory on my local machine
Type git init
Type git pull git://github.com/netty/netty.git
Compile pom.xml using maven as follow: mvn clean package
I now get the following compliation error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.855s
[INFO] Finished at: Sun Jan 08 12:14:21 IST 2012
[INFO] Final Memory: 16M/176M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project netty: Compilation failure: Compilation
failure:
[ERROR] \tradair\tools\netty\src\main\java\io\netty\util\internal\LegacyLinkedTransferQueue.java:[655,61] type parameters of <E>E cannot be determined; no uniqu
e maximal instance exists for type variable E with upper bounds E,java.lang.Object
[ERROR] \tradair\tools\netty\src\main\java\io\netty\util\internal\LegacyLinkedTransferQueue.java:[739,53] type parameters of <E>E cannot be determined; no uniqu
e maximal instance exists for type variable E with upper bounds E,java.lang.Object
[ERROR] \tradair\tools\netty\src\main\java\io\netty\util\internal\LegacyLinkedTransferQueue.java:[827,57] type parameters of <E>E cannot be determined; no uniqu
e maximal instance exists for type variable E with upper bounds E,java.lang.Object
[ERROR] \tradair\tools\netty\src\main\java\io\netty\util\internal\LegacyLinkedTransferQueue.java:[880,65] type parameters of <E>E cannot be determined; no uniqu
e maximal instance exists for type variable E with upper bounds E,java.lang.Object
Can you please advise what I'm doing wrong.

LinkedTransferQueue back-porting was done recently in master, so you better try with latest version of JDK 6, (>= 1.6.0_25, a compiler bug?)

That's a java bug (I hit it before also). Upgrade to latest jdk and it will work. I don't recall what exactly version of java was giving the problems

Related

Scala Play openapi generator project has missing imports

I want to create a simple "news api" in scala-play where the server stub is generated with the openapi scala-play-server generator. (Therefore i use this https://drive.google.com/file/d/1Qez3JcdaBPNVq1BAWrgcS_sbyDrxAQKM/view?usp=sharing openapi file)
The following command is used to generate the project:
openapi-generator generate -g scala-play-server --additional-properties=basePackage=de.hwrBerlin.lehre.effort.newsapi,apiPackage=de.hwrBerlin.lehre.effort.newsapi.generated.api,modelPackage=de.hwrBerlin.lehre.effort.newsapi.generated.model -o api -i openapi.yaml
But when i start to run the project with sbt run and then open localhost:9000 i get several errors:
[info] Compiling 14 Scala sources and 2 Java sources to D:\Programmieren\Effort\newsapi\api\target\scala-2.12\classes ...
[error] D:\Programmieren\Effort\newsapi\api\app\de\hwrBerlin\lehre\effort\newsapi\ErrorHandler.scala:3:28: not found: type DefaultHttpErrorHandler
[error] class ErrorHandler extends DefaultHttpErrorHandler {
[error] ^
[error] D:\Programmieren\Effort\newsapi\api\app\de\hwrBerlin\lehre\effort\newsapi\ErrorHandler.scala:5:47: not found: type Future
[error] e: Throwable): Future[Result] = e match {
...
[error] D:\Programmieren\Effort\newsapi\api\app\de\hwrBerlin\lehre\effort\newsapi\generated\model\News.scala:21:54: not found: value Json
[error] implicit lazy val newsJsonFormat: Format[News] = Json.format[News]
[error] ^
[error] 49 errors found
[error] (Compile / compileIncremental) Compilation failed
[error] application -
(for full stack trace look here https://drive.google.com/file/d/16bdEtOROIGPUIMJvabn3lR4UCnUO4j6V/view?usp=sharing)
It seems like a many issues are missing but i have no idea how to fix the issue except doing it manually.
I use windows 10 and the AdoptOpenJDK version "11.0.8"
This issue is a bug in the current openapi-generator version (4.y.z).
I opened an issue on github:
https://github.com/OpenAPITools/openapi-generator/issues/7371
and wing328(Core team and founding member of OpenAPI Generator) suggested using the 5.0.0-beta2 of the openapi-generator. This fixed all import and dependency issues.

Cannot initialize module TreeWalker - Unable to instantiate SuppressWarningsHolder

I have maven-checkstyle-plugin(v2.5) and maven-eclipse-plugin(v2.8) configured.
Everything worked as expected but as soon as I introduced,
module name="SuppressWarningsHolder" AND/OR module name="SuppressWarningsFilter" to my checkstyle-config.xml, I started to have problems building the project.
Here is what I get:
[ERROR] BUILD ERROR
1> [INFO] ------------------------------------------------------------------------
1> [INFO] Failed during checkstyle configuration
1>
1>EXEC : Embedded error : cannot initialize module TreeWalker - Unable to instantiate SuppressWarningsHolder
1> Unable to instantiate SuppressWarningsHolderCheck
If I remove SuppressWarningsHolderCheck, I get the same error for SuppressWarningsFilter.
Any ideas?
Thanks
It appears you have two problems:
You are using maven-checkstyle-plugin v2.5, which is based on Checkstyle 5.0. In Checkstyle 5.0, the SuppressWarningsHolderCheck and the SuppressWarningsFilter did not exist yet, as they were introduced in 5.7. So you must first upgrade your maven-checkstyle-plugin.
The SuppressWarningsFilter must be configured directly under Checker, not under TreeWalker. The documentation does not make that part very explicit, although it is there. Note that the SuppressWarningsHolder does go under TreeWalker.
If you do both things, stuff should hopefully start working.

using Typesafe Activator on Windows

I tried to run the hello-slick template from inside Typesafe Activator.
When it recompiled it produced:
Refreshing list of source files to watch for changes...
[info] Loading global plugins from C:\Users\Edward G Prentice\.sbt\plugins\project
[info] Loading global plugins from C:\Users\Edward G Prentice\.sbt\plugins
[info] Loading project definition from C:\Users\Edward G Prentice\hello-slick\project
[info] Set current project to hello-slick (in build file:/C:/Users/Edward%20G%20Prentice/hello-slick/)
[error] Expected '"'
[error] apply -cp "C:/Users/Edward
[error] ^
Failed to reload source file list: sbt process never got in touch, so unable to handle request WatchTransitiveSourcesRequest(true)
so clearly it is not expecting spaces in that portion of the classpath. I understand what's failing but not how to fix it.
...and what is the best channel to resolve problems with Typesafe Activator?

Where did the 2nd level of maven java compiler error information go when I updated to java7?

When using java6 I saw two levels of error information
The error: file:[line,char] error: cannot find symbol
Details: symbol: method .... location: class com.....
Now, that I updated to java7 I no longer have this information. If I compile manually using "-Xlint:all" I see the details. For some reason maven isn't displaying the details.
Please let me know if you have any ideas how to fix this.
Thanks
Peter
Good using Java 6
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] warntest/src/main/java/com/attivio/foo/App.java:[9,1] cannot find symbol
symbol : class DoesNotExistType
location: class com.foo.App
Less Information using Java 7
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] warntest/src/main/java/com/attivio/foo/App.java:[9,1] error: cannot find symbol
[INFO] 1 error
This is a known issue: http://jira.codehaus.org/browse/MCOMPILER-158

luntbuild + maven + findbugs = OutOfMemoryException

I've been trying to get Luntbuild to generate and publish a project site for our project including a Findbugs report. All other reports (Cobertura, Surefire, JavaDoc, Dashboard) work fine, but Findbugs bails out with an OutOfMemoryException. Excluding findbugs from report generation fixes the build --- although obviously without a Findbugs report.
The funny thing is that I first encountered this problem locally and solved it by setting MAVEN_OPTS=-Xmx512m. This does not seem to be enough in Luntbuild, however: setting that exact same option as an environment variable of my builder doesn't make a difference.
I've found a couple of posts on the 'net stating you should also add -XX:MaxPermSize=512m to MAVEN_OPTS and/or pass -Dmaven.findbugs.jvmargs=-Xmx512m to mvn.bat. None of these (or their combination) seem to help though so any hints would be greatly appreciated!
Cheers,
Johannes
Relevant information:
Luntbuild is 1.5.6, Maven is 2.1.0, findbugs-maven-plugin is 2.0.1.
This is the Findbugs section of the relevant pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>2.0.1</version>
</plugin>
This is the head of my build log:
User "luntbuild" started the build
Perform checkout operation for VCS setting:
Vcs name: Subversion
Repository url base: http://some.repository.com/repo/
Repository layout: multiple
Directory for trunk: trunk
Directory for branches: branches
Directory for tags: tags
Username: xxxx
Password:xxxx
Web interface: ViewVC
URL to web interface: http://some.repository.com/repo/
Quiet period:
modules:
Source path: somepath, Branch: , Label: , Destination path: somewhere
Source path: somepath, Branch: somewhere1.0.x, Label: , Destination path: somewhere-1.0.x
Source path: somepath, Branch: somewhere1.1.x, Label: , Destination path: somewhere-1.1.x
Update url: http://some.repository.com/repo//trunk
Duration of the checkout operation: 0 minutes
Perform build with builder setting:
Builder name: default
Builder type: Maven2 builder
Command to run Maven2: "C:\maven\apache-maven-2.1.0\bin\mvn.bat" -e -f somewhere\pom.xml -P site -Dmaven.test.skip=false -DbuildDate="Tue Nov 24 11:13:24 CET 2009" -DbuildVersion="site-core138"
-Dsvn.username=xxxx -Dsvn.password=xxxx -DstagingSiteURL=file:///C:/luntbuild/core-reports
-Dmaven.findbugs.jvmargs=-Xmx512m
Directory to run Maven2 in:
Goals to build: site:stage site:stage-deploy
Build properties: buildVersion="site-core138"
artifactsDir="C:\\Program Files\\Luntbuild\\publish\\somewhere\\site-core\\site-core138\\artifacts"
buildDate="Tue Nov 24 11:13:24 CET 2009"
junitHtmlReportDir=""
Environment variables: MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=512m"
Build success condition: result==0 and builderLogContainsLine("INFO","BUILD SUCCESSFUL")
Execute command: Executing 'C:\maven\apache-maven-2.1.0\bin\mvn.bat' with arguments:
'-e'
'-f'
'somewhere\pom.xml'
'-P'
'site'
'-Dmaven.test.skip=false'
'-DbuildDate=Tue Nov 24 11:13:24 CET 2009'
'-DbuildVersion=site-core138'
'-Dsvn.username=xxxxxx'
'-Dsvn.password=xxxxxx'
'-DstagingSiteURL=file:///C:/luntbuild/reports'
'-Dmaven.findbugs.jvmargs=-Xmx512m'
'-DbuildVersion=site-core138'
'-DartifactsDir=C:\\Program Files\\Luntbuild\\publish\\somewhere\\site-core\\site-core138\\artifacts'
'-DbuildDate=Tue Nov 24 11:13:24 CET 2009'
'-X'
'site:stage'
'site:stage-deploy'
Tail of my build log:
Analyzed: C:\luntbuild\somewhere-work\somewhere\...\SomeClass.class
...
Analyzed: C:\luntbuild\somewhere-work\somewhere\...\target\classes
Aux: C:\luntbuild\somewhere-work\somewhere\...\target\classes
Aux: c:\maven\local-repo\...\somejar-1.1.1.1-SNAPSHOT.jar
Aux: c:\maven\local-repo\commons-lang\commons-lang\2.3\commons-lang-2.3.jar
....
Aux: c:\maven\local-repo\org\openoffice\ridl\3.1.0\ridl-3.1.0.jar
Aux: c:\maven\local-repo\org\openoffice\unoil\3.1.0\unoil-3.1.0.jar
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java heap space
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.(HashMap.java:209)
at edu.umd.cs.findbugs.ba.type.TypeAnalysis$CachedExceptionSet.(TypeAnalysis.java:114)
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.getCachedExceptionSet(TypeAnalysis.java:688)
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.computeThrownExceptionTypes(TypeAnalysis.java:439)
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.transfer(TypeAnalysis.java:411)
at edu.umd.cs.findbugs.ba.type.TypeAnalysis.transfer(TypeAnalysis.java:89)
at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:356)
at edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:82)
at edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory.analyze(TypeDataflowFactory.java:44)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:331)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:281)
at edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:173)
at edu.umd.cs.findbugs.classfile.engine.bcel.CFGFactory.analyze(CFGFactory.java:64)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:331)
at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:281)
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:937)
at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysisNoDataflowAnalysisException(ClassContext.java:921)
at edu.umd.cs.findbugs.ba.ClassContext.getCFG(ClassContext.java:326)
at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.analyzeMethod(BuildUnconditionalParamDerefDatabase.java:103)
at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.considerMethod(BuildUnconditionalParamDerefDatabase.java:93)
at edu.umd.cs.findbugs.detect.BuildUnconditionalParamDerefDatabase.visitClassContext(BuildUnconditionalParamDerefDatabase.java:79)
at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:68)
at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:971)
at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:222)
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:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17 minutes 16 seconds
[INFO] Finished at: Tue Nov 24 11:31:23 CET 2009
[INFO] Final Memory: 70M/127M
[INFO] ------------------------------------------------------------------------
Maven2 builder failed: build success condition not met!
Note that apparently maven only uses 70MB... but that probably doesn't mean anything since the Findbugs plugin forks its own process.
I don't have any experience with either of: Luntbuild or maven, but this might help you:
if the error message is "OutOfMemoryError: Java heap space", then Xmx setting is the one for you. -XX:MaxPermSize=512m option deals with PermGen space, which is a different one.
If, as you mention, FindBugs starts its own process, then setting MAVEN_OPTS doesn't seem to be relevant. I would suggest trying to find how to set the Xmx for FindBugs JVM. Probably others will come with details on how to do it.
EDIT:
Documentation for Maven FindBugs Plugin seems to cover the topic of setting heap size. The default value is 512M and you can change it using maxHeap. The only problem is that it seems to be possible only since version 2.2.

Resources