Tomcat 8 Maven Plugin for Java 8

Yes you can, In your pom.xml, add the tomcat plugin. (You can use this for both Tomcat 7 and 8): pom.xml <!– Tomcat plugin –> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <url>http:// localhost:8080/manager/text</url> <server>TomcatServer</server> *(From maven > settings.xml)* <username>*yourtomcatusername*</username> <password>*yourtomcatpassword*</password> </configuration> </plugin> tomcat-users.xml <tomcat-users> <role rolename=”manager-gui”/> <role rolename=”manager-script”/> <user username=”admin” password=”password” roles=”manager-gui,manager-script” /> </tomcat-users> settings.xml (maven … Read more

Tomcat Server/Client Self-Signed SSL Certificate

Finally got the solution to my problem, so I’ll post the results here if anyone else gets stuck. Thanks to Michael Martin of Michael’s Software Thoughts & Ramblings I discovered that: keytool by default uses the DSA algorithm when generating the self-signed cert. Earlier versions of Firefox accepted these keys without problem. With Firefox 3 … Read more

Add JVM options in Tomcat

As Bhavik Shah says, you can do it in JAVA_OPTS, but the recommended way (as per catalina.sh) is to use CATALINA_OPTS: # CATALINA_OPTS (Optional) Java runtime options used when the “start”, # “run” or “debug” command is executed. # Include here and not in JAVA_OPTS all options, that should # only be used by Tomcat … Read more

Get ServletContext in JAX-RS resource

Furthermore, @Resource annotation might not work. Try this @javax.ws.rs.core.Context ServletContext context; The injection doesn’t happen until you hit the service method public class MyService { @Context ServletContext context; public MyService() { print(“Constructor ” + context); // null here } @GET @Path(“/thing”) { print(“in wizard service ” + context); // available here

IntelliJ and Tomcat.. Howto..?

NOTE: Community Edition doesn’t support JEE. First, you will need to install a local Tomcat server. It sounds like you may have already done this. Next, on the toolbar at the top of IntelliJ, click the down arrow just to the left of the Run and Debug icons. There will be an option to Edit … Read more

Absolute path & Relative Path

Absolute paths start with / and refer to a location from the root of the current site (or virtual host). Relative paths do not start with / and refer to a location from the actual location of the document the reference is made. Examples, assuming root is http://foo.com/site/ Absolute path, no matter where we are … Read more

Tomcat 10.x throws java.lang.NoClassDefFoundError on javax.servlet.* [duplicate]

C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\conf\Catalina\localhost\VirtualStore.xml You’re thus using Tomcat 10.x which is based off Servlet API version 5.0 which in turn is part of Jakarta EE version 9. java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener This is unexpected. The javax.* package has been renamed to jakarta.* package since Jakarta EE version 9. This thus means that the deployed web application is actually not … Read more