|
From: Maxime <ma...@ta...> - 2019-04-11 03:54:17
|
Dear Milind Rao Thank you for your email. Normally the Wrapper should only launch the org.springframework.boot.loader.JarLauncher. Then Spring Boot will in turn scan the manifest and launch com.example.PaymentBridge with the dependencies specified in the manifest (inside BOOT-INF/lib/). I am wondering why this is failing to be done by Spring Boot... It would be useful to see the full log file to better understand what is happening. If possible, can you send it to su...@ta...? You may also set wrapper.debug=TRUE in your configuration file to get detailed output. Did you try to run your application with Spring Boot 2 without the Wrapper (without extracting the Jar and editing the classpath)? Do you encounter the same issue? Best Regards, Maxime On Thu, Apr 11, 2019 at 5:01 AM Milind Rao <mi...@gm...> wrote: > I'm using Spring Boot to create an executable jar with an embedded Tomcat > container. > > This is the relevant information from the MANIFEST.MF file > > Spring-Boot-Version: 2.0.5.RELEASE > Main-Class: org.springframework.boot.loader.JarLauncher > Start-Class: com.example.PaymentBridge > Spring-Boot-Classes: BOOT-INF/classes/ > Spring-Boot-Lib: BOOT-INF/lib/ > Created-By: Apache Maven 3.0.5 > Build-Jdk: 1.8.0_191 > > I can run the jar file on Linux with no problem. > java -jar example.jar > > I used method 4 to wrap the jar file and when I run it, I get an error > > Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed > to create an XPathFactory for the default object model: > http://java.sun.com/jaxp/xpath/dom with the > XPathFactoryConfigurationException: > javax.xml.xpath.XPathFactoryConfigurationException: > java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: Provider > com.saxonica.config.EnterpriseXPathFactory could not be instantiated > > This is because it couldn't find the Saxon-EE-9.5.1.9.jar file which is in > the BOOT-INF/lib/ directory of the spring boot jar file. > > I pulled out all the jars in the BOOT-INF/lib directory and copied them to > a directory that I added to a lib2 directory to test. Added the following > property to the wrapper.conf file > wrapper.java.classpath.2=../lib2/*.jar > and it worked. > > Clearly I don't want to do that with every file in the first place. And I > don't want to have to keep doing that every time my dependencies change. > > How can I get the wrapper to add all the embedded jars to the classpath? > > On startup, I do see this line. > > Application started with classpath: [ > jar:file:/opt/example/0.1.0/bin/../lib/example-bridge-0.1.0-SNAPSHOT.jar!/BOOT-INF/classes!/, > > jar:file:/opt/example/0.1.0/bin/../lib/example-bridge-0.1.0-SNAPSHOT.jar!/BOOT-INF/lib/spring-boot-starter-web-2.0.5.RELEASE.jar!/, > > jar:file:/opt/example/0.1.0/bin/../lib/example-bridge-0.1.0-SNAPSHOT.jar!/BOOT-INF/lib/spring-boot-starter-2.0.5.RELEASE.jar!/, > > ... > , > jar:file:/opt/example/0.1.0/bin/../lib/example-bridge-0.1.0-SNAPSHOT.jar!/BOOT-INF/lib/ > *Saxon-EE-9.5.1.9.jar!*/, > jar:file:/opt/example/0.1.0/bin/../lib/example-bridge-0.1.0-SNAPSHOT.jar!/BOOT-INF/lib/xercesImpl-2.10.0.jar > ! > > On linux the classpath is separated by ':', I'm not sure if the comma > between the jars is causing a problem or what. > > Any help would be appreciated. > > _______________________________________________ > Wrapper-user mailing list > Wra...@li... > https://lists.sourceforge.net/lists/listinfo/wrapper-user > |