H Sivad

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

Recent posts by H Sivad

Originally posted by clement valentine:
Hi guys,
It worked when I set "transacted" to false.

Old ---> QueueSession qsession = qconnect.createQueueSession(true,0);
New ---> QueueSession qsession = qconnect.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);

Also I realised that Session.AUTO_ACKNOWLEDGE is 1 and not 0! For that matter I can't find out what the static value '0' is in the javax.jms.Session API. Does '0' mean NO_ACKNOWLEDGEMENT?

According to the WLS doc. when "transacted" the ackowledge value is ignored. But somehow this didn't seem to work. Can anyone explain that for me please?

Whats the effect of setting the "transacted" to false? Does it mean that a rollback is not possible if anything down the line fails?

Thanks guys,
Clement

[ January 19, 2005: Message edited by: clement valentine ]



You should use "Session.AUTO_ACKNOWLEDGE" or "Session.CLIENT_ACKNOWLEDGE" or "Session.DUPS_OK_ACKNOWLEDGE" or "Session.SESSION_TRANSACTED" -- DON'T use the literal int value. If the implementation of these values changes, (in other words, they change the int values these symbolically represent) your application will be broken. Also, someone else can look at you code and see that you want the session transacted, whereas "3" would hold no clue to your intent.

That bit of coding style aside, message beans acknowledgement is automatically handled by the container. If you use bean managed transaction then the receipt is acknowledged by the container. Either way you specify the type of acknowledgement in the deployment descriptoras either AUTO_ACKNOWLEDGE or DUPS_OK_ACKNOWLEDGE. So, the way the transaction is handled depends on Weblogic's implementation and the way you write and deploy your beans.

See This ServerSide article for more details about MDBs.

H.

Originally posted by Malli Raman:
Please try to check the same through normal java application program instead of MDB. In general developer will get the problem related to network/lookup of Queue.



Yes, agreed. Then, make sure that the queue listener in the app server is configured for the queue, and that the MDBs are associated with the connection listener.

Originally posted by Rupesh Raut:
Hi,
I am getting "could not found coonection" error message.
I am trying to send message to another WLS server queue from onMessage()
method of Message Driven Bean of WLS server. But it is raising error at following line
queueSessionLc = conLc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

What is wrong and what are the solutions for sending message on another WLS queue.

Thanks



You didn't include much code, so it's hard to tell. Do you get the connection from the context first? The code would look something like this:



Originally posted by Ramesh D:
Hi Guys,
I developed one J2EE Project on WSAD 5.1.1...
I have one more application ejb jar file is there. so i have to use that ejb jar in my current application . so i added that jar file in WEB-INF/lib/
folder in WEB Project .But its not recognising the JAR file . The JNDI name not found is coming .Is It right way to add that jar ..otherwise how and where to add that jar ...how to run that jar...

PLZ Help me

Thanks in Advance



If you are getting a JNDI look up failure, you may need to define lookup somewhere in the deployment descriptor. If it were not finding the class you would get a ClassNotFoundException.

Originally posted by Nalini Reddy:
Hi

I am unable to find that..Could u please guide me..

Thanks and regards
Nalini.



I have not used JBoss, but based on experience with other servers would look in the administration configuration section dealing with "environment".

You can also package the jar with you EAR file.

Originally posted by H Sivad:


Thanks. I have 1.25G memory, but just changed the virtual from 1526 max to 3072. I'll let you know how that works.

H



It didn't. Still crash @ 200m of memory.

Originally posted by Nalini Reddy:
Hi All,

I have written a small HelloWorld ejb and have also deployed successfully on Jboss3.0.6_tomcat-4.1.18.
But when i try to run the client program,i get Exception in thread main:NoClassDefFoundError rg/jboss/logging/Logger error.


Could any of you please help me out soon.


My client ejb is as follows:import java.rmi.RemoteException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.ejb.CreateException;
import javax.ejb.RemoveException;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
import java.util.Hashtable;

