Closed vmario89 closed 1 year ago
Okay got it working with Jetty version 10 and JDK 17 by doing the following things:
Adjust pom.xml in docs-core to replace with newer dependencies and recompile the war archive file
cd /opt/teedy/docs-core #the folder where i got the sismics-docs git repo cloned into
vim pom.xml
<!-- JDK 17 JAXB dependencies -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>3.0.2</version>
</dependency>
Recompile:
cd /opt/teedy
mvn clean -DskipTests install
mvn -Pprod -DskipTests clean install
cp /opt/teedy/docs-web/target/docs-web-1.10.war /opt/jetty/jetty-base/webapps/dms.war
Then download Jetty 10 and do some basic configuration
cd /opt
wget https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/10.0.11/jetty-home-10.0.11.tar.gz
tar -xvzf jetty-home-10.0.11.tar.gz
mkdir /opt/jetty-10.0.11/jetty-base/
cd /opt/jetty-10.0.11/jetty-base/
java -jar ../start.jar --add-modules=deploy,http
cp /opt/teedy-webapp-deploy-bup/docs-web-1.*.war /opt/jetty/jetty-base/webapps/dms.war #copy the compiled war archive
cp /opt/teedy-webapp-deploy-bup/dms.xml /opt/jetty/jetty-base/webapps/dms.xml
chown -R jetty:jetty /opt/jetty/
my adjusted dms.xml looks alike:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/dms</Set>
<Set name="war"><SystemProperty name="jetty.data" default="."/>/webapps/dms.war</Set>
<Call class="java.lang.System" name="setProperty">
<Arg>docs.home</Arg>
<Arg>/opt/teedy/data/</Arg>
</Call>
</Configure>
the first two lines where not required in an older Jetty 9 instance
the service file to run Jetty with dms finally:
vim /usr/lib/systemd/system/jetty.service
[Unit]
Description = Jetty Web Server for DMS
After = syslog.target network.target
[Service]
User = jetty
ExecStart = /opt/jetty/bin/jetty.sh start
ExecStop = /opt/jetty/bin/jetty.sh stop
ExecReload = /opt/jetty/bin/jetty.sh restart
Type = forking
Environment="DATABASE_URL=jdbc:postgresql://127.0.0.1:5432/teedy_db"
Environment="DATABASE_USER=teedy"
Environment="DATABASE_PASSWORD=YourInstancePassword"
Environment="JETTY_HOME=/opt/jetty"
Environment="JETTY_BASE=/opt/jetty/jetty-base"
Environment="JETTY_USER=jetty"
Environment="JETTY_HOST=0.0.0.0"
Environment="JETTY_ARGS=jetty.port=8081"
[Install]
WantedBy = multi-user.target
The clean way to do it would be to change the Jetty version in the dependencies (pom.xml) and run the tests on that.
Closing this in favor of #668
Hi, i am currently upgrading my server from Fedora 34 to 36 and i also tried to use a newer Java version + Jetty version. Trying to deploy the webapp with Jetty 11 fails with error
IllegalStateException: [..] is not a jakarta.servlet.Filter
:https://developpaper.com/illegalstateexception-is-not-a-jakarta-servlet-filter/
i am going to try what happens with an older jetty instance