Error while trying to access BPEL process through java on localhost

I have a service (CreditRatingService that comes along with install) running on the BPEL engine. Trying to invoke it through java. However, I get an exception. Below is more information. Appreciate any help.
My method
    public String invokeBpel()
      Map payload;
      Hashtable jndi = null;
      try
       String ssn ="1234";
       String xml = "<ssn xmlns=\"http://services.otn.com\">" + ssn + "</ssn>";
        Locator locator;
        locator = new Locator("default","welcome1",jndi);
         IDeliveryService deliveryService =
          (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
          NormalizedMessage nm = new NormalizedMessage( );
          nm.addPart("payload", xml );
            NormalizedMessage res =null;
            try
             res = deliveryService.request("CreditRatingService","process", nm);
            catch(RemoteException oNameEx)
                System.out.println(oNameEx.getMessage());
            payload = res.getPayload();
            System.out.println( "BPELProcess CreditRatingService executed!<br>" );
            System.out.println( "Credit Rating is " + payload.get("payload") );
      catch (Exception e)
        System.out.println("This is the exception" + e);
        System.out.println(e.getStackTrace());
      finally
          return "toPage3"; 
    }//end method
Exception  text
Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found
Env
ADF Business Components:10.1.3.39.84
BPEL Designer      10.1.3.1.0 (Build 061009.0802)
CVS Version     Internal to Oracle JDeveloper (client-only)
Java™ Platform     1.5.0_06
Oracle IDE     10.1.3.39.84
Struts Modeler Version     10.1.3.39.84
UML Modelers Version     10.1.3.39.84
Versioning Support     10.1.3.39.84

Hashtable jndi = null;
try
String ssn ="1234";
String xml = "<ssn xmlns=\"http://services.otn.com\">" + ssn + "</ssn>";
Locator locator;
locator = new Locator("default","welcome1",jndi);
this implies to be in the same initial context then the bpel engine, whicuh you cannot be as long as you are not either part of the ejb code of orabpel or a child of it. and if you are you can use the Locator API without the jndi properties.
hth clemens

