Java.lang.NumberFormatException when sending mails

Gurus,
I am using java mail 1.4 to send mails from my application and the code to do so is
    public void postMail(String recipient, String message) {
        logger.fine("in postMail method..");
        boolean debug = true;
        Properties props = new Properties();
        props.put("mail.transport.protocol", "smtp");
        props.put("mail.smtp.host", ConfigProperty.getProperty("mail.smtp.host"));
        props.put("mail.smtp.auth","true");
        props.put("mail.smtp.port", ConfigProperty.getProperty("mail.smtp.port"));
        props.put("mail.smtp.from", ConfigProperty.getProperty("mail.from"));
        Session session = Session.getDefaultInstance(props, null);
        session.setDebug(debug);
        Message msg = new MimeMessage(session);
        try {
            String from = ConfigProperty.getProperty("mail.from").trim();
            InternetAddress addressFrom = new InternetAddress(from);
            msg.setFrom(addressFrom);
            InternetAddress addressTo = new InternetAddress(recipient);
            msg.addRecipient(Message.RecipientType.TO, addressTo);
            msg.setSubject(ConfigProperty.getProperty("mail.subject"));
            msg.setContent(message, "text/plain");
            logger.info("Sending mail now...............................");
            Transport trans = session.getTransport("smtp");
            trans.connect("casarray.arg.ae",username,password);
            trans.send(msg);
        } catch (Exception e) {
            e.printStackTrace();
    }However i am getting the strange error when sending mails. My email is is very simple [email protected]
Please help me understand the issue here
java.lang.NumberFormatException: For input string: ""
     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
     at java.lang.Integer.parseInt(Integer.java:470)
     at java.lang.Integer.parseInt(Integer.java:499)
     at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:398)
     at javax.mail.Service.connect(Service.java:288)
     at javax.mail.Service.connect(Service.java:169)
     at com.roadMiles.view.util.EmailNotification.postMail(EmailNotification.java:54)
     at com.roadMiles.view.unsecure.page.bean.LoginPageBean.forgotPassword(LoginPageBean.java:180)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.el.parser.AstValue.invoke(Unknown Source)
     at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
     at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
     at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
     at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
     at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
     at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
     at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
     at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:788)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:306)
     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:186)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
     at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
     at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
     at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
     at java.security.AccessController.doPrivileged(Native Method)
     at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
     at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
     at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
     at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
     at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

The error message is telling you exactly what's wrong:
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:470)
at java.lang.Integer.parseInt(Integer.java:499)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:398)
at javax.mail.Service.connect(Service.java:288)
at javax.mail.Service.connect(Service.java:169)
at com.roadMiles.view.util.EmailNotification.postMail(EmailNotification.java:54)At line 54 of EmailNotification.java (which I assume is your class), you're calling connect(), but that fails, because, deeper down, it's trying to parse the empty String ("") as a number. So don't pass the empty String to connect(); pass a valid number instead.

