Ant build weblogic webservice出错,求大家帮忙看看,出点主意。

我在用Ant build Weblogic WebService 为了生成WSDL文件时,出现错误并中断。

我的环境:
  Ant version:  Apache Ant version 1.7.0
  Java version: JDK1.6_U16 <Only>
  Based-Weblogic jar: 8.1 sp2
      ---|..\weblogic\weblogic.jar
      ---|..\weblogic\webservice.jar
      ---|..\weblogic\webserviceclient.jar
      ---|..\weblogic\*.jar
  App Server Platform: Weblogic server 11gR1(内核10.3.6) <我认为和这个因素没有关系>
  
  *JAX-RPC 规范的 webservice, clientgen
  
错误信息:
[clientgen] Generating client jar for XXXXXXXX-WebLogic.ear(XXXXXHandlingService) ...
[clientgen] weblogic.webservice.server.ConfigException: unable to load class:[[I] java.lang.ClassNotFoundException: [I
[clientgen] at weblogic.webservice.server.WebServiceFactory.loadClass(WebServiceFactory.java:1280)
[clientgen] at weblogic.webservice.server.WebServiceFactory.addParamsToMethod(WebServiceFactory.java:1028)
[clientgen] at weblogic.webservice.server.WebServiceFactory.registerOperation(WebServiceFactory.java:863)
[clientgen] at weblogic.webservice.server.WebServiceFactory.initOperations(WebServiceFactory.java:623)
[clientgen] at weblogic.webservice.server.WebServiceFactory.createFromMBean(WebServiceFactory.java:215)
[clientgen] at weblogic.webservice.tools.build.internal.WSDLGenImpl.getWebServiceRuntime(WSDLGenImpl.java:240)
[clientgen] at weblogic.webservice.tools.build.internal.WSDLGenImpl.run(WSDLGenImpl.java:135)
[clientgen] at weblogic.webservice.tools.build.internal.ClientGenImpl.doClientGenFromEAR(ClientGenImpl.java:438)
[clientgen] at weblogic.webservice.tools.build.internal.ClientGenImpl.run(ClientGenImpl.java:345)
[clientgen] at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.doClientGen(ClientGenTask.java:351)
[clientgen] at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:208)
[clientgen] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[clientgen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[clientgen] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[clientgen] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[clientgen] at java.lang.reflect.Method.invoke(Method.java:597)
[clientgen] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[clientgen] at org.apache.tools.ant.Task.perform(Task.java:348)
[clientgen] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
[clientgen] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[clientgen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[clientgen] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[clientgen] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[clientgen] at java.lang.reflect.Method.invoke(Method.java:597)
[clientgen] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[clientgen] at org.apache.tools.ant.Task.perform(Task.java:348)
[clientgen] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391)
[clientgen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[clientgen] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[clientgen] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[clientgen] at java.lang.reflect.Method.invoke(Method.java:597)
[clientgen] at net.sf.antcontrib.logic.For$Reflector.call(Unknown Source)
[clientgen] at net.sf.antcontrib.logic.For.doSequentialIteration(Unknown Source)
[clientgen] at net.sf.antcontrib.logic.For.doTheTasks(Unknown Source)
[clientgen] at net.sf.antcontrib.logic.For.execute(Unknown Source)
[clientgen] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[clientgen] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
[clientgen] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[clientgen] at java.lang.reflect.Method.invoke(Method.java:597)
[clientgen] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[clientgen] at org.apache.tools.ant.Task.perform(Task.java:348)
[clientgen] at org.apache.tools.ant.Target.execute(Target.java:357)
[clientgen] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[clientgen] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[clientgen] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[clientgen] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[clientgen] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[clientgen] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[clientgen] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[clientgen] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[clientgen] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

BUILD FAILED
..\XXXXXXXXX\XXXXX\AAAAAA\build.xml:402: The following error occurred while executing this line:
..\XXXXXXXXX\\XXXXX\BBBBBBBB\CCCCCCC\build.xml:409:
weblogic.webservice.tools.build.WSBuildException: unable to load class:[[I] java.lang.ClassNotFoundException: [I 
- with nested exception:
[weblogic.webservice.server.ConfigException: unable to load class:[[I] java.lang.ClassNotFoundException: [I]

Ant script snapshot:

<taskdef name="clientgen" classname="weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask">
   <classpath>
    <pathelement path="${classpath}"/>
    <fileset dir="${lib.home.po}/weblogic">
     <include name="**/*.jar"/>
    </fileset>
   </classpath>
  </taskdef>
  ...
  ...
  ...
  <clientgen usePortNameAsMethodName="true" overwrite="true" keepGenerated="true"
     useServerTypes="true" clientJar="${src}" ear="${DDDD.home}/dist/XXXXXXXX-WebLogic.ear"
     warName="XXXXXXXXXXX.war" saveWSDL="false" serviceName="@{x}Service"
     packageName="com.aaa.bbb.ccc.services">
     <classpath>     
      <pathelement path="${classpath}"/>
      <fileset dir="${lib.home.po}/weblogic">
       <include name="**/*.jar"/>
      </fileset>
      <fileset dir="${DependentProjA.home}\dist" includes="*.jar"/>
      <fileset dir="${DependentProjB.home}\dist" includes="*.jar"/>
      <fileset dir="${DependentProjC.home}\dist" includes="*.jar"/>
      <fileset dir="${DependentProjD.home}\dist" includes="*.jar"/>
      <fileset dir="${DependentProjE.home}\dist" includes="*.jar"/>
     </classpath>
  </clientgen>

 

发现只有当某个接口或类,它们的方法,方法的参数列表或返回值中包含java原始数据类型数组(int[],long[],byte[]),则build失败. 若不是,或是对象类型数组就是OK的。

SOAP协议规范,理论是支持简单或复杂数据类型参数的,我想知道这是weblogic版本实现的issue,还是其他什么原因。现在也不能使用这种方式去修改代码:int[]--->Integer[],其它也一样不能用。

各位求关注啊!只有10分,不好意思了。

1个回答

这有两个相似的问题:
[url]http://objectmix.com/weblogic/525518-primitive-classnotfoundexception-weblogic-classloader.html[/url]
[url]https://issues.apache.org/jira/browse/TAPESTRY-2088?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel[/url]

你下载最新的相关jar包试试
[clientgen] at weblogic.webservice.server.WebServiceFactory.addParamsToMethod(WebServiceFactory.java:1028)

sumo_my
yu-Wiki 先谢过了,我可能要升级weblogic及其JAR
7 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问