Dasun Perera

Greenhorn
+ Follow
since Jul 09, 2002
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 Dasun Perera

Say we have a complex J2ee application which is running in a J2EE container. Which consists of all sorts of components such as jsp, servlets, stateless session beans, entity beans, MDBs etc. Some part of this application needs to access a web service running on a differrnt machine. What is the best way of doing this?. My main concern is accessing external web serive ultimately involves socket calls and it is not recomneded to initiate socket calls from a J2EE application.
guys,
I am reading that when a datasource to be looked up in a EJB project each ejb should have reference-ref defined. My question is if this EJB project has a java file (say.. a utility class) which needs to lookup datasource, where should be the reference-ref defined. Or what is the standard way of looking up datasource in this case whcih is compatible with J2EE (so I can use the same technique whcih works with all app servers)

Appreciate expert advice from somebody..

Dasun Perera
Hi,

Session bean has a method which sends an asynchronous message (MQ) to retrieve some data from a legacy system. Reply also comes as a MQ message and this data need to be returned from teh above session bean method. Anybody have any idea of what is thebest way to implement this?

Dasun Perera
15 years ago
I created a web service from a java bean. Later I added few more methods to the java bean and would like to have those methods as well in the web service. Only way I could achieve this using WSAD is by deleting the dynamic web project (which has the web service) and recreating web service again from the java bean. IS there a way to update web service when new methods are added to the java beaninstead of recreating web service from scratch.

Dasun Perera
dasun.is-here.lk
15 years ago
My understading is this is not possible. Your client browser always works with web Server in the DMZ so things get decrypted in that web server. In other words SSL communication is with DMZ web server to Client Browser. Proxy servers of course do not decrypt your data while forwarding to some other server

Dasun Perera
------------
http://dasun.is-here.lk/
15 years ago
JAD is the best decompiler.
There is a very nice GUI for JAD called FrontEnd Plus whcih is a free tool.
you can download it from
http://www.kpdus.com/frontend/FrontEnd.zip
-------------
http://dasun.is-here.lk/
15 years ago
yep, found the issue. Both TNS Listener and WAS use port 9090. I changed the WAS admin port to 9091.
17 years ago
My WAS 5.1 service doesn't start when TNSListener is running. But if I stop TNSlistener and start WAS service it starts as ususal and after starting WAS I can start TNSListener as well.

I am on Windows XP running WAS 5.1 and Oracle 9i is also installed.

Anybody seen this issue?
17 years ago
You are modeling your application into two layers.
First is the presentation which has jsps/htmls etc. which is fine. Then you have your controller which is the Servlet. That is also fine but better not to use it to do the business functions. Just use it as a controller. Introduce another layer of calsses with a proper inheritance hierarchy in such a way you don't re-code the same thing. Controller Servlet can call these business layer classes to get the work done.
19 years ago
A very good question though it is a basic one. As others also pointed out EJBs are true distributed objects which has lots of facilities provided by the container where as a Servlet is just an entry point to the web container.
But I think what you are asking is, Why EJBs when Servlets are there ?. If this is your question you are talking about most commonly asked EJB question. For most of the applications (As far as I believe) EJBs are not needed or at least the use of EJBs cannot be justified(interms of money and complexity). But there are some applications which needs transactions management like services and for such projects use of EJBs can be justified.
If your servlet implemets SingleTreadedModel interface there will be one instance of your class for each request. Then the init method will be called at each time.
Otherwise there can be atmost just one instance of your servlet per JVM. The init method is called just before a servlet is placed into service by the servlet container. Destry is called just before it is taken out of service. As far as I know Servlet container may take a servlet out of service. But before doing so it will call destroy method.Them it will be entitled for garbage collection. And Servlet Container might take the servlet back into action. But before that it will call init method.
Therefore there is no gurantee that a init() method is called just once. But followings are definitely guranteed(assuming server doesn't crash).
1.After putting a servlet into action init() is called.
2. Before stopping it destroy() is called.
19 years ago
By any chance if this URL you want to contact is in the same server you can use javax.servlet.RequestDispatcher to handle the situation easily. BUt if this URL is ourside the server as our friends mentioned you need to use URLConnection class
19 years ago
You need to understand a bit about SSL v.3 here. As your program is the browser it needs to talk HTTPS which is more or less HTTP over SSL.
JSSE has everything you need to do this. You need to understand the SSL handshake which involes passing certificates.
Play a bit with JSSE and try to gain the concepts into your head.
If you are stuck let me know I have some code which does the same. But I am using Some Baltimore toolkit classes also in this.
19 years ago