我正在使用Web服务。我有一个wdsl文件,并将其转换为两个java文件:


wsdl2java -uri nameFile.wsdl


创建的Java文件之一具有87kb。当我尝试用Eclipse打开它时,出现以下错误:

java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Unknown Source)
    at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
    at java.lang.AbstractStringBuilder.append(Unknown Source)
    at java.lang.StringBuffer.append(Unknown Source)
    at org.eclipse.core.internal.filebuffers.FileStoreTextFileBuffer.setDocumentContent(FileStoreTextFileBuffer.java:586)
    at org.eclipse.core.internal.filebuffers.FileStoreTextFileBuffer.initializeFileBufferContent(FileStoreTextFileBuffer.java:352)
    at org.eclipse.core.internal.filebuffers.FileStoreFileBuffer.create(FileStoreFileBuffer.java:63)
    at org.eclipse.core.internal.filebuffers.TextFileBufferManager.connectFileStore(TextFileBufferManager.java:150)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider.createFileInfo(TextFileDocumentProvider.java:567)
    at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.createFileInfo(CompilationUnitDocumentProvider.java:969)
    at org.eclipse.ui.editors.text.TextFileDocumentProvider.connect(TextFileDocumentProvider.java:478)
    at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocumentProvider.connect(CompilationUnitDocumentProvider.java:1229)
    at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4056)
    at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:217)
    at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1444)
    at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.internalDoSetInput(JavaEditor.java:2578)
    at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.doSetInput(JavaEditor.java:2551)
    at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.doSetInput(CompilationUnitEditor.java:1371)
    at org.eclipse.ui.texteditor.AbstractTextEditor$19.run(AbstractTextEditor.java:3043)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
    at org.eclipse.jface.window.ApplicationWindow$1.run(ApplicationWindow.java:759)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.window.ApplicationWindow.run(ApplicationWindow.java:756)
    at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2600)
    at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3061)
    at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3088)
    at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:798)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:647)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)


我现在想知道是否:

1)问题wsdl2java。这意味着可以通过更大的方式创建更多的Java文件。

2)内存问题日食

我该如何解决?

谢谢

最佳答案

尝试-u上的wsdl2java标志。

-u             Unpacks the databinding classes

10-06 11:27