Connecting a servlet using a midlet

Hi,
I am trying to connect to a servlet using a Midlet. The servlet is running fine on Apache Tomcat and I m able to build the MIDlet using J2MEWTK . But when I execute the Midlet on an emulator it shows me some code of html page of which the important line which might give u some hint is :
the requested resource (/hitservlet) is not available.
I wrote the code of HitServlet and Hitmidlet using a pdf on net....Do I need to install something else for executing this? I dont understand where is the problem. Should I post the codes? Is it something related to aliases...as indicated by some some tutorial...if so plss elaborate on it..
If anybdy has any idea ...plss help me get out of this problem...
Thanx
Smeeta

Have you added the URL of the Servlet into the J2ME application?
Settings -> UserDefined Tab
Thinks its
HitMIDlet.URL and its value should be the URL of the Servlet

Similar Messages

  • Running Servlet Using ServletRunner(Midlet Connectivity)

    Hi I've made a program that connects a midlet to a servlet for DB connectivity.But when i compile the servlet class it gives error Http servlet not found.I want to ask in which folder of (JSDK2.0) should i keep my servlet file so as to compile it & in which folder should the class file be placed so as to run on the localhost.Please help me as its urgently needed for my project.Thanks.......

    Usually to manage servlet you have to create a WEB-INF directory where to put your web.xml file and a 'classes' sub directory where to put the servlet (.java & .class).

  • Https Connection from servlets using JSSE.

    Hi all,
    Although my question is the same as the QOW for this week, there is an error "unsupported keyword EMAIL" returned when i try to establish a https connection using servlet. The error log is as follow:
    =====================================
    java.io.IOException: unsupported keyword EMAIL
    at com.sun.net.ssl.internal.ssl.AVA.<init>([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.RDN.<init>([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.X500Name.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.ssl.X500Name.<init>([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect([DashoPro-V1.2-120198])
    at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream([DashoPro-V1.2-120198])
    at URLReader.doGet(URLReader.java:78)
    ===================================
    Does anyone know the meaning of this error?
    I try to write a java application using the similar code and it totally works fine(i can connect to the server and obtain the page). Does JSSE support Java Servlet? Or this is the problem of tomcat server? FYI, I'm using
    Tomcat 3.2.2
    Java SDK 1.3
    Many thanks!
    Ethan
    p.s. Here is the source for my program
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.net.*;
    import javax.net.ssl.*;
    import com.sun.net.ssl.*;
    public class URLReader extends HttpServlet{
    private PrintWriter out = null;
    public void doGet(HttpServletRequest req, HttpServletResponse res){
    res.setContentType("text/html");
    res.setHeader("Cache-Control", "no-cache");
    res.setHeader("Progma", "no-cache");
    out = res.getWriter();
    java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    System.setProperty("javax.net.ssl.trustStore", "File_for_keyStore");
    System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    try {
         URL url = new URL("https://server_name:port/index.htm");
         HttpsURLConnection urlconnection = (HttpsURLConnection)url.openConnection();
         BufferedReader in = new BufferedReader(new InputStreamReader(urlconnection.getInputStream()));
         String outputLine ;
         while ( (outputLine = in.readLine()) != null){
         out.println("There is the result: "+outputLine);
         in.close();
    catch(Exception e){
    public void doPost(HttpServletRequest req, HttpServletResponse res){
    }

    I was just having this issue, after months of error-free ssl behavior, on a new machine i was installing (Note: that I was running the IBM jdk1.3) It turns out that when I was editing the java.security file to know about JCE/JSSE providers i had the providers in the wrong order. The Error causing sequence was:
    security.provider.1=com.sun.net.ssl.internal.ssl.Provider
    security.provider.2=com.ibm.crypto.provider.IBMJCA
    # Extra provider added ibm@33894
    security.provider.3=com.ibm.crypto.provider.IBMJCE
    # extra provider i added
    security.provider.4=sun.security.provider.Sun
    The issue disappeared when i changed the order to:
    security.provider.1=sun.security.provider.Sun
    security.provider.2=com.sun.net.ssl.internal.ssl.Provider
    security.provider.3=com.ibm.crypto.provider.IBMJCA
    # Extra provider added ibm@33894
    security.provider.4=com.ibm.crypto.provider.IBMJCE
    hope that helps!
    --john molnar
    Trellis Network Security

  • Problem to connect to mysql from servlet using a javabean

    Hi,
    I'm new here and beginner on java to.
    I have problem to connect to MySql database, by a connection javabean.
    It's the following: a HTML page calls a servlet and this servlet imports the package connection javabean.
    It has no problem when I establish the connection inside the servlet, with all its methods (public and private). But i want to separate the code connection from servlet.
    Detail: there is no problem, using the javabean to connect to MS Access database.
    I put "mysql-connector-java-3.1.12-bin.jar" file inside WEB-INF/lib application and common/lib directories.
    I set the classpath:
    SET CLASSPATH=%CATALINA_HOME%\COMMON\LIB\mysql-connector-java-3.1.12-bin.jar;%CLASSPATH%
    I think that the servlet cannot create an instance of javabean, because passed by catch exception of the servlet init method.
    But I don't know why.
    Please Why?
    Below there are the fragment of errors, servlet code e javabean code.
    Thank you.
    Zovao.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
    at CadServletFileBeanConexArq.doPost(CadServletFileBeanConexArq.java:47)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
    Note: The line 47 is calling insertIntoDB javabean method.
    ========///////////////===============
    // Here is the servlet CadServletFileBeanConexArq.java
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.sql.*;
    import conJdbc.*;
    public class CadServletFileBeanConexArq extends HttpServlet {
    public ConexPed connect = null;
    private String driver = "com.mysql.jdbc.Driver";
    private String URL = "jdbc:mysql://localhost:3306/cadastro";
    public void init( ServletConfig config )
    throws ServletException
    super.init( config );
    try
    connect = new ConexPed(driver, URL, "monty", "some_pass");
    catch ( Exception e )
    e.printStackTrace();
    connect = null;
    public void doPost( HttpServletRequest req,
    HttpServletResponse res )
    throws ServletException
    boolean success = true;
    String email, nome, sobrenome, produto, valor;
    email = req.getParameter( "Email" );
    nome = req.getParameter( "Nome" );
    sobrenome = req.getParameter( "Sobrenome" );
    produto = req.getParameter( "Produto" );
    valor = req.getParameter( "Valor" );
    res.setContentType( "text/html" );
    if ( email.length() > 0 && nome.length() > 0 && sobrenome.length() > 0 && valor.length() > 0 )
    /* inserting data */
    success = connect.insertIntoDB(
    "'" + email + "','" + nome + "','" + sobrenome + "','" + produto + "'", Double.parseDouble(valor) );
    //closing connection
    public void destroy()
    connect.fecharConexao();
    =============///////////////============
    Here is the JavaBean.
    package conJdbc;
    import java.sql.*;
    public class ConexPed
    public Connection connection;
    public Statement statement;
    public ConexPed (String driver, String urlServidor, String user, String password)
    try
    Class.forName(driver);
    connection = DriverManager.getConnection(urlServidor,user,password);
    catch (ClassNotFoundException ex)
    System.out.println("N�o foi poss�vel encontrar a classe do Driver: " + driver);
    catch (SQLException ex)
    System.out.println("N�o foi poss�vel conectar ao servidor");
    try
    statement = connection.createStatement();
    catch (SQLException ex)
    System.out.println("N�o foi poss�vel criar a statement");
    *Inserting data to database
    public synchronized boolean insertIntoDB( String stringtoinsert, double valor)
    try
    statement.executeUpdate( "INSERT INTO pedido values (" + stringtoinsert + " , " + valor + ");" );
    catch ( Exception e ) {
    System.err.println(
    "ERROR: Problemas ao adicionar nova entrada" );
    e.printStackTrace();
    return false;
    return true;
    * Close statement.
    public void fecharStatement()
    try
    statement.close();
    catch (SQLException ex)
    ex.printStackTrace();
    * close database
    public void fecharConexao()
    try
    connection.close();
    catch (SQLException ex)
    ex.printStackTrace();
    }

    Hi,
    I'm new here and beginner on java to.
    I have problem to connect to MySql database, by a connection javabean.
    It's the following: a HTML page calls a servlet and this servlet imports the package connection javabean.
    It has no problem when I establish the connection inside the servlet, with all its methods (public and private). But i want to separate the code connection from servlet.
    Detail: there is no problem, using the javabean to connect to MS Access database.
    I put "mysql-connector-java-3.1.12-bin.jar" file inside WEB-INF/lib application and common/lib directories.
    I set the classpath:
    SET CLASSPATH=%CATALINA_HOME%\COMMON\LIB\mysql-connector-java-3.1.12-bin.jar;%CLASSPATH%
    I think that the servlet cannot create an instance of javabean, because passed by catch exception of the servlet init method.
    But I don't know why.
    Please Why?
    Below there are the fragment of errors, servlet code e javabean code.
    Thank you.
    Zovao.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
    at CadServletFileBeanConexArq.doPost(CadServletFileBeanConexArq.java:47)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
    Note: The line 47 is calling insertIntoDB javabean method.
    ========///////////////===============
    // Here is the servlet CadServletFileBeanConexArq.java
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.sql.*;
    import conJdbc.*;
    public class CadServletFileBeanConexArq extends HttpServlet {
    public ConexPed connect = null;
    private String driver = "com.mysql.jdbc.Driver";
    private String URL = "jdbc:mysql://localhost:3306/cadastro";
    public void init( ServletConfig config )
    throws ServletException
    super.init( config );
    try
    connect = new ConexPed(driver, URL, "monty", "some_pass");
    catch ( Exception e )
    e.printStackTrace();
    connect = null;
    public void doPost( HttpServletRequest req,
    HttpServletResponse res )
    throws ServletException
    boolean success = true;
    String email, nome, sobrenome, produto, valor;
    email = req.getParameter( "Email" );
    nome = req.getParameter( "Nome" );
    sobrenome = req.getParameter( "Sobrenome" );
    produto = req.getParameter( "Produto" );
    valor = req.getParameter( "Valor" );
    res.setContentType( "text/html" );
    if ( email.length() > 0 && nome.length() > 0 && sobrenome.length() > 0 && valor.length() > 0 )
    /* inserting data */
    success = connect.insertIntoDB(
    "'" + email + "','" + nome + "','" + sobrenome + "','" + produto + "'", Double.parseDouble(valor) );
    //closing connection
    public void destroy()
    connect.fecharConexao();
    =============///////////////============
    Here is the JavaBean.
    package conJdbc;
    import java.sql.*;
    public class ConexPed
    public Connection connection;
    public Statement statement;
    public ConexPed (String driver, String urlServidor, String user, String password)
    try
    Class.forName(driver);
    connection = DriverManager.getConnection(urlServidor,user,password);
    catch (ClassNotFoundException ex)
    System.out.println("N�o foi poss�vel encontrar a classe do Driver: " + driver);
    catch (SQLException ex)
    System.out.println("N�o foi poss�vel conectar ao servidor");
    try
    statement = connection.createStatement();
    catch (SQLException ex)
    System.out.println("N�o foi poss�vel criar a statement");
    *Inserting data to database
    public synchronized boolean insertIntoDB( String stringtoinsert, double valor)
    try
    statement.executeUpdate( "INSERT INTO pedido values (" + stringtoinsert + " , " + valor + ");" );
    catch ( Exception e ) {
    System.err.println(
    "ERROR: Problemas ao adicionar nova entrada" );
    e.printStackTrace();
    return false;
    return true;
    * Close statement.
    public void fecharStatement()
    try
    statement.close();
    catch (SQLException ex)
    ex.printStackTrace();
    * close database
    public void fecharConexao()
    try
    connection.close();
    catch (SQLException ex)
    ex.printStackTrace();
    }

  • Could not connect to database using servlet

    Hi,
    i'm using oracle 8.1.5.0.0, tomcat 3.2.1, jdk1.2.2 to build an intranet application. I downloaded the classes12.zip and nls_charset12.zip from the oracle web site and install in the oracle\ora81\jdbc\lib directory.
    when i tried to run the samples code provided by oracle, the program can run properly. but when i tried to run it in my own program using servlet, i got an error as follow:
    java.sql.SQLException IoException:The Network Adapter could not establish a connection.
    i have gone through the codes but could not found any errors that I made and now i'm run out of ideas on the error i get.
    could someone please help me with this problem?
    thank you.
    regards,
    Josephine
    null

    No, the web server requires no configuration. You do need to make sure that the classes12.zip file is in the Tomcat classpath - I believe the Tomcat startup script pulls in all the files in $TOMCAT_HOME/lib, so put the zip file there. I assume you had to change your hostname in the connection URL - what are the connection parameters you used in the Oracle samples? Were these samples Servlets, or command-line programs? Usually when you get the "Network Adapted could not establish a connection" error from the JDBC thin driver, it means that your hostname or port number or SID are wrong,or the database is not up.
    John H.
    null

  • J2me & servlet - exception  in midlet output

    I am invoking servlet in my MIDlet application. when i invoke on my local netword with local ip of web server it works properly on browser and midlet. but when i invoke with internet with global ip of web server it works properly only on browser not on MIDlet. it gives msg - "Uncaught exception java/lang/IllegalArgumentException"
    i am not understanding the problem and helpless...
    please help me to solve this problem....
    my code is here... (for invoking servlet on midlet - i am displaying returning value of this method on form)
    methos in medlet
    public String invokeServlet(String data) throws IOException
    //String url="http://127.0.0.1:8081/dictionary/searchword_mobile?word=" + data; //working properly
    //String url="http://192.168.1.54:8081/dictionary/searchword_mobile?word=" + data; //working properly
    //String url="http://192.168.0.115:8080/dictionary/searchword_mobile?word=" + data; //working properly
    String url="http://202.144.52.226:8080/dictionary/searchword_mobile?word=" + data; //not working gives exception
    HttpConnection c = null;
    InputStream is = null;
    StringBuffer b = new StringBuffer();
    try
    c = (HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-CA");
    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1)
    b.append((char) ch);
    catch (Exception e)
    wordbox.setString("Exception " + e);
    finally
    if(is!= null)
    is.close();
    if(c != null)
    c.close();
    return b.toString();
    =======================
    servlet code
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import com.dictionary.wordpack.WordDAO;
    public class SearchWordServlet_Mobile extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException
              String word=request.getParameter("word");
              String returndata=new WordDAO().searchword_mobile(word);
              //System.out.println("word for searching : " + word);
              response.setHeader("Content-Type", "application/octet-stream");
              response.setHeader("Cache-Control","no-store");
              response.setHeader("Cache-Control", "no-cache");
              response.setHeader("Pragma","no-cache");
              response.setHeader("Cache-Control", "no-transform");
              response.setHeader("Connection", "Keep-Alive");
              response.setHeader("Proxy-Connection", "Keep-Alive");
              response.setContentType("text/plain");
              response.setContentLength(returndata.length());          
              ServletOutputStream out=response.getOutputStream();
              out.print(returndata);                         
              out.close();          
    =====================
    plseae suggest me solution for this problem.
    thanks in advance...

    Are you able to receive any data in simulator I mean to say are you getting the same exception in simulator too?
    Use POST method in place of GET, and check.
    What are you passing in the variable data? May be the data size is exceeding the limit.
    If you resolved then don't forget to reward!!!
    Shan!!!

  • How can I open an AS400 connection w/o using the ODBC in the Control Panel

    Hi.
    Is it possible that i manipulate the ODBC settings in Windows NT using Java?
    I've been using the Client Access ODBC Driver (32 bit) of IBM to connect to AS400 database. Normally i would just configure my DSN and input the default library inside the Server tab that i would be using . All was working perfectly. But i was informed that the default library would vary depending on the data inputed in the library database.
    As in, in our SQL Server they have there a tbl_library where in lib_type is one of it's field. This(lib_type) is where they can specify which library my program would be opening. So in this case, I can't just manually configure my DSN library when retrieving data from AS400 because it would always vary.
    Thank you very much for your time.
    -marlin
    ps.
    Btw, i am doing a servlet for this connectivity.

    If you use the JDBC driver that's included in the AS/400 Toolbox for Java you don't need to use ODBC at all, you can access the AS/400 directly. See this link:
    http://www-1.ibm.com/servers/eserver/iseries/toolbox/

  • How to create a iview in eclipse for connecting  R/3 using JCA?

    Hi everybody,
           I want to create a iview in eclipse for connecting  R/3 using JCA. Can any body send me java code for this purpose. i tried one example from sdn in eclipse but i did't get any code for the same.
    thanking you
    Rajendra

    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sap connector examples download.htm

  • Problem with thin driver connection from servlet

    i'm using a servlet and i'm trying to connect to Oracle using the syntax below. but i get an error.
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@qit-uq-cbiw:1526:orcl", "scott", "tiger");
    // @machineName:port:SID, userid, password
    the error...
    Class oracle.jdbc.driver.OracleDriver not found.
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    ^
    1 error
    i guess the question is, what should be in place of
    oracle.jdbc.driver.OracleDriver());

    Here is what I use:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection(url, userName, password);Which would appear to be the same as what you use. So your syntax is probably OK. This driver exists in a file provided by Oracle as classes12.zip or classes12.jar. On a normal Oracle9i install on Windows this is located C:\oracle\ora90\jdbc\lib, where C: is your Oracle installation drive. I would check to be sure that your classpath points to this specific file (not just the directory).
    Also, if you are using an OLD version of Oracle, this file could be named classes111.zip or classes111.jar.
    Joel

  • Communication with servlet using HTTPURLConnection

    Hi Again,
    well..trying to connect to a servlet using the HTTPURLConnection class.
    but the servlet is found (as i have put a system.out in init method of the servlet and that gets printed correctly).my problem is that the doget method does not get invoked.
    following is the code:
    client side:
    public class test
    public test()
    ObjectOutputStream outs=null;
    try
    URL url = new URL("http://127.0.0.1:7001/DataFetchServlet");
    HttpURLConnection urlcon = (HttpURLConnection)url.openConnection();
    System.out.println(urlcon.toString());
    urlcon.setRequestProperty("Content-Type","application/octet-stream");
    urlcon.setRequestMethod("GET");
    urlcon.setDoInput(true);
    urlcon.setDoOutput(true);
    urlcon.setUseCaches(true);
    outs = new ObjectOutputStream(urlcon.getOutputStream());
    String str = new String("hello");
    outs.writeObject(str);
    ObjectInputStream inp = new ObjectInputStream (urlcon.getInputStream());//********************
    outs.flush();
    outs.close();
    catch(Exception e)
         e.printStackTrace();
    //******************** THIS LINE GIVES A FILENOTFOUND EXCEPTION
    I am sure the servlet is found before the object is written but after the getInputStream it throws the excpetion..
    can anyone help?????
    THanx in advance

    urlcon.connect();

  • What type of connection should i use?

    Not sure if i should i post this here or web tier api's, but here goes...
    I have a servlet in a tomcat webserver and i want it pass information between it and a standard j2se application running on the same machine.
    I'm not sure what type of connection i should use?
    DataStream?
    Socket?
    HttpConnection?
    Any other recommended method?
    Or if i need a network connection like that at all?
    Thanks for the help

    The most straightforward method would be to use rmi since both are running java. that is the least amount of work on your part in terms of managing connections and data marshalling. any of the other solutions add more burdens in one or both of these areas.

  • JDBC connection in session using HttpSessionBindingListener

    Hi All,
    Our architechture needs us to store an OCI connection in the HTTPSession once
    the user logs in. This connection is then used for any DB related queries(passed
    around to workshop controls etc). I know this is againt generally recommended
    practice, but given that we need to do it, i thought of wrapping this connection
    in an HttpSessionBindingListener ,so that when the Servlet API calls the onValueUnbound(),
    i can close the internal connection. However, it has come to my notice that the
    valueUnbound method is not called each and every time a browser window is closed
    or a session times out. Does my wrapper object NEED to implement Serializable?Even
    if it does, the internal OracleOCIConnection is still unserializable. Is there
    any way i can close such a connection reliably when session is closed/invalidated/expired?
    Thanks.
    Vik.

    Hi, I'd refer you to the ejb newsgroup for expert help in that
    area. I'm jdbc, and what you wanted sounded like that.
    Joe
    vik wrote:
    Joe,
    If we were to use a Statefull session bean to do this, could you guide me on how
    i would go about doing it in general terms? One way i can think of is:have a ejbCreate(userName,passWord),
    which is called on login. This calls the getConnection(userName,passWord) from
    the connectionPool,and if the username/pwd is invalid, i will get a CreateException
    wrapping a SQLException. If it goes allright, i now have a session bean associated
    with this client holding a JDBC connection using his credentials.How would i share
    this session bean across the app so that if there are any SQL operations to be
    performed by any action(we are using WorkShop and Weblogic8.1), they are done
    using this session bean. Should i be storing this Stateful Session Bean in the
    HTTP session then?
    Regards,
    Vikram.
    Joe Weinstein <[email protected]> wrote:
    vik wrote:
    Hi All,
    Our architechture needs us to store an OCI connection in the HTTPSessiononce
    the user logs in. This connection is then used for any DB related queries(passed
    around to workshop controls etc). I know this is againt generally recommended
    practice, but given that we need to do it, i thought of wrapping thisconnection
    in an HttpSessionBindingListener ,so that when the Servlet API callsthe onValueUnbound(),
    i can close the internal connection. However, it has come to my noticethat the
    valueUnbound method is not called each and every time a browser windowis closed
    or a session times out. Does my wrapper object NEED to implement Serializable?Even
    if it does, the internal OracleOCIConnection is still unserializable.Is there
    any way i can close such a connection reliably when session is closed/invalidated/expired?
    Thanks.
    Vik.This sounds like stateful session bean, no?
    Joe

  • Connection to XE using JDeveloper fails

    I am creating a java thin client connection in JDeveloper (using the connection navigator) but I get the following error:
    Io exception: The Network Adapter could not establish the connection
    Everything on XE works fine; see listener output and tnsping (I can connect using sqlplus; no problem, there is nothing wrong with XE itself):
    LSNRCTL for Linux: Version 10.2.0.1.0 - Beta on 01-FEB-2006 15:28:28
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux900)(PORT=1521)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 10.2.0.1.0 - Beta
    Start Date 01-FEB-2006 15:01:51
    Uptime 0 days 0 hr. 26 min. 37 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Default Service XE
    Listener Parameter File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/listener.ora
    Listener Log File /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/log/listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux900)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=linux900)(PORT=8080))(Presentation=HTTP)(Session=RAW))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "XE" has 1 instance(s).
    Instance "XE", status READY, has 1 handler(s) for this service...
    Service "XEXDB" has 1 instance(s).
    Instance "XE", status READY, has 1 handler(s) for this service...
    Service "XE_XPT" has 1 instance(s).
    Instance "XE", status READY, has 1 handler(s) for this service...
    The command completed successfully
    TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 01-FEB-2006 15:29:32
    Copyright (c) 1997, 2005, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = linux900)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
    OK (20 msec)
    I am using Jdeveloper release 10.1.2.1.0 (build 1913)
    The following connection properties are being used:
    Type: Oracle (JDBC)
    Driver: oracle.jdbc.driver.OracleDriver
    User: hr
    URL: jdbc:oracle:thin:@127.0.0.1:1521:XE
    I also tried localhost or linux900 (the computers host name)
    I installed both XE and developer on the latest fedora core release.

    Willem - the following suggestion was made to the same questions on the JDBC forum - Re: JDeveloper Oracle XE The Network Adapter could not establish the connec
    Did this work for you ?
    Willem,
    You might want to try connecting to your database purely from Java.
    Here's a class that you use to connect to hr/hr. (providing that its unlocked)
    This is part of a bigger class that is used in a demo app for Oracle XE.
    You'll need to create another class( such as Main.java) that has a main() method which instantiates this class and calls its getAllEmployees() method.
    You can then debug this code to see what the problem is..
    Hope this helps..
    -Chris
    package com.data;
    import java.sql.CallableStatement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.servlet.http.HttpSession;
    import oracle.jdbc.driver.*;
    * DataHandler A Java Class which performs basic data operations on the Employees table.
    public class DataHandler {
    String userid = "hr";
    String password = "hr";
    String jdbcUrl = "jdbc:oracle:thin:@//localhost:1521/xe";
    String query;
    Connection conn;
    Statement stmt;
    ResultSet rset;
    public DataHandler() {
    public ResultSet getAllEmployees() throws SQLException {
    try {
    getDBConnection();
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    query = "SELECT * FROM Employees order by employee_id";
    System.out.println("\nExecuting query: " + query);
    rset = stmt.executeQuery(query);
    } catch ( SQLException ex ) {
    logException( ex );
    return rset;
    public void getDBConnection() throws SQLException {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(jdbcUrl, userid, password);
    public void closeAll() {
    if ( rset != null ) {
    try { rset.close(); } catch ( Exception ex ) {}
    rset = null;
    if ( stmt != null ) {
    try { stmt.close(); } catch ( Exception ex ) {}
    stmt = null;
    if ( conn != null ) {
    try { conn.close(); } catch ( Exception ex ) {}
    conn = null;
    public void logException( SQLException ex )
    while ( ex != null ) {
    ex.printStackTrace();
    ex = ex.getNextException();
    }

  • Can I connect multiple displays using a mac mini

    Can I connect 2 displays using the mac mini? If so, are there any accessories that I need? Are there certain monitors or connections that I should use?

    Hello,
    Assuming this is a 2012 Mini...
    2nd Display Support:
    Dual/Mirroring*
    2nd Max. Resolution:
    2560x1600*
    Details:
    *This model simultaneously supports 1920x1200 on an HDMI or a DVI display (using the included HDMI-to-DVI adapter) and 2560x1600 on a Thunderbolt or Mini DisplayPort display or even a VGA display (with an optional Mini DisplayPort-to-VGA adapter, which is compatible with the Thunderbolt port).
    http://www.everymac.com/systems/apple/mac_mini/specs/mac-mini-core-i7-2.6-late-2 012-specs.html
    If you need more...
    http://eshop.macsales.com/item/NewerTech/VIDU3HDMIDV/
    http://eshop.macsales.com/item/NewerTech/VIDU2DVIA/

  • PI 7.11: Cannot connect to server using message server:...

    Hello Guys,
    we make the Application Management for a Customer PI System.
    Scenario:
    - the SAP Gui Connection to the ABAP Stack is routed via SAPRouter and Works fine.
      SAP Gui -> our SAP Router -> VPN Box from Customer -> Firewall Customer -> ABAP Stack PI System
    - WebAccess its working fine, the Customer use Webdispatcher on every PI Server...
      Browser -> VPN Box from Customer -> Firewall Customer -> Java Stack (Port: 5xx00 btw. 81xx (Webdispatcher))
    Problem:
    Our Problem ist, we can not proceed the Integration Builder or the ESB, the Java Web Start works fine and open the Logon Screen Correctly -> but i fill the Logon Screen with my User name and Password and press Logon come the follwing Error:
    "Cannot connect to server using message server: ms://<hostname>.<domain>:8134/P4"
    In the Details from the Error Message:
    "<hostname>.<domain>:53404 Reason: com.sap.engine.services.rmi_p4.P4IOException:
    Cannot open connection to host: <IP-Adress of Central Instance> and Port: 53404"
    The Customer says, the Firewall is open with the IP Adresses and P4 Port but i dont think so...
    Can everybody help me, or have tips for me! I have checked a lot of OSS Messages (PI High Availabilty etc... its all correct on the System)
    Sorry for my bad English
    Best Regards,
    Markus

    Hi Markus,
    did you check if the browser is using a proxy? (In this case your scenario unfortunately won't work).
    P4-port should generally be routed via a proxy (described in the help.sap.com), but within the PI-Tools(JNLP) the proxy-usage is not implemented.  There is even a SAP-note that describes how to check the JavaWebStart-Proxyconfiguration, but this won't help either.
    If there is a proxy defined in the browser everything is working fine till you pass the logon-screen but even with the correct "javaws"-settings you won't be able to go on.
    (This problem is pretty bad if you do have developers and the SAP-servers seperated because of security issues. I'm hoping that this malfunction will be solved with upcoming patches.)
    Solution: Establish a connection without any proxy in between.
      E.g.: a terminal server in the same network
    It would be helpful to find more people with the same problem to force a fix from SAP for that.
    If anyone else is having problems with this, please add a comment to this thread.
    Best regards
    Christian

Maybe you are looking for

  • File can not be saved

    Hello. I recently moved my Logic Project files to an external drive. When I try to save them, or save as, Logic errors with "the file [xxx] can not be saved". It will still save on my main hard drive if I change the save location. The external drive

  • List of common column name in a table

    I had an urgent request to check for common column name in a table. The table that I can currently have select privelge is ALL_TAB_COLUMNS. I need to list all column_name, table_name, and owner. Thanks.

  • Win 8.1 Outlook removed iCloud link so contacts do not update and yet the mail folder seems to update

    Rediculous... Windows updates 8 to 8.1 and iCloud on Outlook does not work - is it ignorance or spite? How do I fix the problem please.

  • Oracle Business Indicators

    I'm attempting to connect OBI to OBIEE. I can connect and log in via safari but can not seem to get the OBI App to Authenticate. It just sits in an endless loop. Any ideas?

  • RDP SSO?

    I need a little information regarding SSO in use with Remote Desktop services. In searching for RD Services SSO I get these articles about getting the RDWeb SSO and using SSO with RemoteApp. But there is never any mention of RDP itself. My people wan