Rambo Rambabu

Greenhorn
+ Follow
since Jul 12, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rambo Rambabu

Hi, I am trying to run a simple point-to-point JMS program. I configured a server with a queue and queueconnectionfactory and trying to run the java program as a WebSphere 5 Application client program. I picked the "MQ Simulator for Java" for JMS provider while configuring the server.

here are the first 4 statements in my program:
final InitialContext context = new InitialContext();

// Lookup the queue connection factory from the
// initial context.
final QueueConnectionFactory qcf = (QueueConnectionFactory) context.lookup("HelloWorldQCF");

// Create a new queue connection from the queue
// connection factory.
final QueueConnection conn = qcf.createQueueConnection();
// Start the connection

conn.start();

When I run, the program is failing at 3rd statement ie while getting the QueueConnection. Here is the error message:

com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2012
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:246)
at com.ibm.mq.MQJDManagedConnectionFactoryJ11._createManagedConnection(MQJDManagedConnectionFactoryJ11.java:128)
at com.ibm.mq.MQJDManagedConnectionFactoryJ11.createManagedConnection(MQJDManagedConnectionFactoryJ11.java:146)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:171)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.java:737)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:671)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:452)
at com.ibm.mq.MQSPIQueueManager.<init>(MQSPIQueueManager.java:52)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:1659)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1129)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:170)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:80)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:145)
at PointToPoint.<init>(PointToPoint.java:31)
at PointToPoint.main(PointToPoint.java:89)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:616)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:420)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'WAS_localhost_server1'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:556)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:1736)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1129)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:170)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:80)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:145)
at PointToPoint.<init>(PointToPoint.java:31)
at PointToPoint.main(PointToPoint.java:89)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.websphere.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:616)
at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:420)
at java.lang.reflect.Method.invoke(Native Method)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:94)
------------------------------------------------------------

Any help is greatly appreciated.

-- Rambo
20 years ago
Hi, I am getting a similar error message. Did you resovle the problem? If yes, can you share the details.
We just upgraded to WebSphere 4.06.
I added a 13th Application Server instance to my node and I started getting this error (java.lang.ArrayIndexOutOfBoundsException: 12). I thought that I exceeded the max # instances and deleted some of the old AppServer Instances and tried to regenerated the WebSphere plugin and re-booted the Server. When I start an instance, it starts without any problem, but when I try to access a jsp/servlet I get the following error:
[8/18/03 13:09:30:453 PDT] 771d479a OSEListenerDi X PLGN0007E: Engine Throwable
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U java.lang.ArrayIndexOutOfBoundsException: 12
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.servlet.engine.ServletEngine.findServletHostAsWildCard(ServletEngine.java:679)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.servlet.engine.ServletEngine.findServletHostByHostname(ServletEngine.java:606)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:100)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:317)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:391)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:274)
[8/18/03 13:09:30:516 PDT] 771d479a SystemOut U at com.ibm.ws.util.CachedThread.run(ThreadPool.java:144)

