I cant connect to my java application to oracle 11

i am posting my question after alot of research and alot of google stuff .
i have an oracle 11g 11.1.0.6.0 that is installed on my Laptop all i am trying to do is to connect my java application to the database
i am geting this exception : java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection .
the listener is giving me an error as i show below .
i cant telnet the port also 1521 .
i couldnt connect also through sql developer .
the microsoft windows firewall is off .
the code that i am using to connect :
Connection con=null ;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("The driver has been loaded");
con=DriverManager.getConnection("jdbc:oracle:thin:@AMRO-PC:1521:XE", "aa" , "aa");
System.out.println("Connection was established");
catch (Exception e)
System.out.println(e.toString() );
}//catch
my tnsnames.ora is like this
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Amro-PC)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
the full stacktrace :
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:458)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at Main.main(Main.java:31)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:392)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:434)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:687)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:247)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
... 7 more
Caused by: java.net.UnknownHostException: //localhost
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:117)
at oracle.net.nt.ConnOption.connect(ConnOption.java:133)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:370)
... 12 more
the listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\oracle\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Amro-PC)(PORT = 1521))
DEFAULT_SERVICE_LISTENER = (XE)
it gives me an error when I try to start the listener through LSNCTRL that says :
Message 1070 not found; No message file for product=NETWORK, facility=TNSTNS-125
60: Message 12560 not found; No message file for product=NETWORK, facility=TNS
TNS-00530: Message 530 not found; No message file for product=NETWORK, facility
=TNS
And when I try to see the status of the Listener it says :
Message 1053 not found; No message file for product=NETWORK, facility=TNSTNS-125
41: Message 12541 not found; No message file for product=NETWORK, facility=TNS
TNS-12560: Message 12560 not found; No message file for product=NETWORK, facili
ty=TNS
TNS-00511: Message 511 not found; No message file for product=NETWORK, facilit
y=TNS
32-bit Windows Error: 61: Unknown error
So please can someone help me ?! Thanks in advance
Edited by: 913402 on Feb 9, 2012 12:10 AM

You put the machine name as the host name. I would put the (internal) network address of the laptop there and try again - and make sure that Oracle is actually listening on your internal network address in stead of only the localhost. Or are you running the java application on the same laptop? Then you can simply use 'localhost' as the host name.

