Spring Boot App部署到Weblogic 12c并且无法启动

时间:2021-07-14 20:09:22

I tried to create a spring boot deployable war file and then deployed it to weblogic 12c. Application startup failed with the exception:

我尝试创建一个spring boot deployable war文件,然后将其部署到weblogic 12c。应用程序启动失败,但异常:

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
ERROR SpringApplication - Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'graphQLServletRegistrationBean' defined in class path resource
...

Nested exception is:

嵌套异常是:

java.lang.IllegalStateException: No *.graphqls files found on classpath.  Please add a graphql schema to the classpath or add a SchemaParser bean to your application context.

In fact, the above mentioned files *.graphqls exist in the war under WEB-INF/classes/ folder. If the war file was unzipped to the local disk and redeploy the app in exploded format, we won't see this exception.

实际上,上面提到的文件* .graphqls存在于WEB-INF / classes /文件夹下的战争中。如果将war文件解压缩到本地磁盘并以展开格式重新部署应用程序,我们将不会看到此异常。

Do I miss anything?

我想念什么吗?

Thanks.

2 个解决方案

#1


0  

Without seeing your code, or knowing your spring-boot version, it's difficult to really diagnose your issue. There were small changes here and there that had to be to get my spring-boot app to run on WebLogic. Thinks like inclusion of weblogic.xml and some dependencies here and there

如果没有看到您的代码或了解您的spring-boot版本,就很难真正诊断出您的问题。这里和那里有一些小的变化,必须让我的spring-boot应用程序在WebLogic上运行。认为包含weblogic.xml和一些依赖项在这里和那里

The main one being the addition of implements WebApplicationInitializer to my application class like so.

主要的是将WebApplicationInitializer实现添加到我的应用程序类中。

@SpringBootApplication
public class Application extends SpringBootServletInitializer
    implements
    WebApplicationInitializer {

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

}

It looks like a few other had issues similar to yours, maybe these can help you out. It seems like you might be having issues with having spring-boot with other spring (but not spring-boot) dependencies. It's impossible to really tell as I don't know what your pom file or application class file look like.

看起来像其他一些问题与你的问题类似,也许这些可以帮助你。看起来你可能在使用spring-boot与其他spring(但不是spring-boot)依赖项时遇到问题。由于我不知道你的pom文件或应用程序类文件是什么样子,所以无法真正说出来。

One

Two

Three

Four

#2


0  

I've figured out the cause of this issue. It's a bit odd in weblogic when deploying war file. It creates an internal _wl_cls_gen.jar file to package all files for /WEB-INF/classes folder.

我已经找出了这个问题的原因。在部署war文件时,weblogic有点奇怪。它创建一个内部_wl_cls_gen.jar文件来打包/ WEB-INF / classes文件夹的所有文件。

but the application still looks for resources in match directory like /j2ee/wl12/cp_domain/servers/cp_msp01/tmp/_WL_user/cpapps-graphql-results/g4qyhf/war/WEB-INF/classes/**/*.graphqls and find nothing matched.

但应用程序仍在匹配目录中查找资源,如/j2ee/wl12/cp_domain/servers/cp_msp01/tmp/_WL_user/cpapps-graphql-results/g4qyhf/war/WEB-INF/classes/**/*.graphqls并查找没有匹配。

#1


0  

Without seeing your code, or knowing your spring-boot version, it's difficult to really diagnose your issue. There were small changes here and there that had to be to get my spring-boot app to run on WebLogic. Thinks like inclusion of weblogic.xml and some dependencies here and there

如果没有看到您的代码或了解您的spring-boot版本,就很难真正诊断出您的问题。这里和那里有一些小的变化,必须让我的spring-boot应用程序在WebLogic上运行。认为包含weblogic.xml和一些依赖项在这里和那里

The main one being the addition of implements WebApplicationInitializer to my application class like so.

主要的是将WebApplicationInitializer实现添加到我的应用程序类中。

@SpringBootApplication
public class Application extends SpringBootServletInitializer
    implements
    WebApplicationInitializer {

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

}

It looks like a few other had issues similar to yours, maybe these can help you out. It seems like you might be having issues with having spring-boot with other spring (but not spring-boot) dependencies. It's impossible to really tell as I don't know what your pom file or application class file look like.

看起来像其他一些问题与你的问题类似,也许这些可以帮助你。看起来你可能在使用spring-boot与其他spring(但不是spring-boot)依赖项时遇到问题。由于我不知道你的pom文件或应用程序类文件是什么样子,所以无法真正说出来。

One

Two

Three

Four

#2


0  

I've figured out the cause of this issue. It's a bit odd in weblogic when deploying war file. It creates an internal _wl_cls_gen.jar file to package all files for /WEB-INF/classes folder.

我已经找出了这个问题的原因。在部署war文件时,weblogic有点奇怪。它创建一个内部_wl_cls_gen.jar文件来打包/ WEB-INF / classes文件夹的所有文件。

but the application still looks for resources in match directory like /j2ee/wl12/cp_domain/servers/cp_msp01/tmp/_WL_user/cpapps-graphql-results/g4qyhf/war/WEB-INF/classes/**/*.graphqls and find nothing matched.

但应用程序仍在匹配目录中查找资源,如/j2ee/wl12/cp_domain/servers/cp_msp01/tmp/_WL_user/cpapps-graphql-results/g4qyhf/war/WEB-INF/classes/**/*.graphqls并查找没有匹配。