Error running SendMail when launch application from JNI

Hello,
I am getting the following exception when I try to send email using JavaMail. This error began happening when we upgraded to Java 1.6. It does not happen with earlier versions of Java.
javax.mail.SendFailedException: Sending failed;
nested exception is:
     javax.mail.MessagingException: IOException while sending message;
nested exception is:
     javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary="----=_Part_0_2882193.1230049431911"
I have browsed through the forums and read the many postings with a similar error. I have tried the variety of suggestions, but nothing seems to work. My understanding is the JAF is included in Java 1.6, so we should not need the activation.jar in our classpath anymore. Even so I have tried with and without the activation.jar in the classpath. I do not think it is a class loader issue because we do not build any of this into our application. It is all referenced in jar files on the classpath.
The interesting thing is that I can launch the application with a normal JVM launch and it works just fine. The error only occurs when I launch the application from a C++ application using JNI. In both cases I am using the exact same classpath. The error occurs whether I include activation.jar in the classpath or not.
I have tried to programmatically add the MIME types using the MailCommandMap class, but this had no effect.
The most recent test I ran was to put the activation.jar and mail.jar files in my C:\Java\jre6\lib\endorsed directory. This actually cleared up the error. This is not a viable solution for us, but it leads me to believe the .mailcap file is not being loaded correctly for some reason. I just cannot figure out what the issue could be as it seems to be associated with JNI.
Thank you for any help,
Mary Kathryn

Because JAF is now part of the JDK, the JAF classes are loaded by the system class loader
instead of the application class loader. If the thread's context class loader is not set, JAF
uses its class loader to load the mailcap files. Since JavaMail's mailcap file is in mail.jar,
and mail.jar is still loaded by the application class loader, the system class loader can't
find JavaMail's mailcap file.
Normally, when starting the application using the "java" command, the thread's context
class loader will be set to the application's class loader. This may not be happening
automatically when starting the application with JNI.

