You have to define the resource in the deployment descriptor e.g. you are trying to access the URL resource from a web application then you have to have the following entry in the web.xml url/MyURL java.net.URL Container Shareable b) You have to map the resource name e.g. url/MyURL into a location in your vendor specific deployment descriptor e.g. orion-web.xml as follows: c) Now you can lookup the URL resource and connect using the following code: HttpURLConnection connection = null; Context context = new InitialContext(); URL url = (URL) context.lookup (“java:comp/env/url/MyURL”); connection = (HttpURLConnection)url.