我正在使用Maven进行部署(但与Felix Web控制台相同的问题)和maven-sling-plugin,我看到它开始两次:
*INFO* [qtp1462409406-40] logs/access.log 127.0.0.1 - admin 25/Feb/2016:11:18:31 +0100 "POST /dev/system/console/install HTTP/1.1" 200 - "-" "Jakarta Commons-HttpClient/3.1"
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content BundleEvent INSTALLED
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content BundleEvent RESOLVED
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content BundleEvent STARTING
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content BundleEvent STARTED
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content Service [com.as.test.jcr.service.NodeFinderImpl,374] ServiceEvent REGISTERED
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content Service [com.as.test.jcr.service.NodeSorterImpl,375] ServiceEvent REGISTERED
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install2994913564032148892.tmp] com.as.test.content Service [com.as.test.jcr.service.UserProcessorImpl,376] ServiceEvent REGISTERED
====> Starts executing code: creates users, sets permissions and sort nodes with the JCR API
[...]
*ERROR* [pool-7-thread-1] com.as.test.content [com.as.test.jcr.service.ContentInitializerImpl(173)] Failed creating the component instance; see log for reason
*INFO* [FelixFrameworkWiring] com.as.test.content BundleEvent STOPPING
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.ContentInitializerImpl,383] ServiceEvent UNREGISTERING
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.NodeSorterImpl,375] ServiceEvent UNREGISTERING
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.UserProcessorImpl,376] ServiceEvent UNREGISTERING
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.NodeFinderImpl,374] ServiceEvent UNREGISTERING
*INFO* [FelixFrameworkWiring] com.as.test.content BundleEvent STOPPED
*INFO* [FelixFrameworkWiring] com.as.test.content BundleEvent UNRESOLVED
*INFO* [FelixFrameworkWiring] com.as.test.content BundleEvent RESOLVED
*INFO* [FelixFrameworkWiring] com.as.test.content BundleEvent STARTING
*INFO* [FelixFrameworkWiring] org.apache.sling.jcr.contentloader.internal.Loader Content of bundle already loaded com.as.test.content.
*INFO* [FelixFrameworkWiring] com.as.test.content BundleEvent STARTED
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.NodeFinderImpl,384] ServiceEvent REGISTERED
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.NodeSorterImpl,385] ServiceEvent REGISTERED
*INFO* [FelixFrameworkWiring] com.as.test.content Service [com.as.test.jcr.service.ContentInitializerImpl,387] ServiceEvent REGISTERED
*INFO* [FelixFrameworkWiring] com.as.test.jcr.service.ContentInitializerImpl Initializing Sling content
====> Starts (again) executing code: creates users, sets permissions and sort nodes with the JCR API
我在捆绑软件的启动时执行了一些代码,它在中间停止,然后重新启动,我找不到原因。
我分别使用org.apache.felix.framework 4.4.1和5.2.0尝试使用Sling launchpad 7和8
编辑:stacktraces
1. Starts from background install
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator java.lang.Thread.getAllStackTraces(Thread.java:1640)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator com.as.test.Activator.printStrackTraces(Activator.java:33)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator com.as.test.Activator.start(Activator.java:23)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.framework.Felix.activateBundle(Felix.java:2154)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.framework.Felix.startBundle(Felix.java:2072)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.webconsole.internal.core.InstallHelper.doRun(InstallHelper.java:67)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.doRun( BaseUpdateInstallHelper.java:89)
*INFO* [Background Install /var/folders/v0/gh9_k3ld5vx43sn057mg6h3c0000gn/T/install3836459285044407564.tmp] com.as.test.Activator org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.run( BaseUpdateInstallHelper.java:121)
2. Stops from FelixFrameworkWiring
*INFO* [FelixFrameworkWiring] com.as.test.Activator THREAD: Thread[FelixFrameworkWiring,5,main]
*INFO* [FelixFrameworkWiring] com.as.test.Activator java.lang.Thread.dumpThreads(Native Method)
*INFO* [FelixFrameworkWiring] com.as.test.Activator java.lang.Thread.getAllStackTraces(Thread.java:1640)
*INFO* [FelixFrameworkWiring] com.as.test.Activator com.as.test.Activator.printStrackTraces(Activator.java:33)
*INFO* [FelixFrameworkWiring] com.as.test.Activator com.as.test.Activator.start(Activator.java:23)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix.activateBundle(Felix.java:2154)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix.startBundle(Felix.java:2072)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4911)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix.refreshPackages(Felix.java:4148)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:178)
*INFO* [FelixFrameworkWiring] com.as.test.Activator java.lang.Thread.run(Thread.java:745)
3. Restarts from FelixFrameworkWiring
*INFO* [FelixFrameworkWiring] com.as.test.Activator THREAD: Thread[FelixFrameworkWiring,5,main]
*INFO* [FelixFrameworkWiring] com.as.test.Activator java.lang.Thread.dumpThreads(Native Method)
*INFO* [FelixFrameworkWiring] com.as.test.Activator java.lang.Thread.getAllStackTraces(Thread.java:1640)
*INFO* [FelixFrameworkWiring] com.as.test.Activator com.as.test.Activator.printStrackTraces(Activator.java:33)
*INFO* [FelixFrameworkWiring] com.as.test.Activator com.as.test.Activator.start(Activator.java:23)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix.activateBundle(Felix.java:2154)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix.startBundle(Felix.java:2072)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4911)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.Felix.refreshPackages(Felix.java:4148)
*INFO* [FelixFrameworkWiring] com.as.test.Activator org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:178)
答案 0 :(得分:0)
最好的办法是为你的捆绑做好准备应对这种情况。许多事情都可能导致捆绑包多次启动,这应该不是特殊情况。