Nirmala Rayudu

+ Follow
since May 30, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nirmala Rayudu

Thanks Nadeem for a very useful reference(also for finding time to look it up).
Well my assumption stated above proved wrong. I tested this on Sun's Application Server.

Please try to clear this up for me, if anybody out there has a clear picture of how this possible.

Spec makes a big deal about which of the lifecycle and container callback methods of a bean class can call (getEJBHome, getEJBObject, getEJBLocalHome, getEJBLocalObject) methods on their corresponding contexts(SessionContext, EntityContext or MessageDrivenContext). I do not understand why a bean class instance would need to access its home and component interfaces? Would anyony who has any idea/example of this, please share it?

I can think of following case where this would be possible

All that the Spec means when it says that EJB Object references are can be retrieved from ejbCreate and ejbRemove it that the container is not going to throw IllegalStateException when those methods call getEJBObject or getEJBLocalObject on SessionContext and that the value returned would always be null.
Hello Thambu,
Thanks for you reply. I was not attempting to create an entity bean for a non-updatable entity. What I was trying to do was 'Home business method' whose purpose in case of CMP, according to the Spec, is to make batch select operations possible and to return a sigle or collection of non-ejb type values(as opposed to findBy methods). Now it happens that the select operation that I am attempting requires GROUP BY and HAVING clause. TitleAuthor table is an updatable relationship table with two unidirectional One-Many relationships with tables Title and Author. To figure out titles with multiple authors, I need to execute the following query.

select t.title_id, t.title, t.price, t.pubdate, a.au_id,a.au_fname,a.au_lname, ta.royaltyper
from Title t, (
select ta.*
from TitleAuthor ta,
select ta.title_id
from TitleAuthor ta
group by ta.title_id
having count(ta.title_id) > 1
) tb
where ta.title_id = tb.title_id
) ta, Author a
where t.title_id = ta.title_id
and a.au_id = ta.au_id
order by t.title_id

There is no way I can do this query with EJB-QL.
However, in theory, I should not say that it is impossible to do this in CMP, but I would have to grab all the entities of TitleAuthor table and then perform the above logic programmatically in Java. Which is practically inefficient and would be asinine of me to do so.

In such scenarios looks like BMP, or if allowed to use Entity beans at all, DAO/JDBC would more efficient.

In version 2.1 of the EJB Spec, for Stateless session beans it states that ejbCreate and ejbRemove methods can access getEJBObject() and getEJBLocalObject() methods of the SessionContext. However if one looks at the Object Interaction Diagrams from page 103 - page 108 of the Spec, one can clearly see that ejbCreate and ejbRemove have nothing to do with create and remove calls issued by Client. EJBObject always corresponds to the Client. If the client does not exist, then there is no EJBObject instance for that stateless bean.

My question is, since ejbCreate and ejbRemove method calls are independent of the existence of clients(Container can just decide to create a bunch of bean instances and pool them in method-ready state even before a single client makes a create call), how come the Spec says that these methods can access the EJBObject instance for that particular instance of the bean? How is this possible?

I am a newbie to EJBs. I was tying a simple Entity bean example with 3 tables(titles, authors and titleauthor from Microsoft SQL Server's pubs database), with Container managed persitence and transactions. However, When I got down to writing EJB-QL for a home business method that retrieves the details of all the titles(books) with multiple authors, I needed to use GROUP BY and HAVING clause in the select statement. However EJB-QL is very simplistic as of Version 2.1 of EJB Spec. It does not allow these clauses.

My question is, in cases where complex joins and group operations are needed on Entities, it looks like BMP is the only choice, am I correct?

The file has read-only permission in the web-application's lib directory when it is deployed, but so do all other library files I have in the lib directory, and all of them are deleted by Tomcat.

18 years ago
I am using JavaMail APIs in my web-application and some of the functions offerred by the web-app involve sending emails using the JavaMail APIs.
When I undeploy the Web-App, the web-app directory Tomcat5.0.28\webapps directory in not deleted completely, the only file left behind is Tomcat5.0.28\webapps\<myapp>\WEB-INF\lib\mail.jar(mail.jar is the Library for JavaMail).

Does anyone know why this might be happening? I greatly appreciate any response.

18 years ago
Hi all,
I am using Tomcat version 5.5.9, however the issue that I am encountering might not be specific to this version.

Here it goes, In my servlet I am trying to get access to another web-app on my server(the same tomcat server instance, it is not a clustered environment) using 'getContext' method of 'ServletContext' class, the 'contextURI' parameter of the method is correct. However, the method is always returning null.

According to the documentation of 'getContext' method, the container returns null if the web-app does not exist or if the container has decided to not give access to the method becuase of security concerns.However the web-app that I am trying to get access to does not have any security constraints at all.

1) Is there some setting on Tomcat that needs to be configured for this to work, assuming that Tomcat is returning null because of security concerns?

2) Does this method work in clustered Tomcat environment at all?

Thanks in advance for your relevant responses
18 years ago
I have noticed that at least in version 5.0.28, that undeployment of a web-app using tomcat manager, removes all the related files/directories of that web-app in both catalina_home/webapp directory and catalina_home/work/<standard-engine>/<host> directory.

I have done the undeployment by clicking the 'undeploy' link for that web-app at http://<host>:8080/manager/html, where <host> is 'localhost' for my configuration.

However, I started using Tomcat 5.5 and 'undeploy' does not cleanup the directories(catalina_home/work/<standard-engine>/<host> , because of which, when I redeploy the application by simply copying the war file to 'catalina_home\webapp' directory, Tomcat is still using old class files for the java classes in my web-app.

I tried restarting Tomcat to get around this problem and that did not do the cleaning properly either and I ran into the same problem with old versions of my class files.

That gives rise to the following questions,
1) Is this a bug with Tomcat 5.5? Does not seem likely to me, because this would be a serious blow to its main funcationality.

2) Are the 'deployment', 'undeployment', 'start', 'stop' and 'reload' supposed to be done in some other way than the one I am doing(Which is using links on http://<host>:8080/manager/html page for the corresponding web-app)? If so, what is it?

3) Are there any settings that need to configured in server.xml to make this work properly?

I greatly appreciate any relevant responses for my questions.
18 years ago
Hello all,
I am using the latest version of Tomcat (5.5.9). There is no documentation of any sort for the catalina ant tasks, neither in the documentation web-app that comes with tomcat, nor on the jakarta web-site for Tomcat.

Is there respectable good documentation available on catalina ant tasks that any of you are aware of?

18 years ago
Thank you Neeraj and William for your replies.

your answer raised one more question about the 'contextURI' parameter for the getContext method.

If the web-application referred to by the 'contestURI' parameter be located on another jvm, i.e does this method behave the same way in clustered environment?
18 years ago

Why have the ServletContext's RequestDispatcher when ServletRequest's RequestDispatcher does the job? I mean the RequestDispatcher of ServletRequest can handle both request relative paths and WebApp relative paths.

Is there a legitimate reason for the existence of RequestDispatcher in ServletContext(I referred to the Servlet 2.4 Spec, it makes it sound as if ServletContext's RD was designed first, but ServletRequest's RD was designed later on to facilitate relative paths, I am wondering if this is not the case, what is the legitimate reason for existence of ServletContext's RD).

Thanks for your time,
WebApp Learner
18 years ago