Vivek Mathur

Greenhorn
+ Follow
since Jun 29, 2007
Merit badge: grant badges
For More
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 Vivek Mathur



Can anyone help.


Regards,
Vivek Mathur
12 years ago
Hi All,

I am writing a asynchronous listener to WebSphere MQ server (Queue) from Jboss AS4.0(Actually a modified version called as SIAS server by GE). Trying to implement it using MDB (EJB spec2.0). This listener should only pick the data (xml format) from queue, parse it and dump it in Oracle DB.

I am able to receive message from Queue. however i am facing two issues.

1. When Jboss server starts, it starts giving exceptions: [JMS provider failed to connect: Retrying ....... javax.naming.exception ......... wsmq not bound]
and when the whole server gets up and running and the application is deployed, JMS Provider gets connected and MDB starts getting instantiated and receiving Messages from queue.

2. When there is no message on the queue for long time say more than an hour or two, and now after 2 hr. if you put some message on the queue, MDB stops receiving messages.

I have also not seen any traces of EJBRemove() being called, yet it stops receiving messages.


Can Any one please guide me.

Thanks for the help in advance.

Regards,
Vivek Mathur

12 years ago
Hi All,

I tried using MDB (Message Driven Beans), as it implements mesagelistener interface and may help in Asynchronous communication with Websphere MQ.
However I am unable to make a connection to QUEUES using JNDI, every time MDB is giving exception as javax.naming.exception ( Queue not bound with queue mangaer "Queue MangerName") and JNDI context wsmq not bound.


Can any one give some light over it ???

Regards,
Vivek Mathur
Hi,

For one integration we are using MQ for messaging (in xml format : that needs to be parsed based on xsd ).

I need to write some listener, who continuously keeps on listing the Request Queue, and as soon as message comes it receives the message (XML) and parse it and save the containing
data in Database.

I tried after some R&D, synchronous communication by creating connection/session and then receiver object to receive message.

Now I want to make This Listener as Asynchronous, that would continuously checking the queue and if any message is there, it should process it.

Can you Please provide some suggestions ?? Or if possible a code snippet would be much helpful.

Regards,
Vivek Mathur
Hi Jyothsna !

I once tried to do it, with the Authentication.

You need to set the properties as below and use Authenthicator class object that would do the authentication and pass it to the sessions constructor.




Check it out, it may help.

15 years ago
Hi

I want to select multiple columns through EJB-QL, but whenever i write that
it gives an exception saying it was expecting 'from' instead of ','.
EJB-QL is like as follows:

select m1.code, m1.text from DROP_VALUE m1 where lang=?1

Home method for this is having return type as 'Collection'

Can you please tell can we select multiple columns at a time or not throgh EJB-QL and if yes, then how todo that.
Hi All,

