0

I am currently trying to move a JAR from a deployed WAR to just being included in the Tomcat library. Here's the dependency in my pom.xml

<dependency>
    <groupId>psft.pt8</groupId>
    <artifactId>psjoa</artifactId>
    <version>8.54.22</version>
    <type>jar</type>
    <scope>provided</scope>
</dependency>

When scope is <scope>compile</scope> everything works fine. I build the artifact, deploy it in Tomcat, and can access the WSDL. When I change scope to provided, I can still build the artifact, deploy it in Tomcat, it LOOKS like it's fine, but then when attempting to go to the WSDL I reach this error.

The server encountered an internal error that prevented it from fulfilling this request: Servlet.init() for servlet spring-ws threw exception
javax.servlet.ServletException: Servlet.init() for servlet spring-ws threw exception
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    psiprobe.Tomcat80AgentValve.invoke(Tomcat80AgentValve.java:45)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:676)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1099)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:670)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:745)

Not sure where to begin.

Vy Do
  • 46,709
  • 59
  • 215
  • 313
stumpbeard
  • 61
  • 8
  • did you put the jar in tomcat lib folder – JHDev Mar 17 '17 at 21:08
  • Yes I did. I have another project where I've moved the same jar to the lib folder and it works fine. I've tried this current one with both that jar, and the jar that it creates when it is set to compile. – stumpbeard Mar 17 '17 at 21:10
  • take a look at this S.O discussion may help you to configure you tomcat : http://stackoverflow.com/questions/267953/does-tomcat-load-the-same-library-file-into-memory-twice-if-they-are-in-two-web – JHDev Mar 17 '17 at 21:24

1 Answers1

0

Solution 1.

If you don't want including artifact psft.pt8:psjoa:8.54.22 inside WAR generated artifact

  • use <scope>provided</scope> in pom.xml
  • put psft.pt8:psjoa:8.54.22 JAR file inside $CATALINA_HOME\lib (on macOS, Linux) or %CATALINA_HOME%\lib (on Windows operating system).

Solution 2.

If you want including artifact psft.pt8:psjoa:8.54.22 inside WAR generated artifact, use <scope>compile</scope> in pom.xml.

Vy Do
  • 46,709
  • 59
  • 215
  • 313