Any help is appreciated.....
thank you.
21 years ago
Hi, I defined my custo textItem with a constructor like this:
----------------------------------------
public POSTTextField(int maxlength) {
super();
init();
this.maxLength = maxlength;
addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent evt) {
System.out.println("maxlength is|"+POSTTextField.this.maxLength+" currlength is|"+getText().length());

if ( (getText().length() >= POSTTextField.this.maxLength) &&
(!(evt.getKeyChar() == '')) ) // check for backspace key stroke and allow it
evt.consume();
}
});
}
---------------------------------
This works fine for any of my text items I am creating by passing an int for the max length.
When I try to use this field for a local text field and use that one to create a local cell editor and use that editor for a table column, the keyTyped method is not getting called. Any work arounds or other implementation ideas? Here is my code for creating the table column...
---------------------------------
private TableColumn getStdObjDayColumn() {
if (stdObjDayColumn == null) {
try {
DefaultTableCellRenderer localCellRenderer;
localCellRenderer = new DefaultTableCellRenderer();
localCellRenderer.setName("localCellRenderer");
localCellRenderer.setFont(new Font("sansserif", 0, 12));
localCellRenderer.setBorder(LineBorder.createBlackLineBorder());
localCellRenderer.setBackground(Color.white);
localCellRenderer.setForeground(Color.black);
POSTTextField localTextField = new POSTTextField(2);
DefaultCellEditor localCellEditor = new DefaultCellEditor(localTextField);
stdObjDayColumn = new TableColumn();
stdObjDayColumn.setCellRenderer(localCellRenderer);
scheduledHoursColumn.setCellEditor(localCellEditor);
stdObjDayColumn.setHeaderValue("Std. Obj. Day");
stdObjDayColumn.setMaxWidth(123);
stdObjDayColumn.setModelIndex(3);
stdObjDayColumn.setWidth(123);
stdObjDayColumn.setMinWidth(123);
stdObjDayColumn.setResizable(false);
// user code begin {1}
// user code end
} catch (java.lang.Throwable Exc) {
// user code begin {2}
// user code end
handleException(Exc);
}
}
return stdObjDayColumn;
}
-------------------
thank you for your help.
-- Rambo
22 years ago
Hi,
I tried to implement this feature using addKeyListener and extending JTextField. It is working fine as far as limiting the size of the text. Once it reaches the max size, my backspace key is not working. I think the call to comsume() is consuming backspace key also. I added an extra condition to the if clause:
&& (!(evt.getKeyChar() == '')) ) // check for backspace key stroke and allow it
After adding this line, backspace works fine.
22 years ago
Hi,
I have a JTable in which one column is editable. I created a DefaultCellEditor and did column.setCellEditor().
I also have a ComboBox. When this combobox is changed, I fetch new values from the DB and repopulate the JTable.
For editing any column in the JTable, I have to double click on that column and edit. When I edit and change the combobox, new rows are populated in but the last edited cell retains the value I entered before changing the combo box. Any idea how to stop this from happening?
Also, I have a JText field. The value I enter in this text field has to replicated for a column for all rows in the JTable. I have coded a document listener for the textfield and am using setValueAt() for each row of the JTable to copy this value. It is working fine. But again, just as in above problem, if any column is just Edited and I change the value of JText field, new value is copied for all the rows except for the previously edited cell. Any idea to fix this will be a great help.
thank you,
rambo
---------
here is how I popluate the JTable
AdjustmentOrderDetail orderDetail;
if (orderDetailList.size() > 0) {
Iterator it = orderDetailList.iterator();
int testCount = 0;
while (it.hasNext()) {
orderDetail = (AdjustmentOrderDetail) it.next();
Object[] job =
{
orderDetail.getUsocID(),
orderDetail.getOfficeID(),
orderDetail.getLastName(),
orderDetail.getFirstName(),
orderDetail.getOriginalPasscode(),
orderDetail.getSalesCode(),
orderDetail.getTransactionPasscode(),
orderDetail.getCorrectedPasscode()};
int count = dtm.getRowCount();
dtm.addRow(job);
}
}
--------------------
here is how I defined the tablecolumn
POSTTextField localTextField = new POSTTextField();
DefaultCellEditor localCellEditor = new DefaultCellEditor(localTextField);
correctedPasscodeColumn = new javax.swing.table.TableColumn();
correctedPasscodeColumn.setModelIndex(7);
correctedPasscodeColumn.setCellRenderer(localCellRenderer);
correctedPasscodeColumn.setCellEditor(localCellEditor);
-----------------------------------------
here is how I copy the textfiled value to a column in the table (for all rows)
POSTTable detailTable = (POSTTable) getControler().getControler(1);
for (int i = 0; i < detailTable.getRowCount(); i++) {
detailTable.setValueAt(correctedPasscode, i, 7);
}
22 years ago
Hi, we are writting applet based siwng application. Once user logs in using the applet, a separate MainWindow frame is opened with a menu etc, which looks like any regular stand alone application
We are using VAJ 4.0 for developing and deploying in WebSphere4.0. For standalone testing we run the applet by selecting (within VAJ) this applet and Run Main Option. When running in this way every thing looks fine for JTable rows. ie rows have white background color and black text.
When we run the same using the browser which opens up a main window frame, the table rows have gray background.
Can anyone tell how to get white background while running under applet mode also...
I am attaching code snippets I am using for background color...
thanks in advance,
-- rambo
---------
For table: OrderDetailsScrollPaneTable.setBackground(new java.awt.Color(204, 204, 204));

