JAX-WS webservice部署到weblogic11出错

用myeclipse生成的JAX-WS webservice服务端在tomcat下运行正常,部署到weblogic11上出错,期望大虾能帮忙,在网上找了好久说是要导入weblogic的几个jar包具体怎么样也没有说明

错误代码和 java代码如下 如下
2013-8-22 19:23:03 com.sun.xml.ws.transport.http.servlet.WSServletContextListener parseAdaptersAndCreateDelegate
严重: WSSERVLET11: failed to parse runtime descriptor: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExte
nsion: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in jar:file:/D:/oracle/Middleware/wlserver_10.3/server/lib/we
blogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException
com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WS
DLGeneratorExtension is specified in jar:file:/D:/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.w
riter.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:379)
at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:225)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:442)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:209)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:509)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:127)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:148)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:374)
... 44 more
<User defined listener com.sun.xml.ws.transport.http.servlet.WSServletContextListener f
ailed: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: com.sun.xml.ws.util.ServiceConfigura
tionError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in
jar:file:/D:/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut coul
d not be instantiated: java.lang.ClassCastException.
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: com.sun.xml.ws.util.ServiceConfigurationErr
or: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framework.policy.WSDLGeneratorExtension is specified in jar:fi
le:/D:/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtensionbut could not b
e instantiated: java.lang.ClassCastException
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:137)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:148)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
Truncated. see log file for complete stacktrace
Caused By: com.sun.xml.ws.util.ServiceConfigurationError: com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension: Provider weblogic.wsee.jaxws.framewor
k.policy.WSDLGeneratorExtension is specified in jar:file:/D:/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar!/META-INF/services/com.sun.xml.ws
.api.wsdl.writer.WSDLGeneratorExtensionbut could not be instantiated: java.lang.ClassCastException
at com.sun.xml.ws.util.ServiceFinder.fail(ServiceFinder.java:233)
at com.sun.xml.ws.util.ServiceFinder.access$300(ServiceFinder.java:141)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:379)
at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:225)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:442)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:374)
at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:225)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:442)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:209)
Truncated. see log file for complete stacktrace

2013-8-22 19:23:03 com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
信息: WSSERVLET13: JAX-WS context listener destroyed
<Unable to set the activation state to true for the application 'webapp'.
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1510)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassCastException
at java.lang.Class.cast(Class.java:2990)
at com.sun.xml.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:374)
at com.sun.xml.ws.util.ServiceFinder.toArray(ServiceFinder.java:225)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:442)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:209)
Truncated. see log file for complete stacktrace

AdminServer\logs\base_domain3.log will be rotated. Reopen the log file if tailing has stopped. This can happen on some platforms like Windows.>
ase_domain3\servers\AdminServer\logs\base_domain3.log00019. Log messages will continue to be logged in D:\oracle\Middleware\user_projects\domains\base
_domain3\servers\AdminServer\logs\base_domain3.log.>
e successfully.>


iiop, t3, ldap, snmp, http.>
ocols iiop, t3, ldap, snmp, http.>
d:4043:6cbd:c03c%11>
ls iiop, t3, ldap, snmp, http.>
ldap, snmp, http.>
ap, snmp, http.>
snmp, http.>
in Development Mode>

java---------------------------代码如下

@WebService(targetNamespace = "http://www.***.***/", serviceName = "QueryTaskInfosService" )
public class QueryTaskInfosDelegate {

com.huiye.webservice.server.QueryTaskInfos queryTaskInfos = new com.huiye.webservice.server.QueryTaskInfos();

@WebMethod(action = " queryTaskInfoBySource " , operationName = " queryTaskInfoBySource " )  
public String queryTaskInfoBySource(@WebParam(name = " taskSource " )String taskSource) {
    return queryTaskInfos.queryTaskInfoBySource(taskSource);
}

}

1个回答

很多项目迁移到weblogic下部署都会遇到若干问题。究其原因,这些问题90%都是由于jar包冲突导致的。因为weblogic作为一款商业的中间件产品,囊括了很多优秀的特性在里面,当然同时也把大量的开源技术集成在weblogic的classpath下面。所以当你出现class转换失败,找不到class的某个方法等等错误时,第一步,先在WEB-INF下面增加一个weblogic.xml配置文件,然后配置如下:
[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd
http://xmlns.oracle.com/weblogic/weblogic-web-app
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
wls:container-descriptor
wls:prefer-application-packages
wls:package-namejavax.persistence.*/wls:package-name
wls:package-nameantlr.*/wls:package-name
wls:package-namecom.bea.xbean.*/wls:package-name
wls:package-namecom.bea.xml.*/wls:package-name
/wls:prefer-application-packages
/wls:container-descriptor
/wls:weblogic-web-app
[/code]
prefer-application-packages配置的目的是让weblogic从web应用中加载指定的class,而不是从weblogic的classpath加载weblogic自己整合的class。

yybing110
yybing110 天降救星啊,非常适用,可惜我没分了要不然一定好好谢下
6 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问