javaxmlmavenxfire

XFire NamespaceURI cannot be null with Maven Assembly Plugin


I'm trying to use library which intensively uses XML data and so on. I've tried to compile my project into one uber-JAR with Maven Assembly, but after running and some actions I've got following error.

org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: NamespaceURI cannot be null
org.codehaus.xfire.fault.XFireFault: NamespaceURI cannot be null
    at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
    at org.codehaus.xfire.util.dom.DOMSerializer.writeMessage(DOMSerializer.java:47)
    at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)
    at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayRequestEntity(CommonsHttpMessageSender.java:422)
    at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:360)
    at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:123)
    at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
    at org.codehaus.xfire.client.Client.invoke(Client.java:336)
    at eu.unicore.security.xfireutil.client.ReliableProxy.handleRequest(ReliableProxy.java:122)
    at eu.unicore.security.xfireutil.client.ReliableProxy.doInvoke(ReliableProxy.java:102)
    at eu.unicore.security.xfireutil.client.ReliableProxy.invoke(ReliableProxy.java:69)
    at com.sun.proxy.$Proxy71.CreateTSR(Unknown Source)
    at de.fzj.unicore.uas.client.TSFClient.createTSS(TSFClient.java:44)
    at de.fzj.unicore.uas.client.TSFClient.createTSS(TSFClient.java:67)
    at com.mjolnirr.caeserver.client.ClientImpl.createTSSClient(ClientImpl.java:240)
    at com.mjolnirr.caeserver.client.ClientImpl.createJob(ClientImpl.java:245)
    at com.mjolnirr.caeserver.client.ClientImpl.run(ClientImpl.java:95)
    at com.mjolnirr.caeserver.task.description.nodes.ActiveNode.exec(ActiveNode.java:62)
    at com.mjolnirr.caeserver.executor.WorkflowBranchImpl$1.run(WorkflowBranchImpl.java:51)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
Caused by: javax.xml.stream.XMLStreamException: NamespaceURI cannot be null
    at com.sun.xml.stream.writers.XMLStreamWriterImpl.writeAttribute(XMLStreamWriterImpl.java:620)
    at org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:366)
    at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
    at org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
    at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
    at org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
    at org.codehaus.xfire.util.STAXUtils.writeNode(STAXUtils.java:391)
    at org.codehaus.xfire.util.STAXUtils.writeElement(STAXUtils.java:380)
    at org.codehaus.xfire.util.STAXUtils.writeDocument(STAXUtils.java:285)
    at org.codehaus.xfire.util.dom.DOMSerializer.writeMessage(DOMSerializer.java:40)
    ... 28 more

I've tried to assemble in with Shade, but got strange error about wrong manifest signature. Anyone faced that?


Solution

  • Solved with including org.codehaus.woodstox:wstx-api:3.2.9 into jar and running it like:

    java -jar -Djavax.xml.stream.XMLEventFactory=com.ctc.wstx.stax.WstxEventFactory -Djavax.xml.stream.XMLInputFactory=com.ctc.wstx.stax.WstxInputFactory -Djavax.xml.stream.XMLOutputFactory=com.ctc.wstx.stax.WstxOutputFactory caeserver/target/caeserver-0.1-jar-with-dependencies.jar