无法实例化AutoReconfigurationServletContainerInitializer

时间:2015-05-20 21:18:54

标签: websphere-liberty ibm-cloud buildpack

我正在将一个Java EE应用程序部署到Bluemix,当第一个请求到达时,我收到了这个错误:

  

2015-05-20T23:11:58.51 + 0200 [App / 0] OUT [INFO] FFDC1015I:An   已创建FFDC事件:" java.util.ServiceConfigurationError:   javax.servlet.ServletContainerInitializer:Provider   org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializer   无法实例化   com.ibm.ws.webcontainer.osgi.DynamicVirtualHost startWebApp"在   ffdc_15.05.20_21.11.58.0.log

我认为这是Liberty Buildpack的一段代码。 这里是内容文件ffdc_15.05.20_21.11.58.0.log(它似乎是一个ClassNotFoundException,但因为它不是我的应用程序的一部分,我不知道该怎么做):

  

Exception = java.util.ServiceConfigurationError Source =   com.ibm.ws.webcontainer.osgi.DynamicVirtualHost probeid = startWebApp   Stack Dump = java.util.ServiceConfigurationError:   javax.servlet.ServletContainerInitializer:Provider   org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializer   无法在java.util.ServiceLoader.fail中实例化(未知   来自)java.util.ServiceLoader.access $ 100(未知来源)at   java.util.ServiceLoader $ LazyIterator.next(未知来源)at   java.util.ServiceLoader $ 1.next(未知来源)at   com.ibm.ws.webcontainer.webapp.WebApp.initializeServletContainerInitializers(WebApp.java:2454)     在com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1038)     在com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6396)     在   com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:446)     在   com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:248)     在   com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.createRunnableHandler(DynamicVirtualHost.java:313)     在   com.ibm.ws.http.internal.VirtualHostImpl.discriminate(VirtualHostImpl.java:251)     在   com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:306)     在   com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:449)     在   com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:383)     在   com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:283)     在   com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:254)     在   com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:174)     在   com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:83)     在   com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)     在   com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)     在   com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:929)     在   com.ibm.ws.tcpchannel.internal.WorkQueueManager $ Worker.run(WorkQueueManager.java:1018)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)引起:   java.lang.NoClassDefFoundError:   org.springframework.context.ApplicationContextInitializer at   java.lang.ClassLoader.defineClassImpl(Native Method)at   java.lang.ClassLoader.defineClass(未知来源)at   com.ibm.ws.classloading.internal.AppClassLoader.definePackageAndClass(AppClassLoader.java:297)     在   com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:241)     在java.lang.ClassLoader.loadClassHelper(未知来源)at   java.lang.ClassLoader.loadClass(未知来源)at   com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:390)     在   com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:362)     在java.lang.ClassLoader.loadClass(未知来源)at   org.cloudfoundry.reconfiguration.spring.AutoReconfigurationServletContainerInitializer。(AutoReconfigurationServletContainerInitializer.java:33)     at java.lang.J9VMInternals.newInstanceImpl(Native Method)at   java.lang.Class.newInstance(Unknown Source)... 23更多引起:   抛出java.lang.ClassNotFoundException:   org.springframework.context.ApplicationContextInitializer at   com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:412)     在   com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:246)     在java.lang.ClassLoader.loadClassHelper(未知来源)at   java.lang.ClassLoader.loadClass(未知来源)at   com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:390)     在   com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:362)     at java.lang.ClassLoader.loadClass(Unknown Source)... 35 more

谢谢!

1 个答案:

答案 0 :(得分:1)

我认为您的应用程序正在使用Spring Framework,这会触发Spring Auto-Reconfiguration。如果您不需要此自动重新配置支持,可以通过为您的应用程序设置以下环境变量来禁用它,并进行重新设置:

cf set-env <app-name> JBP_CONFIG_SPRINGAUTORECONFIGURATION "enabled: false"

cf restage <app-name>