Servlet : SEVERE: Allocate exception for servlet

前端 未结 11 1752
故里飘歌
故里飘歌 2021-02-06 03:38

The following stacktrace is what I get when i try to access a servlet, which seems running fine from Tomcat manager.

11 Sep, 2012 11:50:12 AM org.apache.catalin         


        
相关标签:
11条回答
  • 2021-02-06 03:58

    My case was using Java 8 lamda expressions with older version of Rest that was not based on Java 8

    0 讨论(0)
  • 2021-02-06 04:02

    I also saw this exception where the @Resource annotation caused a conflict with two technologies stepping on each other's toes (tomcat servlet api 3, and spring).

    0 讨论(0)
  • 2021-02-06 04:03

    I got the similar exception
    While moving from java 8 to java 11 I got the following error

    Exception org.apache.catalina.core.ApplicationContext.log Servlet.init() for servlet [health-servlet] threw exception java.lang.IllegalArgumentException

    To fix the error i upgraded the version in pom

    <jersey.version>2.23.2</jersey.version><!-- Remove this  -->
    <jersey.version>2.30.1</jersey.version><!-- Add this  -->
    

    I had the following entry in my web.xml

        <servlet>
        <servlet-name>health-servlet</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <init-param>
            <param-name>javax.ws.rs.Application</param-name>
            <param-value>com.xyz.platform.registry.service.ServiceRegistryApplication</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    
    0 讨论(0)
  • 2021-02-06 04:06

    Go to the Project Properties -> Deployment Assembly -> Check whether the maven dependencies are visible, if they are missing the also we get the same error. I could resolve my adding the maven dependency into the Deployment Assembly.

    [After adding Maven dependency into the Deployment Assembly, it seems like this]

    https://i.stack.imgur.com/7iwaW.jpg

    0 讨论(0)
  • 2021-02-06 04:09

    For me, it happened when I was using Lambda expression inside my junit tests. After commenting from the tests, the server returned the proper api response.

    0 讨论(0)
  • 2021-02-06 04:13

    Finally , got my mistake. This was a problem caused by the eclipse build. Since the build was not proper, the class files where corrupted. I cleaned up the whole project, took a fresh build, now its working fine. Thanks for your replies.

    0 讨论(0)
提交回复
热议问题