Similar Messages

  • Error message 10660 when launching applications

    Hi,
    Hope someone may be able to help I have a MacBook Pro OS X 10.4.11 and Safari, Microsoft Office, Adobe & Skype are not loading. I have tried phoning Apple who advised trying a new user account, did that but the applications will still not load. I then tried first aid via disc utility on my HD but it came up with errors too. I have also tried reinstalling from the original discs and again errors have occurred. Any suggestions would be gratefully received.

    Does the error occur when trying to start the application or when you are trying to open a document? In the case of the latter be sure the document is trying to open the right application: Press COMMAND-I to open the Get Info window and check what default application is listed in the Open With section.
    If the above isn't relevant then do a Google search for 'error 10660' which will provide a number of links which may find a solution for you.

  • Run time prompts not appearing when launching BR from a right click menu

    Hi!
    I have a problem when trying to launch a business rule from a right click menu which is assigned to a dataform.
    The rule launches but does not show/ask for the run time prompts as it should do. The run-time prompts should not be hidden (I checked also Eas and data form selections).
    When using the rule form the Tools-Business Rules menu, the rule works fine. It prompts for the required variables and as they are filled in, the rule does what it is expected to.
    Also, when using the same rule attached into a form (and selected "use members on form"&"run on save") the rule works correctly.
    We are using version 11.1.2.1.
    I already have tried restarting Planning services but without success.
    What might cause this?
    kind regards,
    user637777

    Hi!
    I found out from the Oracle knowledge base:
    This issue is caused by unpublished Bug 11064867 - RIGHT CLICK MENUS NOT RENDERING RUN TIME PROMPTS
    In version 931 run time prompts worked correctly when launching them from a right click menu, I checked this out.
    In our current version I got this working (this is kind of a workaround) by adding a new RTP variable (using the same dimension as the original RTP variable). This way I got the rule to "ask for more information" (like what were you asking for? ) and not running the rule without interruptions. This instruction was given in Oracle support (knowledge base).
    kind regards,
    user637777

  • Error when downloading application from Server

    Hi,
    I have installed MI Client 7.0 SPS 11 Patch 0 on Symbol Device ;OS Windows Mobile5.0
    i have successfully completed <b>first</b> synchronization .
    After that i assigned Mobile Component to the device and tried synchronizing.
    "Error when downloading application from http://<servername>:50000/meContainerSync/servlet/com.sap.ip.mi.http.MobileComponentServlet?Application=xyz&Type=APPLICATION&Runtime=JSP"
    Pl. suggest
    Note: In NWA under 'Device Maintenance' -> Mobile component
    The state of the aplication is <b>"Deployment Activated"</b>
    rgds,
    Kiran Joshua
    Message was edited by:
            Kiran Joshua

    Hi ALL,
    I resolved it on my own guys !!!
    Actually while downloading server url consists of hostname bcoz the hostfile entry in windows/system32/drivers/etc/hosts was only hostname.
    i entered FQDN name in the hostfile... It WORKED
    Being Saturday and Sunday...i cud not get any help from forums...i was really worried and Guys we need to think on this :-?
    rgds,
    Kiran Joshua

  • How can I avoid running rmiregistry when launch an RMI based application

    Hi,
    How can I avoid running rmiregistry when launch an RMI based application?
    Will invocation of LocalRegistry.createRegistry() do?
    Thanks a lot!
    Regards,
    Justine

    yes it will do...better try it out
    good luck

  • A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

    Hi guys
    i have problem when i run my windows application exe in windows server 2003
    it give me this exception error :
    I using sql server 2005
    visual studio 2008
    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    ************** Exception Text **************
    System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
       at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
       at System.Data.SqlClient.TdsParserStateObject.ReadByte()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
       at System.Data.SqlClient.SqlDataReader.get_MetaData()
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
       at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
       at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
       at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
       at Sales.SalesClass.ShowSalesData(String ConnectionString)
       at Sales.Form1.timer1_Tick(Object sender, EventArgs e)
       at System.Windows.Forms.Timer.OnTick(EventArgs e)
       at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    Sales
        Assembly Version: 1.0.0.0
        Win32 Version: 1.0.0.0
        CodeBase: file:///C:/Documents%20and%20Settings/administrator.ALTAWIREADYMIX.000/Desktop/Sales.exe
    System.Windows.Forms
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    System
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    System.Drawing
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    System.Configuration
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    System.Xml
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    System.Data
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
    System.Transactions
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.dll
    System.EnterpriseServices
        Assembly Version: 2.0.0.0
        Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
        CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.EnterpriseServices/2.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    For example:
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    Why this error show and how to solve it
    if possible help me
    Why this exception show and how to solve it.
    Notes this exception not close my application and not affect in result show but i don't know why it show

    The problem can be caused by certain issues of long-running queries, which are reported improperly. Try increasing the timeout:
    http://support.microsoft.com/en-us/kb/555938

  • CS6: DistributedCOM Error id: 10016 when open pdf from web page in Win8.1

    For example here below I've got the issue: 
    http://modemwifi.it/wp-content/uploads/asus-dsl-n55u.pdf
    Adobe Acrobat X pro V 10.1.8:
    DistributedCOM Error id: 10016 when open pdf from web page.
    Nome registro: System
    Origine:       Microsoft-Windows-DistributedCOM
    Data:          04/11/2013 19:09:19
    ID evento:     10016
    Categoria attività:Nessuna
    Livello:       Errore
    Parole chiave: Classico
    Utente:        PC-PIERO\Piero
    Computer:      Pc-Piero
    Descrizione:
    Le impostazioni delle autorizzazioni impostazioni predefinite del computer non concedono l'autorizzazione di Attivazione in Locale per l'applicazione server COM con CLSID
    {B801CA65-A1FC-11D0-85AD-444553540000}
    e APPID
    {2EAF0840-690A-101B-9CA8-9240CE2738AE}
    all'utente Pc-Piero\SID Piero (S-1-5-21-3453328585-262132574-2759341577-1001) dall'indirizzo LocalHost (tramite LRPC) in esecuzione nel SID del contenitore di applicazioni Non disponibile (S-1-15-2-1430448594-2639229838-973813799-439329657-1197984847-4069167804-1277922394). Per modificare tale autorizzazione di sicurezza, è possibile utilizzare lo strumento amministrativo Servizi componenti.
    XML evento:
    < Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-DistributedCOM" Guid="{1B562E86-B7AA-4131-BADC-B6F3A001407E}" EventSourceName="DCOM" />
        <EventID Qualifiers="0">10016</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x8080000000000000</Keywords>
        <TimeCreated SystemTime="2013-11-04T18:09:19.468877700Z" />
        <EventRecordID>14806</EventRecordID>
        <Correlation />
        <Execution ProcessID="768" ThreadID="776" />
        <Channel>System</Channel>
        <Computer>Pc-Piero</Computer>
        <Security UserID="S-1-5-21-3453328585-262132574-2759341577-1001" />
      </System>
      <EventData>
        <Data Name="param1">impostazioni predefinite del computer</Data>
        <Data Name="param2">Locale</Data>
        <Data Name="param3">Attivazione</Data>
        <Data Name="param4">{B801CA65-A1FC-11D0-85AD-444553540000}</Data>
        <Data Name="param5">{2EAF0840-690A-101B-9CA8-9240CE2738AE}</Data>
        <Data Name="param6">Pc-Piero</Data>
        <Data Name="param7">Piero</Data>
        <Data Name="param8">S-1-5-21-3453328585-262132574-2759341577-1001</Data>
        <Data Name="param9">LocalHost (tramite LRPC)</Data>
        <Data Name="param10">Non disponibile</Data>
        <Data Name="param11">S-1-15-2-1430448594-2639229838-973813799-439329657-1197984847-4069167804-1 277922394</Data>
      </EventData>
    < /Event>
    How can I solve this problem?
    Thanks

    // I got this from an Action (I�m using Struts)
    java.sql.Blob file=(java.sql.Blob)request.getAttribute("PDFfile");
    String filename=(String)request.getAttribute("filename");
    try{
      int iLength = (int)(file.length());
      response.setHeader("Content-type", "application/pdf");   
      response.setHeader("Content-Disposition", "inline; filename=\""+filename+"\"");
      response.setHeader("Expires","0");
      response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
      response.setHeader("Pragma","public");
      response.setContentLength(iLength);
      ServletOutputStream os = response.getOutputStream();
      InputStream in = null;
      in = file.getBinaryStream();
      byte buff[] = new byte[1024];
      while (true) {
          int i = in.read(buff);
          if (i<0) break;      
          os.write(buff,0,i); 
      os.flush();
      os.close();
    } catch(Exception ex){
       out.println("Error while reading file : " + ex.getMessage());
    }and now it�s running !!! I�m not using response.setContentType(...) and I do this in response.setHeader("Content-type", "application/pdf"). And I use response.setHeader("Content-Disposition", "inline; filename=\""+filename+"\"") instead of response.setHeader("Content-Disposition", "attachment; filename=\""+filename+"\"");

  • [Solved] Always Use Wrapper When Launching Application

    Hello all,
    I've write a very simple wrapper for an application (mpv), and would like to always use my wrapper instead of the application.
    As far as terminal goes, I did it by using an alias stored in the ~/.bashrc file (alias mpv='/usr/local/sbin/mpv_launch').
    However, I'm not sure how to achieve the same when launching mpv from not within the terminal (Dolphin, in my case), in such case the .desktop file is used, which obviously calls mpv itself and not my wrapper.
    Is there a way to globally convince the system to always run my wrapper whenever mpv is called, no matter how?
    Thanks, Adam.
    Last edited by adam777 (2013-05-31 13:46:12)

    And one more option: which application gets run depends on the order of your PATH variable. I have "/home/drcouzelis/Library/bin" as the first path in my PATH variable. If I put an "mpv" Bash script in there, then the Bash script will run instead of the installed application.
    # An example Bash script to start mpv fullscreen
    /usr/bin/mpv -fs "$@"
    ...of course, if you make a Bash script called "mpv" that calls "mpv", make sure it calls "/usr/bin/mpv" and not itself!

  • Error in downloading one drive application from apple store

    error in downloading one drive application from apple store

    I've been having some problems with the OneDrive app - I'm able to download and use it but whenever I search for it on the Mac App Store it says it needs updating even though it never shows up in Software Updates.
    You may need to update your version of OS X from 10.8 to 10.8.5 (if indeed you are running 10.8) -> http://support.apple.com/kb/DL1676 and http://support.apple.com/kb/DL1686.
    If you are on 10.8.5 already, I've no idea why you're unable to download. Try rebooting and opening the Mac App Store application again and give it another go.
    Clinton

  • Error message (-41110) when launching Itunes

    rene.haller 
    Feb 24, 2013 4:30 AM 
    I have just downloaded the latest version of Itunes (or rather the latest update). And now I get an error message when i lauch Itunes: -(41110).
    However, it does not prevent me from actually using Itunes. It's just an error box that appears when Itunes is launched. Any idea?
    Windows 7 
    I have this question too (11) 
    Reply
    Categories: Installing, Removing and Upgrading
    Re: Error message (-41110) when launching ItunesFeb 24, 2013 4:10 PM (in response to rene.haller)
    Removing the SC Info folder as per the "Error 3001," "-42110," or "5103" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document seems to help most folks reporting the iTunes launch 42110s: iTunes: Advanced iTunes Store troubleshootin
    I have the question above, bwecause of this annoying problem and the aswear they cave does not solve my problem, the answer is not clear in what to do.....

    Removing the SC Info folder as per the "Error 3001," "-42110," or "5103" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document seems to help most folks reporting the iTunes launch 42110s:
    iTunes: Advanced iTunes Store troubleshooting

  • EVDRE error "encountered problem when retrieving data from webserver"

    Hi,
    in a EVDRE we always get the error "encountered problem when retrieving data from webserver"
    When analysing this further we noticed this is always generated when a base member is selected in the CV and the expansion on the row for this dimension is has one of the following expansion settings:
    DEP
    ALL
    NOEXPAND
    if we select SELF, the error disappears again and the EVDRE works fine again ... is this normal behavior?
    there is no problem with application nor dimension.
    D
    solved it

    Note that the keyword "ALL" does not include the member itself. This may cause some confusion, but as Harish implies, when you select a base member it finds no matches if your memberset is "ALL".
    If you want to design a report to handle the user moving back and forth between base and non-base members in their CV, you either need to include SELF,ALL or SELF,DEP, or something similar....
    OR you need to get a little fancier, and use EVPRO to look and see if the CV member is base -- evpro(app,member,"CALC") -- and then use some conditional logic in Excel to choose the correct expansion options. If Calc=N, use Self, otherwise use SELF,DEP or whatever you choose. This can be a bit tricky if you then want the user to be able to drill down in the report (especially if you want the workbook option to insert add'l rows on the expansion, rather than replace), but it's all possible.

  • Launching applications from an applet

    How do you launch applications from an applet? For example,launch a notepad exceutable when you click on a button (an awt component)?

    Hi,
    you can launch an application from the applet using the Java RunTime environment.
    Runtime.getRuntime().exec(applicationName);
    But to do this the applet needs permissions.It should be a trusted applet.

  • JInitiator 1.1.8.7  Crash when launch it from IE

    We deployed Oracle form to web and required client to download JInitiator
    1.1.8.7 to use web forms. It's working fine for some client machined , but
    others's Jinitiator crash when launch it from Start-->Program-->JInitiator.
    The error is related Jrew.exe. When click web form link from IE, it caused IE
    crash and IE closed without any error message.

    Doh! :8} NermD revived an old thread! :) Forms version is likely Forms 6i or Forms 9i, still it would be good to have the original author indicate these versions. Windows XP came was released in 2002! ;)
    Craig..

  • Launching applications from java code

    I have found a solution to launch applications from java.I thought this will be useful for programmers who want to open a
    1. Browser
    2. Player
    3. Files etc.
    There are 2 solutions :
    I)To use a known application :
    eg: to open windows media player
    String[] cmd = new String[3];
    cmd[0] = "cmd.exe";
    cmd[1] = "/C";
    cmd[2] = "START MPLAYER2.exe "+mediaURL+" /PLAY /CLOSE /FULLSCREEN";
    //eg: mediaURL = "\"D:/project/songs/track1.mp3\""
    // /PLAY /CLOSE /FULLSCREEN this option can be used only for windows media player
    // for any other application use cmd[2] as START apl.exe //apl can be any windows application
    Process p = Runtime.getRuntime().exec(cmd);
    II) To use a default application:
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url);
    // url can be any url
    ref: [http://forums.sun.com/thread.jspa?threadID=5203313|http://forums.sun.com/thread.jspa?threadID=5203313]
    [http://www.ericphelps.com/batch/rundll/|http://www.ericphelps.com/batch/rundll/]
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????
    Edited by: veda_sishta on ? ?????, ???? ??:?? ???????

    To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
    And make up your mind what file type you're having a problem with. Maybe .asx doesn't have a file association on your computer.
    This works just fine for .m3u:import java.awt.Desktop;
    import java.io.File;
    import java.io.IOException;
    public class Playlist {
       public static void main(String[] args) {
          try {
             Desktop.getDesktop().
                   open(new File("E:/Music/Playlists/test.m3u"));
          } catch (IOException ex) {
             ex.printStackTrace();
    }db
    edit Did you try searching the net for the error you got? ("Invalid menu handle")
    Edited by: Darryl.Burke

  • I Pod Touch game Dark Galaxy Freezes when launching application.  Previously worked.

    Recently purchased game Dark Galaxy for I Pod touch, has been played for several days.  Now when launching application will freeze up and unable to completely lauch.

    Try here:
    iOS: Troubleshooting applications purchased from the App Store

Maybe you are looking for