3

我有一个在 OSGi 容器中运行的 Java Web 应用程序。我已经在 Tomcat 服务器上部署了我的应用程序。当我重新启动服务器时,有时我会随机收到多个错误“ BundleContext 不再有效”,因此我无法部署应用程序。当我们重新启动应用程序服务器时,它不会一直发生,而只是有时会发生。我们找到的唯一解决方案就是重新启动服务器。以下是堆栈跟踪:

org.springframework.osgi.extender.internal.dependencies.startup.DependencyServiceManager] : Adding
OSGi service dependency for importer [&simplyticOsgiSaeAdapter] matching OSGi filter [(objectClass=c
om.moodysanalytics.sae.simplytic.adapter.SimplyticSaeAdapter)]
[org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean] : Creating a single
service proxy ...
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (
1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'dataSource
' threw exception; nested exception is java.lang.IllegalStateException: **BundleContext is no longer valid**
org.ops4j.pax.logging.pax-logging-api[org.springframework.beans.factory.xml.BeanDefinitionParserDele
gate] : No XML 'id' specified - using 'templateElement' as bean name and [] as aliases
        at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAcce
ssor.java:102)
[org.springframework.beans.factory.support.DefaultListableBeanFactory] : FactoryBean threw exception
 from getObjectType, despite the contract saying that it should return null if the type of its objec
4

0 回答 0