Archived

This forum has been archived. Please start a new discussion on GitHub.

"internal error reading the generated output list" with the slice2java plugin

I'm getting a new and weird message (as seen in the subject header) from the slice2java plugin, only on two of my (previously well-building) projects. A colleague has the same issue on a different project. I'll do some more debugging, but is this a familiar issue to anyone?

Here's the backtrace from the Eclipse log:
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:242)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:286)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
at com.zeroc.slice2javaplugin.builder.Slice2JavaBuilder.getGeneratedFiles(Slice2JavaBuilder.java:1129)
at com.zeroc.slice2javaplugin.builder.Slice2JavaBuilder.fullBuild(Slice2JavaBuilder.java:636)
at com.zeroc.slice2javaplugin.builder.Slice2JavaBuilder.build(Slice2JavaBuilder.java:89)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:516)
at org.eclipse.core.internal.resources.Project.build(Project.java:94)
at org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:221)
at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:162)
at org.eclipse.ui.actions.WorkspaceAction$2.runInWorkspace(WorkspaceAction.java:483)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Comments

  • matthew
    matthew NL, Canada
    The data emitted by slice2java isn't in the expected XML format. I would suspect you are using the wrong version of slice2java.
  • matthew wrote: »
    The data emitted by slice2java isn't in the expected XML format. I would suspect you are using the wrong version of slice2java.

    Hmm ... can you think of any reason why this would only be happening on two of five projects, where all five use exactly the same .ice files (as in, I made an Eclipse "folder" that points to the .ice files in all five projects)?

    I'll try debugging further today to see what XML is actually being produced, and that should make things clearer.
  • Well, here's what it's trying to parse when the error occurs:
    slice2java: JavaUtil.cpp:379: std::string Slice::JavaGenerator::getPackagePrefix(const Slice::ContainedPtr&) const: Assertion `!file.empty()' failed.

    That looks like slice2java is producing some sort of error in these cases instead of creating the required XML content. Why would this happen? I'm confused ...

    Note that this only happens for some Eclipse projects, and not for others -- as far as I can tell, all are configured identically and none used to have this issue.
  • A bit more about how I have things configured: there is one Eclipse project with the .ice files. For all other projects -- which all use these .ice files -- I've created a "linked resource" through Eclipse pointing at this directory, and pointed the slice2java plugin at it.

    To make it more concrete, here's the directory structure as configured in the Eclipse project view:
    • echoes-ice-interfaces -- project containing the slice files
      • slice -- directory containing slice files
    • action-engine -- another project using the slice files
      • generated -- where the generated .java files go
      • src -- other source files
      • slice -- a linked resource pointing to the "slice" directory in the other project. The slice2java plugin is configured to get slice files from this directory

    For some of the other projects -- not all of them! -- I get the error I mentioned when running the slice2java builder. I just tried removing the "linked resource" and directly copying the .ice files into one of the affected projects, and it worked fine. But I don't want to have to do this, because it would then mean that I'd have multiple copies of the .ice files in different projects and that's very difficult to keep in synch.

    (This is why I asked previously about letting the plugin get its slice files from a directory outside the current project ...)

    Thanks for any suggestions,

    MEF
  • dwayne
    dwayne St. John's, Newfoundland
    If you are using symbolic links then this patch might help.
  • dwayne wrote: »
    If you are using symbolic links then this patch might help.

    Thanks for that -- the patch seems to have fixed it! I'm not using true symbolic links, but rather workspace "linked resources" through Eclipse, but it seems to produce the same symptoms. Weird that this didn't show up before, as I've been using the same configuration for ages ...