This page (revision-109) was last changed on 14-Mar-2022 11:21 by Albrecht Striffler

This page was created on 17-Dec-2012 10:36 by Johanna Latt

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
109 14-Mar-2022 11:21 5 KB Albrecht Striffler to previous
108 14-Mar-2022 11:21 5 KB Albrecht Striffler to previous | to last
107 14-Mar-2022 11:20 5 KB Albrecht Striffler to previous | to last
106 14-Mar-2022 11:20 5 KB Albrecht Striffler to previous | to last
105 14-Mar-2022 11:18 5 KB Albrecht Striffler to previous | to last
104 14-Mar-2022 11:18 5 KB Albrecht Striffler to previous | to last
103 14-Mar-2022 11:15 5 KB Albrecht Striffler to previous | to last
102 14-Mar-2022 11:14 5 KB Albrecht Striffler to previous | to last
101 14-Mar-2022 11:14 5 KB Albrecht Striffler to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 4 added one line
!!!Prerequisites
At line 6 added 2 lines
* __[Java Development Kit (JDK)|http://java.sun.com/javase/downloads/index.jsp#jdk]__, choose the latest Version of Java 8.
* __[Apache Tomcat 7|http://tomcat.apache.org/download-60.cgi]__ \\ Use the "Binary Distribution" - "Core" - .tar.gz or .zip. Do __not__ use the installer. Do __not__ use Tomcat 8
At line 9 added 3 lines
* __[IntelliJ IDEA|http://www.jetbrains.com/idea/download/index.html]__ \\ You might get a community key for the Ultimate Edition. Please ask via dev list.
__or__
* __[Eclipse IDE for Java EE Developers|http://www.eclipse.org/]__
At line 13 added one line
At line 9 removed one line
Please do also take a look at the [screencasts|Tutorial] that show the set up of an IntelliJ workspace.
At line 11 removed 5 lines
!!Prerequisites
* [Java Development Kit (JDK)|https://adoptopenjdk.net/], we recommend the latest version of JDK 14, newer JDKs should work though.
* [Apache Tomcat 9|https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.44/bin/apache-tomcat-9.0.44.zip]\\ Other version might work, but are not officially supported. We recommend to use the linked version 9.0.44. We are dependent on the compatibility with JSPWiki here.
* [IntelliJ IDEA|http://www.jetbrains.com/idea/download/index.html] \\ You might get a community key for the Ultimate Edition. Please ask via dev list.
At line 23 added 6 lines
! Auto-Import Maven Modules
Set IntelliJ to automatically import checked-out or created maven modules:
Settings -> "Maven" -> "Importing" -> activate "import maven projects automatically"
At line 24 changed one line
Clone the following git repositories into your project folder
Select "VCS -> Checkout from Version Control -> Subversion".
At line 33 added 7 lines
Add following repositories by clicking on the "+"-Symbol:
__Read/write access (account necessary):__
%%quote
{{https://isci.informatik.uni-wuerzburg.de/svn/d3web-core}} \\
{{https://isci.informatik.uni-wuerzburg.de/svn/d3web-KnowWE}} \\
{{https://isci.informatik.uni-wuerzburg.de/svn/Research}} \\
/%
At line 27 changed 3 lines
* {{https://github.com/denkbares/Commons.git}} \\
* {{https://github.com/denkbares/d3web-Runtime.git}} \\
* {{https://github.com/denkbares/d3web-KnowWE.git}} \\
To get an account, please contact [info@d3web.de|mailto:info@d3web.de].
Accounts on d3web.de are independent from the SVN accounts.
At line 31 changed one line
In your IntelliJ project, for each repository, select "File -> New/Module from Existing Sources..." and select the path folder of the repository. When you get asked which module to import, choose "Import Module from external Model/Maven" and hit "Next". Other screens can also be confirmed with the default/next.
__Anonymous access (read only):__
%%quote
{{https://isci.informatik.uni-wuerzburg.de/anonsvn/d3web-core}} \\
{{https://isci.informatik.uni-wuerzburg.de/anonsvn/d3web-KnowWE}} \\
{{https://isci.informatik.uni-wuerzburg.de/anonsvn/Research}} \\
/%
At line 33 changed one line
!! Create copy of jspwiki-custom.properties
Select the three main projects (__d3web__, __KnowWE__, and __Research__) as well as __KnowWE-App__ from inside the trunks of the three repositories. They are in the trunk/folders respectively. One by one, right click one the projects and select ''Check out'' and choose your Idea project folder. After that, select the following path $yourprojectname/$projectparent (usually the one in the middle).
When IDEA has finished checking everything out, select "File -> Import module" and choose your project path. You get asked which module to import, choose "Maven" and hit "Next". In the next screen select "local" and "core-plugins" and hit "Next. Select your Java SDK and click "Finish".
At line 35 removed one line
KnowWE is based on JSPWiki and therefore needs an jspwiki-custom.properties to configure some basics. Copy the file {{KnowWE-App/src/resources/local/WEB-INF/classes/jspwiki-custom.properties.default}} into the same folder with the same name, but remove the suffix '.default'. For starters, you only need to set a the {{var.basedir}} to point to a wikicontent (folder with the wiki pages). If you don't have a wikicontent yet, you can start out with the one provided in the distribution from [Downloads#Latest Releases and Builds]. In the zip, extract {{/KnowWE/KnowWE-Tomcat.zip/wikicontent}} to the path you specified as the var.basedir in your jspwiki-custom.properties.
At line 39 changed one line
Select Run -> 'Edit Configurations' and add 'Tomcat Server' -> local. Hit configure and choose your tomcat path. In den bottom pane click + and choose 'Build Artifacts'. Select 'KnowWE-App:war exploded'. Click on the 'Deployment' tab and add 'KnowWE-App:war exploded'. Select as Application Context /KnowWE and click on Ok. Build KnowWE by clicking on the green arrow right next to our new tomcat configuration.
Select "Run -> Edit Configurations" and add "Tomcat Server -> local". Hit configure and choose your tomcat path. In den bottom pane click "+" and choose "Build Artifacts". Select "KnowWE-App:war exploded". Click on the "Deployment" tab and add "KnowWE-App:war exploded". Select as Application Context "/KnowWE" and click on "Ok". Build KnowWE by clicking on the green arrow right next to our new tomcat configuration.
At line 60 added 5 lines
!!Transitioning from Eclipse to IntelliJ IDEA
The d3web/KnowWE community started developing with Eclipse, but recently some of our developers are transitioning to IntelliJ IDEA. If you are considering to transition yourself, you might find the following article helpful: [IntelliJ FAQ]
At line 44 changed one line
At denkbares, we currently don't use eclipse for the development of d3web-KnowWE, but it should work anyway and some users are successfully using it. Here a short guide from Alberto (aarmijo on github):
To make Eclipse work with Subversion, Tomcat and Maven, you will need a few additional plug-ins.
At line 46 removed one line
!! Set-up
At line 48 changed 4 lines
* [Adoptium Temurin 17 JDK|https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/OpenJDK17U-jdk_x64_windows_hotspot_17.0.2_8.msi]
* [Tomcat 9.0.26|https://tomcat.apache.org/download-90.cgi]
* [Eclipse 2022-03|https://www.eclipse.org/downloads/packages/release/2022-03/m2}
* [Maven 3.6.1. |https://archive.apache.org/dist/maven/maven-3/] (The embedded maven in eclipse seems to have some issues when constraining the compilation to JDK14)
!!Installing Plugins
At line 53 changed one line
!! Instructions
Navigate to ''Help'' -> ''Eclipse Marketplace''. Search for "Subversive" and install the most recent "Subversive - SVN Team Provider", e.g. 2.0.1. Click "Install" and follow the instructions. Accept the licenses, and finish the installation. Restart Eclipse when you are asked to.
At line 55 removed 9 lines
* Import d3web-KnowWE project as a Maven project. File -> Import -> Existing Maven Projects
* Window -> Preferences -> Java -> Installed JREs. Add Adoptium JDK and select it
* Make sure that the ‘JRE System Library’ of each maven project is set to ‘JavaSE-14’ compliance level. Also make sure that in maven project properties, the JDK compliance is limited to 14 in the ‘Java Compiler’ section
* In KnowWE-App project, under Maven Dependencies properties -> Use Maven Project settings -> Active Maven Profiles, set ‘core-plugins’ as active profile. This will copy the core dependencies to the KnowWE-App application when deploying it into Tomcat
* Under KnowWE-App project properties -> Java Build Path -> Source, add the next Folder: src/resources/local/WEB-INF/classes. This will copy the jspwiki.properties to the KnowWE-App application when deploying it into Tomcat. Also follow the ste [Create copy of jspwiki-custom.properties|How-To Create Your Own Workspace#Create copy of jspwiki-custom.properties] of the IntelliJ-part of the guide.
* Add the run configuration to build the project: Run -> Run Configurations -> Double click on Maven Build to create a new configuration. Set the Base directory: ${workspace_loc:/KnowWE}; Goals: install; Profiles: core-plugins; Skip Tests. Under JRE -> Execution environment, select JavaSE-14. Select Maven Runtime -> External (It seems that EMBEDDED flavour is not well managed by Eclipse and the compilation is not constrained to version 14)
* Click Run to build the project
* Under the tab Servers, add a Tomcat9 web application server and select the location where you downloaded it. Add KnowWE-App as resource to the right ‘Configured’ section. Under Edit Server Runtime select as JRE the installed JDK 1.7.
* Click Start to launch the server. Open the application in http://localhost:8080/KnowWE-App
At line 75 added 242 lines
!!Java 8 Support
For eclipse versions Kepler (and later?!), you need to install Java 8 support manually. Do so by following the instructions here: [https://wiki.eclipse.org/JDT/Eclipse_Java_8_Support_For_Kepler]
!Selecting the SVN implementation
After restarting Eclipse, click on ''Window'' -> ''Open Perspective'' -> ''SVN Repository Exploring''.
A dialog window will be opened asking you to select an SVN connector implementation.
Select __SVNKit 1.8.7__ (or the latest available SVNKit version of the 1.8 branch, __not__ 1.7 ) and finish the installation wizard.
You need to accept installing unsigned software, and restart Eclipse again when asked.
__Sysdeo Tomcat Plug-in__
The Sysdeo Tomcat Plug-in allows you to start Tomcat directly from within Eclipse.
You can find it at [http://www.eclipsetotale.com/tomcatPlugin.html].
To perform the installation, download the .zip file provided at the author's homepage and unpack it into the {{plugins/}} folder inside your Eclipse installation.
The __KnowWE-App__ project is preconfigured for use with this plug-in.
!!Preparing your workspace
! Eclipse settings
Start arguments: \\
Maven needs Eclipse to run in a JDK, not in a JRE. Start Eclipse with the -vm parameter, for example: \\
"C:\Program Files\eclipse\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0_17\bin\javaw.exe"
You can find the following Eclipse settings in the main menu at ''Window'' -> ''Preferences''.
Encoding: ''General'' -> ''Workspace'' -> ''Text file encoding'': "UTF-8"
Disable certain compiler errors: ''Java'' -> ''Compiler'' -> ''Errors/Warnings'' -> ''Deprecated and restricted API'' -> ''Forbidden reference:'' "Warning"
__Comment format:__\\
Get the [codetemplates.xml] attached to this page and import it: ''Java'' -> ''Code Style'' -> ''Code Templates''
Enable: ''Automatically add comments for new methods and types''
(If your login name is not meaningful, you have to change the comment template for ''Type'', as your login name is used as author name)
__Code format settings:__\\
Get the [code_conventions.xml] attached to this page and import it: ''Java'' -> ''Code Style'' -> ''Formatter''
To enable automatic formatting, certain actions have to be carried out on saving: ''Java'' -> ''Editor'' -> ''Save Actions''
The screenshot on the right shows the actions, that have to be activated.
__Tomcat plug-in: __\\
''Tomcat'' -> ''Tomcat Version:'' Select your Tomcat version here\\
''Tomcat'' -> ''Tomcat Home:'' Choose the directory where you unpacked the Tomcat zip\\
''Tomcat'' -> ''Context declaration mode:'' "Context files" (do __not__ select server.xml!)\\
''Tomcat'' -> ''JVM Settings'' -> ''JRE:'' check that the correct JRE is selected
''optional'': Set larger heap size for tomcat:\\
''Window'' -> ''Preferences'' -> ''Tomcat'' -> ''JVM Settings'' -> ''add to JVM parameters'' -> set for example: -Xmx1g\\
Read for your exact personal settings: [http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html]
''recommended'': Set Tomcat to use UTF-8 (necessary for special characters like german umlauts in page names for example):\\
You have to edit server.xml of Tomcat (is in the conf-directory of Tomcat). Please add to\\
{{{<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true"/>}}}
\\
the term __URIEncoding="UTF-8"__.\\
It should look like that:\\
{{{<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true"
URIEncoding="UTF-8"/>}}}
\\
Further information: [http://www.jspwiki.org/wiki/BugProblemsWithGermanUmlaute]
! Adding the SVN repositories
''Window'' -> ''Open perspective'' -> ''Other…'' -> ''SVN Repository Exploring''.
Repeat the following step for each of the listed repository URIs: \\
In the ''SVN Repositories'' view, perform a right click, select ''New'' -> ''Repository Location''...
__Read/write access (account necessary):__
%%quote
{{https://isci.informatik.uni-wuerzburg.de/svn/d3web-core}} \\
{{https://isci.informatik.uni-wuerzburg.de/svn/d3web-KnowWE}} \\
{{https://isci.informatik.uni-wuerzburg.de/svn/Research}} \\
/%
To get an account, please contact [info@d3web.de|mailto:info@d3web.de].
Accounts on d3web.de are independent from the SVN accounts.
__Anonymous access (read only):__
%%quote
{{https://isci.informatik.uni-wuerzburg.de/anonsvn/d3web-core}} \\
{{https://isci.informatik.uni-wuerzburg.de/anonsvn/d3web-KnowWE}} \\
{{https://isci.informatik.uni-wuerzburg.de/anonsvn/Research}} \\
/%
! Checking out the code
Select the three main projects (__d3web__, __KnowWE__, and __Research__) as well as __KnowWE-App__ from inside the trunks of the three repositories. They are in the trunk/folders respectively. One by one, right click one the projects and select ''Check out'' and click ''Finish''.\\
After downloading, you have to import the downloaded folders as maven projects. Go to ''File -> Import -> Maven -> Existing Maven Projects''. Select the parents with all the child poms and click import.
After checking out and importing the maven projects, Eclipse may make some changes to the .classpath-files of the projects, which should be reverted. Switch back to the Java perspective, click the three main projects (d3web, KnowWE, and Research) and select ''Team'' and then ''Revert... ''.
If you now
!JSP Problems
Eclipse EE will find a lot of ''JSP Problems'' and display them in the ''Markers'' tab. You can ignore them, they are found because of the way we extend JSPWiki. To get rid of them long term, right click on the project ''KnowWE-Resources'' and select ''Properties''. Go to ''Validation'' and select ''"Enable project specific settings"''. Now, deactivate the checkboxes ''Build'' for "JSP Syntax/Context Validator". The checkboxes "Manual" can remain checked.\\
If you now right click on the JSP Problems in the Markers tab, you can delete all of them. They will stay deleted unless you build manually.
!! Building KnowWE
! Create local preferences for JSPWiki
Copy {{KnowWE-App/src/resources/local/WEB-INF/jspwiki.properties.default}} to {{jspwiki.properties}} in the same directory. __Do not rename it in Eclipse.__ \\
In {{jspwiki.properties}}, edit the settings for your local environment. The three most important settings are at the top.
!Install KnowWE-Resources
Right click 'KnowWE-Resources' project -> ''Run as'' -> ''Maven install''
!Install main projects
One by one, right click the main projects d3web, KnowWE, Research and select ''Run As'' and then "Maven install". Wait for the for the current one to finish before you install on the next one.
! Create a run configuration for building the wiki
Right click on "KnowWE-App", select ''Run as'' -> ''Maven build…''. \\
A dialog will show. Set the following settings: \\
Goals: {{clean install}} \\
Profiles: {{local core-plugins}}
\\Enable checkbox "Resolve Workspace artifacts"
! Updating the Tomcat context
Right click on "KnowWE-App" -> ''Tomcat project'' -> ''Refresh context in Tomcat''
! Starting KnowWE
You can now start Tomcat using the ''Start tomcat'' toolbar button or menu entry. Open the following URI in your browser:
%%quote
http://localhost:8080/KnowWE/
/%
!!Troubleshooting
! Slow/unresponsive eclipse and increasing heap space for eclipse
If you are experiencing a really slow reaction and work speed of eclipse, you can try increasing the heap space of eclipse. This is especially relevant, if you have checked out the complete d3web, KnowWE and Apps projects or use Java 7 for eclipse, which also seems to use more memory.
Go to the {{eclipse.ini}} in your eclipse installation and add/adapt the lines for the vm arguments. It could look something like this:
{{{
-vmargs
-Xms512m
-Xmx2g
}}}
The line breaks are important! -Xmx2g says, that eclipse can use up to 2GB of RAM. These 2 GB are recommended, but if you do not have that much to spare, something around 1500m is also ok.
! OutOfMemoryError while installing with Maven
Since Java 7, building parent projects like Research may cause OutOfMemoryErrors:
{{{
[ERROR] Consult the following stack trace for details.
[ERROR] java.lang.OutOfMemoryError: PermGen space
[ERROR] at java.lang.ClassLoader.defineClass1(Native Method)
[ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
...
}}}
To solve this, you have to add some arguments for the Java Virtual Maschine in your run configuration.\\
In the run configuration explorer (available for example via right click on a project an then "Run As" and "Run configurations...") select the run configuration which produces the error and select the tab "JRE". In the text area "VM arguments" add the following statements:
{{{
-Xmx2g -XX:MaxPermSize=512m
}}}
! Compile errors after first build
Sometimes you get errors like:
{{{
Cannot nest output folder 'd3web-Distributed/target/classes' inside output folder 'd3web-Distributed'
}}}
If this happens, close and open all affected projects. Alternatively, you have to do the following steps:
# Remove the affected projects from the workspace without deleting them, by selecting 'Delete' from the context menu and unchecking the checkbox.
# Import the project back to the workspace:
## Menu: File->Import...
## General: Existing projects into workspace
## As root directory select the project directory itself, e.g. <workspacedir>\d3web-KnowWE\d3web-distributed.
## Select the project in the list.
## Click 'Finish'.
# Repeat step 2 for every project that was affected.
! ClassCastException on startup
You might encounter the following exception:
{{{
java.lang.ClassCastException: org.apache.catalina.util.DefaultAnnotationProcessor cannot be cast to org.apache.AnnotationProcessor
}}}
__Workaround:__ In the folder where you unpacked Tomcat (e.g. {{/usr/local/apache-tomcat-6.0.20/}}) you can find a directory called {{conf}}. In there is {{context.xml}}. Add follwing statement into the {{<Context>}} element:
%%quote
{{<Loader delegate="true"/>}}
/%
([Related upstream bug|https://issues.apache.org/bugzilla/show_bug.cgi?id=46344])