java.io.IOException: unable to convert type 0 to a numeric type

Oracle Community | 950584 | 4 years ago
  1. 0

    Exception occurred while decoding a Message for Service

    Oracle Community | 4 years ago | 950584
    java.io.IOException: unable to convert type 0 to a numeric type
  2. 0

    need more visibilty into serialization

    Oracle Community | 6 years ago | 858704
    java.io.IOException: unable to convert type 0 to a String type
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    [android-developers] Problem in packagin .apk from flex application

    Google Groups | 7 years ago | anil
    java.io.IOException: Unable to convert AndroidManifest to binary
  5. 0

    FULL PRODUCT VERSION : java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) ADDITIONAL OS VERSION INFORMATION : Linux com-prod 3.13.0-77-generic #121-Ubuntu SMP Wed Jan 20 10:50:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux EXTRA RELEVANT SYSTEM CONFIGURATION : java-mail: mail-1.4.7.jar A DESCRIPTION OF THE PROBLEM : The RFC for AS2 requires the support for the mime-type "application/XML" See https://www.ietf.org/rfc/rfc4130.txt Section 4.2 (Page 12) The default XmlDataContentHandler (com.sun.xml.internal.ws.encoding.XmlDataContentHandler) however does refuse an mime-message with such an mime-type because the method isXml(ContentType ct) does not check case insensitiv. But the Class javax.activation.ActivationDataFlavor does check by using "this.mimeType.equalsIgnoreCase(mimeType);" (see public boolean isMimeTypeEqual(String mimeType)) The check in XmlDataContentHandler.isXml should be case insensitiv. REGRESSION. Last worked in version 6u45 ADDITIONAL REGRESSION INFORMATION: java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode) STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : See source code EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Output: application/xml processed application/XML processed ACTUAL - Output: application/xml processed Exception in thread "main" java.io.IOException: Cannot convert DataSource with content type "application/XML" to object in XmlDataContentHandler at com.sun.xml.internal.ws.encoding.XmlDataContentHandler.getContent(XmlDataContentHandler.java:85) at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) at javax.activation.DataHandler.getContent(DataHandler.java:542) at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:637) at Test.main(SignaturTest.java:63) ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.io.IOException: Cannot convert DataSource with content type "application/XML" to object in XmlDataContentHandler at com.sun.xml.internal.ws.encoding.XmlDataContentHandler.getContent(XmlDataContentHandler.java:85) at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) at javax.activation.DataHandler.getContent(DataHandler.java:542) at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:637) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- MailcapCommandMap mailcapCommandMap = (MailcapCommandMap) CommandMap.getDefaultCommandMap(); mailcapCommandMap.addMailcap("application/XML;; x-java-content-handler=com.sun.xml.internal.ws.encoding.XmlDataContentHandler"); mailcapCommandMap.addMailcap("application/xml;; x-java-content-handler=com.sun.xml.internal.ws.encoding.XmlDataContentHandler"); String contentType; MimeMessage message; MimeMultipart mimeMultipart; final byte[] bodyConent = "<test/>".getBytes(); InternetHeaders headers = new InternetHeaders(); headers.setHeader("Content-Transfer-Encoding", "binary"); headers.setHeader("Content-Disposition", "attachment; filename=test.xml"); // this works contentType = "application/xml"; message = new MimeMessage(Session.getDefaultInstance(new Properties())); mimeMultipart = new MimeMultipart(); headers.setHeader("Content-Type", contentType); mimeMultipart.addBodyPart(new MimeBodyPart(headers, bodyConent)); message.setContent(mimeMultipart); message.saveChanges(); ((MimeMultipart) message.getContent()).getBodyPart(0).getContent(); // will cause java.io.IOException contentType = "application/XML"; message = new MimeMessage(Session.getDefaultInstance(new Properties())); mimeMultipart = new MimeMultipart(); headers.setHeader("Content-Type", contentType); mimeMultipart.addBodyPart(new MimeBodyPart(headers, bodyConent)); message.setContent(mimeMultipart); message.saveChanges(); ((MimeMultipart) message.getContent()).getBodyPart(0).getContent(); ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Create an own XmlDataContentHandler and override JVM default-Settings

    JDK Bug System | 7 months ago | Webbug Group
    java.io.IOException: Cannot convert DataSource with content type "application/XML" to object in XmlDataContentHandler

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      unable to convert type 0 to a numeric type

      at com.tangosol.io.pof.PofHelper.readAsInt()
    2. com.tangosol.io
      PofBufferReader.readLong
      1. com.tangosol.io.pof.PofHelper.readAsInt(PofHelper.java:718)
      2. com.tangosol.io.pof.PofHelper.readAsLong(PofHelper.java:764)
      3. com.tangosol.io.pof.PofBufferReader.readLong(PofBufferReader.java:176)
      3 frames
    3. com.tangosol.coherence
      Daemon.run
      1. com.tangosol.coherence.component.net.extend.message.Response.readExternal(Response.CDB:9)
      2. com.tangosol.coherence.component.net.extend.Codec.decode(Codec.CDB:29)
      3. com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.decodeMessage(Peer.CDB:25)
      4. com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.onNotify(Peer.CDB:47)
      5. com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
      5 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)[2012-07-14 13:08:55,729]
      1 frame