Eclipse validation error deploying EAR to WebLogic: cvc-complex-type.2.4c: Expected element 'module@http://java.sun.com/xml/ns/javaee'

試著忘記壹切 提交于 2020-01-13 16:30:33

问题


Out of the box, it is not possible to deploy an EAR to Oracle WebLogic using Eclipse.

Environment details:

  • Eclipse version: Indigo (includes Oracle Enterprise Pack for Eclipse 12.1.1.0.0)
  • Weblogic version: 10.3.5 (11gR1)

Oracle guide: http://www.oracle.com/technetwork/articles/javaee/marx-oepe-spring-095718.html

The error I receive when trying to start the server is:

java.lang.Exception: Exception received from deployment driver. See Error Log view for more detail.
    at oracle.eclipse.tools.weblogic.server.internal.DeploymentProgressListener.watch(DeploymentProgressListener.java:190)
    at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deploy(WlsJ2EEDeploymentHelper.java:486)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1466)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:898)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishOnce(WeblogicServerBehaviour.java:686)
    at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publish(WeblogicServerBehaviour.java:539)
    at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
    at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3027)
    at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:341)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: weblogic.management.DeploymentException: VALIDATION PROBLEMS WERE FOUND
  problem: cvc-complex-type.2.4c: Expected element 'module@http://java.sun.com/xml/ns/javaee' before the end of the content in element application@http://java.sun.com/xml/ns/javaee:<null>
    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.DescriptorException: VALIDATION PROBLEMS WERE FOUND
  problem: cvc-complex-type.2.4c: Expected element 'module@http://java.sun.com/xml/ns/javaee' before the end of the content in element application@http://java.sun.com/xml/ns/javaee:<null>

    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
    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.getApplicationDescriptor(ApplicationDescriptor.java:296)
    at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:178)

I am posting this up in the hope that someone who has been bitten by this before can simply reel off the answer - this question features heavily on Oracle and DevX forums when I post the stack into Google, and has not been answered.

Note: Company constraints insist on the use of the specific version of the software quoted at the top of the question - I am fully aware that this version of WebLogic is not Java EE 6 compliant.


回答1:


Thanks for the steer guys. It appears that my application.xml file is a red herring - whilst I do have one, my Maven POM has a plugin which generates its own during build. The problem was that, for Eclipse, the Deployment Assembly (Right Click > Deployment Assembly) did not contain any references to the WAR and JAR project dependenices. I wrongly assumed that Eclipse would simply detect and use an application.xml file found in the folder hierarchy. An empty application.xml file was being created, and thus the stack trace correctly bemoans the lack of modules to deploy.




回答2:


My problem was with the web.xml file, for some reason, my Eclipse modified the "faces / dynamic web module" of my project, and with it, the header of the web.xml file. The new web.xml file didn't have the "<web-app xmlns:xsi" full header, as soon as I fixed that, the weblogic stopped with the exceptions.



来源:https://stackoverflow.com/questions/14125538/eclipse-validation-error-deploying-ear-to-weblogic-cvc-complex-type-2-4c-expec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!