If you get :
Absent Code attribute in method that is not native or abstract in class file javax/validation/constraints/Pattern$Flag
Solution: remove this dependency (if you have it)
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
Another one:
ArquillianServletRunner not found. Could not determine ContextRoot from ProtocolMetadata, please contact DeployableContainer developer.
which is caused by
Error invoking ServletContainerInitializer org.apache.jasper.runtime.TldScanner
java.lang.NoSuchMethodError: javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;
at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:231)
Solution is to modify your pom.xml. Tell maven-surefire-plugin to ignore servlet-api 2.3
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<forkMode>always</forkMode>
<classpathDependencyExcludes>
<classpathDependencyExcludes>
javax.servlet:servlet-api
</classpathDependencyExcludes>
<classpathDependencyExcludes>
org.apache.felix:javax.servlet
</classpathDependencyExcludes>
<classpathDependencyExcludes>
</configuration>
</plugin>
Taken from this site:
http://java.net/jira/browse/GLASSFISH-17445
2 comments:
Very useful post. Thanks
--
Bruno Antunes
If you have transitive dependencies that include servlet-api, you can exclude it with one of more exclusions entries on the dependency.
< exclusions >
< exclusion >
< groupId >javax.servlet< /groupId >
< artifactId >servlet-api< /artifactId >
< /exclusion >
< exclusion >
< groupId >org.mortbay.jetty< /groupId >
< artifactId >servlet-api< /artifactId >
< /exclusion >
< /exclusions >
Post a Comment