JDBC Connection Reset when using many processes on 64 bit system

Hi,
we've a annoying JDBC connection problem since we migrated our Java server to a 64 bit operating system. Here our environment.
Database Machine:
Oracle 10g
Linux 32 Bit (but same problem on 64 Bit)
Application Servers Machine:
JDBC driver 11.1.0.6
SUN Java 1.6.0_06 64bit
Linux 64 bit (SLES 10 SP2)
We have 6 different Java server processes (but with the same code) which all create some connections to the same database (running on a different Hardware). All 6 Java server processes starting at the same time (via scripts).
Everything was fine, until we migrated the application server machine from 32 bit Linux to 64 bit Linux. From this day on, the half (or one more or less) of our application server processes can't longer connect to the database. The application server processes which have the problem product the following stack trace:
java.sql.SQLRecoverableException: I/O Exception: Connection reset
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:281)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:118)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:224)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:296)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:611)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:455)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:494)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:199)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:30)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at com.aaaa.utils.db.DbConnectionPool.<init>(DbConnectionPool.java:130)
It looks like a network problem with the system but all other network stuff works without problems, between the two machines.
- We use the thin JDBC driver (no OCI)
- No firewalls are active on both systems
- Both systems are in the same subnet connected to the same switch
- The DNS configuration on both systems are ok (forward and reverse)
- We've found the same problem on different application-server/database-server pairs with 64 bit application server hardware - but not all of our 64 bit server systems have this problem.
- When running application server process and database on the same system (connecting via localhost) the problem does not longer appear.
- The same database machine connected from a 32 bit application server (with 6 different java processes starting at the same time) works without a problem.
We've tried a lot of things to isolate the problem - but with no success.
- Same problem with SUN Java 1.6.0_06 32 bit (on 64 bit Linux)
- Same problem with SUN Java 1.6.0_15 (32 and 64 bit)
- Played with some JDBC connection properties (oracle.jdbc.TcpNoDelay, oracle.jdbc.ReadTimeout, oracle.net.CONNECT_TIMEOUT, oracle.net.disableOob, oracle.jdbc.RetainV9LongBindBehavior, oracle.jdbc.StreamChunkSize) without a positive result.
- We've updated Linux network driver
- We've changed to an completeky other NIC
- We've tried an other Linux 64 distribution
- We've increased the PROCESSES parameter in the init.ora
- We've tried the JDBC driver 11.1.0.6
- We've tried the _g version of the JDBC driver, but the debugging output simply tell us "Connection Reset" without a hint why.
- We've tried a more complex JDBC connect string (
"jdbc:oracle:thin:@(DESCRIPTION=" +
"(ADDRESS_LIST=" +
"(ADDRESS=(PROTOCOL=TCP)" +
"(HOST=host)" + =
"(PORT=port)" +
")" +
")" +
"(CONNECT_DATA=" +
"(SERVICE_NAME=sid)" +
"(SERVER=DEDICATED)" +
")" +
Nothing of this things helped us to isolate the problem.
When we start our application server processes with a long pause (>1 min) between every process start. The problem does not occure. When we start only one application server with the same number of connections as the 6 different application server processes, everything works fine.
We have absolute no idea why
- this only occures on 64 bit Linux
- independent if it's a 32 bit or 64 bit JVM
- does not occure on all 64 bit application server machines / database machine pairs
- never occure on the same 64 bit app server hardware when using a 32 bit Linux
- using the Oracle JDBC 10g driver (10.xxx) there is no problem (but because of other issues, we need to use the JDBC 11g driver)
Does anybody has an idea what our problem is?
Thanks in advance,
greetings