Similar Messages

  • TNS:Operation Timed Out error while trying to invoke BPEL Process from sql

    Hi,
    I am trying to invoke a BPEL Process from PL/sql code. When i try to invoke the process, I am getting the following error message
    ORA-29273 HTTP Request Failed
    ORA:06512: at SYS.UTH_HTTP at line 1029
    ORA:12535: TNS:Operation Timed Out
    ORA:06512: at line 18
    I have the SOA suite installed on my local machine...and the BPEL process that i am trying to invoke is deployed their.
    Any idea what could be wrong..following is the code piece
    soap_request:='<?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header/>
    <soap:Body xmlns:ns1="http://xmlns.oracle.com/Test">
    <ns1:TesProcessRequest><ns1:input>is1_1land</ns1:input></ns1:TesProcessRequest>
    </soap:Body>
    </soap:Envelope>';
    dbms_output.put_line('soap_request: '||soap_request);
    utl_http.set_proxy('3.209.30.25:80', '3.209.32.149:8888');
    http_req:= utl_http.begin_request('http://3.209.32.149:8888/orabpel/default/Tes/1.0 '
                   ,'POST'
                                  ,'HTTP/1.1');
    dbms_output.put_line('after Begin Request' );
    utl_http.set_header(http_req, 'Content-Type', 'text/xml') ;
    Please advise

    you are right the file adapter doesnt invoke any bpel
    process, instead it is polling the file from
    directory location?If it is polling for new files, shouldn't it create a new instance of the BPEL process automatically the moment it finds a new file? In other words, should a new file trigger an instance of the BPEL process rather than being started from PL/SQL?
    Can this file adapter not be invoked as bpel process
    in that case?The file adapter is part of a BPEL process. The BPEL process can be invoked from e.g. PL/SQL.
    In this case this file adapeter return to an RECEIVE
    activity...I think this receive cannot be invoked as
    a BPEL process rite?Can you explain what you mean with this?
    Also , will all synchronous request return "TIMEOUT"
    error, if tried to invoke from pl/sql?Only if the synchronous process instance takes more time to complete (and thus to return) than the value specified for a time-out to occur. If the instance completes in for example 10 ms and the time-out time is specified as 30 seconds, no time-out will occur.
    Regards, Ronald

  • :: Error : While trying to access the URL through the Apache ::

    Hello,
    We are getting following error after starting the apache in the file <sid>_error_log
    [20/Apr/2009:10:49:04] [Error] SiteMinder Agent
            Failed to initialize the message bus.
    [20/Apr/2009:10:49:04] [Warning] SiteMinder Agent
            SiteMinder agent has encountered initialization errors and will not service requests.
    And while accessing the portal we are getting following error
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, www@ep-<sid>.al.sw.ericsson.se and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Apache/2.0.59 HP-UX_Apache-based_Web_Server (Unix) mod_perl/1.99_16 Perl/v5.8.8 DAV/2 mod_ssl/2.0.59 OpenSSL/0.9.8d Server at ep-<sid>.al.sw.ericsson.se Port 443
    All the config files seems to be okay.
    And on the same Server we have another apache of other system.
    But its down still we are facing above issue.
    Kindly help
    Thank you , Regards,
    Girish

    Hi Girish,
    Do you find out the solution to this issue? We having a similar issue with our Enterprise Portal using Apache and Siteminder Agent?

  • While trying to access  i phone through pc (windows 7 ) showing error 'you do not have permission to access this device '

    while trying to access  i phone through pc (windows 7 ) showing error 'you do not have permission to access this device '
    And while trying  to unlock screen after lock , slide not working 'slide to unlock'

    Hello there, charialji.
    The following Knowledge Base article offers some great steps for troubleshooting your issue:
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/ts3281
    Resolution
    If a single application is not responding or stops responding when it opens, you can force it to close.
    If the device is unresponsive or if certain controls aren't working as expected, restart your device.
    If the device remains unresponsive or does not turn on (or power on), reset your device.
    If there is no video or if the screen remains black, verify that the device has enough charge to turn on:
    If you are using an iPad, ensure that it's connected to the USB Power Adapter supplied with the device.
    Let it charge for at least twenty minutes, then see if it starts normally.
    If there is no image on the screen, press the Sleep/Wake button to attempt to wake the device.
    If the screen displays a red battery icon, continue charging the device until the battery is fully charged. Learn more about charging iPhone and iPod touch, or iPad.
    If the above steps do not resolve the issue, or the if the screen remains black or shows a persistent Apple logo, try restoring with iTunes:
    Connect the device to your computer and open iTunes.
    If the device appears in iTunes, select and click Restore on the Summary pane. Learn more aboutrestoring iOS software.
    If the device doesn't appear in iTunes, try to force the device into recovery mode, and then restore it.
    If the above steps do not resolve the issue, contact Apple.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Error while invoking an asynchronous BPEL process

    Hi ,
    I am trying to call an asynchronous BPEL process through java client.
    Following is the code which I got from SOA bpel samples present in the following location
    <SOA_HOME>\bpel\samples\tutorials\102.InvokingProcesses\rmi\com\otn\samples\async
    The code fails while registering the callback
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    deliveryService.post("HelloWorld", "initiate", nm);
    // register the callback
    watchdog.registerAsyncCallback(convId, testAsyncHandler,
    locator.getDomainAuth());
    The error says java.lang.NoClassDefFoundError: org/collaxa/thirdparty/json/JSONString
    I tried to search for this in google. But it seems noone has got this error or maybe noone has used this at all.
    Maybe I am missing some jar file, but I am unable locate that.
    Can someone help me in this please.

    Hi,
    These sort of class not found errors come when you are running from a client which does not have all the jar files requried to invoke BPEL using the client API.
    org/collaxa/thirdparty/json/JSONString is orabpel-thirdparty.jar.
    The complete list of Jar files you would need in the classpath are:
    ejb.jar ($ORACLE_HOME/home/lib)
    oc4j-internal.jar ($ORACLE_HOME/home/lib)
    optic.jar ($ORACLE_HOME/opmn/lib)
    orabpel-common.jar ($ORACLE_HOME/bpel/lib)
    orabpel-thirdparty.jar ($ORACLE_HOME/bpel/lib)
    orabpel.jar ($ORACLE_HOME/bpel/lib)
    Hope this helps,
    Regards,
    Shanmu.
    http://www.prshanmu.com/articles/

  • "error while trying to access the service"

    I am trying to convert a pdf file to an excel file.  I get a completely unhelpful message that says  "error while trying to access the service" .
    What does this mean and how do i fix it?

    Hi sd433m,
    Thank you for posting on the Adobe forums. If you are already subscribed to the service, kindly try the steps mentioned below.
    1) Open Adobe Reader  Edit>preferences
    2) Go to Adobe Online services>change the email address to the one you have subscribed the service with
    3) Go to identity> change the email address there as well
    4) Click OK
    5) Restart the Adobe Reader and try to access the service again.
    If you have not subscribed to the service please do that as, we do not offer trial for Create PDF.
    Thanks,
    Vikrantt Singh

  • Error when trying to access a form through https

    Hi,
    I'm facing this error when trying to access a form through https, i'm using OAS10g 10.1.2.3 over linux, it has webutil configured and is working perfectly with https
    I'm accessing the form through webcache.
    the error:
    Java Plug-in 1.6.0_37
    Usar versión JRE 1.6.0_37-b06 Java HotSpot(TM) Client VM
    Directorio local del usuario = C:\Users\Carlos
    c:   borrar ventana de consola
    f:   finalizar objetos en la cola de finalización
    g:   liberación de recursos
    h:   presentar este mensaje de ayuda
    l:   volcar lista del cargador de clases
    m:   imprimir sintaxis de memoria
    o:   activar registro
    q:   ocultar consola
    r:   recargar configuración de norma
    s:   volcar propiedades del sistema y de despliegue
    t:   volcar lista de subprocesos
    v:   volcar pila de subprocesos
    x:   borrar antememoria del cargador de clases
    0-5: establecer nivel de rastreo en <n>
    cargar: clase oracle.forms.webutil.common.RegisterWebUtil no encontrada.
    java.lang.ClassNotFoundException: oracle.forms.webutil.common.RegisterWebUtil
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Excepción: java.lang.ClassNotFoundException: oracle.forms.webutil.common.RegisterWebUtil
    cargar: clase oracle.forms.engine.Main no encontrada.
    java.lang.ClassNotFoundException: oracle.forms.engine.Main
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Excepción: java.lang.ClassNotFoundException: oracle.forms.engine.Mainwhat could be the reason it can not find the webutil libraries with https ?? i tried erasing the java's cache but still the same error :(
    Regards
    Carlos

    I got it, i only had to check the option 'Use SSL 2.0 compatible ClientHello format' from the java's control panel advanced tab.
    Metalink's note: 787739.1
    :)

  • EDA Error while trying to access the personal details.

    Hi All,
    A new user(employee) is assigned with EDA responsibility to view/update his personal details and bank details.
    The user is able to view & update the bank details. But he is not able to open the personal details page. He is getting the following error while trying to access the personal detail link.
    HR_BASIC_DETAILS_WEB.GET_READ_ONLY_INFORAMTION: ORA-20002: 3123: Duplicate attribute 'DISPLAY_MARITAL_STATUS' could not be created for item 'HRSSA/28012061'.
    All users except the new user, dont have this issue.
    Oracle Application Version : 11.5.9
    Could someone help me on this.

    Hi Girish,
    Do you find out the solution to this issue? We having a similar issue with our Enterprise Portal using Apache and Siteminder Agent?

  • NetStorage encountered an error while trying to access this

    Strange problem with NetStorage. If I log in to NetStorage on Server A I get a listing of my drives from my login script and have no problems accessing any of them. If I log in to Server B I also get a listing of my drives and can access all of them except for the drives on Server A. When I try to access them I get the following error: "NetStorage encountered an error while trying to access this location." Anyone have any ideas on what could be causing the problem?
    Here's the particulars:
    Server A
    OES2 sp3 on SLES 10
    Internal Network
    Server B
    OES2 sp1 on SLES 10
    DMZ Network
    At first I thought this might be a firewall port issue so I had my network guy open ports 80, 443, and 51080 from server B to server A. Didn't fix the problem.
    I have been searching the forums for an answer but, have not found one that helps for this situation. Thanks in advance for your help.

    Originally Posted by mtracy
    Strange problem with NetStorage. If I log in to NetStorage on Server A I get a listing of my drives from my login script and have no problems accessing any of them. If I log in to Server B I also get a listing of my drives and can access all of them except for the drives on Server A. When I try to access them I get the following error: "NetStorage encountered an error while trying to access this location." Anyone have any ideas on what could be causing the problem?
    Here's the particulars:
    Server A
    OES2 sp3 on SLES 10
    Internal Network
    Server B
    OES2 sp1 on SLES 10
    DMZ Network
    At first I thought this might be a firewall port issue so I had my network guy open ports 80, 443, and 51080 from server B to server A. Didn't fix the problem.
    I have been searching the forums for an answer but, have not found one that helps for this situation. Thanks in advance for your help.
    So you have NetStorage installed on both Server A and B and if you log in to NetStorage on Server A you can access storage hosted by both Server A and B but if you log in to NetStorage on Server B you can only access storage on Server B?
    One obvious comment is that Server B is running an old and now unsupported version of OES2 - the only version of OES2 now supported is OES2 SP3 on SLES10 SP4. Theoretically that shouldn't make a difference but I know that whilst NetStorage may not have visibly changed much over OES versions it has received some bug fixes along the way.
    Your comment about firewalls leads me to ask whether that implies you're blocking all the other ports between the two servers? NetStorage uses the XTier framework which in turn uses NCP to access remote servers. NCP uses UDP port 524.
    HTH.

  • I keep getting an error while trying to access the service

    I keep getting an error while trying to access the service

    Can you try to use ExportPDF directly on the website https://cloud.acrobat.com/exportpdf
    [topic moved to ExportPDF forum]

  • Implement callback for an asynchronous BPEL process through Java

    Hi ,
    I am trying to implement a callback functionality for an asynchronous BPEL process through java.
    I found the code in the samples folder of SOA suite installation folder .
    <SOA_HOME>\bpel\samples\tutorials\102.InvokingProcesses\rmi\com\otn\samples\async.
    There is an AsyncInstanceWatchdog object which registers a callback object(in this case an object of AsyncCallbackImpl class) for a specific CONVERSATION_ID.
    String convId = GUIDGenerator.generateGUID();
    nm.setProperty(NormalizedMessage.CONVERSATION_ID, convId);
    deliveryService.post(proc_name, "initiate", nm);
    // register the callback
    watchdog.registerAsyncCallback(convId, testAsyncHandler,
    locator.getDomainAuth());
    // start it
    watchdog.start();
    There is no problem till the last line. But once the BPEL process returns the control( does a callback), it throws the following error.
    May 25, 2010 3:36:06 PM oracle.j2ee.rmi.RMIMessages EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER
    WARNING: Exception returned by remote server: {0}
    ORABPEL-02118
    Variant not found.
    The variant "output" has not been declared in the current scope. All variants must be declared in the scope before being accessed.
    Please check that the variant "output" is properly declared; otherwise there may be a misspelling in the name of the variant.
         at com.collaxa.cube.engine.core.Scope.getVariantRV(Scope.java:535)
         at com.collaxa.cube.engine.CubeEngine.getFieldValue(CubeEngine.java:2668)
    For your reference the variable output is declared in the definition of AsyncCallbackImpl (which implements the IAsyncInstanceCallback interface).
    There are 2 methods defined in the AsyncCallbackImpl class.
    public void onResult(Map pResultMessage) {
    System.out.println("called back! ");
    Iterator iTest = pResultMessage.keySet().iterator();
    while (iTest.hasNext()) {
    String key = (String)iTest.next();
    System.out.println(XMLHelper.elementToString((Element)pResultMessage.get(key)));
    public String getVariableName() {
    return "output";
    The variable name is same given in the sample code. And the BPEL process returns variable named output. So the name should not be a problem.
    Is it because of the scope of the variable.. If so, how do I change it.
    Any help would be appreciated.
    Edited by: saptarishi on May 25, 2010 4:24 PM
    Edited by: saptarishi on May 26, 2010 4:45 PM

    Solved it by some googling .... :)
    Here is the link:-
    [http://abhishek-soablog.blogspot.com/2008/09/orabpel-02118.html]
    or
    [http://beautifulwaste.blogspot.com/2008/04/calling-asynchronous-bpel-process.html]
    Both gives the same solution..
    In pre 10.1.3.3 release the default behaviour were to keep global variable information along with the instance information for completed BPEL processes.
    In 10.1.3.3 or later, this behaviour changed for performance reasons so that the default behaviour is now, not to keep any global variables for a BPEL process once the BPEL process has completed.
    You can configure this behaviour on a process level basis by using the parameter keepGlobalVariables in the bpel.xml file for the specific process:
    <BPELSuitcase>
    <BPELProcess src=".........." id="...........">
    <configurations>
    <property name="keepGlobalVariables">true</property>
    </configurations>
    </BPELProcess>
    </BPELSuitcase>
    Thanks
    saptarishi

  • Getting the final result of BPEL Process through Java

    I am trying to invoke BPEL Process from Java code as follows:
    NormalizedMessage res=deliveryService.request("BPELProcess1", "process", nm);
    Map payload = res.getPayload();
    System.out.println("size=="+payload.size());
    Element e = (Element)payload.get("payload");
    Node node = e.getFirstChild();
    NodeList list = e.getChildNodes();
    for(int k=0;k<list.getLength();k++){
    Node n= list.item(k);
    System.out.println("Node-->"+n.getNodeName());
    The node names getting printed are :
    Node-->#text
    Node-->result
    Node-->#text
    When i retrieve value from these nodes using getNodeValue(), it is showing null for result. However through the BPEL Console, when i see the instance, it shows the result as 5 :
    <outputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload">
    <BPELProcess1ProcessResponse xmlns="http://xmlns.oracle.com/BPELProcess1">
    <result>5</result>
    </BPELProcess1ProcessResponse>
    </part>
    </outputVariable>
    Any comments on this will help a lot. Thanks

    Does this example helps you:
    http://orasoa.blogspot.com/2007/06/calling-bpelesb-webservice-from.html

  • MSS error while trying to access Adobe forms

    Hi all
    We are using EP 7 sp14. Delpoyed ESS/MSS BP SP 14. while trying to access certain functionalities in MSS which make use if standerd Adobe interactive forme through portal its coming up with the following error.
    com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized.
    I had done few settings in Visual Admin in
    1. server >services>web services security>web services clients>sap.com>tcwdpdfobject>com.sap.tc.webdynpro.adsproxy.Adsproxy*configPort_Document.
    2. In default URL gave : http://portalserver:port/AdobeDocumentServices/Config
    3. Authentication:Basic Authentication : gave username:ADSUSERpwd which is set in the backend.
    4. In Deploy stopped and started the application.
    Also in Destinations -> Created a new HTTP and set the URL pointing to the backend.
    Is there any additional configuration to be set on the Portal side.
    Regards,
    Sasha.

    Got corrected with changing data-type for a property in the definition file.

  • Column Not found error while trying to access databse through JSP+Java Bean

    I am trying to acees MS Access 2003 db through JSP using Tomcat 5.0.28.The code for accessing the databse is incorporated in the bean.The jsp only calls the particular method of the bean .
    Code for Java Bean:
    package ActiveViewer;
    import java.sql.*;
    import java.util.*;
    public class CompanyBean
    Connection con;
    ResultSet rs=null;
    Statement st;
         public CompanyBean(){}
         public void connect()
         try
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Here4");
    con=DriverManager.getConnection("jdbc:odbc:activeviewer","","");
         System.out.println("Here1");
         catch (ClassNotFoundException e)
         System.out.println("Could not locate driver.");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
         e.printStackTrace();
         catch (Exception e)
    System.out.println("An unknown Exception has occured :: "+e);
         e.printStackTrace();
    public void disconnect()
         try
         if (con!=null)
    con.close();
         catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
         e.printStackTrace();
    public ResultSet select(String username)
    if(con!=null)
         try
    st=con.createStatement();
         rs=st.executeQuery("select * from company where username='" + username + "'");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
         e.printStackTrace();
    catch (Exception e)
    System.out.println("An Exception has occured while retrieving :: "+e);
    e.printStackTrace();
    else
    System.out.println("Connection to database was lost.");
    return rs;
    The code for JSP that uses the above bean is:
    <%@ page language="java" import="java.sql.*,ActiveViewer.* " contentType="text/html"%>
    <jsp:useBean id="conn" scope="session" class="ActiveViewer.CompanyBean" />
    <html>
    <body>
    <% String username=request.getParameter("username");
    String password=request.getParameter("password");
    System.out.println("username:"+username);
    System.out.println("password:"+password);
    conn.connect();
    ResultSet rs=conn.select(username);
    System.out.println("Below select ");
    while (rs.next())
    String dbusername=rs.getString("username");
         String dbpassword=rs.getString("password");
         if(dbusername.equals(username) && dbpassword.equals (password))
    { %> out.println("OK");
              <% }
    else { %>Invalid Username and / or Password.
    <br>Clickhere to go back to Login Page.
    <% }
    } %>
    </body>
    </html>
    I get the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Column not found
    though the database is not int he same folder as the jsp, the DSN is set correctly to pint to the db location.The jsp does print in stdout file:
    Here4 (from connect method above)
    Here 1 (from connect method above)
    Below Select (from jsp)
    This means that the jsp does connect to db but it gives the above error.Also the field name also matches that in the database and data is present in the db too.
    All other things like creating package for bean,incorporating the packakage are done.
    Can someone please help me with their precious advice?

    U're getting this error because there is no field called 'password' in ur database, the field in ur database is named 'cpassword' and not 'password'. So change the statement rs.getString("password"); to rs.getString("cpassword");

  • Column Not found error while trying to access database through JSP+Java Bea

    I am trying to access MS Access 2003 db through JSP using Tomcat 5.0.28.The code for accessing the database is incorporated in the bean.The JSP only calls the particular method of the bean .
    Code for Java Bean:
    package ActiveViewer;
    import java.sql.*;
    import java.util.*;
    public class CompanyBean
    Connection con;
    ResultSet rs=null;
    Statement st;
    public CompanyBean(){}
    public void connect()
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    System.out.println("Here4");
    con=DriverManager.getConnection("jdbc:odbc:activeviewer","","");
    System.out.println("Here1");
    catch (ClassNotFoundException e)
    System.out.println("Could not locate driver.");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    catch (Exception e)
    System.out.println("An unknown Exception has occured :: "+e);
    e.printStackTrace();
    public void disconnect()
    try
    if (con!=null)
    con.close();
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    public ResultSet select(String username)
    if(con!=null)
    try
    st=con.createStatement();
    rs=st.executeQuery("select * from company where username='" + username + "'");
    catch (SQLException e)
    System.out.println("An SQL Exception has occured :: "+e);
    e.printStackTrace();
    catch (Exception e)
    System.out.println("An Exception has occured while retrieving :: "+e);
    e.printStackTrace();
    else
    System.out.println("Connection to database was lost.");
    return rs;
    The code for JSP that uses the above bean is:
    <%@ page language="java" import="java.sql.*,ActiveViewer.* " contentType="text/html"%>
    <jsp:useBean id="conn" scope="session" class="ActiveViewer.CompanyBean" />
    <html>
    <body>
    <% String username=request.getParameter("username");
    String password=request.getParameter("password");
    System.out.println("username:"+username);
    System.out.println("password:"+password);
    conn.connect();
    ResultSet rs=conn.select(username);
    System.out.println("Below select ");
    while (rs.next())
    String dbusername=rs.getString("username");
    String dbpassword=rs.getString("password");
    if(dbusername.equals(username) && dbpassword.equals (password))
    { %> out.println("OK");
    <% }
    else { %>Invalid Username and / or Password.
    <br>Clickhere to go back to Login Page.
    <% }
    } %>
    </body>
    </html>
    I get the following error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Column not found
    though the database is not int he same folder as the jsp, the DSN is set correctly to pint to the db location.The jsp does print in stdout file:
    Here4 (from connect method above)
    Here 1 (from connect method above)
    Below Select (from jsp)
    This means that the jsp does connect to db but it gives the above error.Also the field name also matches that in the database and data is present in the db too.
    All other things like creating package for bean in WEB-INF/classes,incorporating the packakage are done.
    Can someone please help me with their precious advice?

    Hi, I too have a problem with an SQL exception, the message is Column not found.
    I'm using the sun jdbc odbc driver with access.
    the first few lines of the stack trace are
    sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1852)
    sun.jdbc.odbc.JdbcOdbcResultSet.getInt(JdbcOdbcResultSet.java:603)
    net.homeip.sdaniels.MemberBean.ejbFindByUnamePwd(MemberBean.java:127)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    I am of course sure that the column does infact exist. I can insert into the column no problems. the sql looks like this:
    SELECT * FROM Members WHERE uName ='Stewart' AND encPwd='�F2C�3����h�1Y�'
    Can any one tell me if there is a common cause to this problem?
    Thanks

Maybe you are looking for