0

Well, this gotta be a very simple question for those experienced Tomcat users. I am having this specific issue since some time, and I thought that through time and experience about Tomcat and Eclipse and IntelliJ, could lead me to the answer, but it didn't. I am programming a Maven project using those specific frameworks:

Jersey 1.8, Spring 3.2.4.RELEASE (All Spring framework, excluding security module)

My project works fine, I can start my server from within Eclipse and IntelliJ and successfully debug my application, but as I am developing an Android application parallel with my Server side, I am running out of memory on my work PC, so, I want to just run my app from CMD (Working on Windows 8) and when an HTTP request is received in the server throws an Exception (When I'm running my app from any IDE, it just works fine)

Here is the trace of the exception thrown when I run Tomcat from Command Line

SEVERE: Servlet.service() for servlet [Jersey Servlet] in context with path [/api] threw exception [Servlet execution threw an exception] with root cause java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder; at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:286) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:218) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

The commands I am using to run tomcat are:

%tomcat&/bin> startup.bat, %tomcat&/bin> catalina.bat run

How can I fix this? [UPDATE] Here is my pom.xml

<dependencies>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
</dependency>


  <!-- SPRING -->
  <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring.version}</version>
  </dependency>
  <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${spring.version}</version>
  </dependency>
  <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>${spring.version}</version>
  </dependency>
  <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-web</artifactId>
      <version>${spring.security.version}</version>
  </dependency>
  <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>${spring.security.version}</version>
  </dependency>
  <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-webmvc</artifactId>
      <version>${spring.version}</version>
  </dependency>
  <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>${spring.jdbc.version}</version>
  </dependency>
  <dependency>
      <groupId>com.sun.jersey.contribs</groupId>
      <artifactId>jersey-spring</artifactId>
      <version>${jersey.version}</version>
      <exclusions>
          <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-web</artifactId>
          </exclusion>
          <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-aop</artifactId>
          </exclusion>
          <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-asm</artifactId>
          </exclusion>
          <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-beans</artifactId>
          </exclusion>
          <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-context</artifactId>
          </exclusion>
          <exclusion>
              <groupId>org.springframework</groupId>
              <artifactId>spring-core</artifactId>
          </exclusion>
      </exclusions>

  </dependency>

    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-server</artifactId>
        <version>${jersey.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-core</artifactId>
        <version>${jersey.version}</version>
    </dependency>
  <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-json</artifactId>
      <version>${jersey.version}</version>
  </dependency>

  <dependency>
      <groupId>asm</groupId>
      <artifactId>asm</artifactId>
      <version>3.3.1</version>
  </dependency>


  <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.9</version>
  </dependency>

AlbertoRuvel
  • 356
  • 4
  • 14
  • Can you show you dependencies – Paul Samsotha Apr 14 '15 at 23:54
  • I thought it might be a Jersey version conflict (or other dependency conflict), and it certainly appears to be, after searching and finding [this post](http://stackoverflow.com/q/23277429/2587435), but I don't see anything conflicting in your dependencies. Maybe something already existing in Tomcat? – Paul Samsotha Apr 15 '15 at 01:05
  • Well, I am re-deploying my app, so, I suppose it isn't anything about jersey versions, I have only one version of Jersey. Do I have to send some extra parameters Eclipse use without us to notice? – AlbertoRuvel Apr 15 '15 at 01:12
  • By looking at the stacktrace again it shows `org.glassfish.jersey.servlet.ServletContainer`. That is a Jersey 2.x class (org.glassfish..). I would check Tomcat to see if there any Jersey jars in the Tomcat lib. I don't see any thing in your pom – Paul Samsotha Apr 15 '15 at 01:38
  • There aren't any jersey jars at Tomcat libs, I am actually trying to do this, my laptop is very slow – AlbertoRuvel Apr 15 '15 at 04:01
  • Just a wild guess. Did you check to see if your app is running? Maybe there is another Jersey2 app that is on the server, and that is the one that is failing. I don't know. I just don't understand how there is a Jersey2 class mentioned in the stack strace when everything you have presented has no trace of Jersey2 – Paul Samsotha Apr 15 '15 at 04:12

0 Answers0