Benny Tang

Greenhorn
+ Follow
since Aug 03, 2003
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 Benny Tang

Hello,

I have kept the oc4jclient.jar under tomcat's common library. That's ok.

But I don't know the two xml files you mentioned as I just deployed the example, which is downloaded from otn.oracle.com. This example is about the stateless session bean. I follow the instruction of the example to deploy in OC4J.

Can you tell me more detail which configuration files required for the EJB client (i.e. The servlet I used in tomcat) to obtain the remote home
reference to the EJB ?

If anyone know any resource about using EJB deployed in OC4j from tomcat, please let me know.

Thank you for your kind attention.

Thanks,
Benny
18 years ago
I have deployed a stateless session bean EmployeeEJB in OC4J. I have tested that the servlet, which is within the same OC4J, can obtain the remote home reference to the EmployeeEJB.

But when I wrote another servlet, which is located in Apache tomcat, to obtain the remote home reference to EmployeeEJB. It fails when the program starts to lookup through JNDI. Part of exception that I got is shown as follow:

javax.naming.NamingException: Cannot create resource instance
at org.apache.naming.factory.EjbFactory.getObjectInstance(EjbFactory.java:184)

The following shows the coding which I try to obtain the remote reference for the EJB

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "pho5930");
env.put(Context.PROVIDER_URL, "ormi://192.168.32.129:23791/employee");

try{
Context context = new InitialContext(env);

Object homeObject = context.lookup("java:comp/env/EmployeeBean");

// Narrow the reference to EmployeeHome.
EmployeeHome home =
(EmployeeHome) PortableRemoteObject.narrow(homeObject, EmployeeHome.class);

// Create remote object and narrow the reference to Employee.
Employee remote =
(Employee) PortableRemoteObject.narrow(home.create(), Employee.class);

Can you know the reason why I got this exception ?
18 years ago
Dear all,

I have written and deployed a stateless session bean in OC4J. Now I want to use a servlet, which is hosted in tomcat, to act as an EJB client to this session bean in OC4J.

However, I fail to get the remote reference when the servlet perform JNDI lookup for the remote reference. The exception is something like 'Cannot create object.....'

Do anyone have the experience of getting EJB remote reference from OC4J by using servlet act as a EJB client hosted in tomcat ?

If yes, can you tell me about the correct procedures in getting it done ?

Thank you for your kind attention

Yours faithfully,
Benny
18 years ago
Hi All,
I want to ask what is the use of the class javax.servlet.http.HttpServletRequestWrapper and javax.servlet.http.HttpServletResponseWrapper? As I seldom use these classes. Can anyone tell me their usage ?
Thanks,
Benny
19 years ago
Hi,
Have you bind the instance of class User if the login process is successful ?
Benny
19 years ago
Hi,
I know that if the output of the JSP page or the servlet already committed, the IllegalStateException is thrown when the program tries to invoke the <jsp:forward> or forward method in the class of RequestDispatcher.
Benny T
19 years ago
JSP
Hi,
In order to call servlet from the JSP page, you can achieve this by setting the attribute action of the <form> in HTML to the servlet and then submit the form.
Benny T
19 years ago
JSP
Hi,
You can use the method setMaximumFractionDigit() in java.text.NumberFormat to manipulate the format of the number.
Benny T
19 years ago
Hi,
As stated in the previous reply, the http-method is not mandatory. If you do not specify the HTTP method within the web-resource-collection, then the security constraints are applied for all the methods such as GET, POST, PUT ....etc.
Benny T
Hi bear,
Boney means that javascript function can be called by using the event-driven in the output of the JSP. For example, you can invoke the javascript function when the user clicks the button...etc. We cannot invoke the javascript function in JSP scriplet directly. But we can make it invoke through the event happended in the output of JSP.
Benny T
19 years ago
JSP
Hi,
I remember that the session objects are reside on the server-side and the client stores the sessionID, which is used to associate with any session-related information, in the in-memory cookie of the browser.
Benny T
19 years ago
Dear All,
Since there are four authentication types can be used in authentication (BASIC / FORM / DIGEST / CLIENT-CERT). I can configure the BASIC authentication without problem. But when I switch to DIGEST authentication type in web.xml and then remove the <realm-name> tag within the <login-config> tag. After that, the login dialog box is popped up without problem, but fail to login even if the username and password are entered correctly, do anyone know the reason?
I saw from the book said that the DIGEST method is not supported by many browsers, is it related to this fact? (But I think IE should support this, is it?)
Thank you for your kind attention.
Yours faithfully,
Benny
19 years ago
Dear all,
When the user close the browser, is the session terminate immediately or it will timeout after a specific period of time?
Thank you for your kind attention.
Yours faithfully,
Benny
19 years ago
Hi,
Have you providing the doHead() method is the servlet class you write? Is this works?
Benny
19 years ago