For tablecolumns:
DefaultTableCellRenderer localCellRenderer;
localCellRenderer = new DefaultTableCellRenderer();
localCellRenderer.setName("localCellRenderer");
localCellRenderer.setFont(new Font("sansserif", 0, 12));
localCellRenderer.setBorder(LineBorder.createBlackLineBorder());
localCellRenderer.setBackground(Color.white);
localCellRenderer.setForeground(Color.black);
lastNameTableColumn = new javax.swing.table.TableColumn();
lastNameTableColumn.setCellRenderer(localCellRenderer);
--------------------------------
22 years ago
Hi,
I have a table in which one column is editable. When I press the save button, I need to take the values in for each cell and do some validations and send data to the database.
For the last edited cell, I am not getting the value that is there is on the screen. It is showing the value just before the most recent change.
I don't know how to trick the UI to think that I left that cell when I press the button.
-- rambo
22 years ago
Thank you. This approach works.
22 years ago
Hi,

1. editCellAt doesn't take my cursor to that row/cell. Just to give a background, I am doing a vlidation when some leaves a row. If validation fails, I want to show and alert and take back the cursor to that row/cell. I am pasting part of my code..

----------------------------
if (incentive.equals("X")){
messagePane.showMessageDialog(
Handlers.PASSCODECORRECTIONPANEL,
"This Passcode is invalid for the office being processed. Please reenter.",
"Invalid Passcode!",
JOptionPane.ERROR_MESSAGE);
Handlers.PASSCODECORRECTIONPANEL.getOrderDetailsScrollPaneTable().editCellAt(Integer.parseInt(rowNumber),5);
22 years ago
Hi, I need to know ho to programmatically take my cursor to a particular cell in my JTable.
Also, I am using a defaultCellEditor with textfield for my JTable cells. When I put my cursor on the cell, the text is not highlighted, which I thought is standard behavior. So, overwriting the text is not automatic. I have to use backspace to erase all the text and type in new text. I need to know if there is any fix for this.
Also, my left and right arrows are not working within the cell. Instead of moving the cursor position within the cell, cursor is going to the next item in the row. Is this the standard behavior?
thanks in advance..
-- rambo
22 years ago
Hi, I need to validate values entered into a table cell. I need to see if the entered value is atleast 7 chars and call a validation method. I need to do these validations as soon as 7 chars are entred. I tried extending CellEditorListener for my adaptor, but editingStopped metohd is firing only after I leave the cell and since I allready left the cell, I don't know how to get the value in the just edited cell as getEditingColumn is giving me -1 in the editingStopped Method.
Also, when user presses the SAVE button, I need to verify if any values are changed for the table (Only one column is editable) and fire a correpsonding save method.
Thak you for your help...
-- Rambo
22 years ago
Hi, I need to set a column as editable or not at runtime instead of desging/coding time. for example, after i populate the table, I need to set columns 1 and 5 as editable for one particular condition and columns 3 and 4 as editable for another condition etc.
Any help is appreciated.
-- rambo
22 years ago
Never mind. I found the answer in the following posting..
https://coderanch.com/t/330598/GUI/java/limit-text
22 years ago
Hi,
Is there anyway we can limit the text length for swing JTextField components? For Example, I want to set a 30 char limit on a Name field on my screen. Instead of writing listeners and checking the length in code, is there any parameter I can set/pass so that swing itself would take care of it?
thank you,
Rambo
22 years ago
Hi,
I would like to know if there is any way to find out the Frame, Panel etc for a given compomenent.
For Ex in the following
--------------------JFrame mainWindow-----------
------------------- JPanel myPanel-------------
--------------------JPanel statePanel---------
StateName: (JTextField) stateTextField
-----------------------------------------------
-----------------------------------------------
------------------------------------------------
I want to know the window(main window) that is holding my component stateTextField.
I need this as I am using MVC patterns and in the action package I am trying to show some dialog (model) windows and to show a dialog, I need to pass the frame as a parameter to the constructor and I don't know how to find the frame(main window).
I tried using component.getParent(), but this is always returning NULL and I getting null pointer excetptions.
thakyou,
Rambo
22 years ago