OracleConnectionPoolDataSource Problem

I'm Trying to connect a JSP tomcat-based application to Oracle using
OracleConnectionPoolDataSource and related classes. I have used
javax.sql.DataSource an it did work fine. I have made changes I need for using
that classes and when I get the DataSource it throws exception
"javax.naming.NamingException: Cannot create resource instance".
I'm using Apache Tomcat 5.5.23 for windows, Java JDK 1.5.0_05 and Oracle 9i
Release 2 (9.2.0.1.0). All for windows.
Changes I have made are these:
In context.xml:
<Context path="/test" docBase="test" debug="0"
reloadable="true" >
<Resource
name="jdbc/test" auth="Container"
type="oracle.jdbc.pool.OracleConnectionPoolDataSource"
maxActive="0" maxIdle="-1" maxWait="-1"
removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true"
username="test" password="test"
driverClassName="oracle.jdbc.pool.OracleConnectionPoolDataSource"
url="jdbc:oracle:thin:@192.168.1.109:1521:GLOBALDB" />
</Context>
In web.xml (only resource-ref):
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>oracle.jdbc.pool.OracleConnectionPoolDataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
Code that creates connection:
initCtx = new InitialContext();
ctx = (Context) initCtx.lookup("java:/comp/env");
ds = (OracleConnectionPoolDataSource) ctx.lookup("/jdbc/test");
PooledConnection pc = ds.getPooledConnection();
con = pc.getConnection();
I have searched in google and found some examples that use
oracle.jdbc.driver.OracleDriver in driverClassName. I have also tried this
option with the same results. I suppose bug is elsewhere.
I have tried to create DataSource instance in the code instead of get it from
resource. Doing this it drops no error and page works, but I don't know how can
I control maximun number of pooled connections. This is the code I have used for
that:
initCtx = new InitialContext();
OracleConnectionPoolDataSource ds = new OracleConnectionPoolDataSource();
ds.setDataSourceName("oracle.jdbc.pool.OracleConnectionPoolDataSource");
ds.setURL(dbURL);
ds.setDescription(DS);
ds.setUser(dbUsuario);
ds.setPassword(dbPassword);
initCtx.rebind(DS, ds);
pc = ds.getPooledConnection();
But it creates only one connection and doesn't allow two users to log in at the
same time.
Please. I need help.

how can
I control maximun number of pooled connections.
Maximum number of dB connections in pool are set using the maxActive parameter.
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
Maximum number of idle dB connections to retain in pool are set using the maxIdle parameter.
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>

