我尝试将共享库部署为webapp,并且可以访问其他Web应用程序中的库。
我的应用服务器是WebLogic 10.3.6,我的jdk是1.6 JRockit
我的带有共享库的WebApp名为clares_shared-0.1.0.BUILD-SNAPSHOT.war,使用maven生成。
在该webapp中,在META-INF目录中,我创建了MANIFEST.MF文件,其中包含以下内容:
清单 - 版本:1.0 规范 - 标题:公共图书馆Clares 规范 - 版本:1.0 实施 - 标题:公共图书馆Clares 实现 - 版本:1.0 Extension-Name:clares_shared-0.1.0.BUILD-SNAPSHOT
当ant通过日志部署此webapp时,他说:
K:\ Development \ CLA_RES \ clares> ant deploy_shared Buildfile:build.xml
deploy_shared:
[wldeploy] weblogic.Deployer -debug -remote -verbose -upload -noexit -name clares_shared-0.1.0.BUILD-SNAPSHOT -source K:\Development\CLA_RES\clares\clares_shared\target\clares_shared-0.1.0.BUILD-SNAPSHOT.war -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -password ******** -deploy -library
[wldeploy] weblogic.Deployer invoked with options: -debug -remote -verbose -upload -noexit -name clares_shared-0.1.0.BUILD-SNAPSHOT -source K:\Development\CLA_RES\clares\clares_shared\target\clares_shared-0.1.0.BUILD-SNAPSHOT.war -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -deploy -library
[wldeploy] [WebLogicDeploymentManagerImpl.<init>():115] : Constructing DeploymentManager for J2EE version V1_4 deployments
[wldeploy] [WebLogicDeploymentManagerImpl.getNewConnection():158] : Connecting to admin server at localhost:7001, as user weblogic
[wldeploy] [ServerConnectionImpl.getEnvironment():286] : setting environment
[wldeploy] [ServerConnectionImpl.getEnvironment():289] : getting context using t3://localhost:7001
[wldeploy] [ServerConnectionImpl.getMBeanServer():237] : Connecting to MBeanServer at service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.domainruntime
[wldeploy] [ServerConnectionImpl.getMBeanServer():237] : Connecting to MBeanServer at service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime
[wldeploy] [DomainManager.resetDomain():36] : Getting new domain
[wldeploy] [DomainManager.resetDomain():39] : Using pending domain: false
[wldeploy] [MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@a1bbe4
[wldeploy] [MBeanCache.addNotificationListener():103] : Added notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@a1bbe4
[wldeploy] [MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@a33ce3
[wldeploy] [MBeanCache.addNotificationListener():103] : Added notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@a33ce3
[wldeploy] [ServerConnectionImpl.initialize():169] : Connected to WLS domain: CLARES_base_domain
[wldeploy] [ServerConnectionImpl.setRemote():480] : Running in remote mode
[wldeploy] [ServerConnectionImpl.init():159] : Initializing ServerConnection : weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl@cfd032
[wldeploy] [BasicOperation.dumpTmids():713] : Incoming tmids:
[wldeploy] [BasicOperation.dumpTmids():715] : {Target=AdminServer, WebLogicTargetType=server, Name=clares_shared-0.1.0.BUILD-SNAPSHOT}, targeted=true
[wldeploy] [BasicOperation.deriveAppName():141] : appname established as: clares_shared-0.1.0.BUILD-SNAPSHOT
[wldeploy] <19-ago-2016 09H32' CLT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, clares_shared-0.1.0.BUILD-SNAPSHOT [archive: K:\Development\CLA_RES\clares\clares_shared\target\clares_shared-0.1.0.BUILD-SNAPSHOT.war], to AdminServer .>
[wldeploy] [BasicOperation.dumpTmids():713] : Incoming tmids:
[wldeploy] [BasicOperation.dumpTmids():715] : {Target=AdminServer, WebLogicTargetType=server, Name=clares_shared-0.1.0.BUILD-SNAPSHOT}, targeted=true
[wldeploy] [BasicOperation.loadGeneralOptions():628] : Delete Files:false
[wldeploy] Timeout :3600000
[wldeploy] Targets:
[wldeploy] AdminServer
[wldeploy] ModuleTargets={}
[wldeploy] SubModuleTargets={}
[wldeploy] }
[wldeploy] Files:
[wldeploy] null
[wldeploy] Deployment Plan: null
[wldeploy] App root: C:\Users\ODONAT~1\AppData\Local\Temp\odonatafly\.\config\deployments\clares_shared-0.1.0.BUILD-SNAPSHOT
[wldeploy] App config: C:\Users\ODONAT~1\AppData\Local\Temp\odonatafly\.\config\deployments\clares_shared-0.1.0.BUILD-SNAPSHOT\plan
[wldeploy] Deployment Options: {isRetireGracefully=true,isGracefulProductionToAdmin=false,isGracefulIgnoreSessions=false,rmiGracePeriod=-1,retireTimeoutSecs=-1,undeployAllVersions=false,archiveVersion=null,planVersion=null,isLibrary=true,libSpecVersion=null,libImplVersion=null,stageMode=null,clusterTimeout=3600000,altDD=null,altWlsDD=null,name=clares_shared-0.1.0.BUILD-SNAPSHOT,securityModel=null,securityValidationEnabled=false,versionIdentifier=null,isTestMode=false,forceUndeployTimeout=0,defaultSubmoduleTargets=true,timeout=0,deploymentPrincipalName=null,useExpiredLock=false}
[wldeploy]
[wldeploy] [ServerConnectionImpl.upload():849] : Uploaded app to C:\Oracle\Middleware\user_projects\domains\CLARES_base_domain\.\servers\AdminServer\upload\clares_shared-0.1.0.BUILD-SNAPSHOT
[wldeploy] [BasicOperation.execute():445] : Initiating deploy operation for app, clares_shared-0.1.0.BUILD-SNAPSHOT, on targets:
[wldeploy] [BasicOperation.execute():447] : AdminServer
[wldeploy] Task 50 initiated: [Deployer:149117]deploy library clares_shared-0.1.0.BUILD-SNAPSHOT on AdminServer.
[wldeploy] Task 50 completed: [Deployer:149117]deploy library clares_shared-0.1.0.BUILD-SNAPSHOT on AdminServer.
[wldeploy] Target state: deploy completed on Server AdminServer
[wldeploy]
[wldeploy] Target Assignments:
[wldeploy] + clares_shared-0.1.0.BUILD-SNAPSHOT AdminServer
[wldeploy] [ServerConnectionImpl.close():332] : Closing DM connection
[wldeploy] [ServerConnectionImpl.close():352] : Unregistered all listeners
[wldeploy] [ServerConnectionImpl.closeJMX():372] : Closed JMX connection
[wldeploy] [ServerConnectionImpl.closeJMX():384] : Closed Runtime JMX connection
[wldeploy] [ServerConnectionImpl.closeJMX():396] : Closed Edit JMX connection
建立成功
我想要访问SharedLibrary的webapp称为:
clares_web-0.1.0.BUILD-SNAPSHOT.war
是使用maven创建的,weblogic.xml文件包含以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
</container-descriptor>
<library-ref>
<library-name>clares_shared-0.1.0.BUILD-SNAPSHOT</library-name>
<specification-version>1.0</specification-version>
<implementation-version>1.0</implementation-version>
<exact-match>false</exact-match>
</library-ref>
</weblogic-web-app>
当我尝试部署此webapp(clares_web)时出现以下错误:
K:\ Development \ CLA_RES \ clares&gt; ant deploy_web Buildfile:build.xml
[wldeploy] weblogic.Deployer -debug -verbose -noexit -name clares_web-0.1.0.BUILD-SNAPSHOT -source K:\Development\CLA_RES\clares\clares_web\target\clares_web-0.1.0.BUILD-SNAPSHOT.war -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -password ******** -deploy
[wldeploy] weblogic.Deployer invoked with options: -debug -verbose -noexit -name clares_web-0.1.0.BUILD-SNAPSHOT -source K:\Development\CLA_RES\clares\clares_web\target\clares_web-0.1.0.BUILD-SNAPSHOT.war -targets AdminServer -adminurl t3://localhost:7001 -user weblogic -deploy
[wldeploy] [WebLogicDeploymentManagerImpl.<init>():115] : Constructing DeploymentManager for J2EE version V1_4 deployments
[wldeploy] [WebLogicDeploymentManagerImpl.getNewConnection():158] : Connecting to admin server at localhost:7001, as user weblogic
[wldeploy] [ServerConnectionImpl.getEnvironment():286] : setting environment
[wldeploy] [ServerConnectionImpl.getEnvironment():289] : getting context using t3://localhost:7001
[wldeploy] [ServerConnectionImpl.getMBeanServer():237] : Connecting to MBeanServer at service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.domainruntime
[wldeploy] [ServerConnectionImpl.getMBeanServer():237] : Connecting to MBeanServer at service:jmx:t3://localhost:7001/jndi/weblogic.management.mbeanservers.runtime
[wldeploy] [DomainManager.resetDomain():36] : Getting new domain
[wldeploy] [DomainManager.resetDomain():39] : Using pending domain: true
[wldeploy] [MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@a07de5
[wldeploy] [MBeanCache.addNotificationListener():103] : Added notification listener for weblogic.deploy.api.spi.deploy.mbeans.TargetCache@a07de5
[wldeploy] [MBeanCache.addNotificationListener():96] : Adding notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@a1ffa6
[wldeploy] [MBeanCache.addNotificationListener():103] : Added notification listener for weblogic.deploy.api.spi.deploy.mbeans.ModuleCache@a1ffa6
[wldeploy] [ServerConnectionImpl.initialize():169] : Connected to WLS domain: CLARES_base_domain
[wldeploy] [ServerConnectionImpl.init():159] : Initializing ServerConnection : weblogic.deploy.api.spi.deploy.internal.ServerConnectionImpl@d2f9ac
[wldeploy] [BasicOperation.dumpTmids():713] : Incoming tmids:
[wldeploy] [BasicOperation.dumpTmids():715] : {Target=AdminServer, WebLogicTargetType=server, Name=clares_web-0.1.0.BUILD-SNAPSHOT}, targeted=true
[wldeploy] [BasicOperation.deriveAppName():141] : appname established as: clares_web-0.1.0.BUILD-SNAPSHOT
[wldeploy] <19-ago-2016 09H43' CLT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, clares_web-0.1.0.BUILD-SNAPSHOT [archive: K:\Development\CLA_RES\clares\clares_web\target\clares_web-0.1.0.BUILD-SNAPSHOT.war], to AdminServer .>
[wldeploy] [BasicOperation.dumpTmids():713] : Incoming tmids:
[wldeploy] [BasicOperation.dumpTmids():715] : {Target=AdminServer, WebLogicTargetType=server, Name=clares_web-0.1.0.BUILD-SNAPSHOT}, targeted=true
[wldeploy] [BasicOperation.loadGeneralOptions():628] : Delete Files:false
[wldeploy] Timeout :3600000
[wldeploy] Targets:
[wldeploy] AdminServer
[wldeploy] ModuleTargets={}
[wldeploy] SubModuleTargets={}
[wldeploy] }
[wldeploy] Files:
[wldeploy] null
[wldeploy] Deployment Plan: null
[wldeploy] App root: C:\Users\ODONAT~1\AppData\Local\Temp\odonatafly\.\config\deployments\clares_web-0.1.0.BUILD-SNAPSHOT
[wldeploy] App config: C:\Users\ODONAT~1\AppData\Local\Temp\odonatafly\.\config\deployments\clares_web-0.1.0.BUILD-SNAPSHOT\plan
[wldeploy] Deployment Options: {isRetireGracefully=true,isGracefulProductionToAdmin=false,isGracefulIgnoreSessions=false,rmiGracePeriod=-1,retireTimeoutSecs=-1,undeployAllVersions=false,archiveVersion=null,planVersion=null,isLibrary=false,libSpecVersion=null,libImplVersion=null,stageMode=null,clusterTimeout=3600000,altDD=null,altWlsDD=null,name=clares_web-0.1.0.BUILD-SNAPSHOT,securityModel=null,securityValidationEnabled=false,versionIdentifier=null,isTestMode=false,forceUndeployTimeout=0,defaultSubmoduleTargets=true,timeout=0,deploymentPrincipalName=null,useExpiredLock=false}
[wldeploy]
[wldeploy] [BasicOperation.execute():445] : Initiating deploy operation for app, clares_web-0.1.0.BUILD-SNAPSHOT, on targets:
[wldeploy] [BasicOperation.execute():447] : AdminServer
[wldeploy] Task 51 initiated: [Deployer:149026]deploy application clares_web-0.1.0.BUILD-SNAPSHOT on AdminServer.
[wldeploy] dumping Exception stack
[wldeploy] Task 51 failed: [Deployer:149026]deploy application clares_web-0.1.0.BUILD-SNAPSHOT on AdminServer.
[wldeploy] Target state: deploy failed on Server AdminServer
[wldeploy] weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext@806038954[app:clares_web-0.1.0.BUILD-SNAPSHOT module:clares_web-0.1.0.BUILD-SNAPSHOT.war path:/clares_web-0.1.0.BUILD-SNAPSHOT spec-version:2.5]", defined in weblogic.xml [Extension-Name: clares_shared-0.1.0.BUILD-SNAPSHOT, Specification-Version: 1, Implementation-Version: 8.1, exact-match: false]
[wldeploy] at weblogic.servlet.internal.WebAppServletContext.processWebAppLibraries(WebAppServletContext.java:2750)
[wldeploy] at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:416)
[wldeploy] at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:494)
[wldeploy] at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
[wldeploy] at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
[wldeploy] at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:384)
[wldeploy] at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
[wldeploy] at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
[wldeploy] at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
[wldeploy] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
[wldeploy] at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
[wldeploy] at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:47)
[wldeploy] at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
[wldeploy] at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
[wldeploy] at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
[wldeploy] at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:44)
[wldeploy] at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
[wldeploy] at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
[wldeploy] at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
[wldeploy] at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
[wldeploy] at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
[wldeploy] at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:749)
[wldeploy] at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
[wldeploy] at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
[wldeploy] at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
[wldeploy] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
[wldeploy] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
[wldeploy] at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:47)
[wldeploy] at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
[wldeploy] at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
[wldeploy] at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
有人可以帮助我知道我犯的是什么错误
thanxs
GOS
enter code here