01-27-2021 02:23 AM
I have been trying to set up the development environment in Alfresco SDK 4.0 with Open JDK 11. I have downloaded the all in one project as mentioned in the documentation and even referred jeff pott's material (https://ecmarchitect.com/alfresco-developer-series-tutorials/maven-sdk/tutorial/tutorial.html#alfres...).
I have applied enterprise license and able to start and test the application. But when i put my customized code in the project structure i faced lot of compilation issues which i have fixed eventaully. But there are few stubborn issues which are related Java modules are giving me a tough time.
Below issues are failing the build.
The package com.xxxx.xxxx.entities is accessible from more than one module: <unnamed>, xxxx.alfresco ( In imports declaration)
The package com.com.xxxx.xxxx.entities conflicts with a package accessible from another module: xxxx.alfresco (In Package declration)
I have understood that this issue is related to JDK modules and fixed it by excluding the unnecessary jar in the pom.xm (for 3rd party jars such as xml and w3c). But the above problems arises when i try to build my customized code.
Below is my development environment i have used:
01-28-2021 05:58 PM
Hi @nikhilesh_s1vak,
let's take a step back and try as follows (all from the CLI):
java -version > output.txt
mvn -version >> output.txt
git clone https://github.com/Alfresco/alfresco-sdk.git sdk-4.2or (if you want to use SSH instead of HTTPS):
git clone git@github.com:Alfresco/alfresco-sdk.git sdk-4.2
cd sdk-4.2
mvn clean install -Pmaven.test.skip=true
mvn archetype:generate -Dfilter=org.alfresco:
<alfresco.bomDependencyArtifactId>acs-packaging</alfresco.bomDependencyArtifactId> <docker.acs.image>quay.io/alfresco/alfresco-content-repository</docker.acs.image> <alfresco.platform.version>6.2.2.10</alfresco.platform.version> <alfresco.share.version>6.2.2.2</alfresco.share.version> <keystore.settings></keystore.settings>
>> output.txtat the end of the command.
If the problem is still there at this point, please post here the output.txt file so we can have a look at it.
If instead the problem is gone, then the culprit was likely a dirty cache or the fact that the right version of the SDK to use today is 4.1 or 4.2.
Hope that helps
02-03-2021 09:44 AM
Hi @andrealigios,
Thanks for the swift response. Please find below inline comments for your questitons.
02-03-2021 10:16 AM
What if you do:
"java -version" > test.txt
?
Unluckily, I've no Windows here and cannot try it myself, but I suspect it's something like that...
02-04-2021 01:01 AM
The command supposed to be as below:
java -version 2>output.txt
02-04-2021 10:17 AM
Hi @andrealigios ,
The build was successfull with all in one archetype though i had issues with integration-tests. I have applied the enterprise license and verified the application.
But when i run after adding the custom code the build fails throwing compilation errors. I am trying to import the project to Eclipse to understand the errors. But i think those issues are mostly the same issues which i was facing earlier.
But i will update you soon once the import is successful. Kindly let me know how can i upload the output.txt file here?
02-04-2021 12:41 PM
You can use a service like https://pastebin.com/ , or even paste its content here in a code block, as you prefer.
02-05-2021 02:12 AM
Please find the below pastebin links of the output.txt response.
Before adding the custom code:
After adding the custom code:
02-09-2021 12:24 AM
Hi @andrealigios ,
Did you get a chance to look into it?
02-09-2021 05:20 AM
Hi @nikhilesh_s1vak , yes I've had a look at it on Friday but then got very busy with the release of the new Alfresco SDK 4.2, which is almost ready.
Can you please tell me the exact version of Platform/Repo you're using (6.2.x.x)?
In Q4 2020, the Alfresco Platform has undergone a major structural refactoring, and your code might need to be revised in order to work against versions newer than November 2020.
Please provide me with this information, I'll have a look again at your log ASAP.
02-09-2021 06:34 AM
We are using Alfresco enterprise 6.2.0 version.
02-10-2021 04:28 AM
I see your custom code is quite big since by default it compiles 128 files:
[INFO] Compiling 128 source files to C:\Nikhilesh\Work\Alfresco\alfresco 6.2\sdk-4.1\alfsdk41\alfsdk41-platform\target\classes
Unless the code is all related to a single functionality, I suggest you (as a golden rule) split it into smaller parts and start adding them one by one, testing when it stops working.
That said, the "Cannot find Symbol" error has several possible causes, but since we're talking about migrating from Java 8 or earlier to Java 9 or higher, which is where JPMS kicked in, you must probably just include a few libraries (and eventually refactor the imports with the help of your IDE, if they're changed) in the pom.xml.
Libraries that were included by default before and are not in the JDK anymore now.
For example, it happened to Java EE, and now if you need "javax" components you need to import them, eg.:
<artifactId>javax.annotation-api</artifactId>
which in modern Java is not available by default.
While Maven simply complains, your IDE should also help you identify immediately what the problem is.
Please ensure that Eclipse (or IntelliJ CE) is properly configured to compile your project against Java 11 and not other versions, then take a look at all the red flags it should raise.
At that point, it should really be a matter of identifying where the missing classes are gone in JDK11, and how to bring them back (likely by declaring them explicitly in pom.xml)
Please let me know if it helped.
Explore our Alfresco products with the links below. Use labels to filter content by product module.