I was recently struggling with this exact same problem. I opened a ticket with Oracle and this is what they told me.
java.security.SecureRandom is a standard API provided by sun. Among various methods offered by this class void
nextBytes(byte[])
is one. This method is used for generating random bytes. Oracle 11g JDBC drivers use this API to generate random number during
login. Users using Linux have been encountering SQLException("Io exception: Connection
reset").
The problem is two fold
1. The JVM tries to list all the files in the /tmp (or alternate tmp directory set by -Djava.io.tmpdir) when
SecureRandom.nextBytes(byte[]) is invoked. If the number of files is large the
method takes a long time
to respond and hence cause the server to timeout
2. The method void nextBytes(byte[]) uses /dev/random on Linux and on some machines which lack the random
number generating hardware the operation slows down to the extent of bringing the whole login process to
a halt. Ultimately the the user encounters SQLException("Io exception:
Connection reset")
Users upgrading to 11g can encounter this issue if the underlying OS is Linux which is running on a faulty hardware.
Cause
The cause of this has not yet been determined exactly. It could either be a problem in
your hardware or the fact
that for some reason the software cannot read from dev/random
Solution
Change the setup for your application, so you add the next parameter to the java command:
-Djava.security.egd=file:/dev/../dev/urandom
We made this change in our java.security file and it has gotten rid of the error.

Similar Messages

  • How can I show additional tab rows when using many open tabs?

    How can I show additional tab rows when using many open tabs?

    What method (code) did you use to get the Tab bar displaying in the space used for the Navigation Toolbar (location bar)?
    The Tab bar should be displayed above the Navigation Toolbar.
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • If 3G connection drops when using dictation, will the dictation be saved?

    If 3G connection drops when using dictation, will the dictation be saved so that it can be used later?

    If you mean a voice recording that get transcribed, no.

  • Connections drop when using Cisco Anyconnect Secure Mobility Client

    Folks I have a strange issues. I have a few laptops that I'm testing using the Cisco AnyConnect Secure Mobility Client Network Access Manager. We like the interface and overall are happy, but have one nagging issue. Periodically the connection drops when using the client, and the only way to reconnect is to choose the Network repair option on the client. That fixes it just fine, but we shouldn't have to do this. The same clients using the built in WIndows supplicant do not have this problem. We are on version 3.0.07059.

    Right now I'm testing on a single access point (autonomous) with WEP! The same laptop works fine without the Cisco client. Usually it is several hours, 12 or more when it happens, but I've seen it less than that. And I've seen it up for over a day and a half. At this point I just don't trust the client to roll out to a larger audience.

  • Connection reset when uploading a report to ras server.

    Hi,
    We're running the jboss app in the linux box and use the java sdk to extract the crystal report with the ras on the remote window box. We got the below exception when extracting one of the crystal report. Any idea what's going on?
    The trace log is also attached below.
    Thanks,
    Min
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Connection reset-- Error code:-2147217387 Error code name:connectServer
    at com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException.throwReportSDKServerException(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.TCPIPCommunicationAdapter.request(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.y.a(Unknown Source)
    at com.crystaldecisions.proxy.remoteagent.r.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.if(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.do(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.a(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.ClientDocument.open(Unknown Source)
    crystalras_xxx_ras.log
    TraceLog 2009  5  6 16:24:40.256 5892 5872 (.\dts\dts.cpp:961): CreateAgent: creating agent=8
    TraceLog 2009  5  6 16:24:40.256 5892 5216 (\servers\ras\dtsagent\cdtsagent.cpp:2463): doOneRequest saRequestId_verifyLogon in
    TraceLog 2009  5  6 16:24:40.865 5892 5216 (\servers\ras\dtsagent\cdtsagent.cpp:2465): doOneRequest saRequestId_verifyLogon out [NoError]
    TraceLog 2009  5  6 16:24:40.865 5892 5872 (.\dts\dts.cpp:1000): RemoveKey: removing agent=8
    TraceLog 2009  5  6 16:24:40.912 5892 5872 (.\dts\dts.cpp:961): CreateAgent: creating agent=9
    TraceLog 2009  5  6 16:24:40.912 5892 3152 (.\dts\cdtsagent.cpp:717): doOneRequest caReservedRequestId_CreateServerAgent in
    TraceLog 2009  5  6 16:24:40.928 5892 3152 (.\dts\cdtsagent.cpp:744): doOneRequest caReservedRequestId_CreateServerAgent out [NoError]
    TraceLog 2009  5  6 16:24:43.319 5892 3152 (.\dts\cdtsagent.cpp:749): doOneRequest caReservedRequestId_CloseServerAgent in
    TraceLog 2009  5  6 16:24:43.334 5892 3152 (.\dts\cdtsagent.cpp:757): doOneRequest caReservedRequestId_CloseServerAgent out [NoError]
    TraceLog 2009  5  6 16:24:43.334 5892 5872 (.\dts\dts.cpp:1000): RemoveKey: removing agent=9
    crystalras_xxx.log
    Timestamp     ProcessID     ThreadID     Message
    [Wed May 06 23:24:40 2009]     5892     5872     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.256 5892 5872 (.\dts\dts.cpp:961): CreateAgent: creating agent=8
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: XmlSerializer: before creating object
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: XmlSerializer: after creating object
    [Wed May 06 23:24:40 2009]     5892     5216     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.256 5892 5216 (\servers\ras\dtsagent\cdtsagent.cpp:2463): doOneRequest saRequestId_verifyLogon in
    [Wed May 06 23:24:40 2009]     5892     5216     (.\comexports.cpp:25): trace message: DllGetClassObject called.
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:43): trace message: Getting instance of class factory.
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:56): trace message: Got instance of class factory.
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:115): trace message: Class factory QueryInterface called.
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:99): trace message: Class factory addref'ed.
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:131): trace message: Class factory QI succeeded..
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:154): trace message: Attempting to create instance of COM component...
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:178): trace message: Successfully created COM object.
    [Wed May 06 23:24:40 2009]     5892     5216     (y:\servers\ras\rasauditing\classfactory.h:107): trace message: Class factory released.
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1896): trace message: GetApslist: apsList size: 1
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1897): trace message: GetApsListm_Members.GetCount()==1
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1898): trace message: GetApsList m_InactiveMembers.GetSize()==0
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infostore.cpp:265): trace message: CInfoStore::Query: SELECT SI_SERVER_NAME,SI_CLUSTER_NAME,SI_SERVER_IS_ALIVE,SI_SERVER_IOR,SI_SYSTEM_INFO FROM CI_SYSTEMOBJS WHERE (SI_PARENTID = 16 AND SI_SERVER_KIND = 'aps') OR SI_ID = 4
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: CInfoStore::QueryEx() returned 2 objects with more to come? 0
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: CInfoSessionManager::GetApsListFromNS: APS MIN.SYMYVR.LOCAL is alive.  Adding to active members
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: CInfoSessionManager::ClusterInfo::UpdateRegistry: Updating min.symyvr.local; to registry
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1896): trace message: GetApslist: apsList size: 1
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1897): trace message: GetApsListm_Members.GetCount()==1
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1898): trace message: GetApsList m_InactiveMembers.GetSize()==0
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1896): trace message: GetApslist: apsList size: 1
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1897): trace message: GetApsListm_Members.GetCount()==1
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:1898): trace message: GetApsList m_InactiveMembers.GetSize()==0
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: Executing query SELECT SI_PRODUCT_VERSION FROM CI_SYSTEMOBJECTS WHERE SI_PARENTID = 26 AND SI_NAME = 'secEnterprise' to get auth properties
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infostore.cpp:265): trace message: CInfoStore::Query: SELECT SI_PRODUCT_VERSION FROM CI_SYSTEMOBJECTS WHERE SI_PARENTID = 26 AND SI_NAME = 'secEnterprise'
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: CInfoStore::QueryEx() returned 1 objects with more to come? 0
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: ClientPing_impl::add_session_handle: session handle (23793J9ujwvkFe3QPWTsv) added
    [Wed May 06 23:24:40 2009]     5892     5216     (.\infosessionmgr.cpp:690): trace message: User: guest logged on
    [Wed May 06 23:24:40 2009]     5892     5216     trace message: ClientPing_impl::remove_session_handle: remove session handle (23793J9ujwvkFe3QPWTsv). succeded=true
    [Wed May 06 23:24:40 2009]     5892     5216     (.\proxy_impl.cpp:436): trace message: LOGOFF implicit session logoff: userId[11], m_uri[osca:iiop://MIN.SYMYVR.LOCAL/SI_SESSIONID=23793J9ujwvkFe3QPWTsv], sessionId[23793], m_sSessionHandle[23793J9ujwvkFe3QPWTsv]
    [Wed May 06 23:24:40 2009]     5892     5216     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.865 5892 5216 (\servers\ras\dtsagent\cdtsagent.cpp:2465): doOneRequest saRequestId_verifyLogon out [NoError]
    [Wed May 06 23:24:40 2009]     5892     5872     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.865 5892 5872 (.\dts\dts.cpp:1000): RemoveKey: removing agent=8
    [Wed May 06 23:24:40 2009]     5892     5872     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.912 5892 5872 (.\dts\dts.cpp:961): CreateAgent: creating agent=9
    [Wed May 06 23:24:40 2009]     5892     3152     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.912 5892 3152 (.\dts\cdtsagent.cpp:717): doOneRequest caReservedRequestId_CreateServerAgent in
    [Wed May 06 23:24:40 2009]     5892     3152     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:40.928 5892 3152 (.\dts\cdtsagent.cpp:744): doOneRequest caReservedRequestId_CreateServerAgent out [NoError]
    [Wed May 06 23:24:43 2009]     5892     3152     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:43.319 5892 3152 (.\dts\cdtsagent.cpp:749): doOneRequest caReservedRequestId_CloseServerAgent in
    [Wed May 06 23:24:43 2009]     5892     3152     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:43.334 5892 3152 (.\dts\cdtsagent.cpp:757): doOneRequest caReservedRequestId_CloseServerAgent out [NoError]
    [Wed May 06 23:24:43 2009]     5892     5872     (.\dts\dts.cpp:1793): trace message:
    TraceLog 2009  5  6 16:24:43.334 5892 5872 (.\dts\dts.cpp:1000): RemoveKey: removing agent=9
    Edited by: limin9 on May 7, 2009 1:29 AM
    Edited by: limin9 on May 7, 2009 1:30 AM

    I tried to put the debug information in java code by applying clientSDKOptions.xml. And I found the report file is cut off when being passed to ras. I'm wondering if there is any file size limitation to use ras api?

  • Connection reset when accessing HTTPS through proxy

    Since upgrading to firefox 27 when trying to access https://www.birtles.org.uk I receive a connection reset or connection interrupted error. I am connecting through a proxy. Firefox 26 works correctly.
    I have tried on 3 different machines 2 windows and one Mac with the same results.

    Same issue and resolution for me when I try to access https://mail.ntlworld.com. I'm also connecting through a proxy, have tried both of them available to me. It works fine using other browsers, just firefox causing issues.
    Also on an unrelated note, https://support.mozilla.org/en-US/users/register keeps redirecting to the login page. Tried on multiple browsers, in the end had to use mobile to create an account.

  • JDBC Connection reset by peer: JVM_recv in socket input stream read

    Hey Guys,
    Has anyone seen this issue? We get this error in our Weblogic app logs at times and no one is able to login to our application. Our database server and SQL server seem fine at a high level. Any ideas what is causing this?
    com.s1.arch.persistence.exception.PersistenceException weblogic.jdbc.mssqlserver4.TdsException: I/O exception while talking to the server, java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
    Thanks

    please make sure that there is no Firewall between your servers and DB server. this message usually happen when there is a fire wall between the servers. if yes please make sure that the connection time on fire wall is longer than the time needed to complete an operation another thing that you need to check if you have a fire wall which is to make sure that Oracle DBMS return the request to the same port that it is listening to (1521 default).

  • Connection Reset when compiling PL/SQL Package

    Recently a strange issue appeared on my office PC. When I try To compile a PL/SQL package on specific Oracle instance I get an error message:
    Error: Io exception: Connection reset by peer: socket write error
    And the connection is reset. I even cannot reconnect to database schema. To open connection again I have to restart SQL Developer. In spite of this issue I can execute SELECT queries in SQL worksheet and view data in tables. Error message appears only when compiling packages in any schema on database instance in our local network and only on my PC. Other office PCs works fine without any errors. I am able to compile packages on remote database from my PC.
    Same error message shows up in different SQL Developer versions and also in JDeveloper. SQL Developer restart, Windows restart, database instance restart doesn't help.
    Used software:
    SQL Developer versions: 1.2.1 and 1.1
    JDeveloper version: 10.1.3.2
    Oracle Database on local network: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit
    Remote Oracle Database: Oracle Database 10g Release 10.2.0.3.0 - Production
    OS: Windows XP Pro SP2
    Thanks,
    Raymond

    I am trying to convert the values in a selected
    column into 1 and 0 so that I can display all 1s in
    one column, all 0s in another. I am doing this in a
    PL/SQL package. However ORACLE compiler does not
    like the CASE construct.
    Does anyone know how to group values in a column into
    several new columns. If CASE WHEN construct is not
    doable in PL/SQL, what alternatives are there?
    Thanks.
    CURSOR v_Cursor IS
    SELECT A.D_CODE, A.M_CODE, TEST_START ,
    , C.C_NAME,C.P_ID,
    SUM(CASE WHEN MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 >
    40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 ANDB.B_CODE IN '11.1','222.2','272.4') THEN 1 ELSE 0
    END) QUALIFIEDUse the Decode function. This has been around in oracle SQL for ages and works like a case construct.
    You would do something like
    select ...
    sum( decode (MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 >
    40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 AND
    B.B_CODE IN ('11.1','222.2','272.4') 1,0 )

  • Jdbc connection in EJB using wsad 5.0

    Hi,
    I want to develop a small application using Ejbs by using oracle 9i as D/b, wsad 5.0 as app server . The problem is i am not able to connect to oracle database in WSAD. What i am doing is i have installed Oracle 9i in my system and has given the Global database name as "samp" while installation . I open my SQL plus with username scott and password tiger and i am able to do all my sql queries successfully.
    Now coming to WSAD,
    while creating a JDBC connection using Oracle 9i driver,
    i ve opened in Data perspective and in that go to DB Servers -> Right click -> New Connection
    There a window is opened for Database Connection.
    We need to fill the fields there.
    I have given samp as Global d/b name while installing Oracle 9i .
    In the window , the feilds are
    Connection Name : conn
    Database Name : samp
    user id : scott
    password : tiger
    D/b vendor type: Oracle 9i
    Jdbc Driver : Oracle Thin Driver
    Host : 127.0.0.1
    port No: 1521
    class location : c:\oracle\ora90\jdbc\lib\classes12.zip
    connection url : jdbc:oracle:thin:@127.0.0.1:1521:samp
    the class location and connection url are automatically coming.
    and please check whether all fields are correct or not
    Is this the correct way.
    Next in code if i want to connect to database should i use connection establish commands again or i can directly use create statement or prepare statement.
    Please reply.
    Thanks

    Create New Server and configure it properly
    It will work
    procedure is as follows:
    Pls visit the following link:
    http://www.webagesolutions.com/knowledgebase/waskb/waskb001/index.html
    Adding a Oracle9i DataSource from WSAD5
    Bibhas Bhattacharya, Web Age Solutions Inc.
    Before you begin, make sure that you have Oracle installed and a database is created. In this document we will use a database called MALL.
    Create a WAS V5 Server
    If you don't already have a WebSphere V5 server created, do so following these steps. Switch to the Server perspective. Right click in the Server Configuration view and select New->Server and Server Configuration.
    Name the server WASV5. Make sure that the Server type is set to WebSphere version 5.0->Test Environment. Click on Finish.
    Add the Database User
    In WSAD5, the default user ID and password to be used by a DataSource are first entered as a JAAS authentication entry.
    In the Server Configuration view, double click on WASV5 to open the configuration editor. Click on the Security tab. Next to the JAAS Authentication Entries list click on Add and add the user.
    Add the JDBC Driver
    Still in the server configuration GUI click on the DataSource tab. You can add the DataSource at the server level or at the node level. We will add it at the server level. Make sure that the Server Settings is expanded. Next to the JDBC providers list click on Add.
    Select the following options:
    Database type: Oracle
    JDBC provider type: Oracle JDBC Thin Driver or the XA version of it if you need two phase commit transaction.
    Click on Next.
    Set the name to Oracle Thin Driver.
    Notice that the location of the driver's class is automatically set to ${ORACLE_JDBC_DRIVER_PATH}/classes12.zip. Here, ORACLE_JDBC_DRIVER_PATH is a node level variable. We need to make sure that the variable is pointing to the correct directory where Oracle's JDBC driver is installed. In our case, we had installed Oracle in c:\oracle. This had installed the JDBC driver class in C:/oracle/ora81/jdbc/lib/classes12.zip.
    In the server configuration GUI click on the Variables tab. Under the Node settings select ORACLE_JDBC_DRIVER_PATH from the Defined variables list. Click on Edit and set the value to C:/oracle/ora81/jdbc/lib.
    Add the DataSource
    Click on the DataSource tab again. Select the Oracle Thin Driver you had created in the previous step. Click on Add next to the Data source defined in the JDBC provider selected above list.
    Select the following options:
    Select the type of JDBC Driver: Oracle JDBC Thin Driver.
    Select the data source type: Unless you will be testing your application with WAS V4, select Version 5.0. You can not use a V4 DataSource from a J2EE 1.3 EJB module running in WebSphere V5.
    Click on Next.
    Enter these key attributes in this screen:
    Name: My Oracle DataSource
    JNDI Name: jdbc/MyDataSource
    DataSource helper class name: com.ibm.websphere.rsadapter.OracleDataStoreHelper. Should be selected by default. The helper class is needed if you wish to access IBM extensions to JDBC. For more details search in WSAD help for "WSDataSource interface".
    Component-managed authentication alias: Set this if you wish to lookup the DataSource using its global JNDI name or using the java:comp/env/ name space and have set the authentication type of the resource reference to Application. Select the JAAS entry you had created. That is, Database user.
    Container-managed authentication alias: Set this if you intend to lookup the DataSource using the java:comp/env/ name space and have set the authentication type of the resource reference to Container. Select the JAAS entry you had created. That is, Database user.
    Use this data source in container managed persistence (CMP): Check on if you intend to use the DataSource from CMP EJBs.
    Click on Next.
    You need to set these properties:
    databaseName: MALL in our case.
    URL: jdbc:oracle:thin:@noble.webagesolutions.com:1521:MALL. In my case the server host name is noble.webagesolutions.com. The listener port number is 1521 (usually the default in most Oracle installations).
    Click on Finish.
    You have finished adding the DataSource. Save the server settings by clicking Control+S. Close the server configuration GUI.
    Testing the DataSource
    There is no out of the box way to test the DataSource. You can create a simple Servlet and add the following code:
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    javax.sql.DataSource ds = null;
    java.sql.Connection con = null;
    java.io.PrintWriter out = resp.getWriter();
    resp.setContentType("text/html");
    try {
    out.println("Looking up DataSource<br>");
    javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    ds = (javax.sql.DataSource) ctx.lookup("jdbc/MyDataSource");
    out.println("Getting connection<br>");
    con = ds.getConnection();
    con.close();
    } catch (Exception e) {
    e.printStackTrace(out);
    out.println("Done<br>");
    Feedback
    Your e-mail:
    Rate this article:
    Very useful Somewhat useful Not bad Needs many corrections
    Comments:

  • How to reduce file size when using batch processing?

    I use File > Process Multiple Files to batch process photos to a smaller file size along with adding my watermark.  I've played with many different settings and no matter what I choose, I can't get my average file size to be less than about 200k.  However, when I've exported the same photos using iPhoto, I can get the file size to about half of that with no difference (to my naked eye at least) in quality.
    I definitely want to keep the height at 768 pixels so that needs to stay constant.
    My current settings in batch processing (average file size = 200 kb)
    Resize images with a height constraint of 768 pixels at 150dpi
    What I've tried:
    Resize at 72dpi (reduced file size by about 5kb)
    convert file to JPEG low quality (reduced file size by about 10kb)
    convert file to JPEG medium quality (not much difference in file size)
    I'm using PSE 10 on a Mac running Lion.
    Thank you in advance for your help!

    You should go with default settings of Optimizer.
    One difference between default settings of Optimizer and Reduce file size is that Optimizer does not guarantee a reduction in file size (if your Optimizer settings lead to an increase in file size, that's what you will get).
    With Acrobat 9, the default setting in Optimizer has an additional setting which would not do an image optimization that results in increase of file size. In that sense it would in most cases give a smaller file.

  • JDBC connection in session using HttpSessionBindingListener

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

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

  • Connection reset when closing the client program.

    when closing the client program I get the error message Connection Reset
    at ServerThread.run(SeverThread.java:244)
    which is the following file
    i've marked the 244: on this file on the left of the file.
    after this I have the client program which is called Client.java
    the error happens when I close the client program and the error is on the serverthread side of the application. Please anyone help out with this one.. Thanks.
    //SererThread.java
    import java.net.*;
    import java.io.*;
    import java.util.Date;
    import java.util.Calendar;
    import javax.swing.*;
    public class ServerThread extends Thread {
    private Socket socket = null;
    String outputStrings = "";
    public ServerThread(Socket socket) {
         super("ServerThread");
         this.socket = socket;
         Calendar c = Calendar.getInstance();
         int hr = c.get(Calendar.HOUR_OF_DAY);
         int hour=hr-1;
         int min = c.get(Calendar.MINUTE);
         int sec = c.get(Calendar.SECOND);
         String timeOfConnect [] = new String[100];
         int conCtr = 0;
    int curState = 0;
         String entries [][] = new String[5][100];
    public String getInput(String theInput) {
    String sentToClient = null;
         Calendar c = Calendar.getInstance();
         int hr = c.get(Calendar.HOUR_OF_DAY);
         int hour=hr-1;
         int min = c.get(Calendar.MINUTE);
         int sec = c.get(Calendar.SECOND);
         int day = c.get(Calendar.DAY_OF_WEEK);
         int month = c.get(Calendar.MONTH);
         int year = c.get(Calendar.YEAR);
         int pm = c.get(Calendar.PM);
         String strHr = Integer.toString(hour);
         String strMin = Integer.toString(min);
         String theInputSeg = "";     
         if(theInput!= null)     
         for(int a=0;a<theInput.length();a++)
              char inputCharArray [] = theInput.toCharArray();
              if(inputCharArray[a]==';')
                   theInputSeg = theInput.substring(0,a);
    if (curState == 0) {
    if(c.PM==1&& hour == 8)
         sentToClient = "yes";
    curState = 1;
    } else if (curState == 1) {
         for(int a=0;a<3;a++)
                   //System.out.println("theInput:" + theInput);
                   //System.out.println("a:" + entries[0][a]);
                   //System.out.println("a:" + entries[1][a]);               
                   //if()
                   if(theInputSeg.equalsIgnoreCase("CUSCarissa_Calton25242526")||theInputSeg.equalsIgnoreCase("CUSSan_Htat27242526")
                        ||theInputSeg.equalsIgnoreCase("CUSSadam_Husien20909990"))
                   //if(theInput.equalsIgnoreCase(entries[0][a])||theInput.equalsIgnoreCase(entries[1][a]))
                        System.out.println("buy...");
                        curState = 0;
                        sentToClient = "Bye.";
                   else
                        System.out.println("buy...!");
                        curState = 0;
                        sentToClient = "Hello.";
    return sentToClient;
    public void run() {
         int next = 0;     
         BufferedWriter bw = null;
         byte [] b = null;
         BufferedWriter bw1 = null;
         try{
    //JOptionPane.showMessageDialog(null,"Sizz");
    String fileNameStr = "C:\\San Server Data\\cInputCustData.txt";
    File f = new File(fileNameStr);
    long size = f.length();
    b = new byte[(int)size];
    FileInputStream fis = new FileInputStream(f);
    BufferedInputStream bis = new BufferedInputStream(fis);
    int count = 0, index = 0;
    int byteRed = 0;
    int sizeInt = (int)size;
    while (bis.available() > size-1)//16848 )
    bis.read(b,index,(int)size);
    //int bytesRead = bis.read(b,index,(int)size2);
    //size2 -= count;
    //index += count;
    //System.out.println( "hello:" + b[index]);
    //index++;
    //bis should be closed in a finally block.
    bis.close() ;
    catch(IOException io)
    System.out.println("Oh oh io error");
         //System.out.println("cInputCustData: \n" + new String(b));
         String bStr = new String(b);
         char charbStr []= bStr.toCharArray();
         String header []= new String[5];
         int ctr = 0;
         int e = 0;
    boolean first = true;
         for(int q=0;q<5;q++)
              for(int u=0;u<100;u++)
                   entries[q]= new String("");                    
         //System.out.println("b: " + bStr);
         for(int s=0; s<charbStr.length;s++)
              if(s<charbStr.length-1)
              if(charbStr[s]==':'&&charbStr[s+1]==':')
                   //System.out.println(" s0: " + s);                    
                   for(int ss=s+2;ss<s+12;ss++)
                        //System.out.println("ss: "+ ss + " s: " + s);                         
                        if(charbStr[ss]==':')
                             //System.out.println("in");     
                             header[ctr] = bStr.substring(s,ss);               
                             //System.out.println("1ss: " + ss + " s: " + s);          
                             for(int c=ss+1;c<charbStr.length;c++)               
                                  if(charbStr[c]==':')
                                       //System.out.println("ctr: " + ctr + " " +"entries[0]" + entries[0][0]+ "\n"+ entries[0][1] + "\n" + entries[1][0] + "\n" + entries[1][1]);
                                       if(ss<charbStr.length)entries[ctr][e++] = bStr.substring(ss+1,c);
                                       //System.out.println("c:" + c);
                                       ss= c;
                        ctr++;
                        e=0;
              //System.out.println("header: " + header);                         
                                  //System.out.println("entires[0]0: " + entries[0][0]);
                                  //System.out.println("entires[0]1: " + entries[0][1]);
                                  //System.out.println("entires[1]0: " + entries[1][0]);
                                  //System.out.println("entires[1]1: " + entries[1][1]);
                                  //System.out.println("entires[2]0: " + entries[2][0]);
                                  //System.out.println("entires[2]1: " + entries[2][1]);
              String timeConnect[][] = new String[5][100];
              char myChars[] = null;
              for(int d=0;d<5;d++)
                   for(int f = 0;f<100-1;f++)
                        for(int cs=0;cs<entries[d][f].length();cs++)
                             if(!(entries[d][f].equals("")))
                                  myChars = entries[d][f].toCharArray();
                             for(int a=0;a<entries[d][f].length();a++)
                                  if(myChars[a]==';')
                                       for(int k=a;k<entries[d][f].length();k++)
                                            timeConnect[d][f]= entries[d][f].substring(a,k);
                                       //     System.out.println("time: " + timeConnect[d][f]);
         //for(int o=0;o<5;o++)
              //System.out.println("Header["+o+"]" + header[o]);
         try {
         PrintWriter output = new PrintWriter(socket.getOutputStream(), true);
         BufferedReader input = new BufferedReader(
                        new InputStreamReader(
                        socket.getInputStream()));
         String inLine, outLine;
         outLine = getInput(null);
         output.println(outLine);
         while ((inLine = input.readLine()) != null) {
    244: outLine = getInput(inLine);
              output.println(outLine);
              System.out.println(inLine);
              outputStrings += inLine;
              //if(inLine.equals("Hello."))break;
              timeOfConnect[conCtr++]= " " Integer.toString(hour)":"+Integer.toString(min)+":"+Integer.toString(sec);
              if(c.PM==1){System.out.println("HL");timeOfConnect[conCtr-1]+="PM";}
              System.out.println(timeOfConnect[conCtr-1]);
              outputStrings += "\n"+ timeOfConnect[conCtr-1];
              //System.out.println("output");     
              try {
                   //FileWriter fw1 = new FileWriter("C:\\San Server Data\\Connectlog.txt");
                   bw1 = new BufferedWriter(new FileWriter("C:\\San Server Data\\Connectlog.txt",true));
                   //PrintWriter pw2 = new PrintWriter(bw1);
                        System.out.println(outputStrings);
                        //pw2.println(outputStrings);
                        if(next == 0)          
                             bw1.write(outputStrings);
                        if(next == 1)
                             bw1.write(outputStrings+ " D");
                        bw1.newLine();
                        bw1.flush();
                   //pw2.close();
                        catch (IOException io) {
                   System.out.println("Oh oh, Got and IOException error!"+io);
                        finally{
                             if(bw1 != null) try{
                                  bw1.close();
                             catch(IOException io)     
         output.close();
         input.close();
         socket.close();
    if(next == 0)next = 1;
         else if(next == 1)next = 0;
         //WONCUS1 won = new WONCUS1();
         //String m[] = new String[1];      
         //won.main(m);
         //won.start();     
         } catch (IOException err) {
         err.printStackTrace();
    //Client.java
    public class Client {          
    public static Socket Socket = null;
    public static BufferedReader i = null;
         public static PrintWriter o = null;
         public static String packetString = "CUSCarissa_Calton25242526"; //product id
         public static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    public static String fromServer;
    public static String fromUser;
    public static void main(String[] args) throws IOException {
         int ars=0;
         if (args.length > 0)
              ars = Integer.parseInt(args[0]);
    try {
         Socket = new Socket("localhost", 4444);
    o = new PrintWriter(Socket.getOutputStream(), true);
    i= new BufferedReader(new InputStreamReader(Socket.getInputStream()));
    } catch (UnknownHostException err) {
    System.err.println("Can not find Server!");
    System.exit(1);
    } catch (IOException e) {
    System.err.println("Couldn't get initialisation files to be represented in true statement!");
    System.exit(1);
    while ((fromServer = i.readLine()) != null) {
         //int hour = Integer.parseInt(fromServer);
         //System.out.println("Server: " + fromServer);
         System.out.println("Server: " + fromServer);     
         if (fromServer.equals("Bye."))
    break;
         if (fromServer.equals("Hello."))
    break;
    fromUser = packetString;
         if (fromUser != null) {
    System.out.println("Client: " + fromUser);
    //o.println(fromUser);
              String getComp = InetAddress.getLocalHost().getHostName();
              String ip = InetAddress.getLocalHost().getHostAddress();
              o.println(fromUser+";"+getComp + " " + ip);
              //o.println(getComp + " " + ip);

    "onclose event of application", at least do something such as call wait() on ReadersWhy? Who is going to notify() it?
    and close the Sockets and then Readers/WritersI won't even ask why about that because it is 100% dead wrong. Close the outermost Writer or OutputStream. That flushes the output, closes the socket, and closes any input streams or readers. Taking your advice the flush() cannot occur. But the evidence is that he is closing the socket: in fact the operating system does that anyway. Possibly he needs to take the advice about closing the Writer/OutputStream, to cause the flush(), which might stop the server from writing. But that depends on the application. If it's legal in the application protocol for the client to exit while the server is still writing he will just have to put up with the 'connection resets', or at least interpret them properly rather than just logging them as an error.
    If your using a window(GUI) you can use the main frame with a Window closing event.And that's completely irrelevant because the error happens on the server.

  • How to insert blank page into pages document when using word processing mode?

    I've recently created a 50+ page document using Pages '09. I started the document using word processing mode. Now, when I view in thumbnail mode and try to insert a blank page somehwere in the middle of the document, it won't allow me to select where I want. It just selects all the pages, as thought they are one section. I believe this is because I am in word processing mode. My question is, can I convert the document to layout mode so that each page represents it's own section, without losing what work I've already done? And if so, how?
    The document is entirely text boxes and images, so I don't have any need for word processing space. I just need new pages to act as blank templates for the text boxes and images I create.
    Is it possible to keep all my work as is, and convert the document to layout mode vs. word processing mode?
    Thanks!

    It just selects all the pages, as thought they are one section.
    That's because they are one section. You must insert section breaks to separate them. There is no need to use page layout which does make each page a separate section. You have to manually add each page & use text boxes or other containers for the text & link the text boxes.

  • Connection reset when inserting file to BLOB column

    Friends,
    When inserting a file to a BLOB clomun and the file is more than 1KB, I receive the following message: java.sql.SQLException: Io exception: Connection reset
    The code is this:
    int fileLength = (int)file.length();
    System.out.println("File length: "+fileLength);
    int cod = (int)(Math.random() * 1000);
    String sql = "INSERT INTO BLOB_TABLE VALUES(?,?)";
    try {
    FileInputStream fis = new FileInputStream(file);
    PreparedStatement pstmt = connection.prepareStatement(sql);
    pstmt.setInt(1, cod);
    pstmt.setBinaryStream(2, fis, fileLength);
    pstmt.executeUpdate();
    System.out.println("File insert sucess!");
    connection.close();
    Does anybody know what this can be? My database is oracle.
    Thanks!

    When you create objects on the database they are stored in the data dictionary by default in UPPER case.
    So in this line:
    src_loc bfile := bfilename('example_lob_dir', 'example.gif'); -- source location
    you need to reference the name of the directory object in upper case. e.g.
    src_loc bfile := bfilename('EXAMPLE_LOB_DIR', 'example.gif'); -- source location
    ;)

  • Xcelsius XML Connection Issue when using a Crystal created XML file

    HI Xcelsius/Crystal Gurus,
    I am running Crystal Reports 2008 version 12.2.9.698 and Xcelsius 2008 5.3.0.0 Build 12,3,0,670,
    I am attempting to create an XML file from a Crystal report which will be consumed by an Xcelsius Dashboard.  Apparently, there is something with the file that Xcelsius does not like.
    I have formatted the report exactly as Xcelsius requires and exporting via text with an xml extension to create an .xml file.  When I add an XML Connection in Xcelsius and add the appropriate names/range, etc...I am able to see the file via the Preview XML button on the Connection, but when I use a component, I am not seeing the data in the component.
    I can 'recreate' the file in NotePad by manually typing in the entries to look exactly like the file created by Crystal and set up a connection in Xcelsius to consume that file and it works beautifully.
    Does anyone have any experience with using Crystal Reports to create an XML file (not using the XML Export, but by exporting as a Text and adding an extension)?
    Is it possible that Crystal is adding hidden characters or something?  I can pull this Crystal created file into an XML editor or MS Word and it is validated as a good XML File.
    Any help is greatly appreciated!

    This article is all about setting up security on the web service. But, I just want to connect to the web service as a client using the proxy and the web service doesn't have any security set on it at this time.
    I am getting a connection timeout, even when I set the syncMaxWaitTime in the domain.xml file on the app server to a higher number (although this doesn't seem to affect the time it takes for the debugger to return).

Maybe you are looking for