javaweb项目之tomcat转weblogic问题

2019-03-11 14:34:28

现本人欲将在开发时就在Tomcat6上运行的Javaweb项目转到weblogic10.3.6上运行,jdk6。
我在MyEclipse里直接复制了目标项目。修改修改后在tomcat上能顺利跑起来,然后直接部署到MyEclipse里的weblogic上,启动不了,报错如下:

  1. <2019-3-11 上午114209 CST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\WebLogic\user_projects\domains\base_domain\autodeploy\pds-unicom-scm-5/WEB-INF/web.xml of module pds-unicom-scm-5. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
  2. problem: cvc-complex-type.2.4a: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' instead of 'url-pattern@http://java.sun.com/xml/ns/javaee' here in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  3. problem: cvc-complex-type.2.4a: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' instead of 'http-method@http://java.sun.com/xml/ns/javaee' here in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  4. problem: cvc-complex-type.2.4a: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' instead of 'http-method@http://java.sun.com/xml/ns/javaee' here in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  5. problem: cvc-complex-type.2.4a: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' instead of 'http-method@http://java.sun.com/xml/ns/javaee' here in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  6. problem: cvc-complex-type.2.4a: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' instead of 'http-method@http://java.sun.com/xml/ns/javaee' here in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  7. problem: cvc-complex-type.2.4a: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' instead of 'http-method@http://java.sun.com/xml/ns/javaee' here in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  8. problem: cvc-complex-type.2.4c: Expected element 'web-resource-name@http://java.sun.com/xml/ns/javaee' before the end of the content in element web-resource-collection@http://java.sun.com/xml/ns/javaee:<null>
  9. at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
  10. at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
  11. at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
  12. at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
  13. at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
  14. at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
  15. at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
  16. at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
  17. at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(WebAppDescriptor.java:141)
  18. at weblogic.servlet.internal.WebAppModule.loadDescriptor(WebAppModule.java:1331)
  19. at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:374)
  20. at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
  21. at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
  22. at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
  23. at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
  24. at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
  25. at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
  26. at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
  27. at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
  28. at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
  29. at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:44)
  30. at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
  31. at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
  32. at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
  33. at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
  34. at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
  35. at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
  36. at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
  37. at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
  38. at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
  39. at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
  40. at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
  41. at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
  42. at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
  43. at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
  44. at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

百度了一下,大多都是说web.xml的开头版本不对,如下:

  1. <web-app xmlns="http://java.sun.com/xml/ns/javaee"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd" version="2.4">

把版本修改为2.5或其他版本都不好使,依然如上报错,也尝试了添加一个weblogic.xml,内容如下:

  1. <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
  2. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
  4. <container-descriptor>
  5. <index-directory-enabled>true</index-directory-enabled>
  6. <!-- 关键!!!先加载web-inf下的jar -->
  7. <prefer-web-inf-classes>true</prefer-web-inf-classes>
  8. <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
  9. </container-descriptor>
  10. </weblogic-web-app>

还是不好使,不知哪位大佬能指点一下下,解决这个问题,万分感激。


0
0
0

添加评论

正在回复:
取消
2
0
0
0