我最近设置了一个新的WebLogic12C环境。在部署一个我知道在WebLogic11g中工作的应用程序时,我得到了一个错误“web应用程序中的url-pattern/resources/*被映射到了多个servlet”。
它所引用的映射位于正在部署的application.ear中的web.xml中,但只映射了一次:
<servlet-mapping>
<servlet-name>velocity</servlet-name>
<url-pattern>/resources/*</url-pattern>
</servlet-mapping>
该项目不包含对url模式/resources/*的任何其他引用,有人能解释重复的映射来自哪里以及我如何处理它吗?
<Error> <Deployer> <BEA-149205> <Failed to initialize the application "<application_name>" due to error weblogic.application.ModuleException: weblogic.management.DeploymentException: [HTTP:101401]The url-pa
ttern /resources/* in web application <application_name> is mapped to multiple Servlets.
weblogic.application.ModuleException: weblogic.management.DeploymentException: [HTTP:101401]The url-pattern /resources/* in web application <application_name> is mapped to multiple Servlets.
at weblogic.application.internal.ExtensibleModuleWrapper.prepare(ExtensibleModuleWrapper.java:114)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:192)
at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:187)
at weblogic.application.utils.StateMachineDriver$ParallelChange.run(StateMachineDriver.java:83)
at weblogic.application.utils.StateMachineDriver.nextStateInParallel(StateMachineDriver.java:144)
at weblogic.application.internal.flow.ModuleStateDriver.parallelPrepare(ModuleStateDriver.java:46)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:75)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:55)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:731)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:243)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:66)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:158)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:65)
at weblogic.deploy.internal.targetserver.AppDeployment.prepare(AppDeployment.java:158)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doPrepare(DeploymentAdapter.java:41)
at weblogic.management.deploy.internal.DeploymentAdapter.prepare(DeploymentAdapter.java:193)
at weblogic.management.deploy.internal.AppTransition$1.transitionApp(AppTransition.java:31)
at weblogic.management.deploy.internal.ConfiguredDeployments$2.doItem(ConfiguredDeployments.java:684)
at weblogic.management.deploy.internal.parallel.BucketInvoker.invoke(BucketInvoker.java:138)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionAppsParallel(ConfiguredDeployments.java:692)
at weblogic.management.deploy.internal.ConfiguredDeployments.prepare(ConfiguredDeployments.java:322)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:202)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:207)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:129)
at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1262)
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:332)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:374)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:232)
at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2020)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:114)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:88)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:666)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Weblogic从版本12.2.1.3开始,在某些情况下会自动将JAX-RS servlet注册到路径/resources/*
(例如,某些依赖项,如jackson-jaxrs-json-provider通过注释/spi/moduleinfo“请求”它)。但是,如果此路径已由另一个服务注册,则抛出上述错误。
有三种可能的解决方案可以尝试:
>
在我们的例子中,问题来自于对web服务组件的类路径扫描,以及在webservices-rt JAR中查找带注释的服务。需要关闭扫描。如果Web应用程序没有任何注释,并且版本设置为2.5或更高,则在Web.xml描述符中将metadata-complete
属性设置为true以避免不必要地扫描Web应用程序类以查找注释。例如。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
metadata-complete="true">
<servlet>
<servlet-name>sample</servlet-name>
<servlet-class>Sample</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>sample</servlet-name>
<url-pattern>/sample</url-pattern>
</servlet-mapping>
</web-app>
或者,您可以在启动WebLogic Server时通过设置-dweblogic.servlet.didisabled=true
标志来关闭所有Web应用程序的注释处理和DI。
在web.xml中为jersey注册另一个路径,例如/jersey/*
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/jersey/*</url-pattern>
</servlet-mapping>
我们最近将VS 2010和.NET 4应用程序升级为VS 2012和.NET 4.5。我们有一个构建脚本来在测试服务器上部署应用程序。我们有两个框-一个是Windows 8和VS 2012(新安装),另一个是Windows 7和VS 2010和VS 2012(新安装)。 从Windows 8运行构建脚本时,box构建脚本运行良好,并将应用程序部署到测试服务器。但从Windows 7 box部署应用
我正在尝试将我的应用程序从Tomcat迁移到Weblogic 12.2.1.3.0。我能够毫无错误地部署应用程序,但我有一个与持久性提供程序相关的运行时错误。这是堆栈跟踪: 在这里写问题之前,我在谷歌上搜索了解决方案,似乎weblogic正在尝试加载org。日食坚持不懈jpa。PersistenceProvider,而不是我正在使用的hibernate提供程序。一种常见的解决方案是将首选项包定义到
“{\”wflyctl0080:Failed services\“=>{\”jboss.deployment.unit.\“yy.war\”WeldStartService\“=>\”启动服务失败,原因是:java.lang.IllegalArgumentException:wflyweld0037:将持久性单元注入CDI托管bean时出错。在部署yy.war中找不到名为“”的持久性单元,用于注入
我在Tomcat服务器上运行了一堆war文件。我将这些文件打包到一个ear中,并希望将其部署到WebLogic12c服务器上。在我进行部署时,Weblogic似乎试图预编译包中包含的所有jsp。它给了我以下错误: 我想jstl库有一些问题。我按照这个指南https://docs.oracle.com/cd/e24329_01/web.1211/e21049/configureJSFandJTSL.
当我尝试在WebLogic 12c上部署应用程序时,会出现此异常。 在这个应用程序中,我有一个简单的jax-ws-Web服务。有人能帮我吗? 问候弗朗西斯科
我正在使用ant脚本构建应用程序。此应用程序在9.2 bea下工作。lib=C:/bea92/weblogic92/server/lib-ant-code-工作正常,但当我切换到12c lib文件夹时。lib=C:/bea12c/wlserver\u 12.1/server/lib,它给了我这个错误: