Thin JPanel when used as TableCellRenderer

Hello,
I'm using JPanels as renderers for my single column JTable.
Even though im using FlowLayout( FlowLayout.LEFT ) and only adding JLabels, the height of each row is about 1.5 times that of a normal JTable row.
Is there anyway to slim it down? Decreasing the font or just using setRowHeight doesn't really work.
//John

By default a FlowLayout uses insets to position the components. Reset the insets to 0.

Similar Messages

  • JTextPane sizing  badly when used as TableCellRenderer

    I am trying to display HTML text is a JTable.
    I have created a TableModel holding HTMLDocument instances. I set the JTables cell renderer so that it returns an instance of JTextPane with the document
    set to the HTMLDocument from the model.That works OK.
    Problem is that initially the JTable only shows the first line of html in the JTextPane (it seems to ignore the height from the JTextPanes preferredSize ).
    Sometimes if I minimise the Window or click the mouse
    on the Table it redraws itself correctly !!!!
    Anyone seen similar behaviour ???
    TIA
    JamesT

    I haven't seen the problem, but it sounds like it has to do with the rubber-stamp behavior of the renderer. If you haven't looked at the Implementation Note on DefaultTreeCellRenderer, you might want to check it out: http://java.sun.com/j2se/1.3/docs/api/javax/swing/table/DefaultTableCellRenderer.html.
    You might do well to make your renderer extend DefaultCellRenderer in order to get the useful behaviors it produces. You could add a JTextPane to it, and override the setValue method with one that sets the document for the textpane and resets the preferredSize.
    Good luck,
    -- Scott

  • Unwanted lines when using effects.

    Having much trouble with unwanted thin lines when using outlined text with multiple effects - outer glow & bevel and emboss. Typically the lines show through the outer glow effect in the color of the background. It is then especially noticable with the darker background I used for this layout. The lines are not visible on screen but show up in printing. I have also tried saving as PDF and then printing but no difference.
    Here is a scanned portion of the layout.
    Any help would be greatly appreciated!

    The transparency flattener preset was set to medium resolution.
    If it's transparency stitching then the flattener preset you use in the print driver would make a difference. Try High resolution or make a flattener preset that has a heavier raster balance. Here's a flattened PDF/X-1a test with low res vs. a customized high res:
    The custom flattener on the left has no stitching at any zoom view

  • JTable text alignment issues when using JPanel as custom TableCellRenderer

    Hi there,
    I'm having some difficulty with text alignment/border issues when using a custom TableCellRenderer. I'm using a JPanel with GroupLayout (although I've also tried others like FlowLayout), and I can't seem to get label text within the JPanel to align properly with the other cells in the table. The text inside my 'panel' cell is shifted downward. If I use the code from the DefaultTableCellRenderer to set the border when the cell receives focus, the problem gets worse as the text shifts when the new border is applied to the panel upon cell selection. Here's an SSCCE to demonstrate:
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.EventQueue;
    import javax.swing.GroupLayout;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTable;
    import javax.swing.border.Border;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import sun.swing.DefaultLookup;
    public class TableCellPanelTest extends JFrame {
      private class PanelRenderer extends JPanel implements TableCellRenderer {
        private JLabel label = new JLabel();
        public PanelRenderer() {
          GroupLayout layout = new GroupLayout(this);
          layout.setHorizontalGroup(layout.createParallelGroup().addComponent(label));
          layout.setVerticalGroup(layout.createParallelGroup().addComponent(label));
          setLayout(layout);
        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
          if (isSelected) {
            setBackground(table.getSelectionBackground());
          } else {
            setBackground(table.getBackground());
          // Border section taken from DefaultTableCellRenderer
          if (hasFocus) {
            Border border = null;
            if (isSelected) {
              border = DefaultLookup.getBorder(this, ui, "Table.focusSelectedCellHighlightBorder");
            if (border == null) {
              border = DefaultLookup.getBorder(this, ui, "Table.focusCellHighlightBorder");
            setBorder(border);
            if (!isSelected && table.isCellEditable(row, column)) {
              Color col;
              col = DefaultLookup.getColor(this, ui, "Table.focusCellForeground");
              if (col != null) {
                super.setForeground(col);
              col = DefaultLookup.getColor(this, ui, "Table.focusCellBackground");
              if (col != null) {
                super.setBackground(col);
          } else {
            setBorder(null /*getNoFocusBorder()*/);
          // Set up our label
          label.setText(value.toString());
          label.setFont(table.getFont());
          return this;
      public TableCellPanelTest() {
        JTable table = new JTable(new Integer[][]{{1, 2, 3}, {4, 5, 6}}, new String[]{"A", "B", "C"});
        // set up a custom renderer on the first column
        TableColumn firstColumn = table.getColumnModel().getColumn(0);
        firstColumn.setCellRenderer(new PanelRenderer());
        getContentPane().add(table);
        pack();
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          public void run() {
            new TableCellPanelTest().setVisible(true);
    }There are basically two problems:
    1) When first run, the text in the custom renderer column is shifted downward slightly.
    2) Once a cell in the column is selected, it shifts down even farther.
    I'd really appreciate any help in figuring out what's up!
    Thanks!

    1) LayoutManagers need to take the border into account so the label is placed at (1,1) while labels just start at (0,0) of the cell rect. Also the layout manager tend not to shrink component below their minimum size. Setting the labels minimum size to (0,0) seems to get the same effect in your example. Doing the same for maximum size helps if you set the row height for the JTable larger. Easier might be to use BorderLayout which ignores min/max for center (and min/max height for west/east, etc).
    2) DefaultTableCellRenderer uses a 1px border if the UI no focus border is null, you don't.
    3) Include a setDefaultCloseOperation is a SSCCE please. I think I've got a hunderd test programs running now :P.

  • Problem refreshing when using GridBagLayout for a JPanel

    Well, i have a JPanel which use the GridBagLayout to layout the components. If i remove a component everything it's ok, i mean it disappear from the panel, but the appears when i want to add a component. It doesn't show me the new component. Any sugestion?

    Here is the all code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test {
         private JFrame f;
         private final JPanel detalii = new JPanel();
         private String[] sir1 = { "1820620160027", "Bradescu", "M", "Marius-Catalin", "Rovine bl. I29", "0745035150" };
         private String[] sir2 = { "1820620160031", "Bercea", "C", "Florin Bogdan", "Brazda bl. I29", "0745035150" };
         public Test(){
              f = new JFrame( "Test" );
              detalii.setLayout( new GridBagLayout() );
              detalii.setPreferredSize( new Dimension( 450, 400) );
              creazaDetaliiElev( sir2 );
              f.addMouseListener( new MouseAdapter(){
                   public void mouseClicked( MouseEvent evt ){
                        if( evt.getButton() == 1){
                             creazaDetaliiElev( sir1 );
                             //detalii.invalidate();
                             f.repaint();
                        } else {
                             creazaDetaliiElev( sir2 );
                             //detalii.invalidate();
                             f.repaint();
              f.getContentPane().add( detalii );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.pack();
              f.setVisible( true );
         protected void creazaDetaliiElev( String[] elev ){
              if( detalii.getComponentCount() == 0 ){                    
                   GridBagConstraints c = new GridBagConstraints();
                   c.fill = GridBagConstraints.VERTICAL;
                   JLabel lblID = new JLabel( "CNP:");
                   c.anchor = GridBagConstraints.WEST;
                   c.insets = new Insets( 5, 5, 5, 5 );
                   c.gridx = 0;
                   c.gridy = 0;
                   detalii.add( lblID, c );
                   JLabel lblNume = new JLabel( "Nume:" );
                   c.gridx = 0;
                   c.gridy = 1;
                   detalii.add( lblNume, c );
                   JLabel lblInitiala = new JLabel( "Initiala:" );
                   c.gridx = 0;
                   c.gridy = 2;
                   detalii.add( lblInitiala, c );
                   JLabel lblPrenume = new JLabel( "Prenume:" );
                   c.gridx = 0;
                   c.gridy = 3;
                   detalii.add( lblPrenume, c );
                   JLabel lblAdresa = new JLabel( "Adresa" );
                   c.gridx = 0;
                   c.gridy = 4;
                   detalii.add( lblAdresa, c );
                   JLabel lblTelefon = new JLabel( "Telefon:" );
                   c.gridx = 0;
                   c.gridy = 5;
                   detalii.add( lblTelefon, c );
                   JTextField txtID = new JTextField( String.valueOf( elev[ 0 ] ) );
                   txtID.setBackground( Color.WHITE );
                   txtID.setHorizontalAlignment( JTextField.TRAILING );
                   txtID.setEditable( false );
                   c.gridx = 1;
                   c.gridy = 0;
                   detalii.add( txtID, c );
                   JTextField txtNume = new JTextField( elev[ 1 ] );
                   txtNume.setBackground( Color.WHITE );
                   txtNume.setHorizontalAlignment( JTextField.LEADING );
                   txtNume.setEditable( false );
                   c.gridx = 1;
                   c.gridy = 1;
                   detalii.add( txtNume, c );
                   JTextField txtInitiala = new JTextField( elev[ 2 ] );
                   txtInitiala.setBackground( Color.WHITE );
                   txtInitiala.setHorizontalAlignment( JTextField.CENTER );
                   txtInitiala.setEditable( false );
                   c.gridx = 1;
                   c.gridy = 2;
                   detalii.add( txtInitiala, c );
                   JTextField txtPrenume = new JTextField( elev[ 3 ] );
                   txtPrenume.setBackground( Color.WHITE );
                   txtPrenume.setHorizontalAlignment( JTextField.LEADING );
                   txtPrenume.setEditable( false );
                   c.gridx = 1;
                   c.gridy = 3;
                   detalii.add( txtPrenume, c );
                   JTextField txtAdresa = new JTextField( elev[ 4 ] );
                   txtAdresa.setBackground( Color.WHITE );
                   txtAdresa.setHorizontalAlignment( JTextField.LEADING );
                   txtAdresa.setEditable( false );
                   c.gridx = 1;
                   c.gridy = 4;
                   detalii.add( txtAdresa, c );
                   JTextField txtTelefon = new JTextField( elev[ 5 ] );
                   txtTelefon.setBackground( Color.WHITE );
                   txtTelefon.setHorizontalAlignment( JTextField.TRAILING );
                   txtTelefon.setEditable( false );
                   c.gridx = 1;
                   c.gridy = 5;
                   detalii.add( txtTelefon, c );
              } else {
                   detalii.removeAll();
         public static void main( String[] args ){
              new Test();
    , but nothing, as you see i use invalidate() too.

  • OJ Pro8000 thin black line appear when using photo paper but not regular paper

    When using both my OJPro 8000 and my wife's OJPro8500, thin black lines appear every 7/8" on the paper when using photo paper.  This does not happen if I print on regular bond paper.

    Anything?  It's only happening in Photoshop, other apps print fine.

  • Thin flickering white line at the very top of screen when using mail

    using an imac 27 inch, new...
    there is a thin flickering white line at the very top of screen when using mail.
    usually when sending a mail or when the cursor moves over a link ( in apple mail )
    the flickering line is just under the very top menu bar which has the date on etc...
    anyone else had this or know how to fix it?
    cheers

    I am facing the same problem. In fact mac book pro 13 retina was in the 14 day period so I got it retuned today, after directions from the apple telephone support. However, the new machine I got in exchange has the same problem or flickering line under the menu tab.
    The only relief it seems is the fact that it's not a hardware problem probably. I also think so because if I do a full screen which essentially means there is no menu bar, then there is no flickering white line.
    Hope apple fixes this. Sad to notice this drop in apple quality, and yet not fixed.

  • Exception report when using tomcat 5 with JDBC

    i followed this guide to setup the JDBC with my TOMCAT 5
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
    but i seem to get this error
    exception
    javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
         org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:81)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
         org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
         org.apache.jsp.SID.test_jsp._jspx_meth_sql_query_0(test_jsp.java:100)
         org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:58)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    i can compile *.java and run them when they need the jdbc drivers to interact with mysql 5 database.
    This is my server.xml
    <!-- Example Server Configuration File -->
    <!-- Note that component elements are nested corresponding to their
    parent-child relationships with each other -->
    <!-- A "Server" is a singleton element that represents the entire JVM,
    which may contain one or more "Service" instances. The Server
    listens for a shutdown command on the indicated port.
    Note: A "Server" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <Server port="8005" shutdown="SHUTDOWN" debug="0">
    <!-- Comment these entries out to disable JMX MBeans support -->
    <!-- You may also configure custom components (e.g. Valves/Realms) by
    including your own mbean-descriptor file(s), and setting the
    "descriptors" attribute to point to a ';' seperated list of paths
    (in the ClassLoader sense) of files to add to the default list.
    e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
    -->
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
    debug="0"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
    debug="0"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <!-- Editable user database that can also be used by
    UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
    type="org.apache.catalina.UserDatabase"
    description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
    <parameter>
    <name>factory</name>
    <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
    </parameter>
    <parameter>
    <name>pathname</name>
    <value>conf/tomcat-users.xml</value>
    </parameter>
    </ResourceParams>
    </GlobalNamingResources>
    <!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" (and therefore the web applications visible
    within that Container). Normally, that Container is an "Engine",
    but this is not required.
    Note: A "Service" is not itself a "Container", so you may not
    define subcomponents such as "Valves" or "Loggers" at this level.
    -->
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- A "Connector" represents an endpoint by which requests are received
    and responses are returned. Each Connector passes requests on to the
    associated "Container" (normally an Engine) for processing.
    By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
    You can also enable an SSL HTTP/1.1 Connector on port 8443 by
    following the instructions below and uncommenting the second Connector
    entry. SSL support requires the following steps (see the SSL Config
    HOWTO in the Tomcat 5 documentation bundle for more detailed
    instructions):
    * If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
    later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
    * Execute:
    %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
    with a password value of "changeit" for both the certificate and
    the keystore itself.
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost(). This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false". When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.
    -->
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    debug="0" connectionTimeout="20000"
    disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout value
    to 0 -->
         <!-- Note : To use gzip compression you could set the following properties :
                   compression="on"
                   compressionMinSize="2048"
                   noCompressionUserAgents="gozilla, traviata"
                   compressableMimeType="text/html,text/xml"
         -->
    <!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
    <!--
    <Connector port="8443"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true"
    acceptCount="100" debug="0" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" />
    -->
    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" debug="0"
    protocol="AJP/1.3" />
    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <!--
    <Connector port="8082"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false"
    acceptCount="100" debug="0" connectionTimeout="20000"
    proxyPort="80" disableUploadTimeout="true" />
    -->
    <!-- An Engine represents the entry point (within Catalina) that processes
    every request. The Engine implementation for Tomcat stand alone
    analyzes the HTTP headers included with the request, and passes them
    on to the appropriate Host (virtual host). -->
    <!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
    <Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
    -->
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost" debug="0">
    <!-- The request dumper valve dumps useful debugging information about
    the request headers and cookies that were received, and the response
    headers and cookies that were sent, for all requests received by
    this instance of Tomcat. If you care only about requests to a
    particular virtual host, or a particular application, nest this
    element inside the corresponding <Host> or <Context> entry instead.
    For a similar mechanism that is portable to all Servlet 2.4
    containers, check out the "RequestDumperFilter" Filter in the
    example application (the source for this filter may be found in
    "$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
    Request dumping is disabled by default. Uncomment the following
    element to enable it. -->
    <!--
    <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
    -->
    <!-- Global logger unless overridden at lower levels -->
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="catalina_log." suffix=".txt"
    timestamp="true"/>
    <!-- Because this Realm is here, an instance will be shared globally -->
    <!-- This Realm uses the UserDatabase configured in the global JNDI
    resources under the key "UserDatabase". Any edits
    that are performed against this UserDatabase are immediately
    available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
    debug="0" resourceName="UserDatabase"/>
    <!-- Comment out the old realm but leave here for now in case we
    need to go back quickly -->
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <!-- Replace the above Realm with one of the following to get a Realm
    stored in a database and accessed via JDBC -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="org.gjt.mm.mysql.Driver"
    connectionURL="jdbc:mysql://localhost/authority"
    connectionName="test" connectionPassword="test"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
    connectionName="scott" connectionPassword="tiger"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!--
    <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
    driverName="sun.jdbc.odbc.JdbcOdbcDriver"
    connectionURL="jdbc:odbc:CATALINA"
    userTable="users" userNameCol="user_name" userCredCol="user_pass"
    userRoleTable="user_roles" roleNameCol="role_name" />
    -->
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" debug="0" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    <!-- Defines a cluster for this node,
    By defining this element, means that every manager will be changed.
    So when running a cluster, only make sure that you have webapps in there
    that need to be clustered and remove the other ones.
    A cluster has the following parameters:
    className = the fully qualified name of the cluster class
    name = a descriptive name for your cluster, can be anything
    debug = the debug level, higher means more output
    mcastAddr = the multicast address, has to be the same for all the nodes
    mcastPort = the multicast port, has to be the same for all the nodes
    mcastBindAddr = bind the multicast socket to a specific address
    mcastTTL = the multicast TTL if you want to limit your broadcast
    mcastSoTimeout = the multicast readtimeout
    mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
    mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
    tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
    tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
    in case of multiple ethernet cards.
    auto means that address becomes
    InetAddress.getLocalHost().getHostAddress()
    tcpListenPort = the tcp listen port
    tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
    has a wakup bug in java.nio. Set to 0 for no timeout
    printToScreen = true means that managers will also print to std.out
    expireSessionsOnShutdown = true means that
    useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
    false means to replicate the session after each request.
    false means that replication would work for the following piece of code:
    <%
    HashMap map = (HashMap)session.getAttribute("map");
    map.put("key","value");
    %>
    replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
    * Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
    * Synchronous means that the thread that executes the request, is also the
    thread the replicates the data to the other nodes, and will not return until all
    nodes have received the information.
    * Asynchronous means that there is a specific 'sender' thread for each cluster node,
    so the request thread will queue the replication request into a "smart" queue,
    and then return to the client.
    The "smart" queue is a queue where when a session is added to the queue, and the same session
    already exists in the queue from a previous request, that session will be replaced
    in the queue instead of replicating two requests. This almost never happens, unless there is a
    large network delay.
    -->
    <!--
    When configuring for clustering, you also add in a valve to catch all the requests
    coming in, at the end of the request, the session may or may not be replicated.
    A session is replicated if and only if all the conditions are met:
    1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
    2. a session exists (has been created)
    3. the request is not trapped by the "filter" attribute
    The filter attribute is to filter out requests that could not modify the session,
    hence we don't replicate the session after the end of this request.
    The filter is negative, ie, anything you put in the filter, you mean to filter out,
    ie, no replication will be done on requests that match one of the filters.
    The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
    filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
    ending with .gif and .js are intercepted.
    The deployer element can be used to deploy apps cluster wide.
    Currently the deployment only deploys/undeploys to working members in the cluster
    so no WARs are copied upons startup of a broken node.
    The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
    When a new war file is added the war gets deployed to the local instance,
    and then deployed to the other instances in the cluster.
    When a war file is deleted from the watchDir the war is undeployed locally
    and cluster wide
    -->
    <!--
    <Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
    managerClassName="org.apache.catalina.cluster.session.DeltaManager"
    expireSessionsOnShutdown="false"
    useDirtyFlag="true">
    <Membership
    className="org.apache.catalina.cluster.mcast.McastService"
    mcastAddr="228.0.0.4"
    mcastPort="45564"
    mcastFrequency="500"
    mcastDropTime="3000"/>
    <Receiver
    className="org.apache.catalina.cluster.tcp.ReplicationListener"
    tcpListenAddress="auto"
    tcpListenPort="4001"
    tcpSelectorTimeout="100"
    tcpThreadCount="6"/>
    <Sender
    className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
    replicationMode="pooled"/>
    <Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
    filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
    <Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>
    </Cluster>
    -->
    <!-- Normally, users must authenticate themselves to each web app
    individually. Uncomment the following entry if you would like
    a user to be authenticated the first time they encounter a
    resource protected by a security constraint, and then have that
    user identity maintained across all web applications contained
    in this virtual host. -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn"
    debug="0"/>
    -->
    <!-- Access log processes all requests for this virtual host. By
    default, log files are created in the "logs" directory relative to
    $CATALINA_HOME. If you wish, you can specify a different
    directory with the "directory" attribute. Specify either a relative
    (to $CATALINA_HOME) or absolute path to the desired directory.
    -->
    <!--
    <Valve className="org.apache.catalina.valves.AccessLogValve"
    directory="logs" prefix="localhost_access_log." suffix=".txt"
    pattern="common" resolveHosts="false"/>
    -->
    <!-- Logger shared by all Contexts related to this virtual host. By
    default (when using FileLogger), log files are created in the "logs"
    directory relative to $CATALINA_HOME. If you wish, you can specify
    a different directory with the "directory" attribute. Specify either a
    relative (to $CATALINA_HOME) or absolute path to the desired
    directory.-->
    <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
    timestamp="true"/>
              <Context path="/testdb" docBase="APACHE_DIR/htdocs/testdb"
    debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_DBTest_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/TestDB"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/TestDB">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- Maximum number of dB connections in pool. Make sure you
    configure your mysqld max_connections large enough to handle
    all of your db connections. Set to 0 for no limit.
    -->
    <parameter>
    <name>maxActive</name>
    <value>10</value>
    </parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxIdle</name>
    <value>5</value>
    </parameter>
    <!-- Maximum time to wait for a dB connection to become available
    in ms, in this example 10 seconds. An Exception is thrown if
    this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>username</name>
    <value>test</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>testpwd</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
    The autoReconnect=true argument to the url makes sure that the
    mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
    connection. mysqld by default closes idle connections after 8 hours.
    -->
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost/testdb?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
         </Context>
    </Host>
    </Engine>
    </Service>
    </Server>

    You haven't added a resource reference for your web application that gives the application a local name for the global resource "UserDatabase".

  • Error Connecting to database URL jdbc:oracle:oci:@rmsdbtst as user rms13 java.lang.Exception:UnsatisfiedLinkError encountered when using the Oracle driver

    Trying to Install RMS application 13.2.2 and I get past the pre-installation checks and when I get to the Data Source details and enter the data source details with the check box checked to validate the schema/Test Data Source I get the following error:
    Error Connecting to database URL jdbc:oracle:oci:@rmsdbtst as user rms13 java.lang.Exception:UnsatisfiedLinkError encountered when using the Oracle driver. Please check that the library path is set up properly or switch to the JDBC thin client oracle/jdbc/driver/T2CConnection.getLibraryVersioNumber()
    Checks performed:
    RMS Application code location and directory contents:
    [oracle@test-rms-app application]$ pwd
    /binary_files/STAGING_DIR/rms/application
    [oracle@test-rms-app application]$ ls -ltr
    total 144
    -rw-r--r-- 1 oracle oinstall   272 Dec 7  2010 version.properties
    -rw-r--r-- 1 oracle oinstall   405 Jan 16 2011 expected-object-counts.properties
    -rw-r--r-- 1 oracle oinstall   892 May 13 2011 ant.install.properties.sample
    -rw-r--r-- 1 oracle oinstall 64004 Jun  6  2011 build.xml
    drwxr-xr-x 9 oracle oinstall  4096 Jun 16 2011 rms13
    drwxr-xr-x 3 oracle oinstall  4096 Jun 16 2011 installer-resources
    drwxr-xr-x 3 oracle oinstall  4096 Jun 16 2011 antinstall
    drwxr-xr-x 2 oracle oinstall  4096 Jun 16 2011 ant-ext
    drwxr-xr-x 5 oracle oinstall  4096 Jun 16 2011 ant
    -rw-r--r-- 1 oracle oinstall 11324 Dec 18 09:18 antinstall-config.xml.ORIG
    -rwxr-xr-x 1 oracle oinstall  4249 Dec 18 10:01 install.sh
    drwxr-xr-x 4 oracle oinstall  4096 Dec 18 10:06 common
    -rw-r--r-- 1 oracle oinstall 16244 Dec 19 10:37 antinstall-config.xml
    -rw-r--r-- 1 oracle oinstall   689 Dec 19 10:37 ant.install.log
    [oracle@test-rms-app application]$
    Application installation:
    [oracle@test-rms-app application]$ ./install.sh
    THIS IS the driver directory
    Verified $ORACLE_SID.
    Verified SQL*Plus exists.
    Verified write permissions.
    Verified formsweb.cfg read permissions.
    Verified Registry.dat read permissions.
    Verified Java version 1.4.2.x or greater. Java version - 1.6.0
    Verified Tk2Motif.rgb settings.
    Verified frmcmp_batch.sh status.
    WARNING: Oracle Enterprise Linux not detected.  Some components may not install properly.
    Verified $DISPLAY - 172.16.129.82:0.0.
    This installer will ask for your "My Oracle Support" credentials.
    Preparing installer. This may take a few moments.
    Your internet connection type is: NONE
    Integrating My Oracle Support into the product installer workflow...
         [move] Moving 1 file to /binary_files/STAGING_DIR/rms/application
    Installer preparation complete.
    MW_HOME=/u01/app/oracle/Middleware/NewMiddleware1034
    ORACLE_HOME=/u01/app/oracle/Middleware/NewMiddleware1034/as_1
    ORACLE_INSTANCE=/u01/app/oracle/Middleware/NewMiddleware1034/asinst_1
    DOMAIN_HOME=/u01/app/oracle/Middleware/NewMiddleware1034/user_projects/domains/rmsClassDomain
    WLS_INSTANCE=WLS_FORMS
    ORACLE_SID=rmsdbtst
    JAVA_HOME=/u01/app/oracle/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
    Launching installer...
    To make sure I have connectivity from the app server to the database (on a database server) here are the steps followed:
    [oracle@test-rms-app application]$ tnsping rmsdbtst
    TNS Ping Utility for Linux: Version 11.1.0.7.0 - Production on 19-DEC-2013 10:41:40
    Copyright (c) 1997, 2008, Oracle.  All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = test-rms-db.vonmaur.vmc)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = rmsdbtst)))
    OK (0 msec)
    [oracle@test-rms-app application]$
    [oracle@test-rms-app application]$ sqlplus rms13@rmsdbtst
    SQL*Plus: Release 11.1.0.7.0 - Production on Thu Dec 19 10:46:18 2013
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@test-rms-app application]$
    [oracle@test-rms-app application]$ ping test-rms-db
    PING test-rms-db.vonmaur.vmc (192.168.1.140) 56(84) bytes of data.
    64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=1 ttl=64 time=0.599 ms
    64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=2 ttl=64 time=0.168 ms
    64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=3 ttl=64 time=0.132 ms
    64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=4 ttl=64 time=0.158 ms
    64 bytes from test-rms-db.vonmaur.vmc (192.168.1.140): icmp_seq=5 ttl=64 time=0.135 ms
    --- test-rms-db.vonmaur.vmc ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4001ms
    rtt min/avg/max/mdev = 0.132/0.238/0.599/0.181 ms
    [oracle@test-rms-app application]$
    [oracle@test-rms-app application]$ uname -a
    Linux test-rms-app.vonmaur.vmc 2.6.18-128.el5 #1 SMP Wed Jan 21 08:45:05 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
    [oracle@test-rms-app application]$
    [oracle@test-rms-app application]$ cat /etc/*-release
    Enterprise Linux Enterprise Linux Server release 5.3 (Carthage)
    Red Hat Enterprise Linux Server release 5.3 (Tikanga)
    [oracle@test-rms-app application]$
    The database is created and all the batch file scripts have been successfully deployed.  Now working on the application server.  The  Weblogic server is installed and 11g forms and reports are installed successfully.
    Any help would be helpful.
    Thanks,
    Ram.

    Please check MOS Notes:
    FAQ: RWMS 13.2 Installation and Configuration (Doc ID 1307639.1)

  • Broken Pipe Error when using database link

    We are using WebLogic 6.1 sp2 / oracle database 8.1.6. / thin drivers.
    The connection works fine, unit I try to access a view that has a union and db links
    in it.
    We have used one or the other (view or a dblink) and it works, but when used together,
    we get broken pipe error.
    I haven't proven that this is the cause, I will try to setup a test, but I was wondering
    if this is a known issue or what ??
    thanks
    Rich

    You need to create the catalog views that support distributed SQL in your remote database (the database you connect to via db_link).
    To create these views, connect "/ as sysdba" and run:
    $ORACLE_HOME/rdbms/admin/catproc.sql
    which will in turn call several other scripts including: $ORACLE_HOME/rdbms/admin/catrpc.sql (which creates your missing view)
    It is best to run the whole catproc.sql script (and not just the catrpc script).
    You can run and rerun catproc.sql several times quite safely.
    Cheers

  • Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

    I'm trying to migrate a Sql Server 2k database to an Oracle 8i schema using OMWB. After using BCP to collect metadata information on the source database, I tried to capture the source data model and got a "Capture aborted" message on the progress screen (even though then it appears a dialog window reporting "0 errors and 0 warnings", funny!). Down there is the error log OMWB generated. After reading some posts, I changed some columns of the OMWB dictionary that holds the source database name, but still got the same error. If someone can enlighten me on this toppic, I'd greatly appreciated it.
    Here's the error log of OMWB:
    ** Oracle Migration Workbench
    ** Production
    ** ( Build 20050629 )
    ** OMWB_HOME: D:\Datos\Download\Oracle\Oracle Migration Workbench\omwb
    ** user language: es
    ** user region: null
    ** user timezone:
    ** file encoding: Cp1252
    ** java version: 1.4.2_04
    ** java vendor: Sun Microsystems Inc.
    ** o.s. arch: x86
    ** o.s. name: Windows 2000
    ** o.s. version: 5.0
    ** Classpath:
    ..\lib\boot.jar
    ** Started : Fri Feb 23 17:18:48 GMT-03:00 2007
    ** Workbench Repository : Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Repository Connection URL: jdbc:oracle:thin:@ServerCms:1521:sigcewbc
    ** The following plugins are installed:
    ** Microsoft Access 2.0/95/97/2000/2002/2003 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 2000 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 6.5 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 7.0 Plugin, Production Release 10.1.0.4.0
    ** Active Plugin : SQLServer2K
    EXCEPTION :SQLServer2KDisconnSourceModelLoad.loadSourceModel(): oracle.mtg.migration.MigrationStopException: java.lang.IndexOutOfBoundsException: Index: 15, Size: 15
    ** Shutdown : Fri Feb 23 18:00:50 GMT-03:00 2007

    Duplicate thread
    Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

  • BINDING.JCA-12510 JCA Resource Adapter - Cannot call rollback when using di

    Hi,
    i'm facing a simillar issue with dbadapter while trying to insert a record.
    The issue that I'm facing is: (BINDING.JCA-12563)
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: http://InsertEmployee.TestEmp. Caused by java.sql.SQLException: Cannot call rollback when using distributed transactions. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    I faced the same issues that have been posted in this thread before but this is a new one I'm seeing.
    Following are the configurations that I'm using.
    WEBLOGIC ADMIN CONSOLE
    JDBC datasources
    General tab:
    JNDI Name: jdbc/SOADataSource
    Connection Pool tab:
    URL - jdbc:oracle:thin:@localhost:1522/XE
    Driver Class Name - oracle.jdbc.xa.client.OracleXADataSource
    Properties - user=SATRA_SOAINFRA
    oracle.net.CONNECT_TIMEOUT=10000
    Deployments
    Inside DbAdapter - Configuration
    The general tab shows blank values for 'Native lib dir' and 'JNDI name' fields. Is this normal or I need to populate values into these.
    Inside Outbound Connection Pools the javax.resource.cci.ConnectionFactory created an entry 'eis/DB/10gXE_DBCon'
    following is the settings for dataSourceName property
    dataSourceName java.lang.String jdbc/SOADataSource
    I have kept the value for xADataSourceName as blank as giving the same value of 'jdbc/SOADataSource' throws error.
    The JNDI value that I'm using while creating the database adapter from Jdev is eis/DB/10gXE_DBCon where 10gXE_DBCon is the database connection name.
    Can you please tell me what is the issue and where I'm going wrong.
    Thanks in advance,
    Satrajit

    Hi Sunil,
    I followed your advice and did the changes, that error has gone but a new error is popping up.
    BINDING.JCA-12563 Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [InsertEmployee.TestEmp]. Caused by java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist . ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    The name of the table i'm inserting to is test_emp and it exists in the database.
    the .jca file for dbadsapter is like
    <adapter-config name="FileToDB_DBAdp" adapter="Database Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/DB/10gXE_DBCon" UIConnectionName="10gXE_DBCon" adapterRef=""/>
    <endpoint-interaction portType="FileToDB_DBAdp_ptt" operation="insert">
    <interaction-spec className="oracle.tip.adapter.db.DBWriteInteractionSpec">
    <property name="DescriptorName" value="FileToDB_DBAdp.TestEmp"/>
    <property name="DmlType" value="insert"/>
    <property name="MappingsMetaDataURL" value="FileToDB_DBAdp-or-mappings.xml"/>
    <property name="DetectOmissions" value="true"/>
    <property name="GetActiveUnitOfWork" value="false"/>
    </interaction-spec>
    </endpoint-interaction>
    </adapter-config>
    and the .xsd file for dbadapter is
    <?xml version = '1.0' encoding = 'UTF-8'?>
    <xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/FileToDB_DBAdp" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/FileToDB_DBAdp" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="TestEmpCollection" type="TestEmpCollection"/>
    <xs:complexType name="TestEmpCollection">
    <xs:sequence>
    <xs:element name="TestEmp" type="TestEmp" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TestEmp">
    <xs:sequence>
    <xs:element name="empid" type="xs:decimal" nillable="true"/>
    <xs:element name="name" type="xs:string" minOccurs="0" nillable="true"/>
    <xs:element name="designation" minOccurs="0" nillable="true">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="50"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    <xs:element name="salary" type="xs:decimal" minOccurs="0" nillable="true"/>
    <xs:element name="deptno" type="xs:decimal" minOccurs="0" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    If I change element name from 'TestEmp' to 'Test_Emp' in the .xsd file,
    I'm getting the following issue ...
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: Could not create/access the TopLink Session. This session is used to connect to the datastore. Caused by java.lang.NullPointerException. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.
    I'm confused why does it take the table name as TestEmp and not as Test_Emp.
    Regards,
    Satrajit

  • Multiple weight font selection when using STL file importing...

    I am aware how powerful the manual editor is for DSP4.2, but unfortunately a lot of the editing for my subtitles needs to be done outside of DSP. So I came across a little bit of a problem...
    When using a multiple weight font, like Kozuka Mincho Pro (and many others), there are several weights, and some don't even have a "Bold." As an example Light, Thin, Roman, Heavy, Black, etc.
    So, using the STL method of importing, how does one specify a font AND weight that does not correspond to a "Bold" version? i.e., setting "Helvetica Neue Bold" does not bring that weight up when specifying "Bold = False," and you can't possibly get "Helvetica Neue Black," under any circumstances. I've attempted to get around this, but all I get is a message saying that the font is not found, and that the default font will be used. Is it even possible to do this?
    Hand entering and altering kanji in DSP's manual editor will be a nightmare, if I can't figure a way around this (the STL file is re-loaded dozens of times for placement issues during the project, meaning manual edits would have to be re-done every time).
    Hopefully the next version will allow the user to edit the .rtf document with styles and fonts and import them as styled text the way it appears. Multiple fonts per line, so easy integration of various symbol fonts can be dealt with, etc.

    Nope, using "$FontName = Helvetica Neue Black" does not work. And you can't even do anything close to that with fonts whose weights are specified as W3, W5, W7, etc.
    I found another snippet buried in the new manual that states something to the effect that the name must be spelled exactly as it appears in the "Font Panel." If this is so, then you can only access two weights from any font, just like working with good old-fashioned windows...
    So, unless there is a DSP specific trick for the STL format, I'm going to guess it's not possible.
    And I cannot re-compile fonts with new names and data, since most of the fonts I will be working with, with this issue, are full Kanji Unicode fonts, and we would have to purchase a font-editor that, IIRC costs about a grand. I think the SysAdmin would frown over both aspects of that... ^_^

  • 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.

  • Catch error in javascript when using SAP script

    All,
    I have a issue when using Javascript to control the SAP GUI in that I get a "syntax Error" raised by Internet Explorer if I attempt to get the SAPGUI runtime object from the runtime object table if SAP is not already running.
    For example:
    I have a javascript function embedded in a web page as follows:
    <script type="text/javascript">
    function displaymessage()
    var sapgui;
    var application;
    var connection;
    if (typeof(application) == "undefined")
       sapgui      = GetObject("SAPGUI");
       application = sapgui.GetScriptingEngine();
    if (typeof(connection) == "undefined")
       connection = application.children(0);
    if (typeof(session) == "undefined")
       session = connection.children(0);
    if (typeof(WScript) != "undefined")
       WScript.connectObject(session, "on");
       WScript.connectObject(application, "on");
    session.findById("wnd[0]/tbar[0]/okcd").text = "fb50";
    session.findById("wnd[0]").sendVKey(0);
    session.findById("wnd[1]/usr/ctxtBKPF-BUKRS").text = "0001";
    session.findById("wnd[1]/usr/ctxtBKPF-BUKRS").caretPosition = 4;
    session.findById("wnd[1]").sendVKey(0);
    </script>
    I have a simple HTML page with a button on it that calls the function.
    If I have already launched SAP GUI and logged in the code works fine and atuomatically navigates me to FB50.
    If SAP is not active and logged in then I get a syntax error!  The error is raised by IE when the GetObject("SAPGUI") is executed.
    Can anyone please help by either:
    a) explaining how I can catch this error in javascript
    b) suggesting a different way to call the GetObject
    c) suggesting a way that I can auto launch SAP to log people in if it is not already active.
    Note - Using VB is not an option as I need to embed the working Javascript code in a Siebel thin client application which only uses Javascript.
    All help welcome. Thanks

    Hey Gunter,
    Thanks much, that did work.
    The other error I spoke of was fixed with the new database, so apparently the two errors I spoke of weren't related.
    You seem to be a good help to this forum, thank you for that.... fixing my problem relieved me from much stress.
    Cheers,
    Derek Miller
    Dreamweaver Enthusiast

Maybe you are looking for

  • PO Ammendment after release prints only changed materials,need to print all

    Dear Sir/Madam, i'm creating a PO and releasing it using ME9F Now, when i change the PO, only the changed materials are displyed in the Output. Now, i got to know that this is the standard process. but my requirement is that all the materials are to

  • Group by date

    How do I group by Date in the new iMovie 10?  This seems like a pretty basic feature that is missing.  Atleast in iMovie I can create smart folder.

  • Automated/batch printing job?

    Hi all, We are using BW 3.5 and I was wondering if there is a way to set up an automated batch print job. (ie. let's say that once a month a report is generated automatically, is there a way to tell BW to print that report automatically at a given ti

  • Wiped Drive Message Question

    Hi, this may seem like an odd question but I'm doing research for a Television series and need show what a basic error message would look like on a MacBook pro after the device drives and operating system had been wiped. The character starts up the l

  • Customs Declaration Cancellation

    HI - GTS System is configured to create a Customs Declaration Document automatically upon saving the Billing Document in SAP ECC System         What is the process followed in the below scenarios:         1) Billing Document has to be cancelled out i