使用wscompile任务的ClassNotFoundException

时间:2011-03-17 23:54:45

标签: java web-services

我们正在使用wscompile ant任务并获取classnotfound错误。

[wscompile] RmiModeler error: java.lang.ClassNotFoundException: org$soa$soap$UserService
[wscompile]     at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.modelPort(RmiModeler.java:685)
[wscompile]     at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildLiteralModel(RmiModeler.java:603)
[wscompile]     at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildModel(RmiModeler.java:457)
[wscompile]     at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
[wscompile]     at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
[wscompile]     at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
[wscompile]     at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
[wscompile]     at com.sun.xml.rpc.tools.ant.Wscompile.execute(Wscompile.java:746)
[wscompile]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[wscompile]     at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[wscompile]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[wscompile]     at java.lang.reflect.Method.invoke(Method.java:592)
[wscompile]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[wscompile]     at org.apache.tools.ant.Task.perform(Task.java:348)
[wscompile]     at org.apache.tools.ant.Target.execute(Target.java:390)
[wscompile]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
[wscompile]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
[wscompile]     at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
[wscompile]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[wscompile]     at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
[wscompile]     at org.apache.tools.ant.Main.runBuild(Main.java:801)
[wscompile]     at org.apache.tools.ant.Main.startAnt(Main.java:218)
[wscompile]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[wscompile]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[wscompile]
[wscompile] CAUSE:

有趣的是,只有当服务的数量没有增加时才会发生这种情况,这意味着没有类文件上升...我认为在ant或wscompile中应该有一些内存设置?

<wscompile server="true"
               keep="true"
               features="documentliteral"
               sourceBase="${gen.dir}/wscompile/src"
               nonClassDir="${gen.dir}/wscompile/nd"
               base="${gen.dir}/wscompile/classes"
               model="${gen.dir}/wscompile/user-model.gz"
               xPrintStackTrace="true"
               verbose="true"
               config="build/config-user_service.xml">
      <classpath>
        <pathelement path="dist/lib/$javacode.jar}"/>
      </classpath>
    </wscompile>

当javacode.jar的大小为52MB时,这种方法有效,并且大小增加到53MB,就会产生上述错误。

1 个答案:

答案 0 :(得分:0)

我会说这很可能是因为你的PermGen内存不足。 PermGen存储关于每个类的元信息,因此类的数量越大,这将增大。尝试增加你传递给wscompile任务的MaxPermSize,看看它是否解决了问题。