Help coderanch get a
new server
by contributing to the fundraiser

sanpra sing

Greenhorn
+ Follow
since Aug 28, 2002
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 sanpra sing

In the j2ee developers guide there is an example to get the contents(html) of a URL on the web.
This worked fine for me when the web server provided by the j2ee servers was accessed as local host. Later in the example the way to access a URL beyond a fire wall (i.e. proxy) is shown as follows.
1. Exit the Application Deployment Tool.
2. Stop the J2EE server.
3. In the bin/j2ee script, add the following options to the PROPS environment variable:

-Dhttp.proxyPort=<port> -Dhttp.proxyHost=<host>
The <port> is the proxy's port number and <host> is the name of your proxy host.
4. In the lib/security/Server.policy file, edit the following line:

permission java.net.SocketPermission "*:0-65535", "connect";
Modify the line so that it appears as follows::
permission java.net.SocketPermission "*", "connect";
5. Start the J2EE server.
6. Start the Application Deployment Tool.
Item 3 is a bit confusing to me and this is how I set it in j2ee.bat.
set PROPS=-Dhttp.proxyPort=8080 -Dhttp.proxyHost=10.2.240.54

Now when I run the client program having declared the URL to connect to as "http://www.google.com" the following exception is thrown.
==================================================
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.RemoteException: Unknown Exception/Error thrown by EJB method.;
nested exception is:
javax.ejb.EJBException: www.google.com
java.rmi.RemoteException: Unknown Exception/Error thrown by EJB method.; nested
exception is:
javax.ejb.EJBException: www.google.com
javax.ejb.EJBException: www.google.com
=================================================
Why is this happening? How can I get this to work?
(Mind you my proxy requires authentication. Could this be the problem)
Thanks.
I think I know the answer but I want to verify it.
In BMP how are the instance variables of the entity bean initialized when the findByPrimaryKey method is called?
thanks.
I think I get the picture,
thanks a lot
What is the latest version of the j2ee specification?
thanx
Have you tried SVG(Scalable Vector Graphics)?
21 years ago
JSP
Hi tim,
I tried this on windows and it works fine.(I got the same error on linux. I think if you have Xwindows running on the server this will work. I couldn't try this since I do not have a monitor attached to my linux box and I can't try the easy way of running a xserver (i.e. xwindows)). What I want to know why do you need to do this?I cant think of much use for this. Could you reply?
21 years ago
JSP
can somebody tell me the difference between the response.sendRedirect(String url) and the jsp forward tag?
21 years ago
JSP
I tried to change the database for the account example in j2ee developers guide from Cloudscape to Postgresql.
I put the driver in %j2ee_home%\lib\ and set the classpath to it.
Made the necessary changes in default.properties.
I inspected that many a time and contains no errors.
Edited the resource references and the changed the JNDI name to the one bound to the new data base.Also supplied username and password to the new database in the resource references dialog box.
When I deploy the application and run it I get...

Caught an exception.
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.RemoteException: Could not create Entity EJB
java.rmi.RemoteException: Could not create Entity EJB
what could be the problem? Where can I get more info to trouble shoot the problem?
The j2ee developers guide describes two states for a stateless session bean. Non existent state (NES)and the ready state. From NES two methods are called in the transition to ready state. These are setSessionContext and ejbCreate. From ready to NES only one method, ejbRemove is called.
Comparing this with the stateful session bean life cycle, the create method of the home interface is indicated when transitioning from NES to ready and the remove method of the remote interface is indicated when transitioning from ready to NES.
Why is these two methods not indicated in the stateless session bean life cycle?
thanks.
sorry sean, what you mean is to change the publicly displayable name isn't it? I did so. I hope it is in accordance with your policies.
Thank you very much for the explanations. Where can I read more about this .class operator?
sanpra sing
21 years ago
I'm not sure where to post this question, but here goes.
In j2ee developers guide under coding the client the narrow method of the javax.rmi.PortableRemoteObject class is used. The full method is as follows.
public static java.lang.Object narrow(java.lang.Object narrowFrom, java.lang.Class narrowTo) throws java.lang.ClassCastException

This method used in the client as follows

ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(objref, ConverterHome.class);
where objref is a reference for some object of class Object. ConverterHome is an interface.
my question is What does ConverterHome.class mean?
It should be a reference to an object of the class, java.lang.Class shouldn't it? But there is no field reference called class in the Interface ConverterHome nor in any of it's extended Interfaces. What is this?
thanks.
21 years ago
I'm not sure where to post this question, but here goes.
In j2ee developers guide under coding the client the narrow method of the javax.rmi.PortableRemoteObject class is used. The full method is as follows.
public static java.lang.Object narrow(java.lang.Object narrowFrom, java.lang.Class narrowTo) throws java.lang.ClassCastException

This method used in the client as follows

ConverterHome home = (ConverterHome) PortableRemoteObject.narrow(objref, ConverterHome.class);
where objref is a reference for some object of class Object. ConverterHome is an interface.
my question is What does ConverterHome.class mean?
It should be a reference to an object of the class, java.lang.Class shouldn't it? But there is no field reference called class in the Interface ConverterHome nor in any of it's extended Interfaces. What is this?
thanks.
21 years ago