aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes connecting to URL on the web from ejb Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "connecting to URL on the web from ejb" Watch "connecting to URL on the web from ejb" New topic
Author

connecting to URL on the web from ejb

sanpra sing
Greenhorn

Joined: Aug 28, 2002
Posts: 15
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.
sanpra sing
Greenhorn

Joined: Aug 28, 2002
Posts: 15
knock knock?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: connecting to URL on the web from ejb