2012-06-29 61 views
4

我在我的Web服務器上部署了一個應用程序,現在我試圖在Web服務器上隱藏另一個應用程序,並收到BeanAlreadyExistsException。我認爲這可能是由於我在兩個不同的項目中有兩個同名的bean。所以我從服務器中刪除了第一個項目 - 但是沒有奏效 - 在部署第二個應用程序時,我仍然得到了這個異常。BeanAlreadyExistsException - Oracle WebLogic

這裏是堆棧跟蹤:

####<Jun 29, 2012 11:35:47 AM EDT> <Warning> <Deployer> <GAATLITISDAU88W> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1340984147265> <BEA-149004> <Failures were detected while initiating deploy task for application 'jwds0002.ear'.> 
####<Jun 29, 2012 11:35:47 AM EDT> <Warning> <Deployer> <GAATLITISDAU88W> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1340984147265> <BEA-149078> <Stack trace for message 149004 
weblogic.management.DeploymentException: Unmarshaller failed 
    at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:193) 
    at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48) 
    at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110) 
    at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76) 
    at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89) 
    at weblogic.management.deploy.internal.MBeanConverter.createApplicationForAppDeployment(MBeanConverter.java:67) 
    at weblogic.management.deploy.internal.MBeanConverter.setupNew81MBean(MBeanConverter.java:315) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.compatibilityProcessor(ActivateOperation.java:81) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.setupPrepare(AbstractOperation.java:295) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:97) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) 
Caused By: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists: "[email protected](/ApplicationParams[webapp.encoding.default])" 
    at weblogic.descriptor.internal.ReferenceManager.registerBean(ReferenceManager.java:231) 
    at weblogic.j2ee.descriptor.wl.WeblogicApplicationBeanImpl.setApplicationParams(WeblogicApplicationBeanImpl.java:564) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:48) 
    at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty.setValue(RuntimeBindingType.java:539) 
    at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType$QNameRuntimeProperty.fillCollection(AttributeRuntimeBindingType.java:381) 
    at com.bea.staxb.runtime.internal.MultiIntermediary.getFinalValue(MultiIntermediary.java:52) 
    at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType.getFinalObjectFromIntermediary(AttributeRuntimeBindingType.java:140) 
    at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(UnmarshalResult.java:200) 
    at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:169) 
    at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65) 
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:150) 
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768) 
    at weblogic.application.ApplicationDescriptor.getWeblogicApplicationDescriptor(ApplicationDescriptor.java:324) 
    at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:181) 
    at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48) 
    at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110) 
    at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76) 
    at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:89) 
    at weblogic.management.deploy.internal.MBeanConverter.createApplicationForAppDeployment(MBeanConverter.java:67) 
    at weblogic.management.deploy.internal.MBeanConverter.setupNew81MBean(MBeanConverter.java:315) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.compatibilityProcessor(ActivateOperation.java:81) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.setupPrepare(AbstractOperation.java:295) 
    at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:97) 
    at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216) 
    at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250) 
    at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13) 
    at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46) 
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528) 
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) 
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) 

這裏是在web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> 
    <display-name>jwds0002</display-name> 
    <welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
    <welcome-file>index.htm</welcome-file> 
    <welcome-file>index.jsp</welcome-file> 
    <welcome-file>default.html</welcome-file> 
    <welcome-file>default.htm</welcome-file> 
    <welcome-file>default.jsp</welcome-file> 
    </welcome-file-list> 
    <servlet> 
    <description></description> 
    <display-name>PubAlertAccessor</display-name> 
    <servlet-name>PubAlertAccessor</servlet-name> 
    <servlet-class>com.myPackage.PubAlertAccessor</servlet-class> 
    </servlet> 
<servlet-mapping> 
    <servlet-name>PubAlertAccessor</servlet-name> 
    <url-pattern>/PubAlertAccessor</url-pattern> 
    </servlet-mapping> 
    <listener> 
    <listener-class>com.myPackage.Configurator</listener-class> 
    </listener>  
</web-app> 
+0

可以粘貼您的weblogic-application.xml中這個錯誤通常表示某些元素的重複。在這種情況下,帶有值的元素 - webapp.encoding.default – prash

+3

我的經驗:該消息來自weblogic使用的Spring IOC:這意味着「Bean」不是您的(Enterprise)Java Bean,因此不能在該級別發生任何碰撞。錯誤指的是容器資源(或對它們的引用),如數據源,jms或javamail會話或應用程序itaself – Andrea

+0

這就像安德烈所說的。這些聽起來像你的描述符試圖創建一個已經存在的資源對象... – megathor

回答

-1

簡單地除去從WebLogic的application.xml中多個庫參考文件。

adf.oracle.domain

+0

你能解釋一點點嗎? –

-2
  1. cd $DOMAIN_HOME
  2. cd config/jdbc
  3. 刪除對配置的xml文件
  4. 重新啓動服務器
0

,你可以嘗試擺脫「APP-部署在/ base_domain/config/config中的「」部分。 XML,它包含了耳朵/戰爭 **

**

+0

請不要發佈這樣的答案,因爲這是一條評論。如果你繼續這樣做,由於你要收到的反對票,你將不能在SO中提問。所以請閱讀[this](https://stackoverflow.com/help/answering),我試圖幫助不成爲rood。 – Sand

+0

我可以知道這個評論有什麼問題嗎? – Abby

+0

這是你應該在主要問題下的評論。閱讀[this](https://stackoverflow.com/help/answering)瞭解如何正確回答。 – Sand