Spring Boot App 部署到 Weblogic 12c 启动失败 [英] Spring Boot App deployed to Weblogic 12c and failed to Start

查看:44
本文介绍了Spring Boot App 部署到 Weblogic 12c 启动失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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
...

嵌套异常是:

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.

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

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.

我有什么想念的吗?

谢谢.

推荐答案

我在这个漏洞上浪费了 8 个小时,将我从其他面临同样问题的人那里得到的各种线索拼凑起来.

I wasted 8 hours in this loophole, piecing together various clues I got from other people facing the same problem.

**唯一的解决方案是将您的应用程序部署为 Weblogic 中的爆炸式 WAR.我假设您已经准备好用于在 Weblogic 上部署的 Spring Boot 应用程序,关于这个主题有几个技巧,但它们可以在 Internet 上找到(排除嵌入式 tomcat 并在 POM.XML 中指定 WAR 打包,使用 weblogic 创建 webapp/WEB-INF 文件夹.xml 和 servlet xml).

**The ONLY solution is to deploy your application as exploded WAR in Weblogic. I assume you already prepared your spring boot application for deployment on Weblogic, there are several tricks on this topic but they are available on the Internet (exclude embedded tomcat and specify WAR packaging in POM.XML, create webapp/WEB-INF folder with weblogic.xml and servlet xml).

现在在服务器上创建一个文件夹,例如/home/oracle/wars/myapp,然后将解压后的 WAR 内容复制到该文件夹​​中.

Now create a folder on the server, /home/oracle/wars/myapp for example, and just copy the unpacked contents of your WAR to that folder.

然后转到部署 - 安装,导航到/home/oracle/wars/并从单选按钮列表中选择 myapp 文件夹,然后只需按照默认步骤进行部署.

Then go to Deployments - Install, navigate to /home/oracle/wars/ and choose myapp folder from the radio button list, and simply follow the default steps to deploy.

注意,你需要一个普通的 web.xml 文件和 weblogic.xml,否则 Weblogic 不会将其视为Web 应用程序"**

Pay attention, you need a plain web.xml file along with weblogic.xml, otherwise Weblogic will not see it as 'Web application'**

部署为已分解的 WAR 是一种解决方法,可避免创建 _wl_cls_gen.jar,这是该问题的根源.

Deploying as exploded WAR is a workaround to avoid the creation of _wl_cls_gen.jar which is at the source of this problem.

最后,对于这个特定的错误,部署到 weblogic 时找不到 **/*.graphqls 文件,下面没有任何工作,我提到它,所以你也不要浪费时间:

Finally, for this particular error, **/*.graphqls file not found when deploying to weblogic, nothing of the below worked, I am mentioning it so you don't waste your time as well:

  1. 在 POM 中添加资源标签

  1. Adding resource tag in POM

在 application.properties 中添加graphql.tools.schema-location-pattern=**/*.graphqls

Adding in application.properties graphql.tools.schema-location-pattern=**/*.graphqls

在 application.properties 中添加graphql.servlet.exception-handlers-enabled=true

Adding in application.properties graphql.servlet.exception-handlers-enabled=true

较新版本的 GraphQL 库,我尝试过,但从 graphql 7.0.1 开始,一切都失败了,出现此错误

Newer versions of GraphQL libraries, I tried it and everything fails with this error from graphql 7.0.1 onwards

在 POM 中添加 spring-boot-starter-parent

Adding spring-boot-starter-parent in POM

这篇关于Spring Boot App 部署到 Weblogic 12c 启动失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