I Have a collection that have data in form of only two columns, like key/sno and Text/Description.(I got this Collection using EJB's finder Method - at my some Java Class that act as a bean -> this is used at JSP(to fill the select box) ).

Now I want to convert it to a HashMap(key,data).Previously i was doing it by making an iterator and then using while loop fetch both code and description(using getter method's of EJB) set that in HashMap.

I have many Collections(number is dynamic -can be more than 100).
so by using Iterator it hits the performance. As all this is done inside nested loops.

Can any one please let me know the easiest way to convert Collection to HashMap.Is there any method that can do so ?
16 years ago
Hi Ben Souther,

Retriving data or showing it in jsp using html tags is not my problem,thats a easy task and i am using EJB's(CMP to be more specific) to fatch the data out.

I have the tabid's in a array on my jsp. and corrosponding fields according to tabid's in different collection.

My problem is if it had been only 2 or 4 tabs it could be easily accomodated but if tabs may go up to 20 in number then what...... ??
So in such case how to accomodate all tabs all together,(one solution that i saw some where is to scroll the tabs with next and previous button.)

However i don't know how to do this scrolling effect......??

Is there any seperate forum where i can get the people who can help me out with this problem, then please move this thread.

--> One more thing IS THERE ANY TAGLIBRARY THAT CAN SOLVE THE PROBLEM ??
hi Jorge,

Thaks for your response.
I am sorry if i was unclear to some extent.
what i want to do is show tabbed page's, where the label of tabs are selected from the database(depending upon the user profile) i am doing it using JSP, and now on depending the tab id different field's that user has to fill will be selected again from the data base.(That means one user may have tab1 with fields 1,2,3,4 or another may have tab 1,2,3,4,5 each having different multiple fields).

And if the number of tabs are greater than 4, i'll have to show a button from where user may be able to scroll the tabs and go to the next tab.


I HOPE MY QUESTION IS CLEAR NOW ...
HI,

I want to show tabs in my jsp page dynamically. The tab id's or label may be selected from database dynamically and according to different tab id's different data should be shown(Same table should be refereshed for different tabs clicked- that holds the text field/labels as these field will too be dynamic in nature).

Can some one suggest how to sort out this problem.

Thanks
Hi Ulf,

I didn't get you?

Can you please elaborate this a little.

this scheduling task should run as the service and if it is scheduled on monthly basis on a specific day or on yearly basis(once a year) on a specific day it should repeat itself on that day.

-----------------------------
if i schedule a task on 30 Jan than there would be a problem on the next month of Feb (as it don't contain 30).

What should be the strategy to follow in these scenarios ?
-----------------------------
16 years ago
Hi Ulf,

I have encountered one more problem regarding scheduling.
I have scheduled this timertask for repetetive scheduling with timer object as i explained above using the below function.

timer.scheduleAtFixedRate(bapiSchedularObj, date.getTime(), delay);

bapiSchedularObj--> TimerTask Object
date -->Calendar Object
delay -->Long delay

I want to schedule this task on monthly basis.So in this function i can only change the delay in milliseconds.....30*24*60*60*100(days*hr*min*sec*millisec)..

Now the problem is the task should schedule only on a specific day of each month (suppose on the 5th of every month), the number of days differ on each month (can be 30/31/28/29).

So can you give some idea as how to reset the delay dynamically?

As after calling the function timer will itself take care of next period to schedule, depending on the days of month how can we set (automatically/dynamically)the delay for the next schedule if next month is of februry(28/29 days)?

Thanks in Advance.
16 years ago
Hi Ulf Dittmer,

I have put down the sapjco.jar file under the lib folder of JBoss server.
And removed it from my application. However for build path i have to export it from some another location.

but now my application .ear file doesn't have any sapjco.jar and i checked by scheduling some dummy method and by redeploying the application few times.

It is not giving the previous exception now.
I hope it also works in the real environment.

I need to workout around timer and timertask a little more so as to make their working fine(in real environment with live tasks).

BOTH OF MY PROBLEMS HAVE BEEN SOLVED FOR NOW............
HOPE SO ...........

THANK YOU VERY MUCH FOR YOUR HELP AND IMMEDIATE REPLIES

HATS OFF TO YOU
16 years ago
Hi,
Thanks for the suggestion, i got it i will make a boolean field in my custom timertask class and set it to true as soon as the run method is called(before calling the method that is to be scheduled). and make it false just before exiting the run function(on successful execution of the task).

And before canceling and rescheduling the task i'll check if that field is true/false. IS IT CORRECT SIR.


NOW ABOUT THE JCO EXCEPTION AS YOU SAID YOU DOESN'T UNDERSTAND ALL THE ISSUES

As we all put our all .jar files in WEB-INF/lib. All the library files are packed with the .ear file.

When server starts first time ClassLoader loads the native libraries in server memory once only,Now if i redeploy the application again server tries to load the Native Libraries(as .jar for SAP are packed with .ear) once again(with another ClassLoader) --->and here comes the exception as Native libraries can only be loded once.

As you said there is no way to unload the native libraries.

What i read is in NETWEAVER WEB APPLICATION SERVER -(MAY BE AS IS BASED ON SAP SERVER ITSELF) WE CAN PUT OUR *.JAR FILES RELATED WITH SAP IN THE SERVER'S LIB FOLDER AND HAVE AN EXTERNAL REFERENCE USING APPLICATION-J2EE-ENGINE.XMLSo as to load native libraries once only.

Actually we don't provide any info to JBoss server throught any .xml file about the native library or any other .jar file(library).

What i want to know is if we can also have any such machanism with which we can provide the info to the application server about the location of library files.
16 years ago
Hi,

One more thing sir, appart from the JCO Exception is ->
The rescheduling task has been changed a little.
I have to make sure that before rescheduling a timertask the previously running task(if in execution state) should complete.

Or if the application is redeployed before undeploying if a timertask is running it should complete first.

Is there any way to find out that the timertask is currently in execution? and if its executing wait till it gets completed and then cancel?
16 years ago