users@glassfish.java.net

Another setup question

From: Norman Walsh <Norman.Walsh_at_Sun.COM>
Date: Tue, 28 Aug 2007 11:32:19 -0400

Forging ahead without an answer to yesterday's query[1], I began to
experiment with the resolver (which I happen to know is part of
appserver-ws.jar).

The relevant bits are:

  CatalogManager catalogmgr = new CatalogManager();
  catalogmgr.setVerbosity(10);
  catalogmgr.setCatalogFiles("http://localhost:8122/catalog.xml");
  CatalogResolver resolver = new CatalogResolver(catalogmgr);

  res = resolver.getResolvedEntity("-//W3C//DTD XHTML 1.0 Transitional//EN",
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd");

  SAXParser parser = spf.newSAXParser();
  XMLReader reader = parser.getXMLReader();
  reader.setEntityResolver(resolver);
  parser.parse(name, new DefaultHandler());

I pass "http://localhost:8122/home.html" for the 'name'.

This code simply sets up a catalog-based entity resolver before
attempting to parse the URI that's passed to it.

Run inside a stand-alone application, this code works as expected.
Watching the logs for localhost:8122, I see a GET for catalog.xml and
then a GET for home.html.

Run inside an endpoint (A lightly hacked hello-jaxws endpoint), this
code does the GET for home.html but never does the GET for catalog.xml.

My first thought was that some earlier version of the endpoint was
cached by the server. But restarting the appserve doesn't seem to
change the results.

Is there some obvious reason why the same code would behave so
differently in an endpoint than it does in a stand-alone application?

Color me confused.

                                        Be seeing you,
                                          norm


[1] https://glassfish.dev.java.net/servlets/ReadMsg?list=users&msgNo=8486
-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.