Tomcat 7 – Servlet 3.0: Invalid byte tag in constant pool

Adding metadata-complete=”true” to your web.xml should sort the issue <web-app version=”3.0″ xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd” metadata-complete=”true”> This tells tomcat not to scan classes for annotations: https://web.archive.org/web/20180510163848/http://www.tomcatexpert.com/blog/2011/10/12/how-use-fragments-and-annotations-configure-your-web-application

Why would “java.lang.IllegalStateException: The resource configuration is not modifiable in this context.” appear deploying Jersey app?

One possible cause is that you have two or more applicable mappings for that URL call. For example: @Path(“/{myParam}”) And somewhere else: @Path(“/{differentParam}”) Now Jersey have no way of telling what method is actually supposed to be called and gives this error.

Jersey 2 injection source for multipart formdata

You need to enable MultiPart feature on your application. Enabling this feature injects necessary message body readers, writers to your Jersey 2 application. Here is how you register them: On the server-side (http-server): final ResourceConfig resourceConfig = new ResourceConfig(MultiPartResource.class); resourceConfig.register(MultiPartFeature.class); On the server-side (servlet deployment): import org.glassfish.jersey.filter.LoggingFilter; import org.glassfish.jersey.media.multipart.MultiPartFeature; import javax.ws.rs.core.Application; import java.util.HashSet; import java.util.Set; … Read more

Tomcat 7 – Maven Plugin?

It work for me as the following. My setting.xml <server> <id>local_tomcat</id> <username>ray</username> <password>password</password> </server> My plugin configuration <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <configuration> <server>local_tomcat</server> <url>http://localhost:8080/manager/text</url> </configuration> </plugin> My tomcat-users.xml <role rolename=”manager-gui”/> <role rolename=”manager-script”/> <user password=”password” roles=”manager-gui, manager-script” username=”ray”/>

jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

The servlet API .jar file must not be embedded inside the webapp since, obviously, the container already has these classes in its classpath: it implements the interfaces contained in this jar. The dependency should be in the provided scope, rather than the default compile scope, in your Maven pom: <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope> </dependency>

Tomcat 7 and JSTL

I have been fighting with this for several hours. Here is a complete solution. I am using Tomcat 7, which is a Servlet 3.0-compliant server. If you desire to use the Servlet 3.0 spec, you must have your web.xml as follows: <web-app xmlns=”http://java.sun.com/xml/ns/javaee” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd” version=”3.0″> If you’re using Maven, your pom.xml should have … Read more