Projects tigase _server tigase-http-api Issues #38
Current code does not compile (#38)
Artur Hefczyc opened 8 years ago
Due Date
2017-01-30

As Andrzej is currently unavailable I am assigning this to Wojciech. Wojciech please take a look if you can solve the problem. If you cannot, reassign to Andrzej.

Current code is not compilable. Attempt to compile results in the following error:

 http-api $ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tigase HTTP API component 1.3.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6:clean (default-clean) @ tigase-http-api ---
[INFO] Deleting /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/pdf (includes = [*.fo], excludes = [])
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ tigase-http-api ---
[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: /bin/sh -c cd "/projects/tigase/http-api" && git rev-parse --verify --short=8 HEAD
[INFO] Working directory: /projects/tigase/http-api
[INFO] Storing buildNumber: 17542348 at timestamp: Jan 30, 2017 9:48:28 PM
[INFO] Storing buildScmBranch: master
[INFO]
[INFO] --- gmaven-plugin:1.5:execute (gitver) @ tigase-http-api ---
setting revision to: 164
[INFO]
[INFO] --- build-helper-maven-plugin:1.9.1:add-source (add-source) @ tigase-http-api ---
[INFO] Source directory: /projects/tigase/http-api/src/main/groovy added.
[INFO]
[INFO] --- asciidoctor-maven-plugin:1.5.0:process-asciidoc (output-html) @ tigase-http-api ---
[INFO] Rendered /projects/tigase/http-api/src/main/asciidoc/index.asciidoc
[INFO]
[INFO] --- asciidoctor-maven-plugin:1.5.0:process-asciidoc (output-docbook) @ tigase-http-api ---
[INFO] Rendered /projects/tigase/http-api/src/main/asciidoc/index.asciidoc
[INFO]
[INFO] --- docbkx-maven-plugin:2.0.16:generate-webhelp (generate-webhelp) @ tigase-http-api ---
[INFO] Processing input file: index.xml
[INFO] Applying customization parameters after docbkx parameters
The created index files are located in /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/webhelp/search
[INFO] See /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/webhelp for generated file(s)
[INFO] Executing tasks
[INFO] Executed tasks
[INFO]
[INFO] --- docbkx-maven-plugin:2.0.16:generate-pdf (generate-pdf) @ tigase-http-api ---
[INFO] Processing input file: index.xml
[INFO] Applying customization parameters after docbkx parameters
[INFO] targetFileExtension pdf
[INFO] type fo
[INFO] /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/pdf/index.pdf has been generated.
[INFO] /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/pdf/index.fo has been generated.
[INFO] Executing tasks
     [move] Moving 1 file to /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/pdf
[INFO] Executed tasks
[INFO]
[INFO] --- docbkx-maven-plugin:2.0.16:generate-html (generate-html) @ tigase-http-api ---
[INFO] Processing input file: index.xml
[INFO] Applying customization parameters after docbkx parameters
[INFO] Chunking output.
[INFO] See /projects/tigase/http-api/docs/Tigase_HTTP-API_Guide/html_chunk for generated file(s)
[INFO] Executing tasks
[INFO] Executed tasks
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tigase-http-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 19 resources to scripts
[INFO] Copying 1 resource to etc
[INFO] Copying 14 resources
[INFO] Copying 7 resources to documentation
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ tigase-http-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
1. ERROR in /projects/tigase/http-api/src/main/groovy/tigase/http/upload/db/FileUploadRepositoryPool.java (at line 58)
	for (FileUploadRepository repo : getRepositories()) {
	                                 ^^^^^^^^^^^^^^^^^
Can only iterate over an array or an instance of java.lang.Iterable

[ERROR] Found 1 error and 0 warnings.
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.578s
[INFO] Finished at: Mon Jan 30 21:48:48 PST 2017
[INFO] Final Memory: 83M/1200M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project tigase-http-api: Compilation failure: Compilation failure:
[ERROR]
[ERROR] 1. ERROR in /projects/tigase/http-api/src/main/groovy/tigase/http/upload/db/FileUploadRepositoryPool.java (at line 58)
[ERROR] for (FileUploadRepository repo : getRepositories()) {
[ERROR] ^^^^^^^^^^^^^^^^^
[ERROR] Can only iterate over an array or an instance of java.lang.Iterable
[ERROR]
[ERROR] Found 1 error and 0 warnings.
[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
Artur Hefczyc commented 8 years ago

Changing problematic line:

	for (FileUploadRepository repo : getRepositories()) {

to

	for (FileUploadRepository repo : getRepositories().values()) {

seems to solve compilation problem, however, I am not sure if this is a correct solution.

Andrzej Wójcik (Tigase) commented 8 years ago

I've fixed this issue.

%kobit You are correct. This is the fix which I applied. Issue was caused by recent changes to MDRepositoryBean API (changed return type from collection of repositories to a map) and fact that after that change I havn't

compile this projects. (nor Jenkins did, as we only compiled release branch). Sorry about that.

wojciech.kapcia@tigase.net commented 8 years ago

Latest build (http://build.tigase.org/jenkins/job/tigase-http-api/1339/console) with Andrzej's fix is successful:

 > git checkout -f 77da876149c416d948bda1dadaf07cb90501777c
…
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Artur Hefczyc commented 8 years ago

Compiled OK now.

issue 1 of 1
Type
Bug
Priority
Blocker
Assignee
RedmineID
4869
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/tigase-http-api#38
Please wait...
Page is in error, reload to recover