Sudeep das

Greenhorn
+ Follow
since Dec 19, 2003
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 Sudeep das

thanks reid,
i was actually getting confused by getCallerPrincipal() call. I was bugging me that how container is getting security info.
While reading ejb 2.0 spec, i also found that the getCallerPrincipal().getName() method may not return any specific login id. That could be anything the server specifies. Could be an arbitary role alltogather. Or a persons login.
In ejb 2.0 spec page 438, sun has shown an example on getCallerPrincipal.getName(), using a prim-key search.
Is it only way of doing this... pls provide me with any other way (practicle) way of implementing it...
thanks to both of u for your helpful and proper reply.


sudeep
hi all,
can anyone pls tell me what happens behind the scene when we call context.getCallerPrincipal() method.
Why do we need it, how internally does it correspond to x509 certificate.
I would like to have an example how can we use it, with proper bean code.
thanks on advance for any help on this regard.
sudeep
hi,
I am using WAS 5.0.2 Network Deploy version. I have two application.
I have a check in one application that other application is running or not.
Can any one provide me with api using which I can trace from within the code of one application if the other
application is running or not?
regards,
sudeep
16 years ago
Hi Kathy,
My name is Sudeep and I know you first by your Head First approach with EJB.
First of all Wish u a Very Happy NEW YEAR 2004.
I have got stuck with a very simple problem... pls help me out.
I am using Weblogic 7.0 with Oracle 9i. Trying to insert a row of data which has two values an "integer" and another "clob". There is an issue with Weblogic handling "Clob" using CMPs.
A data in clob can be easily inserted using BMP beans using PreaparedStatement.
As CMP's don't allow me to add data into database from ejbCreate() using SQL statements. I am trying to write the statements inside the ejbPostCreate().
Now my question is. As we already know that ejbPostCreate() runs under the same transaction as ejbCreate(). Will be it valid to enter data using SQL Statements ejbPostCreate().
Hi,
My name is Sudeep and I know you first by your Head First approach with EJB.
First of all Wish u a Very Happy NEW YEAR 2004.
I have got stuck with a very simple problem... pls help me out.
I am using Weblogic 7.0 with Oracle 9i. Trying to insert a row of data which has two values an "integer" and another "clob". There is an issue with Weblogic handling "Clob" using CMPs.
A data in clob can be easily inserted using BMP beans using PreaparedStatement.
As CMP's don't allow me to add data into database from ejbCreate() using SQL statements. I am trying to write the statements inside the ejbPostCreate().
Now my question is. As we already know that ejbPostCreate() runs under the same transaction as ejbCreate(). Will be it valid to enter data using SQL Statements ejbPostCreate().
ya I have,
sorry forgot to mention that I am using Weblogic 7.0.
I know it is not supported in weblogic 6.1 but not sure about 7.0
sudeep
hi guys,
can any one pls let me know how can we insert data into a CLOB field in Oracle using CMP in Weblogic.
If i get to use BMP I can do it using the PreparedStatement.setCharacterStream(), but in case of CMP how to encode into a reader object.
I tried encoding it using Reader object, but it is storing the object as it is as junk value and not the value, which happens to be a string value.
thanks in advance,
sudeep
Thanks sunil,
for your help....
the answer was very obvious but, I could not find a good view for it...

thanks a lot...
hi Philippe,
Its under section 10.5.2, second last point(third paragraph), page 171,of ejb 2.0 specification.
sudeep
hi guys,
after going through the spec, i found the reason for returning null from ejb create is "to allow create new entity bean with bean managed persistance subclassing any container managed persistant bean.
Can anyone expalin this with an example. And also please pin point how is it going to be an issue if I pass normal a prim key instead of null.
Thanks in advance,
sudeep
hi guys,
adding on to your discussions,
I doubt about that the container will bother to actiavate() a bean again if it is already passivated.
If we look from the containers point of view then it's like this...
The bean is passivated... the container is wating for timeout to pass so that it can remove the bean.
Now the client calls ejbRemove(), now as the bean is already passivated, the container can safely assume that as a developer we have taken care of the state of the bean in the respective methods, therefore eventhough there is nothing in the discussion regarding the passivated session bean getting a remove() call, the container will never call its ejbActivate(), ejbLoad() and then call ejbRemove().
To justify my answer just think of yourself....
There is law you have to abide by... which says go to your home after school. It doesnot specify which way you choose to go. Being a guy to follow the rules and knowing that there is no rule on way to follow would you take the longest way to go back to home or the shortest way.
The obvious answer is the shortest way.
To activate() and load() a bean is a heavy task for any container, so the container will never say "ok i will reactivate() and reload() the bean just to delete it again...
sudeep
Hi guys,
I still have doubt on it....
in addition to your discussion on entity beans and their finder methods, the things which happens is this.....
you call ejbFindBySomething() on home;
the container calls ejbFindBySomething() and then whether it finds a proper entity for it or not it calls ejbActivate(), ejbLoad(), ejbStore() and ejbPassivate().
So what happens is the bean comes out of the pool and gets back to the pool. Because as u were discussing and as mentioned in Spec and HF EJB, that a bean comes out of the pool if the ejbActivate() is called so does not matters which container calls it whether BEA or IBM if it goes by specification it is making the bean come out of the pool.
So my question still lies there on the table ... why? is it so??
Sudeep
Hi,
I have 2 applications, one of them is running on WAS 5.02 Network Deploy, and other one is a standalone application. Both apps are running in the same box.
Lets take for example application "A" and application "B", "A" is running in standalone mode and "B" is running on WAS.
"B" is a J2EE app, containing few EJBs, servlets and JSPs.
"A" is a standlone application which acts as a server, which listens to certain port(s) to serve certain specific functionality.
Methods from application "B" calls methods in application "A". The method calls are RMI calls and gives a (no security manager: RMI Classloader disabled) error.
To get this problem solved I have used java.rmi.RMISecurityManager and System.setSecurityManager() in my code in "A".
After incorporating the (no security manager: RMI Classloader disabled) problem was solved, but I started getting "access denied java.security.AccessControlException(java.net.SocketException)" on one of the ports which "B" is listening to.
To check whether application "B" and its ports are working correctly or not I have used another standalone application to connect to "B", with standalone applications its working fine. Thus it is sure that "B" is working and listening to ports perfectly.
I have tried to change the 'was.policy' file for "A" giving following permissions:
grant codeBase "file:my-web.war" {
permission java.security.AllPermission;
permission java.net.SocketPermission "*", "connect,resolve";
permission java.net.SocketPermission "*:1024-", "connect,resolve";
};
But it did not work and it gives the same exception time and again.
I have also tried giving the below mentioned code as 'was.policy' file.
grant{
permission java.security.AllPermission;
permission java.net.SocketPermission "*", "connect,resolve";
permission java.net.SocketPermission "*:1024-", "connect,resolve";
};
which means for all possible code base.
I think this problem is more of WAS centric then Java centric, as this is working fine with other standalone application.
Please help me with this, its urgent.