Trouble in executing RMI from servlet

hello everybody..
I have trouble in invoking RMI from the servlet.. i get an exception saying connection refused to 192.168.16.65 (my RMI server is running on this system) .
Later i tried running RMI on the same system and got the exception saying connection refused to 127.0.0.1 .
pls help me to solve this trouble.
thanks
- abdel Olakara

Plz send me code where you are using lookup() method bcoz without seeing code we cant undersatnd the error(pblm). plz also send the interface.

Similar Messages

  • How to execute package from Servlet

    Hi all...
    I have set of class files in a package called iDen_parser.
    My main class name is jump_calc..
    String[] cmd={"cmd.exe" , "/c" ,"java iden_parser.jump_calc","d:/test.log","d:/test.txt"};
    Runtime runtime = Runtime.getRuntime();
    process = runtime.exec(cmd);
    I am not getting any output...
    I have placed the folder Iden_parser in current working directory itself.
    While I when I am trying out simple program HelloWorldApp, it's working out fine.
    String[] cmd={"cmd.exe" , "/c" ,"java HelloWorldApp};
    Runtime runtime = Runtime.getRuntime();
    process = runtime.exec(cmd);
    So anyone ,pls help me out in executing the pakage from servlets
    Thnk
    VIjay

    Hi...
    I am placing my code here
    String path1 ="cmd /c dir /d";
    String[] cmd={"cmd.exe" , "/c" ,"java
    java HelloWorldApp"};
    String[] path ={"cmd.exe",null, "
    java iden_parser.jump_calc", "d:/test.log","
    d:/mygod.txt"};
    Replace....
    String[] path ={"java iden_parser.jump_calc", "d:/test.log","
    d:/mygod.txt"};
    Runtime runtime = Runtime.getRuntime();
    Process process = null;
    try {
    process = runtime.exec(path);
    Replace....
    process = runtime.exec(path, null, "the dir from where u call the stand alone program on command prompt");
    outHTML.println("PAth" +path);
    BufferedReader in =
    new BufferedReader(new
    er(new InputStreamReader(process.getInputStream()));
    // Read and print the output
    String line = null;
    outHTML.println("Something had happen");
    if((line = in.readLine()) == null)
    outHTML.println("Empty");
    while ((line = in.readLine()) != null) {
    outHTML.println(line);
    catch (Exception e) {
    outHTML.println("Did not execute the command
    command " );
    //out.println("Problem with finger: " +
    // ServletUtils.getStackTraceAsString(e));

  • How to execute sql file from servlet

    Hi,
    I am using JSP, Servlets and Oracle 8i in my application. I want to execute .sql file from java code. Is it possible to do that,
    as we execute .sql file from sql plus prompt.
    Suppose I have abc.sql file and I want to execute it from java code.
    If any body have the solution then pl. reply with sample code.
    Thanks,
    Rajesh

    If any body have the solution then pl. reply with
    sample code.No, no, dec - s/he doesn't want the actual solution, but the full code!
    /k1

  • Attempting to use SSL over RMI from a web application to a RMI server

    Hi,
    I am attempting to use SSL over RMI to a server. The client is the web
    application that is hosted on WebLogic and that attempts to connect to the
    server. There is no client or server verification at either the client or
    the server end. The code works outside of WebLogic 7/8 but has the following
    issues when running the web application inside weblogic:
    java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
    exception is:
    java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
    actory.java:20)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
    actory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:79)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
    ctionClient.java:59)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
    lient.java:197)
    at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1058)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :401)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :445)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :306)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5445)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3105)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2588)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    The code at the client that initiates the connection:
    socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
    socket.setEnabledCipherSuites(CIPHERS);
    socket.setEnableSessionCreation(true);
    Any ideas?
    Thanks

    I don't see anything that indicates SSL was directly a factor in the
    failure.
    From the exception stack it looks like a more basic connectivity issue,
    maybe the URL for the
    RMI server is incorrect for some reason or the server was down.
    It looks like you are doing something like this:
    SSL client -> WLS server with servletA, servletA RMI client
    (com.hyperion.css) -> RMI server
    The connection failure appears to be the connection from servletA RMI client
    to the RMI server.
    Is that a correct picture?
    Tony
    "Gaurav Khanna" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    I am attempting to use SSL over RMI to a server. The client is the web
    application that is hosted on WebLogic and that attempts to connect to the
    server. There is no client or server verification at either the client or
    the server end. The code works outside of WebLogic 7/8 but has thefollowing
    issues when running the web application inside weblogic:
    java.rmi.ConnectException: Connection refused to host: gkhanna1; nested
    exception is:
    java.net.ConnectException: Connection refused: connect
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
    at java.net.Socket.<init>(Socket.java:268)
    at java.net.Socket.<init>(Socket.java:95)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketF
    actory.java:20)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketF
    actory.java:115)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:494)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
    at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:79)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.initConnection(NTLMConne
    ctionClient.java:59)
    at
    com.hyperion.css.spi.impl.ntlm.NTLMConnectionClient.getUsers(NTLMConnectionC
    lient.java:197)
    at com.hyperion.css.CSSAPIImpl.getUsers(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at com.hyperion.css.CSSAPIImpl.initialize(Unknown Source)
    at jsp_servlet._jsp._app1.__app1signin._jspService(__app1signin.java:133)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:1058)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :401)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :445)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :306)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5445)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:780)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3105)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2588)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
    The code at the client that initiates the connection:
    socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
    SSLSocket socket = (SSLSocket) socketFactory.createSocket(host, port);
    socket.setEnabledCipherSuites(CIPHERS);
    socket.setEnableSessionCreation(true);
    Any ideas?
    Thanks

  • Error while executing report from Query designer

    Hi All,
    When I am executing from query designer, I am getting following error.
    Even I can't execute it from another portal where i created source system of BI server.
    But i can execute queriew from Query analyser and t-code RSRT.
    When I execute from Query desinger the url is as follows.
    http://XXX:00/irj/servlet/prt/portal/prtroot/pcd!3aportalcontent!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?QUERY=0PA_C01_Q0201&VARIABLE_SCREEN=X&DUMMY=5_
    And the error is:
    500 Internal Server Error
      BEx Web Application
    Failed to process request; contact your system administrator
    Information for Administrator
    To avoid this exception see the steps below. To help SAP better investigate this issue, you will need to provide the diagnostic information from these steps.
    1. Most likely, the issue you are experiencing has already been corrected. Please make sure that the most recent patch level is deployed on your system according to notes 1033246 and 1011241. Starting with Support Package Stack 16 patch level 30, BI Java is delivered according to the synchronized delivery process described in the note 1033246.
    2. Please ensure that NetWeaver Business Intelligence Diagnostics & Support Desktop Tool  does not report any issues on your server according to note 937697. You can start it by clicking here (administrator permissions are required).
    3. When opening any customer message on this issue, please attach:
    Support Desktop Tool support info ZIP  file according to note 937697,*
    Required information for reproduction  according to note 948490.*
    Error Summary
    Exception occured while processing the current request; this exception cannot be handled by the application or framework
    If the information on this page does not help you locate and correct the cause of the problem, contact your system administrator
    To facilitate analysis of the problem, keep a copy of this error page Hint: Most Web browsers allow you to select all content, and copy and paste it into an empty document (such as in an email or simple text file)
    Root Cause
    The initial exception that caused the request to fail was:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at com.sap.ip.bi.webapplications.runtime.service.metadata.impl.MetadataAccess.getMetadataModel(MetadataAccess.java:139)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.getMetadataModel(Page.java:8953)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.normalizeCommands(Page.java:4963)
    at com.sap.ip.bi.webapplications.runtime.impl.Page.doProcessRequest(Page.java:4473)
    at com.sap.ip.bi.webapplications.runtime.impl.Page._processRequest(Page.java:3316)
    Details: Full Exception Chain
    System Environment
    Server
    BI Java Release: 7 - Patch level: 0000000100 - Description: BI Web Applications Java - Additional info:  - Production mode: true
    BI ABAP unknown
    Java Virtual Machine Java HotSpot(TM) 64-Bit Server VM - Sun Microsystems Inc. - 1.4.2_24-b04
    Operating System SunOS - amd64 - 5.10
    REgards
    Mohan

    Hi mohan ,
      You can check these OSS notes for the issue  .
    1. 795699 - Customizing default error messages for HTTP
    2. 807000 - Http requests are not fully read after timeout
    3. 804124 - HTTP communication with XI Adapter Engine fails
    Regards,
    Lokesh

  • Java.security.AccessControlException when executing java from the DB

    Hello
    I'm running a Oracle 10.1.0.3.0 on Linux
    I'm having trouble with executing some java code from the DB.
    I created following java stored procedure used to create the directory given by the parameter
    package be.vlaamsparlement.dis.os_commands;
    import java.io.*;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    public class ManageOSDirectory {
    public static String createDir(String directoryName) throws Exception
    if ((new File(directoryName)).mkdirs())
    { return ("TRUE");}
    else
    { return ("FALSE");}
    Wrapped it in a pl/sql procedure an execute it as follows under DB schema DIS :
    begin
    declare
    b boolean;
    begin
    b := pck$os_commands.CreateDir('/data/files/vp_docs/schv/2004-2005/jan/1/');
    end;
    end;
    Where /data/files/vp_docs/schv/ already exist, so the proc needs to create the direcories '2004-2005', 'jan' and '1'
    this gives me following error :
    ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException:
    the Permission (java.io.FilePermission /data/files/vp_docs/schv/2004-2005/month/1 write) has not been granted to DIS.
    The PL/SQL to grant this is dbms_java.grant_permission( 'DIS', 'SYS:java.io.FilePermission', '/data/files/vp_docs/schv/2004-2005/jan/1', 'write' )
    I can't give this permission as the given directory does not yet exist. File permissions on os are ok and when i execute
    the code on the os (not from the DB) it works fine.
    This also worked on a Windows 10G DB without any extra grants.
    Also, i can execute the followint
    b := pck$os_commands.CreateDir('/data/files/vp_docs/schv/2004-2005/');
    but if i then execute
    b := pck$os_commands.CreateDir('/data/files/vp_docs/schv/2004-2005/jan/');
    I get the same error. So i can only creaet 1 directory beneath the schv directory
    Any ideas anyone ?

    The Error message is right.
    You need to:
    Ensure the Directory exist in Unix.
    Create the Directory in the Database as SYS.
    Grant Read,Write permission on th DIrectory to DIS
    Grant Java permission on th DIrectory to DIS (using the syntax already shown in the Error message).
    See my example below (10g R1)
    SQL> connect /as sysdba
    Connected.
    SQL> GRANT CONNECT,RESOURCE TO DIS IDENTIFIED BY DIS;
    Grant succeeded.
    SQL> create or replace directory DIS_DOWNLOAD_DIR as '/data/files/vp_docs/schv/2004-2005/month/1';
    Directory created.
    SQL> col DIRECTORY_PATH format a50
    SQL> select * from dba_directories;
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS DIS_DOWNLOAD_DIR /data/files/vp_docs/schv/2004-2005/month/1
    1 row selected.
    SQL> GRANT READ,WRITE ON DIRECTORY "SYS"."DIS_DOWNLOAD_DIR" TO "DIS";
    Grant succeeded.
    SQL> EXECUTE DBMS_JAVA.GRANT_PERMISSION( 'DIS', 'SYS:java.io.FilePermission', '/data/files/vp_docs/schv/2004-2005/jan/1', 'write' )
    2 /
    PL/SQL procedure successfully completed.
    SQL>

  • Passing an integer from servlet  to PERL

    Hi,
    I have a one problem. Iam having an film database(SQLPLUS) table and can get particular information from the database using filmId(using servlets).
    Now I have to use Perl to know more information about the specific film. So Iam passing the filid to Perl and every time Iam using a different filmID I can see the URL in the perl page change to specific id's so I know the filmid is correctly passed. But for some reason the perl is not able to fetch the information from the database like the servlets. the perl is simply giving a blank HTML Page.
    AM I PASSING THE filmis CORRECTLY IN TO PERL FROM SERVLET??
    Thanks
    The part of the servlet program is below.//Passing the ID(filmsid)
    try
    //Loop through results of query.
    while(rs1.next())
    String filmids = rs1.getString("ID");
    out.println("<TR>");
    out.println("<TD>" + rs1.getString("ID") + "</TD>");
    out.println ("<TD><a href=cgi-bin/'trial2.pl?filmids="+filmids+"'>Click here to view comments </a></TD>");
    out.println("</TR>");
    the perl program is below too.//Getting the filmid's
    $reg = "SELECT ID,Title,Price,Availability FROM FILMS1 WHERE ID =
    /$filmsid/i
    my $sql = $dbh->prepare($reg);
    $sql->execute();
    while (@row = $sql->fetchrow_array){
    print "<TR align = center bgcolor=white> <TD>",$row[0],"</TD> </TR>";
    print "</TABLE>";
    #$exist=$sql->fetchrow_array();
    #print "<H3> $exist is the value </H3>";
    $sql->finish();
    $dbh->disconnect();
    print "</font>";
    print "</body>\n";
    print "</html>\n";

    It doesn't seem to be that you're passing anything to Perl, at least not directly. Rather, you're creating a web page that has a link to a resource on a web server, and the resource is being serviced by a perl script.
    This means that you can debug the two separately. First, confirm that the java servlet is producing the page, and in particular the link, correctly.
    Then, fix the perl script as a separate step. I notice that you only quoted a fragment from your perl script; what you posted msy not run at all.
    If you want help with a perl script, you're better off on a perl-centric forum. Put on your flame-retardant suit and head on over to comp.lang.perl.misc.

  • Calling an applet from servlet

    Hi
    I'm devoloping a server side java software(on netbeans 6) and I want my gui classes(Designed as swing japplet application) to be executed on server side.
    I mean I have database operations on my applet and some logging functions and I want them to execute on server side not client side
    Is it possible to call applets from servlet and so its executed on server if it is possible how can i do that is there a tutorial for that ?
    If it is not is there any other solution? Its really urgent for me
    Thanks

    tolgatanriverdi wrote:
    I'm devoloping a server side java software(on netbeans 6) and I want my gui classes(Designed as swing japplet application) to be executed on server side.Call a company named Citrix, they do stuff like that using a special client.
    I mean I have database operations on my applet and some logging functions and I want them to execute on server side not client sideSo it's not the GUI classes but the rest of the business logic.
    Is it possible to call applets from servlet and so its executed on server if it is possible how can i do that is there a tutorial for that ?It's possible for a servlet to call any class. It's not easily possible for a servlet to connect to a certain applet instance running on a certain client, and neither should it. Hello - it's the server. It's supposed to answer to requests. It's not supposed to issue requests to the client. And considering your set-up as I understood it, you don't ned that anyway. Let the applet just tell the servlet to do action X or Y or Z.
    Its really urgent for meGood Thing that you wrote it here. If you had written it at the beginning of your post, I wouldn't have bothered to answer.

  • Cancel a request from Servlet

    I am wanting know if there is a way to cancel a request from a servlet. I have a servlet that is being activated from a web page that runs on Websphere that create a query against DB2. I am trying to add a Cancel button to stop the query and close the connections if the cancel button is hit. The reason I want to do this is because if the user doesn't enter specific enough criteria then the search may take a while. I want to give the user the ability to stop the search not just redisplay the form and execute another.

    Are you saying have a randomly generated key as a hidden field that a search object would hold onto. If I cancelled the search, another servlet would take that key and communicate with the search object, telling it to stop.
    But then how do I make it stop.
    Currently I have a servlet for cancel that changes a boolean from false to true when executed. The search servlet is running through a loop that is going through a ResultSet to fill a vector with information to display. If the boolean is changed to true the loop is broken and all pieces are closed. This works on my localhost but not in our test environment. It doesn't execute the cancel servlet until after the search servlet has returned a response. We use the Strata five layer architechture not the MVC pattern.

  • Runing java pogram from Servlet

    Hi everbody
    I was trying to execute and run a java program from servlet. It seems to me the servlet can compile the code but it is not capable to execute it. I have tried to save the class file in a bat file after the servlet compiled it but it did not work. any help will be appreciated.
    try{
    String[] command = {"javac","c:\\class\\test.java"};
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(command);
    catch(Exception ex){ }
    try{
    String[] command = {"java","c:\\class\\test"};
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(command);
    catch(Exception ex){ }

    Don't cross-post your questions, please.

  • Changing PWD from servlet

    I want to change mail Password thru servlets on Linux server. I used the follow'g code.
    Process process = Runtime.getRuntime().exec("/usr/sbin/chpasswd < try.pwd");
    // File 'try.pwd' contains user:pwd eg: pankaj:panks
    int status =process.exitValue();
    System.out.println("status:" + status);
    if(status == 0){
    System.out.println("done");
    else{
    System.out.println("not done");
    It doesn't seems to work from servlet (thru JVM).
    But the same command is executed successfully at linux prompt.
    Please help me.................

    I want to change mail Password thru servlets on Linux
    server. I used the follow'g code.
    Process process =
    Runtime.getRuntime().exec("/usr/sbin/chpasswd <
    try.pwd");
    ps.waitFor() ;
    // File 'try.pwd' contains user:pwd eg: pankaj:panks
    int status =process.exitValue();
    System.out.println("status:" + status);
    if(status == 0){
    System.out.println("done");
    else{
    System.out.println("not done");
    It doesn't seems to work from servlet (thru JVM).
    But the same command is executed successfully at linux
    prompt.
    Please help me.................
    Check if this works ....
    Shubhrajit

  • How to send mail from servlets

    m having troubles sending mail from servlets...
    how do you use the SimpleMailUser object needed in the session?
    a sample code on this would be of great help, thanks!

    <html>
    <body bgcolor="white">
    <font size=5 color="black">
    <%@ page import="javax.servlet.http.HttpUtils" %>
    <%@ page import="java.util.*" %>
    <%@ page import = "java.sql.*" %>
    <%@ page import = "java.io.*" %>
    <%@ page import= "sun.net.smtp.SmtpClient" %>
    <%
         String from,to,subject,msgbody,serverName;
         try
    from = request.getParameterValues("from")[0];
    to = request.getParameterValues("to")[0];
    subject = request.getParameterValues("subject")[0];
    msgbody = request.getParameterValues("msgbody")[0];
    serverName = request.getParameterValues("server")[0];
         catch (Exception e)          // Generally Speaking, an Error getting one of these
                                       // Values means that it wasnt passed in; inform the user
              out.println("You must call this JSP from this ");
              out.println("<A href=\"FormMail.htm\"> form</A>.<BR>");
              out.flush();return;
    %>
    Hold On A Moment while I try to Send Your Mail... <BR>
    <%
         out.flush();
         // Here are the real guts of the mail sending
         try
         sun.net.smtp.SmtpClient sm = new sun.net.smtp.SmtpClient(serverName);
         sm.from(from);
         sm.to(to);
         PrintStream msg = sm.startMessage();
         msg.println("To: ");     // Note dont use + for Performance
         msg.println(to);
         msg.println("Subject: ");
         msg.println(subject);
         msg.println();
         msg.println(msgbody);
         msg.println("==============");
         msg.print("This mail brought to you by JSP MAIL..from a user at IP ");
         msg.println(request.getRemoteHost());
         sm.closeServer();
         out.println("Your Mail Has Been Sent!");
         catch (Exception e)
              out.println("The mail couldn't be sent, probably because the mailhost wasnt set correctly.<BR> ");
              out.println("The error message I am getting is: ");
              out.println(e.getMessage());
    %>
    <BR>
    <BR>
    Click here to send another!

  • Acess to ApplicationModuleImpl from servlet

    I need to use from servlet getDBTransaction().executeCommand from ApplicationModuleImpl, which implements AppModule in my projects.
    In servlet:
    String plsql =
    "BEGIN "
    + "TEST.PROC(:p_session_id); " +
    "END;";
    AppModuleImpl ami=new AppModuleImpl();
    CallableStatement s = ami.getDBTransaction().createCallableStatement(plsql, 0);
    try {
    s.setString("p_session_id", "param1");
    s.execute();
    } catch (SQLException e) {
    PLZ Help me
    Error occurs on following statement: CallableStatement s = ami.getDBTransaction().createCallableStatement(plsql, 0);
    oracle.jbo.InvalidOwnerException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-25301. Error message parameters are {0=AppModuleImpl_24, 1=null}

    First of all, is AppModuleImpl the name of your AppModule? I suspect that is the class (yes I know, I formulated it wrong in my first post, my bad), you should propably use AppModule instead of AppModuleImpl.
    Second, you need to define a method in your AppModuleImpl (yes, the java class) which calls the .createCallableStatement(plsql, 0) part. Then expose that method in the Client Interface (AppModule > Java > Client interface).
    So your code should be +- like this:
    String plsql =
    "BEGIN "
    + "TEST.PROC(:p_session_id); " +
    "END;";
    AppModule ami = (AppModule)Configuration.createRootApplicationModule("view.AppModule","AppModuleLocal");
    ami.myMethod(param1,param2); //you give your own parameters
    //All the code below should be in your AppModuleImpl in the myMethod method.
    CallableStatement s = ami.getDBTransaction().createCallableStatement(plsql, 0);
    try {
    s.setString("p_session_id", "param1");
    s.execute();
    Configuration.releaseRootApplicationModule(ami, false);
    } catch (SQLException e) {
    }

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

  • I am new to Mac and am having trouble with uploading images from my pictures folder to Facebook and other share sites- some of my images are accessible while others are seemingly locked....

    I am new to Mac and am having trouble up loafing images from my pictures folder to photography sites and Facebook. Some of the saved images are accessible, while others are not, ( they are light colored and cannot be uploaded) I am not saving them any differently.

    Hi Robodisko,
    Thanks for your prompt reply...... 
    I often proof my work in preview then edit images in photoshop and rename from there.  The dsc images are renamed to correlate the name of the class etc.  i.e. dcs_001 is saved as the file name required 7A.jpeg etc.
    The file names are required to correlate what is what and so on..........

Maybe you are looking for