当前位置: 代码迷 >> Web前端 >> weblogic92上部署JAX-WS
  详细解决方案

weblogic92上部署JAX-WS

热度:519   发布时间:2012-10-06 17:34:01.0
weblogic92下部署JAX-WS
在weblogic.xml中设置jar包的引用方式
<weblogic-web-app>
   <container-descriptor>  
      <prefer-web-inf-classes>true</prefer-web-inf-classes>  
  </container-descriptor>   
</weblogic-web-app>

但是报出了以下错误
2010-3-19 13:40:48 com.sun.xml.ws.transport.http.servlet.WSServletContextListene
r contextInitialized
信息: WSSERVLET12: JAX-WS context listener initializing
2010-3-19 13:40:48 com.sun.xml.ws.transport.http.servlet.WSServletContextListene
r contextInitialized
严重: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoSuchMethodErr
or: javax.jws.WebService.portName()Ljava/lang/String;
java.lang.NoSuchMethodError: javax.jws.WebService.portName()Ljava/lang/String;
        at com.sun.xml.ws.model.RuntimeModeler.getPortName(RuntimeModeler.java:1
299)
        at com.sun.xml.ws.server.EndpointFactory.getDefaultPortName(EndpointFact
ory.java:376)
        at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapter
s(DeploymentDescriptorParser.java:234)
        at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(Deploy
mentDescriptorParser.java:147)
        at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contex
tInitialized(WSServletContextListener.java:108)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run
(EventsManager.java:376)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
        at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(Eve
ntsManager.java:82)
        at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:1616)
        at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletCon
text.java:2761)
        at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.jav
a:889)
        at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleSta
teDriver.java:204)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
river.java:26)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStat
eDriver.java:60)
        at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedMod
uleDriver.java:200)
        at weblogic.application.internal.flow.ModuleListenerInvoker.start(Module
ListenerInvoker.java:117)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleSta
teDriver.java:204)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
river.java:26)
        at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStat
eDriver.java:60)
        at weblogic.application.internal.flow.StartModulesFlow.activate(StartMod
ulesFlow.java:26)
        at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.ja
va:635)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineD
river.java:26)
        at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.
java:212)
        at weblogic.application.internal.DeploymentStateChecker.activate(Deploym
entStateChecker.java:154)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(Ap
pContainerInvoker.java:80)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.ac
tivate(AbstractOperation.java:566)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.ac
tivateDeployment(ActivateOperation.java:136)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.do
Commit(ActivateOperation.java:104)
        at weblogic.deploy.internal.targetserver.operations.StartOperation.doCom
mit(StartOperation.java:139)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.co
mmit(AbstractOperation.java:320)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploym
entCommit(DeploymentManager.java:815)
        at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeplo
ymentList(DeploymentManager.java:1222)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(
DeploymentManager.java:433)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.com
mit(DeploymentServiceDispatcher.java:161)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallb
ackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallb
ackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallb
ackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
        at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkMan
agerImpl.java:518)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
<2010-3-19 下午01时40分48秒 CST> <Warning> <HTTP> <BEA-101162> <User defined lis
tener com.sun.xml.ws.transport.http.servlet.WSServletContextListener failed: com
.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to pa
rse runtime descriptor: java.lang.NoSuchMethodError: javax.jws.WebService.portNa
me()Ljava/lang/String;.
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to
 parse runtime descriptor: java.lang.NoSuchMethodError: javax.jws.WebService.por
tName()Ljava/lang/String;
        at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contex
tInitialized(WSServletContextListener.java:118)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run
(EventsManager.java:376)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
        at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(Eve
ntsManager.java:82)
        Truncated. see log file for complete stacktrace
java.lang.NoSuchMethodError: javax.jws.WebService.portName()Ljava/lang/String;
        at com.sun.xml.ws.model.RuntimeModeler.getPortName(RuntimeModeler.java:1
299)
        at com.sun.xml.ws.server.EndpointFactory.getDefaultPortName(EndpointFact
ory.java:376)
        at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapter
s(DeploymentDescriptorParser.java:234)
        at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(Deploy
mentDescriptorParser.java:147)
        at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contex
tInitialized(WSServletContextListener.java:108)
        Truncated. see log file for complete stacktrace
>

在网上搜索到得解决方法
This fixed it:
Re: Deploying JAX-WS on WebLogic 9.2
Posted: Apr 9, 2008 6:48 AM in response to: xenocid2000
Reply

IMO the simplest way of getting JAX-WS (Metro 1.1 distribution) to work on WLS 9.2 is:

1. create an EAR with your war embedded in it
2. in META-INF/weblogic-application.xml of your ear you should put
<prefer-application-packages>
<package-name>javax.jws.*</package-name>
<package-name>javax.xml.soap.*</package-name>
</prefer-application-packages>
This prevents you from having to tamper with the classpath in startup scripts.
3. required libraries: put the webservices*.jar from the lib directory in the Metro distribution to WEB-INF/lib of your war application.

That's it (at least from me, using a stock 9.2MP2 installation).

HTH
Jorg
Copied from http://forums.java.net/jive/thread.jspa?messageID=216363

Also refer:
http://blog.jonschneider.com/2009/02/getting-jax-ws-to-work-with-weblogic-92.html

http://www.jroller.com/gmazza/entry/deploying_metro_and_cxf_based
http://forums.oracle.com/forums/thread.jspa?threadID=857671