Java Class for mail in oracle

Hi,
I created an Java program to import attachments from a exchange server mailbox using POP3S .It works fine when run as a java application.
But when i put this inside Oracle11g using load java and while executing it gives an error at
Multipart mp = (Multipart) message.getContent();
Error:
Content-Type: multipart/mixed;
boundary="_002_A0C2E09A..................................."
java.lang.ClassCastException
at Newmail.mailPOP3(Newmail:71)
Could someone explain why I am getting this error? What can I do to resolve this error?Any help would be much appreciated.
Regards,
Joseph

Hai Matt,
The actual class i am tested as follows,
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.Part;
import javax.mail.Multipart;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.MimeMessage;
public class Newmail
public Newmail()
super();
public static int mailPOP3(String phost,
String pusername,
String ppassword)
Folder inbox =null;
Store store =null;
int result = 1;
try
String host=phost;
final String username=pusername;
final String password=ppassword;
System.out.println("Authenticator");
Authenticator auth=new Authenticator()
protected PasswordAuthentication getPasswordAuthentication()
return new PasswordAuthentication(username, password);
System.out.println("Certificate");
String filename="D:\\Certi\\jssecacerts";
String password2 = "changeit";
System.setProperty("javax.net.ssl.trustStore",filename);
System.setProperty("javax.net.ssl.trustStorePassword",password2);
Properties props = System.getProperties();
System.out.println("host-----"+props);
props.setProperty("mail.imaps.port", "993");
props.setProperty("mail.imaps.starttls.enable","true");
props.setProperty("mail.imaps.ssl.trust", "*");
Session session = Session.getInstance(props,auth);
session.setDebug(true);
store = session.getStore("imaps");
System.out.println("store------"+store);
store.connect(host,username,password);
System.out.println("Connected...");
inbox = store.getDefaultFolder().getFolder("INBOX");
inbox.open(Folder.READ_ONLY);
Message[] msgs = inbox.getMessages();
System.out.println("msgs.length-----"+msgs.length);
result = 0;
int no_of_messages = msgs.length;
for ( int i=0; i < no_of_messages; i++)
System.out.println("msgs.count-----"+i);
System.out.println("Attachment....>"+msgs.getContentType());
// Casting message to multipart
*Multipart mp = (Multipart)msgs[i].getContent();* System.out.println("Casting Success" + mp.getContentType());
catch(Exception e)
e.printStackTrace();
finally
try
if(inbox!=null)
inbox.close(false);
if(store!=null)
store.close();
return result;
catch(Exception e)
e.printStackTrace();
return result;
In this class when running from oracle using a procedure "Multipart mp = (Multipart)msgs[i].getContent();" throws exception..
Error:
Content-Type: multipart/mixed;
boundary="_002_A0C2E09A..................................."
java.lang.ClassCastException
at Newmail.mailPOP3(Newmail:71)
Thanks & Regards
Joseph

