HTTP Status 500 - Servlet.init() for servlet dispatcher threw exception type Exception report message Servlet.init() for servlet dispatcher threw exception description The server encountered an internal error that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet dispatcher threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:745) root cause org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is java.lang.VerifyError: Bad type on operand stack Exception Details: Location: org/springframework/web/servlet/mvc/condition/ProducesRequestCondition.compareMatchingMediaTypes(Lorg/springframework/web/servlet/mvc/condition/ProducesRequestCondition;ILorg/springframework/web/servlet/mvc/condition/ProducesRequestCondition;I)I @89: invokevirtual Reason: Type 'org/springframework/http/MediaType' (current frame, stack[1]) is not assignable to 'org/springframework/util/MimeType' Current Frame: bci: @89 flags: { } locals: { 'org/springframework/web/servlet/mvc/condition/ProducesRequestCondition', 'org/springframework/web/servlet/mvc/condition/ProducesRequestCondition', integer, 'org/springframework/web/servlet/mvc/condition/ProducesRequestCondition', integer, integer, 'org/springframework/web/servlet/mvc/condition/ProducesRequestCondition$ProduceMediaTypeExpression', 'org/springframework/web/servlet/mvc/condition/ProducesRequestCondition$ProduceMediaTypeExpression' } stack: { 'org/springframework/http/MediaType', 'org/springframework/http/MediaType' } Bytecode: 0000000: 0336 051c 1504 9f00 0c15 041c 6436 05a7 0000010: 004f 1c02 9f00 4a15 0402 9f00 442b b701 0000020: 031c b901 1a02 00c0 0079 3a06 2db7 0103 0000030: 1504 b901 1a02 00c0 0079 3a07 1906 1907 0000040: b601 1236 0515 0599 0008 1505 a700 1019 0000050: 06b6 0111 1907 b601 11b6 00fa 3605 1505 0000060: ac Stackmap Table: append_frame(@18,Integer) append_frame(@79,Object[
This is what I see when I try to run my Spring based web application. I read several articles in which I could understand that this problem can occur when using different versions of dependencies. In my application, I use Spring 4.0.1 version and Spring-Security only 3.2.5, because this is not the latest version. If my problem is this, please tell me what I can do.
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>fullproject</groupId> <artifactId>fullproject</artifactId> <packaging>war</packaging> <version>1.0</version> <name>fullproject</name> <repositories> <repository> <id>eap</id> <url>http://maven.repository.redhat.com/techpreview/all</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>unknown-jars-temp-repo</id> <name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name> <url>file:${project.basedir}/lib</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>eap</id> <url>http://maven.repository.redhat.com/techpreview/all</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <version>9.2-1003-jdbc4</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.25</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>org-apache-commons-logging</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>cglib-2.2</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-aop-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-aspects-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-beans-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-build-src-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-context-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-context-support-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-core-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-expression-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-framework-bom-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-instrument-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-instrument-tomcat-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-jdbc-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-jms-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-messaging-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-orm-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-oxm-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-test-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-tx-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-web-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-webmvc-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-webmvc-portlet-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>spring-websocket-4.0.1.RELEASE</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>javax.servlet.jsp.jstl-api</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>javax.servlet.jsp.jstl</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-dbcp2</artifactId> <version>2.0.1</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>4.1.8.Final</version> </dependency> <dependency> <groupId>unknown.binary</groupId> <artifactId>hibernate-jpa-2.0-api-1.0.1.Final</artifactId> <version>SNAPSHOT</version> </dependency> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>3.2.5.RELEASE</version> </dependency> </dependencies> <profiles> <profile> <id>openshift</id> <build> <finalName>fullproject</finalName> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <outputDirectory>webapps</outputDirectory> <warName>ROOT</warName> </configuration> </plugin> </plugins> </build> </profile> </profiles> </project>
source share