Sendig Emails by using JSP occours an error

Hi,
I'm using the following jsp-script:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>JSP</title></head> <body>
<%@ page import="java.util.*,javax.mail.*,javax.mail.internet.*" %>
<%
  boolean write=true;
  String missingData="";
  String sep2=".";
  String sep3=":";
  String linesep=System.getProperty("line.separator");
  String name=request.getParameter("nachname");
  String mail=request.getParameter("mail");
  String kommentar=request.getParameter("kommentar");
  if(name.length()==0) {
    out.println("<b>Bitte den Namen eingeben</b><br>");
    write=false;
    missingData=missingData+"Nachname<br>";
  if(mail.length()==0) {
    out.println("<b>Bitte die Mail-Adresse eingeben</b><br>");
    write=false;
    missingData=missingData+"E-Mail<br>";
  if(kommentar.length()==0) {
    out.println("<b>Bitte einen Kommentar eingeben</b><br>");
    write=false;
    missingData=missingData+"Kommentar<br>";
if(write) {
    GregorianCalendar cal=new GregorianCalendar();
    int day=cal.get(Calendar.DATE);
    int month=cal.get(Calendar.MONTH)+1;
    int year=cal.get(Calendar.YEAR);
    int hour=cal.get(Calendar.HOUR_OF_DAY);
    int minute=cal.get(Calendar.MINUTE);
    int second=cal.get(Calendar.SECOND);
    String body="Ein Internet-Surfer hat das Kontaktformular ausgefllt:"+linesep+linesep;
    body=body+"Name: "+name+linesep+"E-Mail: "+mail;
    body=body+linesep+"Datum: "+day+sep2+month+sep2+year;
    body=body+linesep+"Uhrzeit: "+hour+sep3+minute+sep3+second;
    body=body+linesep+linesep+"Kommentar: "+linesep+kommentar;
    try {
     Properties prop=new Properties();
     prop.put("mail.smtp.host","appmail.eu.infineon.com");
     Session s=Session.getInstance(prop);
     MimeMessage message=new MimeMessage(s);
     InternetAddress from=new InternetAddress(mail);
     message.setFrom(from);
     InternetAddress rcpt=new InternetAddress("[email protected]");
     message.addRecipient(Message.RecipientType.TO,rcpt);
     message.setSubject("Internet-Anfrage");
     message.setText(body);
     Transport.send(message);
     out.println("<p>Vielen Dank fr Ihre Nachricht!</p>");
   catch(MessagingException msgexcep) {
    out.println(msgexcep.getMessage());
else {
   out.println("<p>Daten konnten nicht abgesendet werden. <br>Folgende Daten fehlen:</p>");
   out.println(missingData);
   out.println("<br><br>");
   out.println("<a href='javascript:history.back()'>Zurck zur Eingabe</a>");
%>
</body></html>And the following error occours:
Sending failed; nested exception is: class javax.mail.MessagingException: 451 4.1.8 To send mail, first check your mail with a valid POP3 account; this prevents unauthorized SPAM relaying. I don't understand this error-message?
One thing is really stange: this up mentioned script worked very well, yesterday (the emails have been sent without any problems).
So I haven't changed anything in this script.
Today I've tried it again and the up mentioned error has been displayed...
Do you know a reason for it ?
cu
Chris

The normal way to do this is to configure the mail session in the jsp container (I'll explain how to do this in Tomcat in a second).
I use the following code to obtain the mail session:
    public Session getMailSession() throws EmailProcessingException{
        Session mailSession=null;
        Context initCtx=null;
        try {
            initCtx = new InitialContext();
            if(initCtx == null)
                throw new EmailProcessingException("No Context");
            Context envCtx = (Context) initCtx.lookup(Constants.CONTEXT);
            mailSession = (Session) envCtx.lookup(Constants.MAILSESSION);
        catch (NamingException e) {
            throw new EmailProcessingException(e);
        return mailSession;    
    }Now, the tricky part is setting up the mail session in JNDI.
You will need to edit the server.xml file for the tomcat instance that is running, and locate the context element that your JSP is running inside of.
Here's a full context tag for a sample web app that contains entries for setting the mail authentication:
        <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="0" displayName="WWW" docBase="C:\Program Files\eclipse data\workspace\www" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/www" privileged="false" reloadable="true" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper">
          <Resource name="mailSession/YourApp" scope="Shareable" type="javax.mail.Session"/>
          <ResourceParams name="mailSession/YourApp">
            <parameter>
              <name>mail.smtp.host</name>
              <value>mail.yourhost.com</value>
            </parameter>
            <parameter>
              <name>mail.smtp.password</name>
              <value>your smtp password here</value>
            </parameter>
            <parameter>
              <name>mail.smtp.user</name>
              <value>your smtp username here</value>
            </parameter>
         <parameter>
           <name>mail.smtp.auth</name>
           <value>true</value>
         </parameter>
          </ResourceParams>
        </Context>Hope this helps - it took awhile for me to find the correct parameter names (documentation was a bit sketchy on this).
One big advantage of doing it this was (using JNDI) is that you don't have to hard code your passwords, etc... into your source code. You can even use different mail servers on your development workstation than in production.
Cheers,
- K

Similar Messages

  • EMAIL FUNCTION USING JSP

    HOW CAN I WRITE A EMAIL FUNCTION USING JSP
    WHICH HAVE FORWARD, REPLY, REPLAY ALL, AND ADDRESS BOOK LIKE YAHOO EMAIL FUNCTION
    HOW CAN I WRITE IT?

    I meant you would face a considerable challenge trying to write
    public static void main(String[] arg) { } with your Caps-Lock key stuck.
    You would not even be able to escape your way out of it with
    \u0070\u0075\u0062\u006C\u0069\u0063 \u0073\u0074\u0061\u0074\u0069\u0063 \u0076\u006F\u0069\u0064 \u006D\u0061\u0069\u006E(S\u0074\u0072\u0069\u006E\u0067[] \u0061\u0072\u0067) { } as the "\u" escape sequence also contains a lowercase character.

  • How to send emails using JSP?

    How can i send emails using JSP? what are the things that i will need? please help me asap...thanks

    Hi,
    This works for me:
    <%
    String from = "Person"
    String to= "my-email-address;
    try{
    SmtpClient client = new SmtpClient("smtp.stuff.com");
    client.from(from);
    client.to(to);
    PrintStream message = client.startMessage();
    message.println("To: " + to);
    message.println("Subject: Sending an e-mail");
    message.println();
    message.println("Groovy :-)");
    client.closeServer();
    catch (IOException e){
    System.out.println("ERROR SENDING EMAIL: "+e);
    %>

  • TS4002 Can you tell me if the smtp settings have changed recently?  I use me/ICloud mail with Outlook and can not receive emails but outgoing emails are no longer working.  Error message is: Authentication failed because Outlook doesn't support any of the

    I am able to receive messages on my IMac using Outlook but am unable to send.  I've had no trouble in the past but began receiving the following messages today.
    5.7.8 Bad username or password (Authentication failed).
    Authentication failed because Outlook doesn't support any of the available authentication methods.
    I am able to send messages using this account on my IPhone and IPad so the IMac is the only place I am having issues.  Any advice?

    Here are the correct settings. They have never changed since iCloud debuted a year ago.
    Server information
    IMAP (Incoming Mail Server) information:
    Server name: imap.mail.me.com
    SSL Required: Yes
    Port: 993
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    SMTP (outgoing mail server) information:
    Server name: smtp.mail.me.com
    SSL Required: Yes
    Port: 587
    SMTP Authentication Required: Yes
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    Note: If you receive errors using SSL, try using TLS instead. SSL is required for both IMAP and SMTP connection with iCloud. POP is not supported by iCloud. 

  • Error when Connect to Oracle using JSP

    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); There is no problem with this code in Java, but when i used it in JSP, the error occured.
    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
    I am using JRUN Web Server, i don't know how to Configure JRUN to use JSP with Oracle.

    the problem is that your JDBC driver is not in the classpath of your servlet. Add the jar file to the WEB-INF\lib folder of your web application.
    i don't know how to Configure JRUNSorry, but in order to achieve anything, you'll have to RTFM.

  • Send PDF as email attachment using Outlook 2011 ERROR

    Every time I try to send a PDF as an email attachment, I get the following error:
    "An error occurred while trying to create a mail document.  Acrobat is unable to complete your request."
    Prior to getting this error, every time I sent an email Adobe would open the default Mail program on the mac. I  opened mail and changed the preference to use Outlook 2011 as the default mail program, but this did not correct the error.
    Any ideas?
    Thanks!

    AmbooS wrote:
    This is a known issue with Mac Outlook 2011 which is an unsupported version for Acrobat X. This will be supported in the next release.
    If adobe was smart it would be added in the update rather than in than in AcrobatXI  And while at it they need to add support for SeaMonkey and Thunderbird as well.  You've been ingnoring of Dissing Mozilla Products since OSX has been out.

  • Error in switching from one database location  to another database location in Crystal Reports using JSP

    Hi,
    Please help me in resolving the issue while changing the database dynamically in crystal reports using JSP. I followed the below link to change DB connection dynamically.
    CRJava Modify DB Location
    Please help me on this.
    While switching from one database to another i found the issue.
    dbController.replaceConnection(oldConnectionInfo, newConnectionInfo,pFields,replaceParams);
    The Error is:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Subreport does not exist.---- Error code:-2147467259 Error code name:failed
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2284)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:732)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)
        at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:480)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:421)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)
        at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
        at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
        at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.char(SourceFile:220)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.new(SourceFile:240)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.do(SourceFile:452)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.if(SourceFile:429)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:156)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
        at com.crystaldecisions.sdk.occa.report.application.an.a(SourceFile:65)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.a(SourceFile:1921)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValues(SourceFile:2237)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValue(SourceFile:2328)
        at org.apache.jsp.DynamicDB_jsp._jspService(DynamicDB_jsp.java:255)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.reportdefinition.ReportModificationException: Subreport does not exist.
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.a(SourceFile:229)
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.for(SourceFile:214)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1492)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)
        ... 47 more
    Any help Appreciated.
    Thanks
    Penchal

    Do you have subreports in your reports?
    If yes, set the connection info for the subreports as well.
    Additionaly refer to the below discussion
    http://scn.sap.com/thread/3153289
    As you are using Crystal reports for ecllipse runtime libraries to build your jsp, you would need to post your dicussions in the below forum to get better response.
    http://scn.sap.com/community/crystal-reports-for-eclipse
    The above space is dedicated for the issues with crystal reports for ecllipse.
    Thanks,
    Prithvi

  • Error when trying to email report using Analyzer for Excel template

    I have a report for which I have created both "RTF" and "Analyzer for Excel" based templates. I can email the report using the RTF template, but when I try to email it using the A4E template (using the 'Send' button from the report screen), it never arrives. If I schedule the report to be emailed, it fails, and I get the following error information:
    oracle.apps.xdo.servlet.scheduler.ProcessingException: oracle.apps.xdo.servlet.data.DataException: Invalid format requested: html
         at oracle.apps.xdo.servlet.scheduler.XDOJob.generateReport(XDOJob.java:959)
         at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:404)
         at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
         at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
    Caused by: oracle.apps.xdo.servlet.data.DataException: Invalid format requested: html
    Ideas?

    HI,
    Is this qury is running fine in SQL?? Have you checked this query in Sql server(Management studio) whether working or not??.
    I feel there is some mismatch with relations in query.. Cross check your query once in SQL itself. once it is running well, we will take a look.
    Regards,
    Salah.

  • Error in a array populated using jsp in client-side in java-script

    hii ,
    I have this problem.
    I have populated an array with records in jsp.The array is being populated correctly ..i hav check it .
    Now I need to get back this array in client side in a java-script function.
    I need this bcoz i need to check whether the value entered in a particular field in the form is there in the table before the form is submitted...hence the need of array.
    Surprisingly in my java-script function i can get back the length of array,but as soon as i am writing something like arr[0] where arr is the name of array populated in server side using jsp,i am get scripting error.
    i.e a code like
    funtion partynamecheck()
    var n=<%arr[0]%>
    alert (n) ;
    is giving scripting error.i.e showing error in page at the bottom left -side of browser.
    but code like
    funtion partynamecheck()
    var n=<%arr.length%>
    alert (n) ;
    } is working fine.
    Please help ..all wrk stuck.
    Arnab

    Hi,
    i cann't help you with javascript, but the jsp-expression must have this syntax
    var n=<%=arr[0]%>
    Hope this help!
    Roland

  • Error in PCR approval using JSP scenarios in ERP 2005

    Hi All,
       Due to the missing Adobe PCR scenarios for Request for Transfer, we are having to use the JSP PCRs.  I can create one, and route it to the senior manager for approval, but when they try to launch the form from the workitem, I get the following error:
    "Unable to perform action because the system returned an invalid URL"
    We've debugged the FM that provides the items for the UWL, and looked in lots of portal logs, but can't find what this invalid URL actually is!  Therefore, it's proving virtually impossible to find out what I need to change to correct it!
    In order to change to the JSP PCRs, I've changed the scenario config in QISRSCENARIO to specify "Entry Using JSP iView", I've specified an "Internet Link" (below the Additional Data button) of:
    http://<server>:<port>/irj/servlet/prt/portal/prtroot
    In the additional data, the Portal Component comes through as:
    com.sap.pct.hcm.pcr_specialpayment.default
    and I've defined a "Server" entry for Entry Using JSP iView of:
    http://<server>:<port>/irj/servlet/prt/portal/prtroot
    I've looked at SAP note number 646601.  I've configured SWFVISU to change task TS50...075 from Java WebDynpro to "iView", and specified:
    ID = com.sap.pct.hcm.isrdispatcher.default
    When registering the item types in the portal UWL config, this appears to pull through values as per the xml config file attached to 646601.
    Any ideas?
    I'd very much appreciate any help you can give!
    Many thanks,
    Russell.

    Hi Lewis,
       Yes, I did!  The problem is that the UWL iview launcher requires a fully qualified iview path (ROLES://portal_content/...).
    However, the isrdispatcher iview is a "master iview" from the EP5 days.  This means that it doesn't exist in the PCD as an iview that you can fully qualify!
    It does have a par file, however, so the solution is to create your own isrdispatcher iview, based on this par file.  Then you can enter the fully qualified location of your iview in the ID attribute in SWFVISU:
    ROLES://portal_content/.../my_isr_dispatcher
    Hope this helps!
    R

  • Bc4j,jsp,jdev3.22:Error using custom Domain

    I have created a domain subclassing from oracle.jbo.domain.Number, to allow for the formatting of numbers.
    I attached this new domain to a attribute of an entity object e.g. bid. When using the tester, the number is displayed correctly.
    When assessing the view (e.g bidView), from the JSP client, i get the error:
    java.lang.VerifyError: package6.common.num
    What am i doing wrong or is there a better way to format numbers when using jsp and bc4j?
    The code is as follows:
    package package6.common;
    import oracle.jbo.server.*;
    import oracle.jbo.domain.DomainOwnerInterface;
    import oracle.jbo.domain.DomainInterface;
    import oracle.jbo.JboException;
    import oracle.jbo.domain.Number;
    import java.text.*;
    import java.math.*;
    import java.sql.*;
    public class num extends Number {
    * This is the default constructor (do not remove)
    public num() {
    public num(String value) throws SQLException, ParseException {
    super(new BigDecimal(NumberFormat.getInstance().parse(value).doubleValue()));
    //validate();
    public String toString() {
    NumberFormat nf = NumberFormat.getInstance();
    nf.setMinimumFractionDigits(2);
    return nf.format(this.doubleValue());

    Take the code of the jsp file :
    <%@ page language="java" %>
    <%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
    <html>
       <head>
         <title> First Struts Application </title>
       </head>
         <body>
            <table width="500" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> </td>
            </tr>
            <tr bgcolor="#36566E">
              <td height="68" width="48%">
                <div align="left">
                  <img src="images/hht.gif" width="220" height="74">
                </div>
              </td>
            </tr>
            <tr>
             <td> </td>
            </tr>     
           </table>
           <html:form action="Lookup"
                      name="lookupForm"
                      type="wiley.LookupForm" >
           <table width="45%" border="0">
            <tr>
              <td>Symbol:</td>
              <td><html:text property="symbol" /> </td>
            </tr>
             <tr>       
              <td colspan="2" align="center"><html:submit/> </td>
             </tr>       
            </table>              
          </html:form>
         </body>
    </html>

  • Error in File uploading using jsp

    I am tring to upload files to a mysql database using jsp.I have used BLOB type to store files.Iam using the JDBC driver mysql-connector-java-2.0-14-bin to connect the database with the jsp API.My problem is when i try to transfer a file of size which is less than the possible capacity through blob ,which is 1048576 bytes ( for example when a file of size 916KB is attempted to transfer) the following error is being generated.
    java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet from server configuration of 1048576 bytes
         at com.mysql.jdbc.Buffer.ensureCapacity(Unknown Source)
         at com.mysql.jdbc.Buffer.writeBytesNoNull(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at org.apache.jsp.file3$jsp._jspService(file3$jsp.java:110)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    java.lang.IllegalArgumentException: Packet is larger than max_allowed_packet from server configuration of 1048576 bytes
         at com.mysql.jdbc.Buffer.ensureCapacity(Unknown Source)
         at com.mysql.jdbc.Buffer.writeBytesNoNull(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at com.mysql.jdbc.PreparedStatement.executeUpdate(Unknown Source)
         at org.apache.jsp.file3$jsp._jspService(file3$jsp.java:110)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    My uploading code in jsp is as follows.
         <% try{
              Class.forName("org.gjt.mm.mysql.Driver").newInstance();
              Connection dbCon = DriverManager.getConnection("jdbc:mysql:///uoc");
              out.println("Connection done !");
              Statement stmt = dbCon.createStatement();
              out.println("Statement Created !");
    ResultSet rs = stmt.executeQuery("SELECT * FROM blob_test)
    stmt.close();
    dbCon.close();
    out.println("<br><br> <b>Data Successfully selected !<b>");
    } //try
    catch(SQLException e){
         out.println(" <br> ");
         out.println("Sorry ! problem in selecting a data "+e.toString());
         out.println(" <br> ");
                   e.printStackTrace();
    %>
    Please help .I thank You in advance for any help .

    Have you tried increasing the BLOB field greater than 1048576 or using a smaller file of say 1 or 2k as a test? There is no guarantee that the database will store the file with exactly the same size as the file on the filesystem, so the file might be more than 916k in the database.
    Using BLOBs is a great way to destroy the performance of your database by the way :)

  • I get this error message when I try to email photos using iPhoto: Your email did not go through because the server did not reply.

    I get this error message when I try to email photos using iPhoto: Your email did not go through because the server did not reply. How can I get this to work when my internet is connected?

    Are you able to email from Mail with those two accounts?  If so:
    1 - go to iPhoto's Accounts preference pane and delete both accounts. Now add them back and try again.
    2 - a better solution IMO is to set Mail as the email client for iPhoto is iPhoto's General preference pane.  This gives you better access to your contacts, a sent copy of all emails and, if you want a layout similar to iPhoto's, photo layouts located in Mail's stationary.

  • Topic: error occuring while use jsp

    code:
    Parsing of JSP File '/view.jsp' failed:-------------------------------------------------------------------------------- /view.jsp(18): "mybean" is not a defined bean variable on this pageprobably occurred due to an error in /view.jsp line 18:value="<jsp:getProperty name="mybean" property="firstname"/>"/>
    this is the error i am getting while accesing the view.jsp.
    here below is my view.jsp and mybean.java codes.
    view.jsp
    code:
    <jsp:useBean id="mybean" class="mvc.beans.mybean" scope="request"/ ><html><head><title>MVC View</title></head><body><h2>MVC Architecture View<h2><form method="post" action="myservlet"><table> <tr> <td>     First Name:     </td> <td>     <input type="text"           name="form first name"                    value="<jsp:getProperty name="mybean" property="firstname"/>"/>                                   </td>     </tr>      <tr>     <td>          Last Name:          </td>          <td>          <input type="text"               name="form last name"                    value="<jsp:getProperty name="mybean" property="lastname"/>"/>     </td>     </tr>      <tr>     <td>          E-mail:          </td>          <td>          <input type="text"               name="form mail"                    value="<jsp:getProperty name="mybean" property="email"/>"/>     </td>     </tr>      <tr>     <td>     <input type="submit"          value="submit"/>          <td>     <tr> </table></form></body>      <pre>     <jsp:getProperty name="mybean" property="message"> </pre></html>
    mybean.java
    code:
    package mvc.beans; public class mybean{ private String firstname; private String lastname; private String email;  public String getFirstname()     {       return fixNull(this.firstname);    } public String getLastname()     {      return fixNull(this.lastname);    } public String getEmail()     {       return fixNull(this.email);    } public void setFirstname(String firstname)     {      this.firstname=firstname;     } public void setLastname(String lastname)     {      this.lastname=lastname;     } public void setEmail(String email)     {       this.email=email;    } private String fixNull(String in){        return (in == null) ? "" : in;    }      public String getMessage()     {      return "\nFirst Name:" +  getFirstname() + "\n"              +"Last Name :" +  getLastname()  + "\n"                      +"email     :" +  getEmail()     + "\n";     } };
    please clarrify my error.

    Are u putting the bean in the request scope????

  • Error message when using JSP pages

    Version 6.0
    The error I'm getting is as follows:
    trying to POST headerFragment.html, internal-redirect reports: no way to service request for headerFragment.html
    All I'm trying to do is a jsp:forward on JSP page 1 to JSP page 2 which, at the top of it, has a jsp:include (the headerFragment.html page mentioned in the error).
    Any thoughts on how to remedy this problem would be appreciated.
    Thanks,
    Mark

    By default, the server will not serve static files in response to POST requests, even when using jsp:include.
    This bug was addressed in 6.0 SP2, but instances created in an earlier release will continue to exhibit the problem even after upgrading. To fix the problem, locate the following line in the obj.conf configuration file:
    Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-fileChange the above line so it reads as follows:
    Service method=(GET|HEAD|POST) type=*~magnus-internal/* fn=send-file

Maybe you are looking for