Similar Messages

  • Connecting to desktop Java application from R/3

    I want to connect to a java application program in my desktop and return a parameter to R/3. I have installed Java connector and I want to call the java application from R/3 using Java connector.
    I was able to get few samples to setup the RFC destination for a remote server program, but I was not able to find anything for an application in the client system. How to setup the RFC destination for a Java connector to call the application in the desktop? Can anyone please answer this question.

    Hi Allam,
    1. Why do you need to connect from backend system to your desktop client? Did I understood it correctly that it's exacly what you want to do?
    2. I guess examples you saw are for JCO or JCA which is a part of SAP J2EE server. Simply speaking the server is waiting for a client request and your desktop application probably not. If you still are sure that server->desktop connection is what you need then you have to emulate the server on your self and then depending on what you need JCO/JCA you have to create a kind of container that will implement listening service.
    I'd like to hear your answer for question one to give you more detailed answer.

  • Connecting Java application to Oracle Database with JDBC

    How can I connect my Java application using Oracle 11g database?
    Please provide the steps involved along with the coding.

    What kind of Java application? Stand alone/desktop? Or web? Do you need dedicated, individual connections, or connection pooling for 10,000 concurrent users?
    You'll find a few clues in This Article [This Article|http://javawebdb.com/2012/01/30/connecting-a-java-servlet-to-a-database/]

  • How to deploy a POJO or a java application in oracle ESB?

    hi,
    I m beginner in oracle ESB.
    please someone tell me how to deploy a POJO or a java application in oracle ESB?
    thank you.
    Peter.

    The short answer is "you wouldn't"
    The long answer is that you would expose your Java Application or POJO as a Web Service then virtualise it through the ESB.
    If you're wanting to learn more about SOA, ESB and BPEL have you been to this site http://download.oracle.com/docs/cd/B31017_01/index.htm

  • JCo 3.0 connectivity issues between Java application on NWCE and ERP

    Requirement: We have a Java application that would run on NWCE. This application will be invoked from ERP/SAPGUI via HTML Controller. With SSO enabled, the goal is to pass ERP credentials to CE application. This CE application in turn will use ERP credentials from Logon ticket to connect to ERP and invoke BAPI calls (JCo 3.0 destination)
    System Information:
    CE System: SAP NW CE 7.2 SPS 04
    ERP: SAP ECC 6.04
    Both systems are trusted using X.509 certificates
    Current scnerio:
    1) Destination (CE to ERP) - JCo 3.0 using Authetication method of u201CCurrent User (Logon Ticket)u201D
    - Web application is unable to find the JCo 3.0 destination.
    2) Destination (CE to ERP) - JCo 3.0 using Authetication method of u201CTechnical Useru201D
    - Web application is able to find the JCo destination
    Any assiatance in resolving the issues would be appreciated ....
    Trace Log:
    #2.0 #2011 01 19 14:44:38:756#+0100#Error#com.sap.security.core.server.destinations.provider.DestinationsProviderFrame#
    com.sap.getDestinationProperties()#BC-JAS-SEC#tcsecdestinations~provider#001F2960BE89048C0000000100005BC1#16777250000000004#sap.com/TestJcoWebEar#com.sap.security.core.server.destinations.provider.DestinationsProviderFrame#10207625#182##4286395D23D211E08BA2000001000022#d981f18323b011e0b5eb000001000022#d981f18323b011e0b5eb000001000022#0#Thread[HTTP Worker [@2002275007],5,Dedicated_Application_Thread]#Plain##
    ASJ.dest.pr0023#

    Hi Hemandra,
    This is the Full error message i am getting
    Message:   ASJ.dest.pr0023
    Severity:   Error
    Date:   2012-02-09
    Time:   21:37:25:134
    User:   SUPPLIER
    Category:   /System/Security
    Location:   com.sap.security.core.server.destinations.provider.DestinationsProviderFrame
    Application:   XXXXXXXXXXXXXXXXXXXXXX
    Thread:   Thread[HTTP Worker [@254542764],5,Dedicated_Application_Thread]
    Data Source:   j2ee/cluster/server0/log/system/security.log
    Arguments:   
    Passport User Activity ID:   1d2dfea9533811e1adf3000000dc2fc6
    Message ID:   com.sap.getDestinationProperties()
    Session:   11
    Transaction:   
    Time Zone:   +0530
    Customer Message Component:   BC-JAS-SEC
    Runtime Component:   tcsecdestinations~provider
    Correlation ID:   14430150000000004
    Passport Session:   8703D330533611E19565000000DC2FC6
    Passport Connection:   1d2dfea9533811e1adf3000000dc2fc6
    Passport Connection Counter:   0
    Host:   XXXXX
    System:   XXX
    Instance:   J01
    Node:   server0
    Log ID:   C000AC10088100FF0000000000002BF1
    Regards,
    Srinivas

  • Unable to get database connection  from loaded java class in oracle

    Hi all,
    I am trying to call java class method from oracle function, but getting below exception, while creating connection.
    SQL> select charge_calculation(1,'2011-06-01', 'E') from dual;
    select charge_calculation(1,'2011-06-01', 'E') from dual
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.ExceptionInInitializerError
    inside main method
    inside main method1
    inside main method2
    inside main method3
    inside main method3
    Exception in thread "Root Thread" java.lang.ExceptionInInitializerError
    at javax.crypto.Cipher.getInstance(DashoA12275)
    at oracle.security.o5logon.O5LoginClientHelper.decryptAES(Unknown Source
    at oracle.security.o5logon.O5LoginClientHelper.generateOAuthResponse(Unk
    nown
    Source)
    at
    oracle.jdbc.driver.T4CTTIoauthenticate.marshalOauth(T4CTTIoauthenticate.java)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:367)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:
    501)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
    at
    oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java:187)
    at SPEodPricing.spEodPricing(SPEODPRICING:98)
    at SPEodPricing.main1(SPEODPRICING:47)
    Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
    at javax.crypto.SunJCE_b.<clinit>(DashoA12275)
    ... 13 more
    Caused by: java.security.PrivilegedActionException: java.io.IOException
    at java.security.AccessController.doPrivileged(Native Method)
    ... 14 more
    Caused by: java.io.IOException
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java)
    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:165)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:43)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:70)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.ja
    va:102)
    at
    sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:1
    24)
    at javax.crypto.SunJCE_d.a(DashoA12275)
    at javax.crypto.SunJCE_b.g(DashoA12275)
    at javax.crypto.SunJCE_b.e(DashoA12275)
    at javax.crypto.SunJCE_q.run(DashoA12275)
    ... 15 more
    SQL> select charge_calculation(1,'2011-06-01', 'E') from dual;
    select charge_calculation(1,'2011-06-01', 'E') from dual
    ERROR at line 1:
    ORA-29549: class BBVA_MERGED.SPEodPricing has changed, Java session state
    cleared
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64
    bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    JAVA Sample code:-
    public String method1(int pi_ctry_id,String pi_cur_busi_date ,String pi_eod_bod_flag)
    System.out.println("inside main method1");
    CachedRowSet tmplcrs                = null;
    HashMap resMap                              = new HashMap();
              Double ln_candidate_extra           = 0.0;
              Double ln_calculate_on_val          = 0.0;
              int lv_calculate_on                = 0;
              int lv_cand_attribute                = 0;
    // int pi_ctry_id                          = 0;
    // String pi_cur_busi_date           = null;
    int pi_bch_id                          = 0;
    // String pi_eod_bod_flag               = null;
    Date ldt_cur_busi_date          = null;
    Date lstr_next_calc_date     = null;
    int li_bch_id                         = 0;
    int li_chg_ac_branch               = 0;
    int calFrequency                     = 0;
    DbUtils dbObj = new DbUtils();
    Map reqMap = new HashMap();
    CachedRowSet updtcrs                = null;
    Connection conn = null;
              try
    System.out.println("inside main method2");
                   reqMap.put("pi_ctry_id", ""+pi_ctry_id);
                   reqMap.put("pi_cur_busi_date", ""+pi_cur_busi_date);
                   reqMap.put("pi_eod_bod_flag", ""+pi_eod_bod_flag);
    System.out.println("inside main method3");
                   Class.forName("oracle.jdbc.driver.OracleDriver");
    // Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.1.56.85:1521:orcl", "bbva_merged", "bbva_merged");
    // conn = DriverManager.getConnection("jdbc:oracle:thin:@10.1.50.104:1521:cmsdb6", "bbva_base", "bbva_base");
    System.out.println("inside main method3");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.50.129)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.50.130)(PORT = 1521))(LOAD_BALANCE = yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = BBVASIT)))", "BBVA_MERGED", "BBVA_MERGED");
    conn.setAutoCommit(false);
    System.out.println("inside main method4");
    }

    29532, 00000, "Java call terminated by uncaught Java exception: %s"
    // *Cause: A Java exception or error was signaled and could not be
    //          resolved by the Java code.
    // *Action: Modify Java code, if this behavior is not intended.

  • Java application in Oracle

    I'm writing an Java application which is triggered by a table update. The application need call some classes which are packaged in a .jar file. Now, I use Java stored procedure to create the trigger but how can I import the .jar file?? I try to use loadjava but some errors are prompted. I would like to know whether it is possible to use database trigger to initiate a java application (with many classes) and the method to implement such application.
    Thx in advance.

    Hi Avi,
    Thanks for your reply. Here is the error message when I load the .jar into Oracle.
    C:\TEMP>loadjava -u scott/tiger@ORCL C:\Temp\javaOracle.jar
    Error while creating acbbinding/oracl/SCOTT/Tables/EMPPackage/Record
    ORA-29533: attempt to overwrite class or resource acbbinding/oracl/SCOTT/Tables/EMPPackage/Record while defining or compiling SCOTT.acbbinding/oracl/SCOTT/Tables/EMPPackage/Record
    Error while creating acbbinding/oracl/SCOTT/Tables/EMP
    ORA-29533: attempt to overwrite class or resource acbbinding/oracl/SCOTT/Tables/EMP while defining or compiling SCOTT.acbbinding/oracl/SCOTT/Tables/EMP
    Error while creating acbbinding/ODBCException
    ORA-29533: attempt to overwrite class or resource acbbinding/ODBCException while defining or compiling SCOTT.acbbinding/ODBCException
    Error while creating class acbbinding/ODBCException1
    ORA-29537: class or resource cannot be created or dropped directly
    loadjava: 4 errors
    There are similar errors in loading other .jar files. Could you tell me what's the problem?
    I also can write the Java Stored Procedure and trigger it successfully. The problem is whether I can pass some information , say the updated record which initiate the trigger, to other class in the .jar files.
    Thanks for you kindly help again.

  • Is it possible to deploy Java application in Oracle 9iAS

    We have a stadard 3-tier system implemented in Java with a presentation-tier(servlets, JSP), middle-tier(business logic, transactions) and a data-tier(Java classes that hold all SQL and so on).
    NB We're NOT using EJB's!
    For the moment we are running Oracle HTTP server with Apache, Jserv, Ojsp and JRE 1.2.2.
    We are now interested in using Oracle 9iAS as application server and we have a few questions about it.
    1) Is it possible to to run our Java-code inside Oracle 9iAS?
    2) If it is possible, should we run the servlets and JSP there too?
    Regards Peter

    An interesting fact about 9iAS - unless you do some work to change things around, 9iAS = Apache/JServ. So yes you can deploy your app to it. However, OJSP is a technet product so don't expect any tech support. And Oracle won't let you upgrade JServ to Tomcat, so don't expect Servlet 2.2. And if you want to use Orace Servlet Engine to get Servlet 2.2, you might run into some deployment and performance issues. Read my posting in the 9i Application Server forum.
    If, however, you try and meet with more success than I have so far, I will be happy to learn from your experience <grin>.
    John H.

  • 2 jdbc connections from a java application works ok to 9i but not to 10g

    Hi,
    I hava java swing application which opens one jdbc connection. Tha application has 10 classes all of which are in one package say app.someapp.pkg1. This works ok.
    I am trying to integrate a second java component which provides a drilldown JTree interface to the user. The second component has 6 classes and has its own package app.someotherapp.pkgA. The second java component also opens a JDBC connection.
    If both the jdbc connections point to a common 9i database it works fine.
    If both the jdbc connections point to a common 10g 10.0.2.0.0 database the second component fails to open the conection.
    Some static variables in the two packages may be getting overloaded i.e connection. Should this matter even though the packages are different.
    Are there any issues in opening a 2nd connection to 10.0.2.0.0 using JDBC.
    What might I be doing wrong can anyone suggest a line of attack
    Saugato

    Dear All
    IT WORKS FINE . Pls disregards this thread
    I misinterpreted the ORA-02019 error message. The 10g instance was missing a database link to a 3rd remote database . The 9i instance had this database link hence was not complaining.
    The following error was thrown when a select was performed on a table refred to using the database link.
    java.sql.SQLException: ORA-02019: connection description for remote database not found
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)

  • Jdb fails to connect to running java application over sockets

    I'm trying to use jdb to connect to a running instance of a java program.
    If I use dt_shmem:
    java -agentlib:jdwp=transport=dt_shmem,address=shmem,server=y,suspend=n JDBTest
    jdb -attach shmemSet uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    Initializing jdb ...
    quitworks fine.
    If I use dt_socket, jdb crashes:
    java -agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n JDBTestP:\workspace\JDBTest>jdb -attach 9000
    java.io.IOException: shmemBase_attach failed: The system cannot find the file specified
    at com.sun.tools.jdi.SharedMemoryTransportService.attach0(Native Method)
    at com.sun.tools.jdi.SharedMemoryTransportService.attach(SharedMemoryTra
    nsportService.java:90)
    at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingCo
    nnector.java:98)
    at com.sun.tools.jdi.SharedMemoryAttachingConnector.attach(SharedMemoryA
    ttachingConnector.java:45)
    at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnectio
    n.java:358)
    at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:1
    68)
    at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
    at com.sun.tools.example.debug.tty.TTY.main(TTY.java:964)
    Fatal error:
    Unable to attach to target VM.
    It looks like jdb is trying to connect over shared memory instead of using sockets.
    Trying jdb -attach localhost:9000 has the same effect.
    I can however connect to the running Java program using the Eclipse debugger using a remote configuration.
    What can I do that jdb will use sockets?
    I'm using Windows 2000 SP4 and Java 1.5.0_07.
    Many thanks in advance
    Thomas

    jdb -help says:
    -attach <address>
    attach to a running VM at the specified address using standard connector
    On Windows the 'standard', ie. default, connector uses the shared memory transport.
    To connect to a socket, you need to tell jdb to use the socket attaching connector, ie
    jdb -connect com.sun.jdi.SocketAttach:port=9000
    It is hard to remember the names and params of all the connectors. You can do
    jdb -listconnectors
    to refresh your memory.
    HTH.

  • Connection Pooling in Java Application for interacting with Websphere MQ

    I have following infrastruture at my site.
    1> Machine #1 has below
    - Websphere MQSeries 6.0 (client setup - Slim Client)
    - OS = Windows 2003
    - i/p address : 10.1.11.10
    - Tomcat web server 5.5
    - No Websphere Application Server.
    2> Machine #2 has below
    - Websphere MQSeries 6.0 (Server setup)
    - OS = Windows 2003
    - i/p address : 10.1.11.21
    - Queue Manager Name : qMngr
    - Queue Name (client will put the message) : toServerQ
    - Queue Name (client will get the message) : fromServerQ
    - I have developed the web application in Tomcat web server 5.5 using MQ base classes for accessing the Websphere MQ.
    - Since it is web application there can be atleast 25 request at time.
    i.e. when client#1 request data from queue he must get data related to client#1 only not other than client#1.
    - For accessing the websphere MQ, I am using websphere MQ base classes in Client mode. (Not JMS)
    ==>>>> Source Code as follows
    Class MQInterface (Servlet) is used for getting the web request from user and reply the response in html format.
    public class MQInterface extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String Output = "";
    System.out.println("!! Entered into Banking Servlet !!");
    String requestParam = request.getParameter("OPRN_CODE");
    if (requestParam.equalsIgnoreCase("GET_NAME_DETAIL")){
         String id = request.getParameter("id");
         Output = MQDataObject().getNameDetail(id);
    return Output;
    response.setContentType("text/html");
         PrintWriter out = response.getWriter();
    out.println(Output);
    Class MQDataObject is used for getting and putting data(message) into Websphere MQ.
    public class MQDataObject {
    private String hostname = "10.1.11.21";
    private String channel = "Chnl1";
    private String qManager = "qMngr1";
    private MQQueueManager qMgr;
    private ISISSSLAdaptor ssl;
    private ISISConfigHelper ConfigHelper;
    private String Output;
    public MQDataObject(){
    MQEnvironment.hostname = hostname;
    MQEnvironment.channel = channel;
    MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
    MQEnvironment.sslCipherSuite = "SSL_RER_WERH_3KIUD_EQW_CRT_SSA";
    try{
    ssl = new DEMOSSLAdaptor("DEMOSSLAdaptor.config");
    ConfigHelper = new ISISConfigHelper("MQConnection.config");
    }catch(Exception exception){
    System.out.println("Exception Details => " + exception);
    public String getNameDetail(String sendMessage){
    MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
         String msgText = "";
         try
    // Create a connection to the Queue Manager.
    qMgr = new MQQueueManager(qManager);
    // Set up the options on the queue we wish to open
    int openOutOptions = MQC.MQOO_OUTPUT;
    // Specify the queue to open and open option      
    MQQueue sendingQueue = qMgr.accessQueue("toServerQ",openOutOptions,null,null,null);
    // Define the MQ message and write some text in UTF format
    MQMessage sendingMessage = new MQMessage();
    sendingMessage.writeUTF(sendMessage);
    // Specify the message options..
    MQPutMessageOptions pmo = new MQPutMessageOptions();
    // Put message on the queue
    sendingQueue.put(sendingMessage,pmo);      
    // Close Sending Queue
    sendingQueue.close();          
    // Receiving the message back
    // Wait for 5 seconds to get reply from receiving queue
    Thread.sleep(5000);
    // Set up the options on receiving queue we wish to open
    int openInOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;
    MQQueue receivingQueue = qMgr.accessQueue("fromServerQ",openInOptions,null,null,null);
    MQMessage receivingMessage = new MQMessage();
    // Set and Get the message options
    MQGetMessageOptions gmo = new MQGetMessageOptions();
    // Receiving the message off the queue.
    receivingQueue.get(receivingMessage,gmo);
    // Get the message from the receiving queue.
    msgText = receivingMessage.readStringOfByteLength(receivingMessage.getMessageLength());
    // Close Receiving Queue
    receivingQueue.close();
    // Close a connection to the Queue Manager.
    qMgr.disconnect();
    // Parse the received message using parser.
    String output = new IFXXMLParser().runExample(msgText);
    catch (MQException mqex){
    System.out.println("MQ Error : " + mqex);
    catch (Exception ex){
    System.out.println("General Error : " + ex);
    return Output;
    The message for sending the receiving is in XML format.
    Could any one help me following in questions.
    1> Since there is 30 request at time so for improve the performance and resources I need to do connection pooling.
    How can I achieve this using base classes.
    2> While retrieving (getting) the message for particular request how can I identify the response message.
    i.e. when client#1 request data from queue he must get data related to client#1 only not other than client#1.      
    because In above scenario there are separate queues for getting the message and putting the message.
    I have read the tutorial on connection pulling but I am little confused.
    i.e. default connection pool and MQSimpleConnectionManager.
    Thanking in Advance
    Sanjeev

    RahulSharna wrote:
    Well my advice would be something different here..
    Can you tell us whether the swing application that you are referring could be used by multiple client machines at the sametime ??
    If yes my advice for you would be a costly affair yet effective.
    Think of seperating your DAO layer from the swing client and you can make an attempt to make a centralized tier where DAO and business services are handled (also ensure that we you use connection pooling with a good tranaction support for building that tier).
    Think of publishing those as services either by using remoting tehnologies like RMI,Burlap, Hessian or as a Webservice.
    All you'd do is implementing respective client in the swing or client application which you are referring to..
    (if you things are too wierd and what is the best solution to go about the below url offers a good solution
    [http://tuscany.apache.org/]
    And in doing this you'd ensure there is not toomuch load on the Database and you'd have a centralized location where you can start tracing the problem.My guess would be that since the OP said that they have a server that they do in fact have a server.

  • Calling java application from Oracle forms button

    Hi all,
    I have a problem. The idea is to call Java desktop application when button is pressed. I have used this (above) line of code, but there is no results. When I start form in local everything is fine but when I start from server it doesn't work. Does anyone has that kind of problem and how is solved?
    Thanks in advance.
    __Code is:__
    DECLARE
    v_path VARCHAR2(1000);
    BEGIN
    v_path:= '\\location\Java_Application.jar';
    HOST(v_path);
    END;

    First, please start here:
    http://blogs.oracle.com/shay/2007/03/02/
    As for what you are doing and the problem, it will be difficult to give an exact reason, but here are a few comments which will apply regardless of the platform, version, and installation type.
    1. In most case, when calling HOST from Forms the shell that is started does not include all of the system environment variables. This means for example, if a java.exe is needed (on Windows), you would need to specify its path as part of the call or use a batch file rather than calling a command or app directly. The batch file would first set all the needed environment variables (i.e. PATH, CLASSPATH, etc)
    2. If you are running a newer version of Forms, you have a middle tier. This is were your HOST call will be executed. So, if you are expecting this to occur on the client it will not work. You would need WebUtil for client side calls.
    3. Calling a network resource (i.e. shared drive) is not permitted on Windows platforms when called from a Windows Service. Doing so can be seen as a security vulnerability. This can be overridden, but I would suggest that doing so is not a good idea. All files needed to run your app should be made available locally. If files exist on a remote machine, they should be temporarily brought to the machine (e.g. using ftp, sftp, etc) where they are needed and removed later if necessary. If you are running a newer version of Forms, the Forms runtime process belongs to a Windows Service, even if indirectly as a child.
    4. Calling a jar directly is not the proper way to call a java app. Refer to the following:
    http://download.oracle.com/javase/tutorial/deployment/jar/run.html

  • Issue with Java Application with ECC - Connection Issue

    Hi
    We have developed one java application to connect to SAP to extract some data. We are using java API (sapjco) to connect to the SAP. Now we are facing one issue u2013 for the ECC while connecting through the java application we are getting u201CUserid or Password incorrect erroru201D, but with the same userid and password we are able to log through the SAP GUI. If we changed the password with all CAPS (Capital Letters) and without numeric values, its working fine in java application (Means its connecting to ECC)
    We are facing this issue only in ECC; the same application is running successfully in SAP 4.7 etc. without changing password.
    Please Help!

    I would draw the conclusion that you have to provide the paaword in upper case. There is a standar java method there that does this for you. Just do it before sending the password.
    Regards,
    Benny

  • HOW COULD CONNECT FROM SAP SYSTEM TO THIRD PARTY JAVA APPLICATION

    HI expects,
            HOW COULD CONNECT FROM SAP SYSTEM TO THIRD PARTY JAVA or . DET APPLICATION.please provide me some scenarios and documents.please help me.

    Hi,
    In the sender side i.e. in SAP system you can use IDoc/RFC/Proxy to push the data to XI.
    IDoc supports only Async communication and in Sync case performace is good using Proxy.
    In the receiver side you can use Java Proxy to connect to the Java application or you can even bulid a webservice over the Java/.Net application and use SOAP adapter to post data to it.
    Thanks
    SaNv...

  • Open connections between AS Java and AS ABAP when using JRA

    Hi, we have a problem with open connections and hope that someone here could give me hint where to find a solution.
    The situation is that we open a connection from a Java application to an AS ABAP. In detail, the application first connects to a statefull session bean on the AS Java by RMI. The bean communicates with the associated AS ABAP by the Java Resource Adapter (JRA).
    All interactions between all components work correctly. But even after we close the application, manually close of the connections (on side of the AS Java) , remove all created and used session beans there are still open connections between the AS ABAP and the AS Java.
    The transaction smgw (Gateway Monitor) shows open connections from jlaunch to our local SAP gateway using the internal communication protocol. Obviously, the established connections are not closed, even when they are open for a week or longer.
    After opening 100 connections, the AS ABAP denies additional connection attempts.
    We have been able to close all open connections by restarting the AS Java or by restarting the Connector over the Visual Administrator (path: Cluster – Server – Services – Connector Container – “select the right connector” – stop / start).
    We have developed our application similar to the tutorial from [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
    Can someone explain to us why the connections stay open for so long? Is there no timeout mechanism? Or is there some way to close the connections from our Java application?

    Hello,
    maybe someone can help us with our problem.
    We have developed our application similar to the tutorial from https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4 and it was running without problem with the SP12, now we change our system to SP16 and we are having the problem described in note 1083348, but as you can see, for us it was working with SP12 and now it doesn't work with SP16....
    Here is part of our code....
        public List getAll() {
            String functionName = "bla";
            try {
                openConnection();
                MappedRecord response = (MappedRecord) interaction.execute(null, request);
                MappedRecord record = (MappedRecord) response.get("E_S_RETURN_CODE");
                if (((String) record.get("RETURN_CODE")).equalsIgnoreCase("E")) {
                    throw new SQLException((String) record.get("RETURN_TXT"));
            catch (ResourceException exc) {
                throw new EJBException(".");
            catch (SQLException exc) {
                throw new EJBException(".");
            finally {
                closeConnection();
        protected void openConnection() {
            try {
                connection = connectionFactory.getConnection();
                interaction = connection.createInteraction();
            catch (ResourceException exc) {
                interaction = null;
                connection = null;
                throw new EJBException(getExceptionText(exc));
      protected void closeConnection() {
           try {
                if (interaction != null) {
                    interaction.close();
                if (connection != null) {
                    connection.close();
            catch (ResourceException exc) {
                throw new EJBException(".");
    With that code we are getting this error: "Connection handle is already closed and no longer associated with a managed connection" everytime we try to close the connection in the method closeConnection().
    We were thinking that maybe we should not close the connections, because the were already close, and tried not to close the connection (connection.close()), but then after a few time we are getting the following error, because we are not closing the connections:
    Connection to ABAP System could not be opened, because the Connection Factory returns "Cannot get connection for 120 seconds. Possible reasons: 1) Connections are cached within SystemThread(can be any server service or any code invoked within SystemThread in the SAP J2EE Engine), 2) The pool size of adapter "eis/..." is not enough according to the current load of the system or 3) The specified time to wait for connection is not enough according to the pool size and current load of the system. In case 1) the solution is to check for cached connections using the Connector Service list-conns command, in case 2) to increase the size of the pool and in case 3) to increase the time to wait for connection property. In case of application thread, there is an automatic mechanism which detects unclosed connections and unfinished transactions.". Please check the connection defined for the Connection Factory of the Java Resource Adapter with JNDI name...
    Any help?

Maybe you are looking for

  • MEDIASOURCE WON'T UPD

    SO I have the latest plays for sure update on my zen touch. The windows media player autos sync is terrible and freezes everytime. Ive currently just been dragging files on, but that is annoying. I want to go back to mediasource. I have version 2.03.

  • Error within Workflow calling a form

    Hey, I have made a workflow with a form getting some values, transmited to a WF attribute, then i call another form which use this value. First i used a subprocess to call the form and i had this error: "com.waveset.util.WavesetException: Suspended c

  • Can I get the kuler panel in illustrator cs6?

    I Cant get the kuler panel to work in illustrator cs6.

  • Connection to remote database failed

    I have configured the cman.ora file and changed the connection string for the java applet, but I encountered the error "The NT Adapter could not establish the connection" when I tried to connect to remote database from JDev2.0(beta). Any ideas of wha

  • How to incorporate a Language that is not supported in Oracle Portal

    Hi, I want to know the preferred way to add support for a new language in Oracle Portal. If a language is not supported in Oracle Portal, how I can add the content for that language in the Portal? Please advise. Best Wishes.