Skip to content

guide_dev_troubleshooting

devonfw-core edited this page Apr 11, 2023 · 23 revisions

Troubleshooting for Developers

CobiGen-eclipse or CobiGen-eclipse-test has build errors after git clone or pull

This might be caused as of the fact, that the cobigen-eclipse*/lib folder is not available after initial cloning or the contents of the lib folder are not in sync with the dependencies specified in the pom.xml respectively with the classpath inclusions in the plugin.xml (tab runtime).

Solution

In any of these cases you can fix the issue by running a mvn clean package -Pp2-build-photon.

Getting Not authorized , Reason Phrase: Unauthorized

You are facing an error like

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-ftp:1.0-beta-6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.wagon:wagon-ftp:jar:1.0-beta-6 @@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.capgemini:cobigen-htmlplugin:1.1.0 (D:\toolscobigen\tools-cobigen2\cobigen\cobigen\cobigen-htmlplugin\pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-ftp:1.0-beta-6 or one of its dependencies could not be resolved: Failed to read a
rtifact descriptor for org.apache.maven.wagon:wagon-ftp:jar:1.0-beta-6: Could not transfer artifact org.apache.maven.wagon:wagon-ftp:pom:1.0-beta-6 from/to publ
ic (https://devon.s2-eu.capgemini.com/nexus/content/groups/public/): Not authorized , ReasonPhrase: Unauthorized. -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException

Solution

Please note the message Not authorized , ReasonPhrase: Unauthorized. → [Help 2]!

  1. Please check, that you run the command by using the console.bat or a similar console initialized with the IDE environment variables.

  2. Please check your corporate login in the variables-customized.bat to be correct (DEVON_NEXUS_USER and DEVON_NEXUS_PASSWD). Make sure, that you restart the console.bat you are working in after changing the variables-customized.bat. Same holds for eclipse instances running. Please restart to make the new values accessible.

  3. Please check your password to escape special characters.

  4. Please check whether you are able to login to https://devon.s2-eu.capgemini.com and Nexus is up and running. If you cannot login, contact one of the main developers.

Testing changes on the CobiGen-core

To test changes implemented on the cobigen-core you have to follow the next process:

  1. Open a console and step into cobigen/cobigen-core-parent. Run mvn clean install and remember the jar version you have just installed.

  2. On Eclipse, go to cobigen/cobigen-eclipse pom.xml and change the <version> of your cobigen-core.

  3. Also check on the cobigen/cobigen-core-parent pom-xml that it is using the just installed version.

  4. Open a console and step into cobigen/cobigen-eclipse. Run mvn clean package -Pp2-build-photon,p2-build-stable,p2-build-experimental.

  5. On Eclipse, go to cobigen/cobigen-eclipse and double-click 'plugins.xml'. On the bottom, click on 'runtime' tab. On 'classpath', add a new library and choose the jars you have just installed.

  6. Refresh on Eclipse, press F5 on the cobigen-eclipse inside Eclipse.

  7. If you still see compilation errors: On Eclipse, right-click cobigen/cobigen-eclipse → Maven → Update projects.

Issues with workspace when Oomph automatic updates don’t work (especially for Indian colleagues)

Executing eclipse-cobigen-development.bat file will open Eclipse with all the projects automatically imported. Oomph creates 'Working Sets' and set 'Top Level Elements' pointing to that working set. For Countries where proxy restricts Oomph to execute, we see no projects imported into project explorer/Navigator. Rather than trying manual import which later can give build issues we should follow below solution. Build Issues could be like:

[ERROR] Cannot resolve project dependencies:
[ERROR]   You requested to install 'com.capgemini.cobigen-htmlplugin 0.0.0' but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: com.capgemini:com.capgemini.cobigen.eclipse.test:3.0.1 @

Solution

In Eclipse, you can click the small downward arrow in the upper right corner of the Navigator/Project Explorer view and go to 'Top Level Elements' and point them to 'Projects'. This should show all the projects inside Project Explorer View. Also, Each plugin should point to respective branch.

Issue when testing Eclipse plugin by Running as Eclipse Application.

Error message will be like:

1) Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle com.devonfw.cobigen.eclipse
2) org.osgi.framework.BundleException: Error starting module.
3) org.eclipse.core.runtime.CoreException: Plug-in com.devonfw.cobigen.eclipse was unable to load class com.devonfw.cobigen.eclipse.workbenchcontrol.handler.XXXXHandler.

Solution

Delete or rename the runtime-EclipseApplication inside workspaces folder. Re-run and try setting up workspace in that environment again. It should work!!

1) Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle com.devonfw.cobigen.eclipse
2) org.osgi.framework.BundleException: Error starting module.
3) org.eclipse.core.runtime.CoreException: Plug-in com.devonfw.cobigen.eclipse was unable to load class com.devonfw.cobigen.eclipse.workbenchcontrol.handler.XXXXHandler.

== Issue when running Eclipse SWTBot tests via github actions with custom test projects Error message on github actions will be like:

org.eclipse.swtbot.swt.finder.widgets.TimeoutException: Timeout after: 15000 ms.: The widget (of type 'Button' and with mnemonic 'Finish' and with style 'SWT.PUSH') was not enabled.
...
at com.devonfw.cobigen.eclipse.test.common.utils.EclipseUtils.importExistingGeneralProject(EclipseUtils.java:101)

But on the local system the build and test process works fine.

==== Solution If you add an Eclipse test project, make sure that you git force add the .project file too. Otherwise the importExistingGeneralProject method will fail.

== I get ongoingly wrong intendation (4 whitespaces instead of 2) by the eclipse formatter on editor save

The issue might be, that due to eclipse upgrades or accidential changes on the formatter configuration, you might have project specific formatter settings enabled without your knowledge or even just have an old version of eclipse nobody is compliant anymore with. To clean up your installation as well as making sure, that you don’t have any project specific jdt configuration, please follow the following steps:

  1. Close all devonfw applications

  2. Open a git bash in the devonfw workspace of your cobigen projects

  3. Run devon ide update all to get in sync with the latest settings and setup. This may take some time. Please read the messages carefully. You might need to run this command again in case the scripts get updated.

  4. Navigate to your workspace root, e.g. workspaces/main and run rm */.settings/org.eclipse.jdt.core.prefs to get rid of all project specific settings.

  5. Open eclipse and validate the fix.

Clone this wiki locally