public class HelloClient
{
public static void main(String args[]) throws Exception
{
// String JNDI_NAME ="ejb20-Hello-HelloHome";
Hashtable h=new Hashtable();

h.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");

h.put(Context.PROVIDER_URL, "localhost:1099");

h.put("java.naming.factory.url.pkgs",
"org.jboss.naming rg.jnp.interfaces");

InitialContext initial=new InitialContext(h);

Object obj=initial.lookup("ejb/Hello");

HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);


Hello hello=home.create();
System.out.println(hello.hello());

hello.remove();
}
}


Thanks and regards
Nalini.




You need to make sure and if needed add the jar containing "rg/jboss/logging/Logger" to the server configuration. At run time, the server will try to find this class in it's classpath, so you need to be sure it's there.

H

Originally posted by Murtaza Husain:
hi there,

I had run in with the same problem of memory out of space. As a solution i had increased my RAM to 1 GB. Try also increasing your virtual memory. After doing all this i had not run into the problem. You can try them and reply me back



Thanks. I have 1.25G memory, but just changed the virtual from 1526 max to 3072. I'll let you know how that works.

H

Originally posted by Pradeep Bhat:
Yes.



Specifically since it's a static method you do this:



This will branch to the other class's main in the current thread.


You could wrap this in a class and kick it off on it's own thread:



H.
I do exactly what you are talking about. Here is the MDB




When the message shows up on the queue, the bean is triggered and places the response into an application level cache. The user's viewing application looks to the cache for the message, not the queue.


The tracking id is needed since concurrent users may get responses from the same queue -- this could be the session id.

The caching is implemented by either an entity bean or database or other method. The thing here is that you need to manage the messages within your application as they come off of the queue. The user page then checks the cache for responses, and removes any that are read. Also, the cache implementation lets returned messages in the cache time-out and are deleted auto-magically.

Finally, the parser simply knows how to read the returned message and find the tracking id. You could also use a property on the message, something like this:


Your publisher needs to set that property for that solution to work.
I've been working on a project that has three distributed components. One uses JSF pages, the other two are straight J2EE MDB servers that provide support for the first.

With the JSF project, and only that one, I have a problem while developing: I run out of memory in the tool. It starts out at about 138M, and climbs up to 200M (little by little) and then I need to close down and restart or loose my workbench settings due to an out-of-memory error.

I'm using WebSphere Studio Application Developer (Windows) Version: 5.1.2. Running it with JVM 1.4.2 and have added extra memory parameters. (eclipse.exe -vm C:\j2sdk1.4.2_05\jre\bin\javaw.exe -Xms 350m -Xss 200m)

Has anyone else experienced this? is this a known problem with IBM? I found a fix on the IBM site (http://www-1.ibm.com/support/docview.wss?rs=800&context=SS7JFU&q1=interim+006&uid=swg24008457&loc=en_US&cs=utf-8&lang=en) but this seems to be for "WebSphere Studio Site Developer - Express v5.1.1".

Thanks.


H

Originally posted by Steve Buck:
Hrm.

Problem with polling: I just don't like that "design". To me it just seems kind of shoddy, ya know?

As for the client count...each site will have anywhere from 25 to 50 concurrent clients.

[ November 30, 2004: Message edited by: Steve Buck ]



Look at Java Messaging Service as a possible solution, from what you say. No timed triggers needed. You put the update on a queue and it waits there until it's consumed. If you wish to update (synchronize) multiple servers with your records, you can use the pub/sub paradigm. When a client updates a record, the server would publish that message. Your other servers would subscribe to the topic, and update there state accordingly. If the servers are "durable subscribers", the message is retained until they come on line and consume them. so if a site is off line, they get the updates when they come on line.

Having worked with both J2EE and .NET, I don't really see any advantage to the .NET framework in this case. There are queues in .NET, but the JMS spec is more mature and better thought out (IMO).

H.

[ December 03, 2004: Message edited by: H Sivad ]
I'm trying to define a Datasource for the One$Db within WSAD. Has anyone done this?

I can succesfully run the basic JDBC code (and did so to confirm the ths database was correctly installed), but am having a hard time setting up a connection pool within the app server.

Any pointer or war stories are appreciated.

H.