Similar Messages

  • InterMedia Java Classes for Servlets and JSPs and Netscape

    I am using the interMedia Java Classes for Servlets and JSPs to upload and retrieve multimedia data. I have found that it is much more performant in Internet Explorer (5.5) than in Netscape Communicator (4.7). In fact, I cannot upload images larger than 10K at all using netscape. However, the same image can be uploaded into the same application using IE. Is this a known issue?
    Thanks in advance.

    Hi,
    We have successfully uploaded multimedia data in the giga-byte range (Quicktime and AVI files) at the same speed with both the Netscape (4.7n) and MS IE (4.n and 5.n) browsers. One thing we have noticed is that its very important to set the manual proxy settings correctly if you have an environment with a proxy server. If you don't, then uploads can go via the proxy server and, for some reason, that seems to take considerably longer. For example, suppose you are in the www.xyzco.com domain and are connecting to a host named webserver.www.xyzco.com, then specify webserver and webserver.www.xyzco.com (to cover both cases) in the "Do not use proxy servers for..." box in the manual proxy server configuration screen. Also, if you're using a tool such as JDeveloper that uses the host IP address in the debugger environment, then you also need to add the numeric-based (nnn.nnn.nnn.nnn) IP address to this list.
    Hope this helps.
    In order to better understand the variety of ways in which our customers are using interMedia, we'd be very interested in knowing a little more about your application, the interMedia functionality that you are using, and how you are developing and deploying your application. If you are able to help us, please send a short email message with some information about your application, together with any comments you may have, to the Oracle interMedia Product Manager, Joe Mauro, at [email protected] Thank you!
    Regards,
    Simon
    null

  • Simple java class for SQL like table?

    Dear Experts,
    I'm hoping that the java people here at the Oracle forums will be able to help me.
    I've worked with Oracle and SQL since the 90s.
    Lately, I'm learning java and doing a little project in my spare time. 
    It's stand alone on the desktop.
    The program does not connect to any database 
    (and a database is not an option).
    Currently, I'm working on a module for AI and decision making.
    I like the idea of a table in memory.
    Table/data structure with Row and columns.
    And the functionality of:
    Select, insert, update, delete.
    I've been looking at the AbstractTableModel.
    Some of the best examples I've found online (they actually compile and work) are:
    http://www.java2s.com/Code/Java/Swing-JFC/extendsAbstractTableModeltocreatecustommodel.htm
    http://tutiez.com/simple-jtable-example-using-abstracttablemodel.html
    Although they are rather confusing.
    In all the examples I find, there always seems to be
    at least three layers of objects:
    Data object (full of get/set methods)
    AbstractTableModel
    GUI (JFrame, JTable) (GUI aspect I don't need or want)
    In all the cases I've seen online, I have yet to see an example
    that has the equivalent of Delete or Insert.
    Just like in SQL, I want to define a table with columns.
    Insert some rows. Update. Select. Delete.
    Question:
    Is there a better java class to work with?
    Better, in terms of simpler.
    And, being able to do all the basic SQL like functions.
    Thanks a lot!

    Hi Timo,
    Thanks. yes I had gone thru the java doc already and  they have mentioned to use java.sql.Struct, but the code which got generated calls constructor of oracle.jpub.runtime.MutableStruct where it expects oracle.sql.STRUCT and not the java.sql.STRUCT and no other constructor available to call the new implementation and that is the reason i sought for some clues.
      protected ORAData create(CmnAxnRecT o, Datum d, int sqlType) throws SQLException
        if (d == null) return null;
        if (o == null) o = new CmnAxnRecT();
        o._struct = new MutableStruct((STRUCT) d, _sqlType, _factory);
        return o;
    here CmnAxnRecT is the class name of the generated java class for sqlType.
    Thanks again. Please let me know if you have any more clues.
    Regards,
    Vinothgan AS

  • The java class is not found:  oracle.apex.APEXExport

    Hi,
    when i run java oracle.apex.APEXExport
    i have the error
    The java class is not found: oracle.apex.APEXExport
    CLASSPATH=/opt/ora/admin/Apex_Backup/class/classes12.zip:/opt/ora/admin/Apex_Backup/APEXExport.class
    also
    CLASSPATH=/opt/ora/admin/Apex_Backup/class/classes12.zip
    causes the error
    Can somebody help he out of this?

    Hello,
    Take a look at my blog post on Backing Up Your Applications, available here -
    http://jes.blogs.shellprompt.net/2006/12/12/backing-up-your-applications/
    I run through all the steps you need to do to get it working.
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Java Class to connect to oracle

    Hi all,
    I am a new in Java in database...
    I have written a java class to connect to oracle and to get some information from the databse. In the class i use the driver oracle.jdbc.driver.OracleDriver.
    When I exeute the code in JDeveloper it works fine.
    I have loaded the classes to database (10gR2), have written the wrapper function. That all was compilled without errors.
    But when I execute the wrapper function I get in SQL*Plus my custom Error-Message from Java Code "Not able to connect to oracle".
    The oracle driver classes are owned by sys. Should SYS grant to the user any special rights with dbms_java.grant_permission?
    Or is it any other way to connect to the database, in which the java classes are loaded? The user is connected with SQL*Plus. The Java Classes are owned by the user. Should I use JDBC to connect to the same database?
    Best regards,

    Hi
    You don't need to re-connect... Have a look here...
    http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/ssid.htm#i1024903
    HTH
    Chris

  • JAXB to generate java classes for XSD.

    Hi
    I have a XSD, which is importing other couple of xsds in it, tried to generate java classes using xjc, it is throwing error.
    C:\vittal\Project\received\development-1\da_xsd>xjc -p com daAuthoring.xsd
    parsing a schema...
    [ERROR] Property "Alt" is already defined. Use <jaxb:property> to resolve thi
    s conflict.
      line 42 of file:/C:/vittal/Project/received/development-1/da_xsd/commonElement
    s.xsd
    [ERROR] The following location is relevant to the above error
      line 2205 of file:/C:/vittal/Project/received/development-1/da_xsd/daCommonEle
    ments.xsd
    Failed to parse a schema.Please let me know how to fix this issue.

    Thanks for information,
    I do understand xml well, and having basic knowledge on XSD.
    1. can i generate a java classes for a xsd which is including other XSDs.
    2. how to overwrite the issue, using annotation, point me to a location where i will get more information, that will be great help.
    here is my xsd.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/" xmlns:dctm="http://www.documentum.com" elementFormDefault="qualified">
         <xs:import namespace="http://dita.oasis-open.org/architecture/2005/" schemaLocation="ditaarch.xsd"/>
         <xs:import namespace="http://www.documentum.com" schemaLocation="dctmAttrs.ent.xsd"/>
         <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
         <xs:group name="alt">
              <xs:sequence>
                   <xs:element ref="alt"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="desc">
              <xs:sequence>
                   <xs:element ref="desc"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="title">
              <xs:sequence>
                   <xs:element ref="title"/>
              </xs:sequence>
         </xs:group>
         <!-- Elements in tblDecl.mod -->
         <xs:group name="colspec">
              <xs:sequence>
                   <xs:element ref="colspec"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="entry">
              <xs:sequence>
                   <xs:element ref="entry"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="row">
              <xs:sequence>
                   <xs:element ref="row"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tbody">
              <xs:sequence>
                   <xs:element ref="tbody"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="tgroup">
              <xs:sequence>
                   <xs:element ref="tgroup"/>
              </xs:sequence>
         </xs:group>
         <xs:group name="thead">
              <xs:sequence>
                   <xs:element ref="thead"/>
              </xs:sequence>
         </xs:group>
    </xs:schema>

  • Generic Java class for working with Context Nodes

    Hi,all
    I would like to write generic Java class for working with Context Nodes:
    populating node,
    add element to node,
    update node element,
    remove node element
    Any ideas how can I do it?

    Hi,Armin
    Thanks for your answer.
    I have many nodes with the same structure,but different data.
    I don't want to work with each one of them individually.
    This is the main reason.
    Regards,
    Michael
    Any ideas?

  • The java class is not found:  oracle/aurora/util/Wrapper

    When I try and load my Java class file using 'loadjava' into Oracle I'm getting the error:
    The java class is not found: oracle/aurora/util/Wrapper
    What is causing this?

    On which machine should ORACLE_SID be set to solve this problem, server or client. I run into this error when run loadjava

  • Is there a Java SDK for Siebel Analytics/Oracle BI

    Hi, I want to integrate with Siebel Analytics (now known as Oracle Business Intelligence, right?) to our product. Is there a JAVA SDK for Siebel Analytics/Oracle BI? If so, can anyone point me to the right place to get them. Much appreciated.

    There is currently no JDK or any other API to work with OBI EE (formerly Siebel Analytics).
    The presentation component exposes some functionality via web services.
    You can interact with the BI Server via NQCMD so you could build your own application that executes NQCMDs but this is not well documented other than typing NQCMD ? at the command line.
    The OBI Metadata is captured in a .rpd file which can be manipulated via UDML but this is not supported - do a search on Google for UDML (which is a proprietary format) for some examples on using this. OWB recently rolled out with some integration with OBI - it accomplishes this by manipulating the .rpd file using UDML.
    The Oracle folks monitor this forum. If you can reply with some specifics as to what you want to accomplish, I'm sure they will consider your needs if they decide to publish an API.

  • Extending the oracle java classes for PJCs - Help!

    In developer6 (forms) - I am trying to create my own version of
    certain forms components, without much look.
    I have created an item in forms, ie. Checkbox, in the
    'Implementation Class' field I called my java class.
    My code 'extends VCheckbox' and I have created my own paint()
    mthoed.
    Whilst it does call and run my code there are several problems.
    Mainly being that I cannot change the size the component - I have
    seen the demo source code - and the examples of what I am trying
    to do are less than simple (read: less than useless).
    I dont not want a java bean. The forms help says I should be able
    to extend the above class okay - but doesnt say what limitations
    there are or what functionality there is in the oracle.forms.ui
    classes.
    Has anyone else actually achieved anything other than JavaBean
    components?
    null

    : Have you seen the RolloverButton example ?
    : It is under Forms documentation in TechNet
    : and is quite advanced.
    No, have search Dev6 manuals, can not find this by searching
    Technet either - can you specify (provide URL)?
    I am trying to re-implement the VCheckbox using Smoking/No
    Smoking images. I can create the images, but the toggling action
    does not work when the component size is greater than the
    original subclassed component.
    None of the examples show creating components of sizes that
    differ from the subclass.
    Surely I only need to override paint() method?
    Code fragment:
    import ....
    public class ImageToggler extends VCheckbox {
    // ... does initialisation of images ....
    // ... Images are 32x32 ...
    public void paint( Graphics g ) {
    if ( getState() == true ) {
    g.drawImage( ysSmoke.getImage(), 0, 0,
    ysSmoke.getIconWidth(),
    ysSmoke.getIconHeight(), this );
    } else {
    g.drawImage( noSmoke.getImage(), 0, 0,
    noSmoke.getIconWidth(),
    noSmoke.getIconHeight(), this );
    null

  • OAAM 11g R2: Unable to load java class for custom configurable action

    Need to configure a Configurable Action to get triggered for a particular action at a given checkpoint.
    Steps Followed:
    1. Created a java class implementing com.bharosa.vcrypt.tracker.dynamicactions.intf.DynamicAction, getParameters() and execute() methods were implemented in that java class.
    2. Added necessary jars from $ORACLE_IDM_HOME\oaam\cli\lib to the build classpath.
    3. Compiled and created a jar with it.
    4. Extracted the oracle.oaam.extensions.war file into a working folder.
    5. Added the Custom Jar created in step 3 into <working folder>/WEB-INF/lib/
    6. Changed the following in MANIFEST.MF in <working folder>/META-INF/:
    Specification-Version:11.1.2.0.1
    Implementation-Version:11.1.2.0.1
    7. Rejar-ed the oracle.oaam.extensions.war from the working folder using following command:
    jar -cvfm oracle.oaam.extensions.war <working folder>\META-INF\MANIFEST.MF -C <working folder>/ .
    8. Stopped the oaam_admin_server1, oaam_offline_server1 and oaam_server_server1.
    9. Deleted the oracle.oaam.extensions deployment from the weblogic.
    10. Deployed the newly created oracle.oaam.extensions as a shared library for oaam_admin_server1 and oaam_server_server1.
    11. Started all managed servers.
    But when I tried to create an action template with the java class I just created, it was throwing following error
    +java.lang.ClassNotFoundException: *+
    Unable to load configurable action class *. Ensure the class is made available in the class path.
    Referred following documents:
    1.      http://docs.oracle.com/cd/E27559_01/admin.1112/e27207/cfgactions.htm
    2.     http://docs.oracle.com/cd/E27559_01/dev.1112/e27206/cfg-action.htm
    3.     http://docs.oracle.com/cd/E27559_01/dev.1112/e27206/extend.htm
    Kindly help me. Thanks in advance.
    Edited by: 917717 on Dec 12, 2012 7:16 PM

    This thread is a bit stale but I thought it might help to clarify one point about custom jar files on UCCX.
    To properly load a custom jar:
    Upload it into the classpath directory in the document repository. 
    Select it under System | Custom Classes Configuration
    Finally you need to restart the CCX Engine and the CCX Administration services.  If you have HA you need to restart them on both servers. 
    Other notes:
    When referencing your class in the CCX Editor, use the fully qualified name of the class.  Lots of other classes use things like Element or Document so you need to be explicit. The editor only knows about the 20 native classes by their object names.  If you create a Document object in the editor you are really creating a com.cisco.doc.Document object.  If you loaded jdom.jar and you wanted a jdom document then you need to create an object of type org.jdom.Document.
    When compiling your custom jar files, be sure to compile for the version of Java that the CCX Engine runs.  In general UCCX 7.X and older use Java 1.4.  UCCX 8.X and higher use Java 1.6.  Several of the core Java classes had significant changes between 1.4 and 1.6. If you ran your code on UCCX 7 or earlier and now it fails in UCCX 8.X or higher, recomplile for Java 1.6 and you classes will likely work again.
    Finally, check for security violations in UCCX 8.X or higher.  Cisco has restricted some of the things you can do.  These URL's have more information:
    http://docwiki.cisco.com/wiki/Engine
    http://docwiki.cisco.com/wiki/Troubleshooting_Tips_for_Unified_CCX_8.0
    -Steven
    Please help us make the communities better.  Rate helpful posts!

  • JDeveloper 10g (10.1.3) - classes for use in Oracle 9i Server

    Hello,
    I'm currently using JDeveloper Studio Edition Version 10.1.3.0.4 (SU2) to develop some classes which interact with some of the data in my Oracle 9i database.
    The server is Oracle 9i 9.2.0.5.
    From what I can tell, the JRE on the server is 1.3.1, and according to the JDeveloper about box my "JavaTM Platform" is "1.5.0_05".
    My plan is to load the Java classes onto the server for calling via stored procedure.
    Do I need to require Java 1.5 on the Oracle server for this to work?
    Or do I need to change my "Source" and "Target" versions in the Compiler settings in my JDev project to 1.3?
    I am mostly just using JDBC stuff like
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import java.sql.Statement;
    as well as java.util stuff too, along with oracle.jdbc.OracleDriver for my connection generation.
    Right now I get problems loading my classes onto the server (I'll post more details the next time I can gather them).
    Are there any thoughts on where I should start? In other words - does anyone know if I'm even able to update the version of java on the server, or do must I compile to a different level of Java?
    Or is there something in the Java loading process that can be done to refer to the right java version?
    thanks!
    Mike

    FOLLOW UP:
    OK I decided to change the compiler setting to have a source and target of "1.3".
    When we try to load the java .class files we get a
    ORA-29545 badly formed class
    with no additional information.
    Should I try loading the source directly?
    thanks again
    -Mike

  • Importing Java Classes for Bussiness Logic in Forms6i

    I have created a Java Class with some bussiness logic in it and i m able to impotr it in Forms 6i BUT when it converts my java method into program unit it automatically changes the name of the method with some code ..like method name is "increment" it will make it as "increment_3137" and also one parameter of Ora_java.object type will be added ....WHY is THAT ???and how to work for hat ...even when i m executing the method with the parameter it gives some Exception that Non-Oracle Exception ...and my class individually runs perfectly fine ...CAN U HELP ME ASAP ...Please as its urgent
    Thanx..

    Once you have imported java class files on forms throgh java import class option..
    it creates a pl/sql for the java class that you have imported.
    names for the procedures are assigned by machine code, so dont worry about it..
    for eg. if the name of a method in java class is Increment and after loading java class file the name of ur pl/sql is increment_1254.
    when u call increment_1254 and pass parameter to the procedure ur class incerement will be called and desired operation will be performed.
    ora_java.object is the objec that will be used to access the the class file.
    as java is object oriented it requires a object to execute method of class.
    so u have to initialize the object..
    e.g. increment_1234 (ora_java.object,a,b) is ur procedure
    to call this procedure do the following
    declare
    PASS ORA_JAVA.JOBJECT;
    a,b integer;
    begin
    pass := <classname>.new;     --new will be created if ur class is public or u got public constructor in ur class.
    increment_1234 (pass,a,b) ; -- increment_1234 (ora_java.object,a,b) ;
    end;

  • Customized java class for an external Java function activity

    Hi,
    how can i customize my jdeveloper in order to build my own classes for external Java function activities ?
    because any time i try to build my class the compiler tells me that it doesn't know WFFunctionAPI! And i do not have any idea neither which libraries i have to reference nor where i can find them. i tried to reference the *.jar file from my <ORACLE_HOME>.Wf.Java\Oracle\Apps\Fnd\Wf path, but the compiler still was mocking at me!
    Thanks for your help
         abi

    In the "Project" menu, select "Project Properties";
    In the "Libraries" tab, click the "Add" button;
    Click "New";
    Type "Oracle Workflow" (or any other name) in the Name field;
    In the "Class path" field, click the "..." button;
    Click "Add path" and select <ORACLE_HOME>/wf/java;
    Click "Add ZIP/Jar" and select wfjava.jar and wfapi.jar from the <ORACLE_HOME>/wf/java/oracle/apps/fnd/wf/jar directory.
    Click "Ok" in all those windows and compile your class.
    Regards,
    Daniel Viero - [email protected]
    iProcess Solugues em Tecnologia
    Porto Alegre, RS - Brasil

  • Error while mapping a Java class for a Search Dialog Box component

    Hi,
    Scenario : There is PAR which I have developed for the sorting options for a Search Component set to be used in Km Search Iview.
                   I have copied this PAR from a similiar search functionality and customised the same.
    Problem: When I deploy the PAR and then map this class for the sort options while creating a New Search Dialog box :
    I get the following "Class not found error" ... Please can you let me know what could be the problem.
    Any help would be appreciated here as I have tried all the possibilities to solve the problem.
    Regards,
    Vaishali.

    I modified the xml file as described in the forum.But the error persists.
    One interesting thing is:
    When I create model after restarting the NDS,I get the following error:
    org.eclipse.swt.SWTException: Failed to execute runnable <i>(java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library librfc. Found version "620.0.1237" but required at least version "620.0.1374".)</i>
    I get the NoClassDef found error next time onwards,
    Where do I get the 620.0.1374 version of librfc?
    thanx.
    Bhupesh

Maybe you are looking for

  • Query Updation recovery in Oracle

    Is there any way I can track changes made to the database timewise. I modified a column value from front end by mistake. It actually toggles the column value in the table from 'Y' to 'N' or vice versa upon clicking it. Im not sure how many times I to

  • Fire wire ports?

    I have an external drive conected to my powerbook G4 via firewire 400 but need to conect a deck also to capture video. problem is i only have 1 firewire 400 port, is htere a way of conecting the 2 divices together( without using the firewire 800) ?

  • Moving to Sky but can I still use my BT internet e...

    Been with BT internet for years but am moving to Sky. Will I still be able to use my @btinternet.com e mail  address after I have left? I did go to aol years ago but came back. In the time I was away I was still able to use my @btinternet.com email.

  • Broken DC ESS, MSS & PCUI

    Hello all, I am having some troubles with NWDI, when I import the SCA I got that many DC are broken, must of this broken DC are consecuence of prior DC. I fopund out one of the main DC an the build log shows: "sap.com/pcui_gp/xsscfg" (variant "defaul

  • Laserwirter 4/600 PS

    Hi I have an old Laser Writer 4/600 PS printer and an Apple iBook with MacOS 9.1. I need to connect this printer to the iBook.The printer has only a LocalTalk Port and i am not able to connect the printer to the iBook, since the iBook doesnt have the