Project

General

Profile

TaxonomicEditorDevelopmentEnvironment » History » Revision 27

Revision 26 (Andreas Müller, 06/15/2022 09:34 AM) → Revision 27/29 (Andreas Müller, 06/15/2022 12:09 PM)

# Taxonomic Editor development environment 

 **The main source of information is [Setting up a Taxonomic Editor development environment](http://cybertaxonomy.org/taxeditor/getting-started.html) and #4227** 


 {{toc}} 

 {{child_pages(depth=1)}} 


 ## Steps to set up development environment 

 as documented in #4227 

 1. git checkout generated-resources 
 1. run `setup-project.sh` 
 1. Install m2e feature (if not already installed) in eclipse 
  * Update-Site: http://download.eclipse.org/releases/neon 
  * Feature to install: m2e - Maven Integration for Eclipse 
 1. Import projects as maven projects into the eclipse workspace 
  * **Note**: A dialog may pop up saying that a mapping for *antrun* and maybe others are missing. Just install all connectors that are available (Note AM: what does this mean?). The problem with antrun will then be solved by importing `cdmlib/lifecycle-mapping-metadata.xml` in the preferences under *Maven->Lifecycle Mappings->Change mapping file location* 
 ![](#4227#maven_plugin_connectors.png) 
 1. Open `/eu.etaxonomy.taxeditor/rcp.target` and reload all locations 
 1. Click "Set as target platform" 

 ### Updating a project after switching to an other branch for example: 

 1. ./setup-project 
 1. für alle taxeditor projekte: Maven > Update Project Alt+F5 

 

 ### Solving "cycles exist" problem 

 Sometimes not all errors (in problems view) disappear after executing the above steps. 
 In this case it may help to close the projects according to there dependency among each other. 
 In a first step one may close all projets except .taxeditor, .feature, .cdmlib. 
 Then repeat 

 1. fix all remaining errors (if there are still some) 
 1. open the next project and return to previous step 
 1. run maven->update project on the currently opened project 

 Open the projects in the following order: workbench, store, bulkeditor, editor, navigation, {help, molucular.lib, test}, print, molecular, application, test 

 Note: often it is enough to seperate the projects between bulkeditor and editor as these tend to create cycles if updated at the same time. 

 


 This page only contains additional information not yet contained in the above linked page. 

 

 ### Download timeouts in the maven validate phase 

 Note AM (2022-06-15): *The below does not seem be critical and also needs to be updated as eclipse-swtbot does not seem to be in use anymore and also indigo is not used anymore. During the build there usually come similar warnings but they do not seem to be critical. However, increasing the timeouts might be a good idea to avoid unwanted behaviour so we keep this instruction here.* 

 This especially happens with the http://download.eclipse.org/releases/ repository from where plugins have to be downloaded. 

 The according error message in the maven log is: 

 ~~~ 
 [ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'eclipse-swtbot' from location http://download.eclipse.org/releases/indigo/: Unable to read repository at http://download.eclipse.org/releases/indigo. Unable to read repository at http://download.eclipse.org/releases/indigo/201109230900/content.jar. Read timed out -> [Help 1] 
 ~~~ 

 Running maven in the debug mode (`-X`) reveals that this is a socket timeout:  

 ~~~ 
 Caused by: java.net.SocketTimeoutException: Read timed out 
	 at java.net.SocketInputStream.socketRead0(Native Method) 
	 at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) 
	 at java.net.SocketInputStream.read(SocketInputStream.java:170) 
	 at java.net.SocketInputStream.read(SocketInputStream.java:141) 
	 at org.apache.http.impl.io.AbstractSessionInputBuffer.read(AbstractSessionInputBuffer.java:198) 
	 at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:178) 
	 at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137) 
	 at java.io.FilterInputStream.read(FilterInputStream.java:133) 
	 at java.io.FilterInputStream.read(FilterInputStream.java:107) 
	 at org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer$1.performFileTransfer(AbstractRetrieveFileTransfer.java:178) 
	 at org.eclipse.ecf.filetransfer.FileTransferJob.run(FileTransferJob.java:73) 
	 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) 
 ~~~ 

 In the above download process two classes are involved which have different timeout settings: 

 * org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer 
 * java.net.SocketInputStream 

 ### setting timeout controls for JRE-http based transport 

 in org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer 

 See http://wiki.eclipse.org/Equinox/p2/TransportDebugging.  

 In case of equinox transport timeouts, a message like the following should become visible in the log. 

 ~~~ 
     Timeout while reading input stream. 
     The following system properties can be used to adjust the readTimeout, retryAttempts, and closeTimeout 
     org.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=xxx 
     org.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=xxx 
     org.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=xxx 
 ~~~ 

 ### Setting the waggon timeouts in the setting.xml 

 **This is the recommended solution!** 

 see http://maven.apache.org/guides/mini/guide-http-settings.html and http://stackoverflow.com/questions/23510525/maven-dependency-timeout-settings#27015320 

 This setting is supposed to configure the java.net.SocketInputStream timeouts which therefore is the correct one in order to fix the above problem. 

 Setting in the `~/.m2/settings.xml` 

 ~~~xml 
 <server> 
   <id>eclipse-swtbot</id> 
   <!-- username and password are required otherwise the tycho P2PasswordUtil will fail with an NPE --> 
   <username></username> 
   <password></password> 
   <configuration> 
     <httpConfiguration> 
       <all> 
         <connectionTimeout>180000</connectionTimeout> 
         <readTimeout>180000</readTimeout> 
       </all> 
     </httpConfiguration> 
   </configuration> 
 </server> 
 ~~~ 

 The error which is thrown when the user credentials are missing: 

 ~~~ 
 [ERROR] Internal error: java.lang.NullPointerException -> [Help 1] 
 org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException 
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121) 
         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
         at java.lang.reflect.Method.invoke(Method.java:497) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
 Caused by: java.lang.NullPointerException 
         at org.eclipse.tycho.p2.remote.P2PasswordUtil.setCredentials(P2PasswordUtil.java:69) 
         at org.eclipse.tycho.p2.remote.RemoteRepositoryLoadingHelper.setPasswordForLoading(RemoteRepositoryLoadingHelper.java:124) 
         at org.eclipse.tycho.p2.remote.RemoteRepositoryLoadingHelper.getEffectiveLocationAndPrepareLoad(RemoteRepositoryLoadingHelper.java:82) 
         at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.translateAndPrepareLoad(RemoteMetadataRepositoryManager.java:47) 
         at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:57) 
         at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:52) 
         at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:297) 
         at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:269) 
         at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:174) 
         at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:126) 
         at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1) 
         at org.eclipse.tycho.p2.manager.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform(ReactorRepositoryManagerImpl.java:82) 
         at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:221) 
         at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109) 
         at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:77) 
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266) 
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
         ... 11 more 
 [ERROR]  
 ~~~ 

 Further informations especially for remoting you can find here [Taxonomic Editor Developers Guide](https://dev.e-taxonomy.eu/redmine/projects/edit/wiki/TaxonomicEditorDevelopersGuide#Remoting)