1

I discovered this morning (2015-01-10) that I cannot deploy my Java EE application in GlassFish 4.1 without an Internet connection. I realized this fact when I tried to deploy my applications and received the following error:

- java.io.IOException: Error parsing descriptor Deployment descriptor file META-INF/glassfish-ejb-jar.xml in archive [elis-ejb-0.0.1-SNAPSHOT_jar].   
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:361)   
at com.sun.enterprise.deployment.util.DOLUtils.readRuntimeDeploymentDescriptor(DOLUtils.java:512) 
- ...
- Caused by: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.oracle.com/splash/java.net/maintenance/index.html   
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1838)   
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)

Apparently, several Oracle web sites where down until around 08:30 central time this morning that my GlassFish Java EE application depends on to parse the glassfish-ejb-jar.xml file during application deployment. I noticed that http://www.glassfish.org also resulted in the following error message page until the same time that I was able to deploy my application again.

I am currently developing the application, so I was able to wait for the web site(s) to recover before continuing my development without much inconvenience. However, this incident worries me about the eventual deployment of the application to run my company because the applications needs to run and preferably to deploy without an Internet connection.

How do I identify my application's Internet dependencies?

How do I eliminate my application's Internet dependencies?

The following is my ejb-jar.xml.

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                             http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd"
         version="3.2">
</ejb-jar>

The following is my glassfish-ejb-jar.xml file.

<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//
DTD GlassFish Application Server 3.1 EJB 3.1//EN"
"http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">
<glassfish-ejb-jar>
    <display-name>elis-ejb</display-name>
</glassfish-ejb-jar>
kolossus
  • 20,559
  • 3
  • 52
  • 104
Reed Elliott
  • 223
  • 2
  • 15
  • I can't reproduce that. Please add your `ejb-jar.xml` to the question. – unwichtich Jan 11 '15 at 23:04
  • I added the ejb-jar.xml as requested. Are you able to deploy your Java EE application without an Internet connection? – Reed Elliott Jan 13 '15 at 21:34
  • When I disable my Internet connection, I receive the following exception when I try to deploy my application: java.io.IOException: Unable to locate the DTD to validate your deployment descriptor file [META-INF/glassfish-ejb-jar.xml]. My glassfish-ejb-jar.xml file contains the following standard DTD: . Do you have a glassfish-ejb-jar.xml file in your application? @unwichtich – Reed Elliott Jan 20 '15 at 13:03
  • I have tried it with both files and it works in both cases without internet connection. – unwichtich Jan 20 '15 at 18:40

1 Answers1

3

I found a similar post by hzhang_jn on a java.net forum that stated the following:

You might have a typo in your glassfish-web.xml when declaring the DOCTYPE....The DOCTYPE is used to resolve the declared dtd to the local repository and validate. When the DOCTYPE is wrong, it will try to go to internet and fetch the dtd...

I carefully compared the DOCTYPE of my glassfish-ejb-jar.xml file to the one listed in the GlassFish 4.0 Application Deployment Guide and they were exactly the same. In fact, I am confident that I created my glassfish-ejb-jar.xml file by cutting and pasting from the guide. Regardless, after I changed my three line DOCTYPE to one line, I was able to deploy my application without access to the Internet.

DOCTYPE that works without Internet Connection:

<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 EJB 3.1//EN" "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">

DOCTYPE that requires Internet connection:

<!DOCTYPE glassfish-ejb-jar PUBLIC "-//GlassFish.org//
DTD GlassFish Application Server 3.1 EJB 3.1//EN"
"http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd">

Thank you @unwichtich for your help!

Reed Elliott
  • 223
  • 2
  • 15