Similar Messages

  • Getting java.lang.SecurityException while sending mail

    While i trying to send mail through web browser i am getting following error.But by calling same function in main method of my Mailer.java class its successful. Will anybody suggest me what am i miss .I m using Tomcat & i already put activation.jar and mail.jar in classpath.
    "java.lang.SecurityException: class "javax.mail.Address";'s signer information does not match signer information of other classes in the same package"
    Regards
    Riaz
    Edited by: Riaz_Ansari on May 2, 2008 12:44 AM

    You've probably got more than one version of the javax.mail.* classes in your CLASSPATH.
    Look for multiple copies of mail.jar, or perhaps a j2ee.jar or javaee.jar that duplicates those
    classes.

  • Java.lang.NumberFormatException When I type "Exit"

    import java.util.Scanner;
    public class ItemsQ2 {
    public static void main(String[] args) {
    String item = null;
    int Iprice = 0;
    int total_bill = 0;
    do {
    System.out.print("Enter Item: ");
    Scanner Sitem = new Scanner(System.in);
    item = Sitem.nextLine();
    String test= item.replaceAll("\\D","");
    Iprice = Integer.parseInt(test);
    total_bill = Iprice + total_bill;
    // System.out.print(test);
    System.out.print("Your total bill is: " +total_bill);
    } while (!item.equalsIgnoreCase("Exit"));
    System.out.print("Your total bill is: " +total_bill);
    }

    To fix this problem, you can check if the input string is "Exit" before you try to convert it to an integer. If so, exit gracefully at that point(echo to the user something like 'program finished successfully' first). You may also want to wrap the line that converts the input to an integer in a try/catch block. In the catch block, exit gracefully (echo to the user 'illegal character entered').

  • "java.lang.NumberFormatException" error while running custom BIP report

    Hi,
    When we are running a custom BIP report, it is completing in ERROR at times and running Succesfully at times for the same set of parameters.
    Please let us know the solution if any one faced similar kind of an issue.
    Below is the log file when the program errors out:
    Calling XDO Data Engine...
    java.lang.NumberFormatException: For input string: "000</UIN><ACC>726030</ACC><ACC_N>Express Services - Mail and Courier</ACC_N><S_ACC_N>00000</S_ACC_N><S_ACC_NA>Default - Sub Account</S_ACC_NA><I_CO>000</I_CO><PROD>Term Life - GBL - Allocation Ind NQ NP BCLIC Direct</PROD><BAL>1126.47</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3123</R_ID>ACC_N><S_ACC_NA>Default - Sub Account</S_ACC_NA><I_CO>000</I_CO><PROD>Annuities Dep Type - Allocation Ind NQ NP OCB</PROD><BAL>13.5</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3124</R_ID>N><ACC>MGMT_ACCT_HIERARCHY</ACC><ACC_N/><S_ACC_N/><S_ACC_NA/><I_CO/><PROD>FPDA - Other Ind Q NP BCLIC Ind Agt</PROD><BAL>176028.27</BAL><A_L>0</A_L><P_ACC/><S_F>Y</S_F><R_ID>36</R_ID>_T>>726030</ACC><ACC_N>Express Services - Mail and Courier</ACC_N><S_ACC_N>00000</S_ACC_N><S_ACC_NA>Default - Sub Account</S_ACC_NA><I_CO>000</I_CO><PROD>Annuities Other - Allocation Ind NQ NP NON OCB</PROD><BAL>2.58</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3127</R_ID>R_ID>3128</R_ID>S_F><R_ID>41</R_ID>ther - Allocation Ind NQ NP BCLIC Career</PROD><BAL>267.97</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3131</R_ID>areer</PROD><BAL>53.31</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3132</R_ID>o CV Ind NQ NP BCLIC Direct</PROD><BAL>-29963</BAL><A_L>0</A_L><P_ACC/><S_F>Y</S_F><R_ID>46</R_ID>N>Telecommunication/Online Services</ACC_N><S_ACC_N>00000</S_ACC_N><S_ACC_NA>Default - Sub Account</S_ACC_NA><I_CO>000</I_CO><PROD>Term Life - Other - Allocation Grp NQ NP BCLIC Career</PROD><BAL>.06</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3135</R_ID>_ACC_NA><I_CO>000</I_CO><PROD>LTC - Allocation Ind Guar Ren NON OCB</PROD><BAL>22.05</BAL><A_L>9</A_L><P_ACC>GEN_EXP_POSTAGE_S</P_ACC><S_F>N</S_F><R_ID>3136</R_ID>ROD>Term Life - Other - Allocation Grp NQ NP BCLIC Career</PROD><BAL>1118.96</BAL><A_L>0</A_L><P_ACC/><S_F>Y</S_F><R_ID>51</R_ID>S_ACC_N>00000</S_ACC_N><S_ACC_NA>Default - Sub Account</S_ACC_NA><I_CO>000</I_CO><PROD>Annuities Other - Allocat"
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:59)
         at java.lang.Integer.parseInt(Integer.java:467)
         at java.lang.Integer.parseInt(Integer.java:508)
         at oracle.apps.xdo.dataengine.ScalableStringList.get(ScalableStringList.java:162)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeRowSetListToStream(XMLPGEN.java:1277)
         at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(XMLPGEN.java:559)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:445)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:308)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:334)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:294)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
    Oracle error 6502: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "APPS.FND_CONCURRENT", line 1331
    ORA-06512: at line 1
    has been detected in FND_CONCURRENT.SET_INTERIM_STATUS.+---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Output file size:
    9662
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 970405 on node UXEBSCMP01 at 29-SEP-2012 21:02:30.
    Post-processing of request 970405 failed at 29-SEP-2012 21:02:30 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 29-SEP-2012 21:02:30
    Thanks.

    If you use parameters you can try playing with them to narrow down the values on which the error occurs. Anyway, need to get the output in XML (without template) and review it. If it's not too huge, post the XML here.

  • SAP_XI_IDOC/IDOCFlatToXmlConvert, java.lang.NumberFormatException

    Hi,
    I am getting the below exception when I tried to convert IDoc Flat File to IDoc XML using the module "SAP_XI_IDOC/IDOCFlatToXmlConvert" in sender File adapter.
    Exception:
    Module Exception 'com.sap.aii.af.idoc.exception.IDOCModuleException' found, cause: java.lang.NumberFormatException: For input string: ""
    I have successfully uploaded and created the IDoc with the same file from WE19 transaction.
    Any idea about this Exception.
    Thanks,
    Krishnaraju.

    Adarsh,
    Is the source system is an SAP system? Could you post the file to check the format of the file. As said in the blog we need to have the format maintained to transform IDoc flat files into XML files.
    Hi Li,
    We have over come the number format exception by placing unique identifier in place of Idoc number and segment relations ships.
    Module is successfully converting the IDoc Flat file with multiple Idocs, we dont have this limitation in this module.
    The limitation is in the format of the source file. The flat file should contain unique identifier in place of IDoc and Parent and child node relation ship should explicitly mentioned in the IDoc flat file. Without these explicit parameters Module is not converting IDoc flat file into IDoc XML.
    Without mentioning these explicit parameters, WE19 trasaction is successfully uploading the Idocs.
    I think Java module is considering the unique relation ship by taking these parameters and ABAP program is reading the file in sequential way and creating the IDocs by breaking the file whenever it encounters EDIDC segment.
    If the source system is not a SAP system, then it would be a problem using this module to convert Falt file into IDoc XML.
    Thanks,
    Krishna.

  • Java.lang.NoSuchMethodError: com.sun.mail.util.SocketFetcher.getSocket

    I am recieving the above error in a FileNet Content Manager environment. The full stack trace is:
    Exception in thread "main" java.lang.NoSuchMethodError: com.sun.mail.util.SocketFetcher.getSocket(Ljava/lang/String;ILjava/util/Properties;Ljava/lang/String;Z)Ljava/net/Socket;
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1195)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:322)
    at javax.mail.Service.connect(Service.java:233)
    at javax.mail.Service.connect(Service.java:134)
    at javax.mail.Service.connect(Service.java:86)
    at javax.mail.Transport.send0(Transport.java:162)
    at javax.mail.Transport.send(Transport.java:80)
    at com.bearingpoint.utilities.EMail.send(EMail.java:171)
    at com.bearingpoint.utilities.EMail.send(EMail.java:31)
    at email.main(email.java:11)
    I have spent many hours, fiddling with classpaths, ensuring that the mail.jar, mailapi.jar, smtp.jar, activation.jar are all from the same generation of JavaMail. With my classpath set correctly I can run a simple program constructed to just test whether the box can send out email from the command line.
    The code for the program is:
    public class email {
         public email() {
         public static void main (String args[]) {
              try {
              EMail.send("10.132.147.62", "[email protected]", "[email protected]", "test", "test");
              catch (Exception e) {
                   System.err.println(e.toString());
    Where EMail.send() is:
    public static void send(
    String mail_server_host,
    String email_from,
    String email_to,
    String subject,
    String message) throws AddressException, MessagingException, IOException {
    send(mail_server_host,
    (Authenticator)null,
    new InternetAddress[] {new InternetAddress(email_from)},
    new InternetAddress[] {new InternetAddress(email_to)},
    (InternetAddress[])null,
    (InternetAddress[])null,
    subject,
    message,
    null,
    null);
    which calls:
    public static void send(
    String mail_server_host,
    Authenticator authenticator,
    InternetAddress[] addresses_from,
    InternetAddress[] addresses_to,
    InternetAddress[] addresses_cc,
    InternetAddress[] addresses_bcc,
    String subject,
    String message,
    InputStream[] attachments,
    MimeType[] attachmentTypes) throws MessagingException,IOException {
    Properties properties = new Properties();
    properties.put("mail.smtp.host", mail_server_host);
    MimeMessage msg = new MimeMessage(
    Session.getInstance(properties, authenticator));
    msg.addFrom(addresses_from);
    msg.setRecipients(Message.RecipientType.TO, addresses_to);
    msg.setRecipients(Message.RecipientType.CC, addresses_cc);
    msg.setRecipients(Message.RecipientType.BCC, addresses_bcc);
    msg.setSubject(subject);
    BodyPart bpBody = new MimeBodyPart();
    bpBody.setText(message);
    Multipart mpMessageBody = new MimeMultipart();
    if (attachments == null && attachmentTypes == null) {
    mpMessageBody.addBodyPart(bpBody);
    msg.setContent(mpMessageBody);
    else if (attachments == null) {
    bpBody.setContent(message, attachmentTypes[0].toString());
    mpMessageBody.addBodyPart(bpBody);
    msg.setContent(mpMessageBody);
    else {
    mpMessageBody.addBodyPart(bpBody);
    for (int i=0; i<attachments.length;i++) {
    bpBody = new MimeBodyPart();
    DataSource dsAttachment = new ByteArrayDataSource(attachments, attachmentTypes[i].toString());
    bpBody.setDataHandler(new DataHandler(dsAttachment));
    bpBody.setFileName("attachment." + new MimeFileExtensions(attachmentTypes[i].getValue()).toString());
    mpMessageBody.addBodyPart(bpBody);
    msg.setContent(mpMessageBody);
    Transport.send(msg);
    As said before all .jar files are of the same generation, yet when I run FileNet and the underlying content engine, and try to send an email, I recieve this exception. I have run out of ideas, and any help would be appreciated.
    Things I've tried (multiple times):
    - Removing any old versions of the jar files and replace them with JavaMail 1.3.3_01
    - Have the content engine specifically import the JavaMail jar files.
    While I realize some of you may not know what FileNet is, perhaps you have come across this exception before. Any new ideas would be more then appreciated.
    Thank you for your time.

    I haven't seen this error before so I need more detail to reproduce it.
    It looks like you daisy chained calls to various static send() methods from various classes. Could you write a static main() for the class with the send() method actually doing the work? In the main() write the test case and compile it, test it and if it still doesnt work post it. Please include the import statements as it is germain to the solution.
    Its much easier for me to help you if I don't have to recreate "FileNet" to reproduce your error.
    As an alternative....
    The following code I got from: http://javaalmanac.com/egs/javax.mail/SendApp.html?l=new
    its simpler than you're code but gets the job done (without attachments).
    I've tested it and it works with:
    javac -classpath .;c:\sun\appserver\lib\j2ee.jar;c:\sun\appserver\lib\mail.jar SendApp.java
    java -classpath .;c:\sun\appserver\lib\j2ee.jar;c:\sun\appserver\lib\mail.jar SendApp
    Ran on Windows XP, Sun J2EE 1.4/Appserver Bundle
        import java.io.*;
        import javax.mail.*;
        import javax.mail.internet.*;
        import javax.activation.*;
        public class SendApp {
            public static void send(String smtpHost, int smtpPort,
                                    String from, String to,
                                    String subject, String content)
                    throws AddressException, MessagingException {
                // Create a mail session
                java.util.Properties props = new java.util.Properties();
                props.put("mail.smtp.host", smtpHost);
                props.put("mail.smtp.port", ""+smtpPort);
                Session session = Session.getDefaultInstance(props, null);
                // Construct the message
                Message msg = new MimeMessage(session);
                msg.setFrom(new InternetAddress(from));
                msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
                msg.setSubject(subject);
                msg.setText(content);
                // Send the message
                Transport.send(msg);
            public static void main(String[] args) throws Exception {
                // Send a test message
                send("10.1.4.105", 25, "[email protected]", "[email protected]",
                     "test", "test message.");
        }

  • Java.lang.NumberFormatException while retriving detail in jsp page

    inside ActionClass(in struts i have )i am taking msgno as a input
    ArrayList arry=new ArrayList();
    Message msg=null;
    Address[] from=null;
    Date date=null;
    Address[] recipients=null;
    String subject=null;
    String contType=null;
    Object msgBody=null;
    BodyBn bbn=null;
    System.out.println("inside bussiness");
    Properties props = new Properties( );
    props.put("mail.debug","true");
    final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
    final String host = "pop.gmail.com";
    final String port="995";
    final String username = "[email protected]";//my mail id
    final String password = "######### "; //my password
    String provider = "pop3";
    props.put("mail.pop3.host",host);
    props.put("mail.pop3.user",username);
    props.put("mail.pop3.port",port);
    props.setProperty( "mail.pop3.socketFactory.port", "995");
    props.setProperty( "mail.pop3.socketFactory.class", SSL_FACTORY);
    props.setProperty("mail.pop3.socketFactory.fallback", "false");
    try {
    Session session = Session.getInstance(props,new javax.mail.Authenticator() {
    protected PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication(username,password);     }
    Store store = session.getStore(provider);
    store.connect(host, username, password);
    boolean b=store.isConnected();
    if(b==true) {
    System.out.println("************conneted to pop server***********");
    Folder inbox = store.getFolder("INBOX");
    if (inbox == null) {
    System.out.println("No INBOX");
    System.exit(1);
    inbox.open(Folder.READ_ONLY);
    msg = inbox.getMessage(msgno);
    from= msg.getFrom();
    date=msg.getSentDate();
    recipients=msg.getAllRecipients();
    subject=msg.getSubject();
    contType= msg.getContentType();
    msgBody=msg.getContent();
    System.out.println("msg is from "+from);
    System.out.println("msg date "+date);
    System.out.println("msg recipients "+recipients);
    System.out.println("msg sub is "+subject);
    System.out.println("msg conttype "+contType);
    System.out.println("msg body is "+msgBody);
    bbn=new BodyBn(from,date,recipients,subject,contType,msgBody);
    System.out.println("----------adding to arry list--------------");
    arry.add(bbn);
    req.setAttribute("msgDetail",arry);
    return mapping.findForward("success");
    }catch(Exception e) {
    System.out.println("Exception***********");
    ------------------------------in jsp page i m retriving all data--------------------------------
    <body>
    <logic:present name="msgDetail">
    <table>
    <tr>
    <td>${msgDetail.from[0]}</td>
    </tr>
    <tr>
    <td>${msgDetail.recipients[0]}</td>
    </tr>
    <tr>
    <td>${msgDetail.subject}</td>
    </tr>
    <tr>
    <td>${msgDetail.contType}</td>
    </tr>
    <tr>
    <td>${msgDetail.msgBody}</td>
    </tr>
    </table>
    </logic:present>
    while printing these data in to console it is showing all data properly
    but when i am trying to access these data from jsp page it is giving me
    Following exception
    java.lang.NumberFormatException: For input string: "from"
         java.lang.NumberFormatException.forInputString(Unknown Source)
         java.lang.Integer.parseInt(Unknown Source)
         java.lang.Integer.parseInt(Unknown Source)
         javax.el.ListELResolver.coerce(ListELResolver.java:166)
         javax.el.ListELResolver.getValue(ListELResolver.java:51)
         javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
    Plz help for this problem

    This problem doesn't seem to have anything to do with JavaMail.
    You'll probably have better luck in a Struts or JSP forum.

  • Java.lang.NumberFormatException: For input string: "DESCRIPTION="

    Colleagues,
    eBis 11.5.10.2.
    I'm getting a Warning in the concurrent manager when I submit a programme that has an attached xml template. The warning is stating: -
    ------------- 1) PUBLISH -------------
    Beginning post-processing of request 2667735 on node BAMBI at 02-SEP-2011 17:32:56.
    Post-processing of request 2667735 failed at 02-SEP-2011 17:32:57 with the error message:
    One or more post-processing actions failed. Consult the OPP service log for details.
    ------------- 2) PRINT   -------------
    Not printing the output of this request because post-processing failed.
    When I consult the OPP log in Sysadmin, I can see a not very helpful message: -
    [9/2/11 5:32:57 PM] [UNEXPECTED] [36822:RT2667735] java.lang.NumberFormatException: For input string: "DESCRIPTION="
         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
         at java.lang.Integer.parseInt(Integer.java:447)
         at java.lang.Integer.parseInt(Integer.java:497)
         at oracle.apps.xdo.generator.pdf.PDFGenerator.setFont(PDFGenerator.java:629)
         at oracle.apps.xdo.generator.pdf.PDFGenerator.setProperties(PDFGenerator.java:468)
         at oracle.apps.xdo.generator.ProxyGenerator.setProperties(ProxyGenerator.java:1373)
         at oracle.apps.xdo.template.fo.FOHandler.startElement(FOHandler.java:262)
         at oracle.apps.xdo.template.fo.FOHandler.startElement(FOHandler.java:204)
         at oracle.apps.xdo.common.xml.XSLTMerger.startElement(XSLTMerger.java:55)
         at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:167)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1182)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:149)
         at oracle.apps.xdo.template.fo.FOProcessingEngine.process(FOProcessingEngine.java:320)
         at oracle.apps.xdo.template.FOProcessor.generate(FOProcessor.java:1051)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.runProcessTemplate(TemplateHelper.java:5926)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3458)
         at oracle.apps.xdo.oa.schema.server.TemplateHelper.processTemplate(TemplateHelper.java:3547)
         at oracle.apps.fnd.cp.opp.XMLPublisherProcessor.process(XMLPublisherProcessor.java:290)
         at oracle.apps.fnd.cp.opp.OPPRequestThread.run(OPPRequestThread.java:157)
    [9/2/11 5:32:57 PM] [36822:RT2667735] Completed post-processing actions for request 2667735.
    Now, this isn't programme specific as it's affecting all our BI Publisher reports. Also the specific report I am working on has the option to email. I'm finding that the emails still work and when I open the attachment, they are displaying in PDF format correctly - even though the concurrent manager completes with the above warning. The above warning doesn't let me view the output in PDF from Oracle Financials.
    Any help would be greatly appreciated.
    Thanks

    Maybe check if Metalink note 764180.1 applies? This appears to be a bug fixed with patch 7669965.

  • Exception in thread "main" java.lang.NumberFormatException:For input String

    this is a code about arrylist. but when I debug it.it metion:Exception in thread "main" java.lang.NumberFormatException:For input String at java.lang.NumberFormatException.forInputString(numberFomatExceptionio java:48)
    at java.lang.Integer.parseInt(integer.java:468)
    at java.lang.Integer.parseInt(integer.java:497)
    at Get.getInt(manerger.java:208)
    at LinkList.insertFirst(manager.java:94)
    at manager.main(manager.java;20)
    this is my code:
    import java.io.*;
    import java.lang.*;
    public class manager
         public static void main(String args[]) throws IOException
         LinkList list=new LinkList();
         System.out.println("input S can scan the grade\ninput D can delete one entry\ninput U can update the entry\ninput A can add one entry\ninput E can end");
         int cr=System.in.read();
    switch(cr)
         case 'A':
         list.insertFirst();break;//this is 20 row
         case 'S':
         System.out.println("input the s");break;
         case 'D':
         System.out.println("input the d");break;
         case 'U':
         System.out.println("input the u");break;
    class Link
    public int number;
    public String name=new String();
    public int chs;
    public int eng;
    public int math;
    public Link next;
    public Link(int number,String name, int chs,int eng,int math)
    this.number=number;
    this.name=name;
    this.chs=chs;
    this.eng=eng;
    this.math=math;
    public Link()
         this(0,"",0,0,0);
    public void displayLink()
    System.out.println(number + " "+name+ " "+chs+ " "+eng+ " "+math+ " ");
    class LinkList
    public Link first;
    public LinkList()
    first = null;
    public boolean isEmpty()
    return first==null;
    public void displayList()
         System.out.println("");
         Link current=first;
         while(current!=null)
              current.displayLink();
              current=current.next;
         System.out.println("");
    public Link insertFirst() throws IOException
         Get getdata=new Get();
         int number=getdata.getInt();//this is 94 row
         String name=getdata.getString();
         int chs=getdata.getInt();
         int eng=getdata.getInt();
         int math=getdata.getInt();
         Link newLink = new Link(number,name,chs,eng,math);
         first=newLink;
         return first;
    public Link find(int key)
         Link current=first;
         while(current.number!=key)
              if(current.next==null)
              return null;
              else
              current=current.next;
         return current;
    public Link update(int key) throws IOException
         Link current=first;
         while(current.number!=key)
         if(current.next==null)
         return null;
         else
              System.out.println("Input the first letter of the subject:");
         int c=System.in.read();
         Get get=new Get();
              switch(c)
                   case 'c':
                   current.chs=get.getInt();break;
                   case 'e':
                   current.eng=get.getInt();break;
                   case 'm':
                   current.math=get.getInt();break;
         return current;
    public float average(char key)
         Link current=first;
         float total=0;
         float average=0;
         float counter=0;
         if(current==null)
         return 0;
         while(current!=null)
              switch(key)
                   case 'c':
                   total=current.chs+current.next.chs;break;
                   case 'e':
                   total=current.eng+current.next.eng;break;
                   case 'm':
                   total=current.math+current.next.math;break;
              current=current.next.next;
              counter++;
         average=total/counter;
         return average;
    public Link delete(int key)
         Link current=first;
         Link previous=first;
         while(current.number!=key)
              if(current.next==null)
              return null;
              else
                   previous=current;
                   current=current.next;
              if(current==first)
              first=first.next;
              else
              previous.next=current.next;
              return current;
    class Get
    public static String getString() throws IOException
    System.out.println("Input your name:");
    InputStreamReader str = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(str);
    String s = br.readLine();
    return s;
    public static int getInt() throws IOException
    System.out.println("Input your data:");
    String st = getString();
    return Integer.parseInt(st);//this is 208 row
    }

    It may be that the code in getString() returns a
    String that ends with a newline. If that is the
    problem, you can use
    return (Integer.parseInt(st)).trim();1. getString will never return a String ending in newline. BufferedReader.readLine strips off the newline.
    2. Even if you had a newline, String.trim doesn't trim newlines.
    3. You would need to trim the String, not the int:
    return (Integer.parseInt(st.trim()));As JimDinosaur said, you are passing bad data (the value of "st").
    In getInt, add this before trying to parse "st":
    System.out.println("###"+st+"###");What does it print?

  • Getting java.lang.NumberFormatException: For input string: "63420;https=127.0.0.1" Error while creating bpel service in oracle soa suite12c

    Hi ,
    I am getting below error when I try to create a bpel project in oracle soa suite 12C, can any one help on this issue why it is happing, earlier am able to create bpel service.
    java.lang.NumberFormatException: For input string: "63420;https=127.0.0.1"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.parseInt(Integer.java:527)
    at oracle.jdeveloper.webservices.wsdl.CachedWSDLReader.getNewReaderInstance(CachedWSDLReader.java:379)
    at oracle.jdeveloper.webservices.wsdl.CachedWSDLReader$1.initialValue(CachedWSDLReader.java:299)
    at oracle.jdeveloper.webservices.wsdl.CachedWSDLReader$1.initialValue(CachedWSDLReader.java:295)
    at java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:160)
    at java.lang.ThreadLocal.get(ThreadLocal.java:150)
    at oracle.jdeveloper.webservices.wsdl.CachedWSDLReader.getReaderImpl(CachedWSDLReader.java:309)
    at oracle.jdeveloper.webservices.wsdl.CachedWSDLReader.getExtensionRegistry(CachedWSDLReader.java:425)
    at oracle.jdeveloper.webservices.wsdl.CachedWSDLReader.readWSDLWithExtensionRegistry(CachedWSDLReader.java:468)
    at oracle.tip.tools.ide.utils.xml.wsdl.WSDLUtil.parseWSDL(WSDLUtil.java:1398)
    at oracle.tip.tools.ide.bpel.v2.datamodels.util.TemplateUtil.createProcessWSDL(TemplateUtil.java:1208)
    at oracle.tip.tools.ide.bpel.v2.designer.builder.model.ProcessBuilderUtil.createWSDLFiles(ProcessBuilderUtil.java:198)
    at oracle.tip.tools.ide.bpel.v2.designer.builder.model.ProcessBuilder.createIDEProject(ProcessBuilder.java:73)
    at oracle.tip.tools.ide.bpel.v2.designer.builder.ui.CreationDialogPanel.doCreate(CreationDialogPanel.java:57)
    at oracle.tip.tools.ide.bpel.shared.designer.processbuilder.ui.BPELCreationDialog.handleOK(BPELCreationDialog.java:199)
    at oracle.tip.tools.ide.bpel.shared.designer.processbuilder.ui.BPELCreationDialog.actionPerformed(BPELCreationDialog.java:239)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
    at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
    at java.awt.Dialog.show(Dialog.java:1082)
    at java.awt.Component.show(Component.java:1655)
    at java.awt.Component.setVisible(Component.java:1607)
    at java.awt.Window.setVisible(Window.java:1014)
    at java.awt.Dialog.setVisible(Dialog.java:1005)
    at oracle.tip.tools.ide.bpel.shared.designer.processbuilder.ui.BPELCreationDialog.display(BPELCreationDialog.java:83)
    at oracle.tip.tools.ide.bpel.shared.designer.manager.BPELDesignerManager.launchCreationDialog(BPELDesignerManager.java:53)
    at oracle.tip.tools.ide.bpel.shared.designer.manager.BPELDesignerManager.launchCreationDialog(BPELDesignerManager.java:48)
    at oracle.tip.tools.ide.bpel.shared.plugins.soa.sca.BPELComponent.createImplementation(BPELComponent.java:46)
    at oracle.tip.tools.ide.fabric.gui.controller.ActionComponentEdit.add(ActionComponentEdit.java:118)
    at oracle.tip.tools.ide.fabric.gui.controller.ActionComponentEdit.process(ActionComponentEdit.java:95)
    at oracle.tip.tools.ide.fabric.gui.controller.DiagramController.processActionRequest(DiagramController.java:358)
    at oracle.tip.tools.ide.fabric.gui.controls.DiagramSOAPopupHandler.actionPerformed(DiagramSOAPopupHandler.java:117)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3320)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:694)
    at java.awt.EventQueue$3.run(EventQueue.java:692)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:708)
    at java.awt.EventQueue$4.run(EventQueue.java:706)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
    at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
    at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    Thanks in advance.
    Cheers,
    bala

    Please paste composite.xml and bpel source file here. Looks like one of the endpoints is getting goofed up.

  • Java.lang.NoSuchMethodException: com.sun.mail.imap.IMAPStore.

    All:
    I have completed the following:
    1. Downloaded the JavaMail 1.4.2 API.
    2. From this downloaded API I had extracted the mail.jar file (timestamp 2009-02-26 13:28) to my C:\Program Files\Tomcat 6.0\lib directory
    3. Downloaded the jaf-1_0_2-upd2 API
    4. From this downloaded API I had extracted the activation.jar file (timestamped 2005-05-07 21:14) also to my C:\Program Files\Tomcat 6.0\lib directory.
    In Eclipse I have created a simple JSP page that calls a POJO that is to read a particular email box using IMAP. In this POJO I have code to set up the Properties, Session and Store objects as such:
    Line 1 Properties properties = System.getProperties();
    Line 2 properties.put("mail.from", "[email protected]");
    Line 3 properties.put("mail.debug","true");
    Line 4 session = Session.getDefaultInstance(properties, null);
    Line 5 session.setDebug(debug);
    Line 6 printData("About to get store object...");
    Line 7 store = session.getStore("imap");
    In eclispe, I click "Debug on Server" and Tomcat starts, begins to display my JSP and then I am dropped on the line of code in my POJO where I set a breakpoint (Line 1). Now I single step through the code. The code throws the following execption when it executes line 7 of the above code :
    (Line 6 ==>) About to get store object...
    DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
    java.lang.NoSuchMethodException: com.sun.mail.imap.IMAPStore.<init>(javax.mail.Session, javax.mail.URLName)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.getConstructor(Unknown Source)
         at javax.mail.Session.getService(Session.java:782)
         at javax.mail.Session.getStore(Session.java:574)
         at javax.mail.Session.getStore(Session.java:536)
         at javax.mail.Session.getStore(Session.java:515)
         at emailTest.readEmails.processMail(readEmails.java:62)
         at emailTest.readEmails.<init>(readEmails.java:24)
         at org.apache.jsp.emailTest_jsp._jspService(emailTest_jsp.java:94)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    There are no jar files defined in my project's classpath. The only jar file found in the project is in the WEB-INF\lib folder wherein I have a jndi.jar (timstamp 5/5/2009 8:10AM) file.
    I put the activation.jar file and the mail.jar file in my Tomcat.6\lib folder according item 4 of the JavaMail Sessions section of the Apache Tomcat JNDI Resources HOW_TO found here: http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html
    Can anybody please tell me what I need to do to get around this error? Do I perhaps have the wrong versions of one or more jar files?
    FYI: I have also put these same two jar files in my projects classpath and still recevied the same exception. Because I am invoking a POJO from a JSP should these jar files be in my projects classpath in addition to the tomcat\lib directory, or should they only be in the projects' classpath?
    Thanks to all for your time in responding.
    Gary

    bshannon:
    Thank you for your resonse. Your response got me to thinking that my instance of Ecliplse that I had had running yesterday was behaving a little strangely so this morning I closed everything I had running on my workstation and closed down the machine and rebooted. When I finally opend up Eclipse again and ran my JSP program calling my POJO, the code no longer threw the exception. Apparently Eclipse can have its tempermental moments.
    Also, let it be known that while everything is working for me now, I performed a small experiment. I moved the activiation.jar and mail.jar from my project\WEB-INF\lib folder and put them in the the C:\Program Files\Tomcat 6.0\lib directory. Then, when I ran my program I once again recieved the java.lang.NoSuchMethodException error. When I moved these jar files back from the Tomcat diretory to my project\WEB-INF\lib directory, the program worked just fine.
    Thanks again
    Gary

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • Java.lang.NumberFormatException

    2010-07-02 12:58:35     Error     Could not execute statement for table/stored proc. "sp_PalletBackflushAcknowledge" (structure "Acknowledge") due to java.lang.NumberFormatException: For input string: "393006000111122222"
    2010-07-02 12:58:35     Error     JDBC Message processing failed, due to Error processing request in sax parser: Error when executing statement for table/stored proc. 'sp_PalletBackflushAcknowledge' (structure 'Acknowledge'): java.lang.NumberFormatException: For input string: "393006000111122222"
    2010-07-02 12:58:35     Error     Adapter Framework caught exception: null
    2010-07-02 12:58:35     Error     Delivering the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'sp_PalletBackflushAcknowledge' (structure 'Acknowledge'): java.lang.NumberFormatException: For input string: "393006000111122222".
    2010-07-02 12:58:35     Error     The message status was set to NDLV.
    JDBC RECEIVER
    I the JDBC the field data type is BIGINT.
    IN MESSAGE MAPPING SOURCE DATA TYPE IS INTEGER WHERE WE WILL BE GETTING A 18 DIGIT NUMBER.
    IN TARGET DATA TYPE THE DAtatype is long where we pass the integer to this long.
    and mapping is successful but trying to sent the respoinse back it gives the error as above
    can you please

    Hi PBS,
    It seems bigint datatype is not there in Oracle. Can you please check that. I have seen the data types in oracle and I didn't find it.
    http://ss64.com/ora/syntax-datatypes.html
    If you can convert that into number or long that would be good. It can handle your requirement.
    Regards,
    ---Satish

  • In java.lang.NumberFormatException

    Hello,
    my code can compile, but when I try to create an new TempEntry (String info), in java.lang.NumberFormatException keeps appearing by the time I get to my first integer.
    * Constructor for objects of class TempEntry
    public TempEntry(String info)
    info = info.trim();
    String[] parts= info.split(",");
    month= Integer.parseInt(parts[1]);
    day= Integer.parseInt(parts[2]);
    year= Integer.parseInt(parts[3]);
    average= Double.parseDouble(parts[4]);
    high= Double.parseDouble(parts[5]);
    low= Double.parseDouble(parts[6]);
    }

    Obviously it is because of the , where the formatter was expecting a .
    Run select * from nls_session_parameters; and verify that everything is set correctly in the database.
    I think this may be the one tripping you up. Are your numbers displaying as 50.2 or 50,2 in the data grid?
    Here is my nls setup and it works for me, of course I am in america so...
    NLS_NUMERIC_CHARACTERS     .,
    I also saw a post that stated that the number format may be coming from the JVM and therefore your computer's setup.
    What version of oracle are you using?
    Here is another post that may help:
    java.lang.NumberFormatException from OracleXMLSave.insertXML
    Eric

  • Application Start Fails with java.lang.NumberFormatException: null

    Hi All,
    I am new to Weblogic.
    I am facing issue in starting application in weblogic. I have weblogic 11g(10.3.1.0) installed on windows.
    After deploying my application, when I am starting the application by selecting "Servicing All Requests" I get error message
    java.lang.NumberFormatException: null.
    I have created and tested data sources.
    I checked the server log and based on the log I check the code with the given line number. But that line does not expect any numeric value. It is hardcoded.
    I am not able to make out what else could have caused this issue.
    below is the error stact from log.
    Appreciate your help in resolving this.
    Thanks
    <p>
    weblogic.application.ModuleException: [HTTP:101216]Servlet: "BranchController" failed to preload on startup in Web application: "CCWEB".
    java.lang.ExceptionInInitializerError
         at com.app.ccc.logging.BranchLogger.<init>(BranchLogger.java:77)
         at com.app.infra.controller.BranchController.init(BranchController.java:121)
         at javax.servlet.GenericServlet.init(GenericServlet.java:241)
         at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
         at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
         at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1913)
         at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1887)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1805)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:53)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:143)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.NumberFormatException: null
         at java.lang.Integer.parseInt(Integer.java:415)
         at java.lang.Integer.parseInt(Integer.java:497)
         at com.app.ccc.common.BranchConstants.<clinit>(BranchConstants.java:99)
         ... 46 more
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1376)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:53)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:143)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    java.lang.NumberFormatException: null
         at java.lang.Integer.parseInt(Integer.java:415)
         at java.lang.Integer.parseInt(Integer.java:497)
         at com.app.ccc.common.BranchConstants.<clinit>(BranchConstants.java:99)
         at com.app.ccc.logging.BranchLogger.<init>(BranchLogger.java:77)
         at com.app.infra.controller.BranchController.init(BranchController.java:121)
         at javax.servlet.GenericServlet.init(GenericServlet.java:241)
         at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
         at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
         at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:521)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1913)
         at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1887)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1805)
         at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3041)
         at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1374)
         at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:452)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
         at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
         at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
         at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
         at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:629)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
         at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:206)
         at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:53)
         at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
         at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
         at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
         at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:143)
         at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
         at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
         at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
         at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
         at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    <P>

    You'd have to show us the actual lines of code that are failing. I think it will be clear from that.

Maybe you are looking for