我有一個Spring Boot'1.5.1.RELEASE'jar文件。我能夠在我的本地使用java -jar 'jar Name'
執行jar並且能夠在本地啓動應用程序。無法在生產Web Sphere 8.5服務器中執行Spring Boot Jar
但是當我在WAAS 8.5中執行相同的jar文件時,我在瀏覽器上得到There was an unexpected error (type=Internal Server Error, status=500). AuthConfigFactory error: java.lang.ClassNotFoundException: com.ibm.ws.security.jaspi.ProviderRegistry
。
及以下例外服務器 java.lang.SecurityException: AuthConfigFactory error: java.lang.ClassNotFoundException: com.ibm.ws.security.jaspi.ProviderRegistry java.lang.SecurityException: AuthConfigFactory error: java.lang.ClassNotFoundException: com.ibm.ws.security.jaspi.ProviderRegistry at javax.security.auth.message.config.AuthConfigFactory.getFactory(AuthConfigFactory.java:83) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.catalina.authenticator.AuthenticatorBase.getJaspicProvider(AuthenticatorBase.java:1191) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:465) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:783) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1177) [na:1.7.0] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [na:1.7.0] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.11.jar!/:8.5.11] at java.lang.Thread.run(Thread.java:857) [na:1.7.0] Caused by: java.lang.ClassNotFoundException: com.ibm.ws.security.jaspi.ProviderRegistry
我嘗試使用 `
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
` ,但它並沒有幫助。
PS:我希望它作爲jar文件而不是war文件執行。
我pom.xml文件
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.scb.com</groupId>
<artifactId>BatchDashBoard</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>DashBoard</name>
<description>DashBoard For the Batch Processing</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.2.14.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<properties>
<java.version>1.7</java.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
你不能在servlet容器中「運行」一個jar,它必須是戰爭或耳朵。 –
爲什麼不先生?我能夠啓動jar,但是訪問URL時發生錯誤。 我設法解決它,這是與Web球體服務器的JRE的問題。 我的應用程序是在Oracle JRE上開發和編譯的,但是在Web球體服務器上它是IBM jre ..所以有一個不匹配的JRE .. 管理修復並運行..謝謝 –
您只能部署spring-boot作爲'wars',否則你不會將它部署到WebSphere,而只是作爲java應用程序運行。檢查這個頁面的教程 - http://www.adeveloperdiary.com/java/spring-boot/deploy-spring-boot-application-ibm-liberty-8-5/ – Gas