Win a copy of Head First Android this week in the Android forum!

Mike Sever

Ranch Hand
+ Follow
since Jul 24, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mike Sever

I'm trying to run a testing jsp file for JMS (without MDB) on WAS 6.0. I've done below configuration but there is such a exception when calling QueueSession's createSender method:
javax.jms.JMSSecurityException: MQJMS2008: failed to open MQ queue
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2035
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2858)
at com.ibm.mq.jms.MQQueueServices.getOutputQueue(MQQueueServices.java:347)
at com.ibm.mq.jms.JMSServicesMgr.getOutputQueue(JMSServicesMgr.java:137)
at com.ibm.mq.jms.MQSession.createQSender(MQSession.java:6187)

Configuration as below:
WAS console->Resources->JMS Providers->Websphere MQ
1. create a queue connection factory in "WebSphere MQ queue connection factories":
input "Name"(MyFactory), "JNDI name"(test/MyFactory), set none in "Component-managed authentication alias", "Container-managed authentication alias" and "Mapping-configuration alias"(but the last one will be reset to "DefaultPrincipal Mapping" after saving, don't know whether it does matter), set "Transport type" as "BINDINGS", and Queue manager(maybe required).

2. create a queue destination in "WebSphere MQ queue destinations":
input "Name"(MyQueue), "JNDI name"(test/MyQueue), "Base queue name", "Base queue manager name"(maybe required), keep default setting "APPLICATION_DEFINED".

3. JMSAdmin JMSAdmin.config.ws:
INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
PROVIDER_URL=iiop://localhost:31000/
SECURITY_AUTHENTICATION=none

define q(MyQueue) queue(local_queue_name) qmanager(qm_name)
define qcf(MyFactory) qmanager(qm_name)

ps: "MyFactory" is defined in step 1 as "Name", "MyQueue" is defined in step 2 as "Name".

4. jsp:
QueueConnectionFactory factory = (QueueConnectionFactory)context.lookup("test/MyFactory");//lookup ok
QueueConnection connection = factory.createQueueConnection();
connection.start();
Queue queue = (Queue)context.lookup("test/MyQueue");//lookup ok
QueueSession qsession = connection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender= qsession.createSender(queue);//exception here

Is there any other step required? Thanks for reply!
Any suggestion? Which step could have some problem? Thanks for reply!
My application id is not in mqm group (solaris) and privided put/get/browse/dsp permission to that local queue, is it enought? What happened when calling QueueSession's createReceiver method?
The most strange thing is I can receive messages from that queue by ibm mq api, but can NOT by JMS...
I'm doing a jms testing (weblogic, mq), already done below items, sending is ok (CURDEPTH is added 1), but receiving has some problem: MQJE001: Completion Code 2, Reason 2035.
MQJMS2008: failed to open MQ queue.
It looks MQRC_NOT_AUTHORIZED, but the application id has been given pemission to put, get message from that queue. Is there anywhere else required to set/check permission? Thanks for help!

JMSAdmin:
define q(mqQ) queue(LocalQueue) qmanager(QueueManager)
define xaqcf(mqXAQCF) qmanager(QueueManager)
weblogic console:
Foreign JMS Servers (WebsphereMQServer) ->
JNDI Initial Context Factory: com.sun.jndi.fscontext.RefFSContextFactory
JNDI Connection URL: file:/path...
MyForeign JMSConnection Factory:
Local JNDI Name:test/XAQCF
Remote JNDI Name:mqXAQCF
MQ:
application id has been given permission to get/put and also the destination queue: GET(ENABLED) PUT(ENABLED).
MyForeign JMSDestination:
Local JNDI Name:test/Queue
Remote JNDI Name:mqQ
There is a job to call a .ksh file, in which it will execute "/usr/local/bin/scp Folder1/20070201* Folder2/". (both Folder1 & Folder2 are on same machine)
The log of job is:
...
Folder1/200702010000.txt | 1.2kB | 1.2kB/s | TOC: 00:00:01
scp: warning: stat: 20070201* (src): no such file (server msg: 'syserr: No such file or directory, file: 20070201*')


What could be the problem? Since the size of that file could be recognized, why can not copy it by scp? (I've also checked the timestamp of "Folder1/200702010000.txt" which is early to the time of calling job.)
14 years ago
The below code works well, but occasionally, there is a NullPointerException after "logger.debug("after read:"+numRead);"(here can always print the number, for example, if normal response is "abc", it will return 3, but if exception, I can also get 3 in that line).
Any master helps to point out whether there is any potential exception in some line with relevant possible reason, thanks in advance!
(Is it possible to avoid it after using httpclient?)

14 years ago
I encountered the below exception displayed in page when calling "session.invalidate()" in jsp file even putting into the block "try...catch(Exception ex)...", any solution to this issue?
Env: was 6.0
Thanks in advance!



[BSouther: Added line breaks to error message]
[ January 03, 2007: Message edited by: Ben Souther ]
14 years ago
JSP
We are facing such a problem in our project: how to extract all logs from one client? (because logs will be mixed by different clients)
It seems adding session id to each log sentence sentence is available, but the issue is that all files were made by using log4j to debug log, how to add session id to log, we'd like NOT to add session id to each log sentence in source code.
Thanks in advance!
Thanks for reminding.

The problem has not been solved, can any master do a favour(how to simulate the expired page scenario)? Thanks in advance!
14 years ago
JSP
Generally, we have expired setting for form submitting, but I can not see that way when testing below two files:
(1)submit a.jsp to b.jsp (2)click back button in menu bar(or right click mouse to select back) (3)a.jsp can be displayed as before but it should display expired page, pls help check whether there is anything wrong? Thanks a lot!

a.jsp

b.jsp

[ December 11, 2006: Message edited by: Bear Bibeault ]
14 years ago
JSP
Thus, how about username and password? They seems have to be stored in property file rather than hardcoded in source code, but how to encryt, plain text seems not proper since they are confidential.
The history is that we have a complete online application, and this standalone app one is the seperate part which will gather information from database scheduledly. The two ones are running on the same machine.

It has existed when I touched it, maybe its positive aspect is to hide username/password and control the total number of connections, but connection to db seperately should seems more clear structure and independent, but how to control the total number of connections since there is no pool. If there is some problem in scheduled job which will call standaline app, maybe there will be a lot of connections. I'm not clear about the balance, could you clarify your point of view about it? Thanks!
Otherwise, I encounter a new problem when getting connection from data source:


Configuration:
WAS 6.0
have a Component-managed authentication alias and select it in data source(Test connection is ok)
the data source seems belong to the server (cell:node:server)
JDBC Implementation class name: oracle.jdbc.xa.client.OracleXADataSource

Pls note: calling dataSource.getConnection() has such problem (it is ok in weblogic), dataSource.getConnection("username", "password") is ok, but we don't want to hardcode them in source code.
Thanks in advance!