Similar Messages

  • OEM Problem in Communicating with Listener

    Dear all,
    for some reason, my OEM is corrupted and when it's enabled, it messes up with the listener. I concluded the problem lies in OEM rather than in the listener since I can establish connection between SQLdeveloper and the server via the listener without any problem.
    I have instance named INARA, host named FIREFLY.SNOWDROP.COM, and listener named ORACLE_LISTENER.
    I closed SQLdeveloper application and its listener and started OEM first to pinpoint the problem. After I started OEM, the Management Service log emoms.log dumped:
    2011-06-15 11:55:12,203 [HTTPThreadGroup-2] WARN  jdbc.ConnectionCache _getConnection.353 - Got a fatal exeption when getting a connection; Error code = 17002; Cleaning up cache and retrying
    2011-06-15 11:55:12,204 [HTTPThreadGroup-2] ERROR conn.ConnectionService verifyRepositoryEx.891 - Invalid Connection Pool. ERROR = Io exception: The Network Adapter could not establish the connection
    2011-06-15 11:55:12,205 [EMUI_11_55_12_/console/aboutApplication] ERROR svlt.PageHandler handleRequest.639 - java.lang.IllegalStateException: Response has already been committed
    java.lang.IllegalStateException: Response has already been committed
         at com.evermind.server.http.EvermindHttpServletResponse.resetBuffer(EvermindHttpServletResponse.java:1892)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:249)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:51)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:193)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:284)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:198)
         at oracle.sysman.emSDK.svlt.PageHandler.render(PageHandler.java:1113)
         at oracle.sysman.emSDK.svlt.PageHandler.myRender(PageHandler.java:1173)
         at oracle.sysman.emSDK.svlt.PageHandler.handleRequest(PageHandler.java:597)
         at oracle.sysman.emSDK.svlt.EMServlet.myDoGet(EMServlet.java:787)
         at oracle.sysman.emSDK.svlt.EMServlet.doGet(EMServlet.java:343)
         at oracle.sysman.eml.app.Console.doGet(Console.java:157)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:107)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.sysman.db.adm.inst.HandleRepDownFilter.doFilter(HandleRepDownFilter.java:146)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.eml.app.BrowserVersionFilter.doFilter(BrowserVersionFilter.java:122)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.emSDK.svlt.EMRedirectFilter.doFilter(EMRedirectFilter.java:102)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:327)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:621)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595) also the Management Agent trace file emagent.trc dumped:
    SQL = "                                                                   OCISessionGet"...
    LOGIN = dbsnmp/<PW>@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=firefly.snowdrop.com)(PORT=1521))(CONNECT_DATA=(SID=inara)))
    2011-06-15 11:57:05,914 Thread-4147767632 ERROR vpxoci: ORA-12541: TNS:no listener
    2011-06-15 11:57:05,914 Thread-4147767632 WARN  vpxoci: Login 0x67fd70 failed, error=ORA-12541: TNS:no listener
    2011-06-15 11:57:05,914 Thread-4147767632 WARN  TargetManager: Exception in computing dynamic properties of {inara.snowdrop.com, oracle_database },GetDbBlockSize::ORA-12541: TNS:no listener
    2011-06-15 11:57:05,916 Thread-4138318160 ERROR TargetManager: nmeetm.c : Target inara.snowdrop.com has a failed critical dynamic property
    2011-06-15 11:57:05,918 Thread-4138318160 WARN  upload: Upload manager has no Failure script: disabled
    2011-06-15 11:57:05,918 Thread-4138318160 WARN  upload: Amount of upload data will be recalculated due to reload.enabling collections and regenerating metadata.
    2011-06-15 11:57:05,918 Thread-4138318160 WARN  TargetManager: Regenerating all Metadata
    2011-06-15 11:57:05,983 Thread-4138318160 WARN  upload: Truncating value of "SHORT_NAME" from "Average Synchronous Single-Block Read Latency (ms)" to "Average Synchronous Single-Block Read La"
    2011-06-15 11:57:05,983 Thread-4138318160 WARN  upload: Truncating value of "SHORT_NAME" from "Average Synchronous Single-Block Read Latency (ms)" to "Average Synchronous Single-Block Read La"
    2011-06-15 11:57:06,080 Thread-4138318160 WARN  upload: Truncating value of "COLUMN_LABEL" from "Total messages processed per queue per subscriber per minute in the last interval" to "Total messages processed per queue per subscriber per minute in "
    2011-06-15 11:57:06,080 Thread-4138318160 WARN  upload: Truncating value of "COLUMN_LABEL" from "Total messages received per queue per subscriber per minute in the last interval" to "Total messages received per queue per subscriber per minute in t"
    2011-06-15 11:57:06,080 Thread-4138318160 WARN  upload: Truncating value of "COLUMN_LABEL" from "Messages processed per queue (%) per subscriber per minute in the last interval" to "Messages processed per queue (%) per subscriber per minute in th"
    2011-06-15 11:57:06,080 Thread-4138318160 WARN  upload: Truncating value of "COLUMN_LABEL" from "Age of the first message in persistent queue per subscriber (seconds)" to "Age of the first message in persistent queue per subscriber (sec"
    2011-06-15 11:57:06,081 Thread-4138318160 WARN  upload: Truncating value of "COLUMN_LABEL" from "Age of the first message in the buffered queue per queue (seconds)" to "Age of the first message in the buffered queue per queue (second"
    2011-06-15 11:57:06,096 Thread-4138318160 WARN  collector: enable collector
    2011-06-15 11:57:06,100 Thread-4138318160 WARN  collector: Regenerating all DefaultColls
    2011-06-15 11:57:07,145 Thread-4147767632 ERROR upload: Exceeded max. amount of upload data: 314 files, 346.533864 MB Data. 89.74% of disk used. Disabling collections.
    2011-06-15 11:57:07,145 Thread-4147767632 WARN  collector: Disable collector
    2011-06-15 11:57:08,237 Thread-4147767632 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:57:08,337 Thread-4147767632 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:57:38,442 Thread-4147767632 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:57:38,545 Thread-4147767632 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:58:08,732 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:58:08,835 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:58:38,952 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:58:39,055 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:59:09,157 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:59:09,260 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:59:39,364 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:59:39,465 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
    2011-06-15 11:59:58,595 Thread-4154857808 ERROR command: nmejcn: received no status header from repository at https://firefly.snowdrop.com:5500/em/upload/Looked like OEM had some errors and warnings after it got initiated but I don't know what they meant.
    After OEM is successfully started, at least according to the emtcl command, I started listener ORACLE_LISTENER. At this point I performed loopback test using NET manager on the server, and it took forever so I aborted it. The database at this point was still open and running without problem though. TNSPING took 157080 msc to return OK value, on the other hand lsnrctl status ORACLE_STATUS was stalled.
    So looking at emagent.trc after listener was initiated:
    2011-06-15 12:02:10,306 Thread-4138318160 WARN  ssl: <nmehlssl.c:nmehlssl_readcb>: nmehl_read_sock timed out, rsf = -5, setting read timeout flag
    2011-06-15 12:02:10,306 Thread-4138318160 WARN  ssl.io: fd=6: nmehlssl_read, nzos_Read error = 28862 readTimed Out = 1
    2011-06-15 12:02:10,306 Thread-4138318160 WARN  http: <nmehl.c>:<nmehl_readline>: nmehlssl_read() timed out
    2011-06-15 12:02:10,306 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Error in request response. code = 400. text =
    2011-06-15 12:02:40,433 Thread-4138318160 WARN  ssl: <nmehlssl.c:nmehlssl_readcb>: nmehl_read_sock timed out, rsf = -5, setting read timeout flag
    2011-06-15 12:02:40,433 Thread-4138318160 WARN  ssl.io: fd=6: nmehlssl_read, nzos_Read error = 28862 readTimed Out = 1
    2011-06-15 12:02:40,433 Thread-4138318160 WARN  http: <nmehl.c>:<nmehl_readline>: nmehlssl_read() timed out
    2011-06-15 12:02:40,433 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Error in request response. code = 400. text =
    2011-06-15 12:03:40,570 Thread-4138318160 WARN  ssl: <nmehlssl.c:nmehlssl_readcb>: nmehl_read_sock timed out, rsf = -5, setting read timeout flag
    2011-06-15 12:03:40,570 Thread-4138318160 WARN  ssl.io: fd=6: nmehlssl_read, nzos_Read error = 28862 readTimed Out = 1
    2011-06-15 12:03:40,570 Thread-4138318160 WARN  http: <nmehl.c>:<nmehl_readline>: nmehlssl_read() timed out
    2011-06-15 12:03:40,570 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Error in request response. code = 400. text =
    2011-06-15 12:04:10,704 Thread-4138318160 WARN  ssl: <nmehlssl.c:nmehlssl_readcb>: nmehl_read_sock timed out, rsf = -5, setting read timeout flag
    2011-06-15 12:04:10,704 Thread-4138318160 WARN  ssl.io: fd=6: nmehlssl_read, nzos_Read error = 28862 readTimed Out = 1
    2011-06-15 12:04:10,704 Thread-4138318160 WARN  http: <nmehl.c>:<nmehl_readline>: nmehlssl_read() timed out
    2011-06-15 12:04:10,704 Thread-4138318160 ERROR pingManager: nmepm_pingReposURL: Error in request response. code = 400. text = also emoms.trc
    2011-06-15 12:05:26,159 [HTTPThreadGroup-6] WARN  jdbc.ConnectionCache _getConnection.353 - Got a fatal exeption when getting a connection; Error code = 17002; Cleaning up cache and retrying
    2011-06-15 12:05:29,774 [HTTPThreadGroup-5] WARN  jdbc.ConnectionCache _getConnection.352 - Io exception: Socket read timed out
    java.sql.SQLException: Io exception: Socket read timed out
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:77)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:111)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:230)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:501)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:436)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:621)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:492)
         at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:386)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:276)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:212)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:140)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1752)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.makeOneConnection(OracleImplicitConnectionCache.java:644)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:592)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:460)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:544)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:480)
         at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:336)
         at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:322)
         at oracle.sysman.util.jdbc.ConnectionCache.getUnwrappedConnection(ConnectionCache.java:575)
         at oracle.sysman.emSDK.svc.conn.FGAConnectionCache.getFGAConnection(FGAConnectionCache.java:207)
         at oracle.sysman.emSDK.svc.conn.ConnectionService.getPrivateConnection(ConnectionService.java:1138)
         at oracle.sysman.emSDK.svc.conn.ConnectionService.getPrivateConnection(ConnectionService.java:1172)
         at oracle.sysman.emdrep.receiver.OMSHandshake.getParameterFromDB(OMSHandshake.java:570)
         at oracle.sysman.emdrep.receiver.OMSHandshake.getMaxAgentCompatVer(OMSHandshake.java:552)
         at oracle.sysman.emdrep.receiver.OMSHandshake.handshake(OMSHandshake.java:1033)
         at oracle.sysman.emdrep.receiver.OMSHandshake.handshake(OMSHandshake.java:836)
         at oracle.sysman.emdrep.receiver.FxferRecv.doGet(FxferRecv.java:598)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:327)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    2011-06-15 12:05:29,775 [HTTPThreadGroup-5] WARN  jdbc.ConnectionCache _getConnection.353 - Got a fatal exeption when getting a connection; Error code = 17002; Cleaning up cache and retryinglastly, ORACLE_LISTENER log said:
    15-JUN-2011 12:16:38 * <unknown connect data> * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.5)(PORT=18844)) * establish * <unknown sid> * 12525
    TNS-12525: TNS:listener has not received client's request in time allowed
    TNS-12535: TNS:operation timed out
      TNS-12606: TNS: Application timeout occurred
    15-JUN-2011 12:16:38 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))(SERVICE_NAME=inara.snowdrop.com)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.5)(PORT=18842)) * establish * inara.snowdrop.com * 0
    15-JUN-2011 12:16:38 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))(SERVICE_NAME=inara.snowdrop.com)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.5)(PORT=18838)) * establish * inara.snowdrop.com * 0
    15-JUN-2011 12:16:38 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=oracle))(SERVICE_NAME=inara.snowdrop.com)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.5)(PORT=18833)) * establish * inara.snowdrop.com * 0
    15-JUN-2011 12:16:38 * service_update * inara * 0
    15-JUN-2011 12:16:38 * service_update * inara * 0
    15-JUN-2011 12:16:38 * service_update * inara * 0At this point some part of the NET services was corrupted caused by OEM corruption, but I didn't know what caused of it. The NET services with its listener can work normally after I stopped OEM and forced killed the listener and restarted it normally.
    Any idea how to troubleshoot the problem from this point?
    regards,
    Val

    Hi SyBrand,
    sorry if you got impression that I'm ignoring pointers that you gave me. I assure you that I'm trying to use the pointers that everyone gave to me and I really appreciate it.
    I'm still learning how to get familiar with the database, read the log file, troubleshoot the problems, and get familiar the whole concept, that's why most of the time I receive wrong message from everyone, most often I detect them incorrectly.
    Ok, so far what I understand is I have a database resides in the server, a client, and a listener. The client, in this case, OEM is connecting to the server via listener. In my listener.ora configuration, there are 2 listener configuration, LISTENER and ORACLE_LISTENER. In the client side whose description is in tnsnames.ora it has inara as client service name, which should be matched with available listener either with LISTENER or ORACLE_LISTENER.
    one of the log file that says connecting to 192.168.1.5 is because it implicitly translated firefly into its ip address which is 192.168.1.5.
    Also I double check both files as you suggested before listener.ora
    # listener.ora Network Configuration File: /usr/local/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    ORACLE_LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = firefly.snowdrop.com)(PORT = 1521))
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = firefly.snowdrop.com)(PORT = 1521))
    ADR_BASE_LISTENER = /usr/local/oracle
    ADR_BASE_ORACLE_LISTENER = /usr/local/oracletnsnames.ora
    # tnsnames.ora Network Configuration File: /usr/local/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
    # Generated by Oracle configuration tools.
    INARA =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = firefly.snowdrop.com)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = inara.snowdrop.com)
    LISTENER_ORCL =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    ORCL =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = orcl.snowdrop.com)
    LISTENER_OCA11G =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = firefly.snowdrop.com)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      )service inara in tnsnames.ora is consistent with LISTENER or ORACLE_LISTENER.
    How can I associate local service name inara with OEM client? BTW OEM client and database reside in the same host firefly.
    Edited by: Valerie Debonair on Jun 17, 2011 4:23 AM

  • DB Lookup Problem

    Hi All,
      I am trying to use DB LOOKUP in the  mapping.
      I am getting the following error. Can you through some pointers?
       I am using
      1. Driver = oracle.jdbc.pool.OracleConnectionPoolDataSource
    2. Connection = jdbc:oracle:thin:@190.190.190.190:1528:PXI
    com.sap.aii.mapping.lookup.LookupException: Exception during processing the payload.Problem when calling an adapter by using communication channel DB_LOOKUP_CHANNEL (Party: , Service: DB_LOOKUP_SERVICE, Object ID: b2096509d2383857a480e38f3f4d2abe) XI AF API call failed. Module exception: 'Error ACK handling failed: java.lang.NullPointerException'. Cause Exception: (No information available). com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel DB_LOOKUP_CHANNEL (Party: , Service: DB_LOOKUP_SERVICE, Object ID: b2096509d2383857a480e38f3f4d2abe) XI AF API call failed. Module exception: 'Error ACK handling failed: java.lang.NullPointerException'. Cause Exception: (No information available). at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:131) at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:68) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:149) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:77) at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169) at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211) at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160) Root Cause: com.sap.aii.af.service.api.AFException: XI AF API call failed. Module exception: 'Error ACK handling failed: java.lang.NullPointerException'. Cause Exception: (No information available). at com.sap.aii.af.service.api.AdapterAccess.sendMsg(AdapterAccess.java:214) at com.sap.aii.af.service.api.AdapterAccess.execute(AdapterAccess.java:283) at com.sap.aii.ibrun.server.lookup.AdapterProxyLocal.execute(AdapterProxyLocal.java:123) at com.sap.aii.ibrun.server.lookup.SystemAccessorInternal.execute(SystemAccessorInternal.java:68) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:149) at com.sap.aii.ibrun.server.lookup.SystemAccessorHmiServer.process(SystemAccessorHmiServer.java:77) at com.sap.aii.utilxi.hmis.server.HmisServiceImpl.invokeMethod(HmisServiceImpl.java:169) at com.sap.aii.utilxi.hmis.server.HmisServer.process(HmisServer.java:178) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:296) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.processRequestByHmiServer(HmisServletImpl.java:211) at com.sap.aii.utilxi.hmis.web.workers.HmisInternalClient.doWork(HmisInternalClient.java:70) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doWork(HmisServletImpl.java:496) at com.sap.aii.utilxi.hmis.web.HmisServletImpl.doPost(HmisServletImpl.java:634) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390) at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347) at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325) at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887) at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241) at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92) at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:160)
    Thank you
    Ganges Leaves

    Hi Ganges~
    <i>Exception during processing the payload</i>
    1) Check the Payload is a valid xml
    2) Check the JDBC Adapter connection Parameters -go to Adapter Monitoring and check is this is showing Active and Green..
    3) Check these blog- /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    4) Check this for Connection Parameters and drivers information-
    Using JDBC Adapter posting data from Oracle database to Falt file????
    For more-
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/406642ea59c753e10000000a1550b0/frameset.htm
    Hope this helps,
    REgards,
    Moorthy

  • Problems using connection pooling

    I'm having problems configuring connection pooling in oc4j. Have specified my datasource/connection pool in my data-sources.xml. I always get the following error when I try to access it with an instance of OracleConnectionPoolDataSource within my apps. The app server dosen't seem to create the connections when started 'cos its not displayed within Oracle dba studio. Can anyone tell what I need to do pls.
    regards!
    dyzke
    //-- error displayed
    Exception in thread "main" java.sql.SQLException: Io exception: The Network Adap
    ter could not establish the connection
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:260)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:365)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java
    :111)
    // -- extract
    <data-source
              class="com.evermind.sql.DriverManagerDataSource"
    name="MYDS"
              location="jdbc/XXX"      
    xa-location="jdbc/xa/OracleXADS"
              ejb-location="jdbc/OracleDS"
    pooled-location="xxx/xxxx"
              max-connections="10"
              min-connections="3"                    
              connection-driver="oracle.jdbc.driver.OracleDriver"
              username="admin"
              password="admin"
              url="jdbc:oracle:thin:@localhost:xxx"
              inactivity-timeout="30"
         />

    see my answer in the other newsgroup.
    please don't cross post.
    "M. Hammer" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    We have problems using connection pooling in a WLS 5.1.x - Cluster. Is it
    possible to use CP in such a cluster at all ? The problem is, connections
    will be opened and never been closed. How can I configure a cluster forCP?
    >
    I have a WLS-Cluster with 2 instances and my webApp uses connectionpooling.
    By the way I get a connection on Instance 1, Instance 2 gets a connection
    also, but never releases it.
    In my opinion, the reference to the connection in the partner-instancewill
    be lost.
    How do I have to configure my cluster to work well with that stuff ?
    Thank a lot,
    Markus.

  • 11G Oracle Install problems

    Ok, not sure what is going...
    I installed Oracle 11g on Linux. Everything was working, I could access the database via Enterprise Manager, then I re-boot and EM no longer works, I figured this has something to do with some script to make it auto start at boot, so I searched the internet and found a script and made sure that it matched my paths and version numbers.
    as a oracle user when I type
    oracle@dragonfly:~$ echo $ORACLE_HOME
    /u01/app/oracle/product/11.1.0/db_1
    but
    oracle@dragonfly:~$ echo $ORACLE_SID
    I get a blank, would like to learn where to do the setting for oracle SID, is it in /etc/profile ? my SID is orcl
    in /etc/oratab I put a Y for this db instance.
    Anyways, when I try to manually start EM, I get these problems:
    root@dragonfly:/u01/app/oracle/product/11.1.0/db_1/bin# ./emctl status dbconsole
    Environment variable ORACLE_SID not defined. Please define it.
    ok, let me define it:
    root@dragonfly:/u01/app/oracle/product/11.1.0/db_1/bin# export ORACLE_SID=orcl
    root@dragonfly:/u01/app/oracle/product/11.1.0/db_1/bin# ./emctl status dbconsole
    Oracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    https://dragonfly.kodiaktechnical.net:1158/em/console/aboutApplication
    Oracle Enterprise Manager 11g is not running.
    Logs are generated in directory /u01/app/oracle/product/11.1.0/db_1/dragonfly.kodiaktechnical.net_orcl/sysman/log
    then I type it again:
    ./emctl start dbconsole
    and I see this...
    root@dragonfly:/u01/app/oracle/product/11.1.0/db_1/bin# ./emctl start dbconsoleOracle Enterprise Manager 11g Database Control Release 11.1.0.6.0
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    https://dragonfly.kodiaktechnical.net:1158/em/console/aboutApplication
    Starting Oracle Enterprise Manager 11g Database Control ............................................................................................. failed.
    Logs are generated in directory /u01/app/oracle/product/11.1.0/db_1/dragonfly.kodiaktechnical.net_orcl/sysman/log
    there is a dot . . . . added every few seconds, but eventually it errors out
    I am on Linux dragonfly 2.6.28-14-server

    when I do:
    netstat -lt | grep 1158
    nothing comes back...
    from log:
         at oracle.sysman.emdrep.notification.NotificationMgr.run(NotificationMgr.java:1715)
    2009-08-17 21:50:48,024 [NotificationMgrThread] WARN jdbc.ConnectionCache _getConnection.353 - Got a fatal exeption when getting a connection; Error code = 17002; Cleaning up cache and retrying
    2009-08-17 21:50:48,152 [PAFAQDaemon] WARN jdbc.ConnectionCache _getConnection.352 - Io exception: The Network Adapter could not establish the connection
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:390)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:519)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:167)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:816)
         at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:325)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:235)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:157)
         at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:94)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.makeCacheConnection(OracleImplicitConnectionCache.java:1702)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.getCacheConnection(OracleImplicitConnectionCache.java:575)
         at oracle.jdbc.pool.OracleImplicitConnectionCache.getConnection(OracleImplicitConnectionCache.java:435)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:432)
         at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:397)
         at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:336)
         at oracle.sysman.util.jdbc.ConnectionCache._getConnection(ConnectionCache.java:322)
         at oracle.sysman.util.jdbc.ConnectionCache.getUnwrappedConnection(ConnectionCache.java:575)
         at oracle.sysman.emSDK.svc.conn.FGAConnectionCache.getFGAConnection(FGAConnectionCache.java:207)
         at oracle.sysman.emSDK.svc.conn.ConnectionService.getSystemConnection(ConnectionService.java:1304)
         at oracle.sysman.pp.paf.impl.PAFDepot.createRepositoryConnectionImpl(PAFDepot.java:377)
         at oracle.sysman.pp.paf.impl.PAFDepot.createRepoConnection(PAFDepot.java:349)
         at oracle.sysman.pp.paf.impl.PAFDepot$AutoPAFContext.getRepositoryConnection(PAFDepot.java:898)
         at oracle.sysman.pp.paf.impl.PAFDepot.getRepoConnection(PAFDepot.java:596)
         at oracle.sysman.pp.paf.dal.PAFDataSource.getConnection(PAFDataSource.java:344)
         at oracle.sysman.pp.paf.dal.PAFDataSource.dequeueRequest(PAFDataSource.java:1105)
         at oracle.sysman.pp.paf.impl.PAFDepot$AQThread.run(PAFDepot.java:796)
    2009-08-17 21:50:48,153 [PAFAQDaemon] WARN jdbc.ConnectionCache _getConnection.353 - Got a fatal exeption when getting a connection; Error code = 17002; Cleaning up cache and retrying                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Problem with connectionPool configuration to Oracle

    Hi
    I am facing some problems with configuration of connectionPool with oracle.I am using J2EE app server 8.1.While configuring I am giving following details:
    Datasource Classname: oracle.jdbc.pool.OracleConnectionPoolDataSource
    Resource type: javax.sql.ConnectionPoolDataSource
    PoolSettings,Connection Validation and Transaction Isolations settings are default.
    In Prperties
    DataSourceName OracleConnectionPoolDataSource
    ImplicitCachingEnabled false
    NetworkProtocol tcp
    FastConnectionFailoverEnabled false
    LoginTimeout 0
    Password xxx
    URL jdbc:oracle:thin:@localhost:1521:orcl (orcl is database name)
    ConnectionCachingEnabled false
    User SYSTEM
    ExplicitCachingEnabled false
    PortNumber 0
    MaxStatements 0
    ojdbc14.jar is placed in Appserver/lib directory and absolute path of this jar is added in classpath suffix in AppServer setting.
    But when I ping the connection thru Appserver only , Iget following error
    "Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Access denied to execute this method : setConnectionCachingEnabled"
    I dont understand what is the problem.
    Please help me out....
    Thanks a lot in advance

    I got it,
    Remove everything else from the settings except url,user and password.Save and restart Appserver.Now it will work....

  • Problems with jsp and jdbc

    I am writing a simple class to start learning about jdbc. I wrote the following WHICH COMPILES:
    public MyClass {
    System.out.println("establishing connection...");
    OracleConnectionPoolDataSource ods = new OracleConnectionPoolDataSource();
    // this is where all the variables are initialised.
    ods.setDriverType ("oci8");
    ods.setServerName ("test");
    ods.setNetworkProtocol ("tcp");
    ods.setDatabaseName ("tester");
    ods.setPortNumber (1521);
    ods.setUser ("test");
    ods.setPassword ("password");
    // this is the variable that will get the connection pool.
    // from this connection pool, you will get all ur connections.
    pool = new OracleConnectionCacheImpl(ods);
    and i am calling it by:
    System.out.println("connecting to DataBase");
    dbc = new MyClass();
    System.out.println("connected to DataBase");
    THIS WORKS FINE when i do either a command line execution - run a query thru a normal main method.
    HOWEVER, when i try and call it from a jsp page, i get the following error from tomcat:
    org.apache.jasper.JasperException: oracle/jdbc/pool/OracleDataSource
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
    furthermore, the first system.out.println("establishing connection"); is not printed. "Connecting to Database" is printed however. i am really confused.
    however, i have an ancient copy of tomcat 3.2 that i used - just to test - and that worked fine. i have to get this to work with tomcat 4.1.
    i am really in a jam - any insights, please help!!!
    thankyou so much.

    Mahesh,
    It is the problem of your DRIVER not being in the classpath of TOMCAT. Put the driver in the lib folder of tomcat or else include the folder which contains the driver to the tomcat classpath. It should work OK.
    Good Luck.
    Sekar

  • Oralce datasource - problem

    Hello,
    I tried to create a datasource using Visual Administrator to Oracle Database. I have a webdynpro application accessing the datasource to pull the data from the Database and display to the user.
    I am working on Oracle 10.2 and using ojdbc14.jar. I am using JDBC 2.x driver for this. Here are the configuration parameters used for the Datasource
    JDBC Version : 2.0 (with XA Support)
    Object Factory : oracle.jdbc.pool.OracleDataSourceFactory
    DataSource Type : ConnectionPoolDataSource
    CPDS Classname : oracle.jdbc.pool.OracleConnectionPoolDataSource
    [Additional] Properties:
    url = jdbc:oracle:thin:@localhost:1521:orcl817
    user = scott
    password = tiger
    My application is not able to pull up any data from the database and is not showing any data. I found an exception on the defaultTrace file. Here is the stack trace of the exception thrown.
    #1.5_#0003BA1D8303004F0000005700000B5F00043969ECC1420E#
    1189027013280#com.sap.engine.services.connector##
    com.sap.engine.services.connector#Administrator#11205####
    1da526b05bf511dc907a0003ba1d8303#SAPEngine_Application_Thread[impl:3]
    _37##0#0#Error##Plain###ResourceObjectFactory.getConnectionSet(MDM_SandBox),
    Exception: com.sap.engine.services.connector.exceptions.BaseResourceException:
    ConnectionFactory "MDM_SandBox" does not exist.
    Possible reasons: the connector in which ConnectionFactory "MDM_SandBox" is
    defined is not deployed or not started.
          at com.sap.engine.services.connector.ResourceObjectFactory.getConnectionSet(ResourceObjectFactory.java:671)
          at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.listUsedConnections(DataSourceManagerImpl.java:565)
          at com.sap.engine.services.dbpool.deploy.DataSourceManagerImpl.getUsedConnectionsCount(DataSourceManagerImpl.java:967)
          at sun.reflect.GeneratedMethodAccessor459.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
          at com.sap.pj.jmx.mbeaninfo.AdditionalInfoProviderMBean.invoke(AdditionalInfoProviderMBean.java:289)
          at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
          at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
          at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
          at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
          at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
          at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
          at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
          at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
          at com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:131)
          at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:212)
          at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:766)
          at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:102)
          at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
          at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
          at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:312)
          at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199)
          at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
          at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
          at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
          at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
          at java.security.AccessController.doPrivileged(Native Method)
          at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
          at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    The excpetion says that the Datasource is not deployed or not started. However, I can see my datasource running in the Visual Administrator.
    Any help on fixing this problem is appreciated.
    Thanks
    Suman

    Suman,
    We had a lot of trouble figuring out how to setup Data Source for Oracle also so you're not alone.  : )
    Before setting up the datasource, did you create a driver in Visual Administrator? You can name it anything you want but it should point to the classes*.zip file that contains the Oracle drivers.
    Then you need to specify that driver in the Data Source.
    The rest looks OK. The only other thing I can suggest right now is for you to set the Initial Connections to a non-zero value. Then when you save the Data Source, it will attempt to create the connection. If it fails you know there is something wrong with your data source. If it saves OK then the problem is somewhere else.
    Oh, and we haven't been able to get it to work with Native SQL option under SQL Engine. We use Vendor SQL radio button.
    Good luck!

  • Problem JndiDataSourceTransactionPool

    Hello Every1,
    I'm trying to Initialize Ibatis SqlMap and keep getting following error!
    App Server : WAS 6.1
    IDE : RAD7
    ORFrameWork: Ibatis
    I added all necessary jars in my /lib file ( like thinclient.jar etc.). Still kepp getting error!
    Any thoughts?
    Thanks
    Frank
    SqlMapConfig.xml
    <transactionManager type="JDBC" commitRequired="true" >
    <property name="SetAutoCommitAllowed" value="false"/>
    <property name="DefaultAutoCommit" value="false"/>
              <dataSource type="JNDI">
         <property name="DataSource" value="jdbc/DSDatasource" />
    <property name="JDBC.Driver" value="oracle.jdbc.pool.OracleConnectionPoolDataSource" />
         <property name="JDBC.ConnectionURL" value="jdbc:host:db" />
              <property name="JDBC.Username" value="usr" />
              <property name="JDBC.Password" value="passwrd" />     
              </dataSource>
         </transactionManager>
    Error:
    Problem with accessing oracleError occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/transactionManager/dataSource/end()'. Cause: com.ibatis.sqlmap.client.SqlMapException: There was an error configuring JndiDataSourceTransactionPool. Cause: javax.naming.ServiceUnavailableException: Could not obtain an initial context due to a communication failure. Since no provider URL was specified, the default provider URL of "corbaloc:iiop:[email protected]:2809/NameService" was used. Make sure that any bootstrap address information in the URL is correct and that the target name server is running. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: java.net.ConnectException: Connection refused: connect:host=port=2809  vmcid: IBM  minor code: E02  completed: No]
    Jul 21, 2009 5:23:16 PM com.ibm.ws.naming.util.WsnInitCtxFactory
    WARNING: jndiUnavailCommErr

    Hi, Beverley.  
    Thank you for visiting Apple Support Communities.  
    I understand that you are unable to trim clips using iMovie.  I would need a little more information on how you were attempting to trim a clip to provide a better answer.  However, make sure you have the movie project open and are selecting the clip that you wish to trim as this will activate the clip trimmer.  
    Trim clips
    -Jason H.  

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

Maybe you are looking for