当前位置:编程学习 > JAVA >>

怎样在virgo中部署标准的war文件

你好,我现在使用virgo Tomcat server部署war文件。结果出现了以下问题
这是什么原因?这个war文件是一个标准的war文件。在Tomcat上能运行,现在把他部署到virgo Tomcat Server中,却出现以下错误!!!

[2012-07-20 09:51:07.890] start-signalling-4           <DE0006E> Start failed for bundle 'formtags-war-3.0.0' version '0.0.0'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Web application failed to start
at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:132)
at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.eclipse.gemini.web.core.WebApplicationStartFailedException: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/formtags-war-3.0.0.RELEASE' failed to start. Check the logs for more details.
at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:108)
at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
... 8 common frames omitted
Caused by: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/formtags-war-3.0.0.RELEASE' failed to start. Check the logs for more details.
at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)
at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)

求解答! --------------------编程问答-------------------- 额。块一个月了,结果竟然搜到自己的帖子,而且关键的是一个回复也没有! --------------------编程问答--------------------  因为国内对这方面了解的人太少,而且一般公司很少有注意到virgo的。 这个问题我也遇到了,应该说是VTS开发中非常常见的一个问题。我现在见到的解释是:因为war包的web.xml中含有<listener >
        <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class>
    </listener >
而这个ContextLoaderListener 类实际在war包启动时是无法找到该类的(其实这个类是被web-inf/lib下spring的包,包括Virgo的ext目录都有)。解决的方法,我看到的 一种是直接修改war包的meta-inf,然后import-package 缺少的类(相当于将一个单纯的war改造为一个shared libraries war). 
    如果是不含spring单纯的war项目(只有jsp和servlet)是没有这个问题,可以直接被VTS装载,只有spring web app 会出现这个问题。我也很奇怪,按照VTS的user manual来说,应该标准war直接可以应用啊。

   另外告诉你一个小知识,你需要把configuration下的serviceability.xml中的logback的日志级别提升到trace(默认是INF),这样你可以在 logs/log 文件看到大量的输出跟踪信息。 我觉得 VTS的日志这点做的有问题,这种启动异常错误居然不能默认显示出来,实在让人很无语 --------------------编程问答-------------------- --------------------编程问答-------------------- eferences
[2012-09-17 09:42:58.440] TRACE start-signalling-3           org.springframework.beans.TypeConverterDelegate                   No String constructor found on type [org.springframework.osgi.service.importer.support.ImportContextClassLoader] java.lang.NoSuchMethodException: org.springframework.osgi.service.importer.support.ImportContextClassLoader.<init>(java.lang.String)
        at java.lang.Class.getConstructor0(Class.java:2706)
        at java.lang.Class.getConstructor(Class.java:1657)
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:191)
        at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)
        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:499)
        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:493)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1371)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1330)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$301(AbstractDelegatedExecutionApplicationContext.java:69)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$1.run(AbstractDelegatedExecutionApplicationContext.java:186)
        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java:182)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExecutionApplicationContext.java:89)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
        at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:122)
        at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
        at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
        at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
        at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
        at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
        at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
        at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

[2012-09-17 09:42:58.440] TRACE start-signalling-3           org.springframework.beans.TypeConverterDelegate                   Converting String to [class [Ljava.lang.Class;] using property editor [org.springframework.beans.propertyeditors.ClassArrayEditor@64c182ee]
@                                                                                                                      --------------------编程问答-------------------- 这个需要修改virgo的配置文件,我们到virgo的安装目录的repository\ext下,找到配置文件 org.eclipse.virgo.web.properties

原来里边设定的值是WABHeaders=strict

试下这个。 --------------------编程问答-------------------- 改成WABHeaders=defaulted --------------------编程问答-------------------- <root level="TRACE">
<appender-ref ref="SIFTED_LOG_FILE" />
<appender-ref ref="LOG_FILE" />
</root>
变成TRACE,然后你就能看到:Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml] 就是 要有applicationContext.xml]  当然,我现在还没有确认能不能换成其他的文件名
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,