I am using mono 2.10.2 to run a .Net application on RHEL 5. The application has a reference assembly Dll which makes a web service call to a JBoss server.I get ‘System.Security.Cryptography.CryptographicException’ when i run it in RHEL.I installed mono on windows and it runs fine there.The client application uses a .p12 certificate
I run the program with the following command:
mono --debug --trace=N:MyApplication "Prod_Module/TestApp/bin/Debug/abc Prod Module Test.exe"
I get the following trace while running it:
[0x40570940:] EXCEPTION handling:
System.Security.Cryptography.CryptographicException: Store Root
doesn’t exists. [0x40570940:] EXCEPTION handling:
System.Security.Cryptography.CryptographicException: Store Root
doesn’t exists. [0x42155940:] EXCEPTION handling:
System.Net.WebException: The remote server returned an error: (500)
Internal Server Error. [0x40fd8940:] EXCEPTION handling:
System.Net.WebException: The remote server returned an error: (500)
Internal Server Error. [0x2b15fbbefb50:] EXCEPTION handling:
System.ServiceModel.FaultException: Unmarshalling Error: unexpected
element (uri:”http://ws.array.asi.abc.com/”, local:”username”).
Expected elements are <{}username>,<{}password> [0x2b15fbbefb50:]
EXCEPTION handling: System.ServiceModel.FaultException: Unmarshalling
Error: unexpected element (uri:”http://ws.array.asi.abc.com/”,
local:”username”). Expected elements are <{}username>,<{}password>
[0x2b15fbbefb50:] EXCEPTION handling:
System.ServiceModel.FaultException: Unmarshalling Error: unexpected
element (uri:”http://ws.array.asi.abc.com/”, local:”username”).
Expected elements are <{}username>,<{}password> [0x2b15fbbefb50:]
EXCEPTION handling: System.ServiceModel.FaultException: Unmarshalling
Error: unexpected element (uri:”http://ws.array.asi.abc.com/”,
local:”username”). Expected elements are <{}username>,<{}password>
[0x2b15fbbefb50:] EXCEPTION handling:
abc.Prod.Module.Exception_Model.ModulePluginException: Unmarshalling
Error: unexpected element (uri:”http://ws.array.asi.abc.com/”,
local:”username”). Expected elements are <{}username>,<{}password>
Unmarshalling Error: unexpected element
(uri:”http://ws.array.asi.abc.com/”, local:”username”). Expected
elements are <{}username>,<{}password>The JBoss(v7.1) server logs has the following:
01:26:09,038 WARNING [org.apache.cxf.phase.PhaseInterceptorChain]
(http–0.0.0.0-3506-1) Interceptor for
{http://ws.array.asi.abc.com/}ArrayWSAPIImplService#{http://ws.array.asi.abc.com/}login
has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault:
Unmarshalling Error: unexpected element
(uri:”http://ws.array.asi.abc.com/”, local:”username”). Expected
elements are <{}username>,<{}password> at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:801)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:642)
at
org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:156)
at
org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:109)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:207)
at
org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:91)
at
org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:169)
at
org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:87)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:185)
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at
org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:135)
at
org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)
[jbossws-spi-2.0.3.GA.jar:2.0.3.GA] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.13.Final.jar:] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.13.Final.jar:] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.13.Final.jar:] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.13.Final.jar:] at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
[jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final] at
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
[jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
[jbossweb-7.0.13.Final.jar:] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.13.Final.jar:] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.13.Final.jar:] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
[jbossweb-7.0.13.Final.jar:] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.13.Final.jar:] at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
[jbossweb-7.0.13.Final.jar:] at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
[jbossweb-7.0.13.Final.jar:] at java.lang.Thread.run(Thread.java:662)
[rt.jar:1.6.0_27] Caused by: javax.xml.bind.UnmarshalException
– with linked exception: [javax.xml.bind.UnmarshalException: unexpected element (uri:”http://ws.array.asi.abc.com/”,
local:”username”). Expected elements are <{}username>,<{}password>]
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:434)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:371)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:348)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:778)
… 29 more Caused by: javax.xml.bind.UnmarshalException: unexpected
element (uri:”http://ws.array.asi.abc.com/”, local:”username”).
Expected elements are <{}username>,<{}password> at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:662)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:258)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:253)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:120)
at
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.childElement(Loader.java:105)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.childElement(StructureLoader.java:251)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:498)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:480)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:247)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:181)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:369)
… 31 more Caused by: javax.xml.bind.UnmarshalException: unexpected
element (uri:”http://ws.array.asi.abc.com/”, local:”username”).
Expected elements are <{}username>,<{}password> … 42 more
Is it something to do with the client certificate?
You need to import the certificates yourself, as stated by Mono Security FAQ.