RE: Running Tomcat+Struts w/o internet connection

2001-07-15 Thread Craig R. McClanahan



On Thu, 28 Jun 2001, Maxime Soucy wrote:

 I was facing the same problem depending on the way I was buiding my war
 file.
 
 -If I made a copy of all the files and folder required for the my war file
 in a specific folder (a copy of my Css/*, Jpg/*, *.jsp, and Web-inf/*) and
 then made :
 war cvf demo.war .
 then running the demo.war in Tomcat, Tomcat was able to resolveEntity(...)
 and everything was fine.
 
 -But if I made my war file this way:
 war cvf demo.war *.jsp Web-inf Css Jpg
 then I faced the DTD-Reference problem.
 
 the 2 war files are the same size and they have the same structure once
 uncompressed.
 
 Anyone faced this strange behavior ?
 What should I do to correct the situation, any idea?
 
 (yes i could put hte Dtd in the demo.war ... but...i does not explain the
 strange behavior... )
 
 
 Thanks
 
 Maxime
 

The important issues for resolving correctly are:

- You must use the correct public identifier in your config files.
  That is what the XML parser uses to match things up.

- You must include struts.jar inside WEB-INF/lib of your web app.

- You must ***not*** have struts.jar on your classpath.

Craig McClanahan




Re: More on running Tomcat+Struts w/o internet connection

2001-06-26 Thread Hartmut Bernecker

Hello,

I'm also interested in a solution of that problem. Admittedly the
subject-matter is not the struts-config.dtd but rather any dtd of any
(custom) xml-document struts works with.

TIA

Thomas Burns schrieb:
 
 My coworker posted the original question in the Running Tomcat+Struts w/o
 internet connection thread, but since I'm the one trying to overcome this
 particular problem, I thought I'd add some more detail.  First off, we're
 using Tomcat 3.2.1 or 3.2.2 (not sure) and Struts 1.0.
 
 The DOCTYPE line of the struts-config.xml by default looks like:
 
 !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
 Configuration 1.0//EN
 http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
 
 If I run tomcat disconnected from the network I get the following:
 
 resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
 1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
 Not registered, use system identifier
 Parse Fatal Error at line 3 column -1: External entity not found:
 http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd.
 
 whereupon Tomcat barfs and stops loading.  It was suggested to use a
 'file://' style URL to fix this.  That works fine, (i.e.
 'file:///c:/foo/bar/struts-config_1_0.dtd') but it demands an absolute file
 path.  Any attempt to use a relative path (such as
 'file://struts-config_1_0.dtd') has failed with the same 'external entity
 not found' error as above.  I've tried various permutations, but either it
 doesn't work, or I can't figure out what the current working directory is
 that the URL will base itself off of (tried tomcat/bin, webapps,
 webapps/myapp, webapps/myapp/WEB-INF).
 
 So, how about specifying the file directly, as in:
 
 !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
 Configuration 1.0//EN struts-config_1_0.dtd
 
 Well, here's the resulting error:
 
 Parse Fatal Error at line 3 column -1: Relative URI struts-config_1_0.dtd;
 can not be resolved without a document URI.
 
 Even though XML Spy thinks this is OK, obviously tomcat wants a little more
 information.  I poked around in the XML Bible, but couldn't find anything to
 tip me off as to what to include in the XML that would make this error go
 away.
 
 All I want to do is have the struts DTD be a local file, referenced with
 some sort of resolveable relative path.  An absolute path just can't be
 worked with, and we cannot guarantee a network connection.  Any more ideas?
 
 Thanks!
 
 t
 --
 Thomas Burns
 RiskMetrics Group
 [EMAIL PROTECTED]
 734.945.6428
_
Hartmut Bernecker
Electronic Publishing
ASIM(r) - CONTENT MANAGEMENT AT ITS BEST

Druckhaus Waiblingen
Siemenstrasse 10
D-71332 Waiblingen, Germany
Tel.:   +49 (0)71 51 / 5 66 - 4 48
Mail:   mailto:[EMAIL PROTECTED]
Web:http://www.dhw.de/



More on running Tomcat+Struts w/o internet connection

2001-06-25 Thread Thomas Burns

My coworker posted the original question in the Running Tomcat+Struts w/o
internet connection thread, but since I'm the one trying to overcome this
particular problem, I thought I'd add some more detail.  First off, we're
using Tomcat 3.2.1 or 3.2.2 (not sure) and Struts 1.0.

The DOCTYPE line of the struts-config.xml by default looks like:

!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 1.0//EN
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

If I run tomcat disconnected from the network I get the following:

resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN', 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
Not registered, use system identifier
Parse Fatal Error at line 3 column -1: External entity not found:
http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd.

whereupon Tomcat barfs and stops loading.  It was suggested to use a
'file://' style URL to fix this.  That works fine, (i.e.
'file:///c:/foo/bar/struts-config_1_0.dtd') but it demands an absolute file
path.  Any attempt to use a relative path (such as
'file://struts-config_1_0.dtd') has failed with the same 'external entity
not found' error as above.  I've tried various permutations, but either it
doesn't work, or I can't figure out what the current working directory is
that the URL will base itself off of (tried tomcat/bin, webapps,
webapps/myapp, webapps/myapp/WEB-INF).

So, how about specifying the file directly, as in:

!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 1.0//EN struts-config_1_0.dtd

Well, here's the resulting error:

Parse Fatal Error at line 3 column -1: Relative URI struts-config_1_0.dtd;
can not be resolved without a document URI.

Even though XML Spy thinks this is OK, obviously tomcat wants a little more
information.  I poked around in the XML Bible, but couldn't find anything to
tip me off as to what to include in the XML that would make this error go
away.

All I want to do is have the struts DTD be a local file, referenced with
some sort of resolveable relative path.  An absolute path just can't be
worked with, and we cannot guarantee a network connection.  Any more ideas?

Thanks!

t
--
Thomas Burns
RiskMetrics Group
[EMAIL PROTECTED]
734.945.6428




Running Tomcat+Struts w/o internet connection

2001-06-22 Thread James Howe

We are trying to run Tomcat + Struts to run our web application without an 
external internet connection.  We are running into a problem because our 
struts-config.xml has an external reference to the struts-config DTD.  What 
is the proper way to modify struts-config.xml to reference a locally 
defined DTD and where would that file normally reside in a standard Tomcat 
installation?

Thanks.




RE: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread Liang Li

Open the struts-config.xml, change the head

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

To:

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  file://c:/{where_your_DTD_is}/struts-config_1_0.dtd

I think that will work.

-Original Message-
From: James Howe [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 10:30 AM
To: [EMAIL PROTECTED]
Subject: Running Tomcat+Struts w/o internet connection


We are trying to run Tomcat + Struts to run our web application without an 
external internet connection.  We are running into a problem because our 
struts-config.xml has an external reference to the struts-config DTD.  What 
is the proper way to modify struts-config.xml to reference a locally 
defined DTD and where would that file normally reside in a standard Tomcat 
installation?

Thanks.



RE: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread Liang Li

Of course you can use relative directory, and put the DTD file into your
war.

-Original Message-
From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: Running Tomcat+Struts w/o internet connection


Hi,

I think that problem has been fixed since Struts 1.0, but I'm not sure.
Do you have a new release from Struts?

The solution with file://c:/... is IMHO a problem if you want to
deploy your Application (e.g. in a war-File).
Who guarantees you, Tomcat or JRun or ... will be installed on Drive C?

Currently I have a similar problem: I have a XML-File (retrieved by
SOAP) and do parse it with Digester.
That is no problem. If I want to validate that Document, I do it by
writing the DTD-Reference into the XML-File
( !DOCTYPE root SYSTEM xy.dtd ) and by calling
digester.validate(true).
The Drawback is, that I must put that DTD in the tomcat/bin Directory,
otherwise it would **not** be found.

Then I tried to use the digester.register method. But it seems, I does
not work, as I want.
What I want is: To put the DTD file in some custom directory and use it
to validate the XML-File (that I get wrapped in in a SOAP Document).

Who knows, how to do that?

Cheers
Hartmut



Liang Li schrieb:
 
 Open the struts-config.xml, change the head
 
 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;
 
 To:
 
 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
   file://c:/{where_your_DTD_is}/struts-config_1_0.dtd
 
 I think that will work.
 
 -Original Message-
 From: James Howe [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 22, 2001 10:30 AM
 To: [EMAIL PROTECTED]
 Subject: Running Tomcat+Struts w/o internet connection
 
 We are trying to run Tomcat + Struts to run our web application without an
 external internet connection.  We are running into a problem because our
 struts-config.xml has an external reference to the struts-config DTD.
What
 is the proper way to modify struts-config.xml to reference a locally
 defined DTD and where would that file normally reside in a standard Tomcat
 installation?
 
 Thanks.



RE: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread DHarty

I was following this thread, and I tried to use a relative directory of the
type:
file://./struts-config_1_0.dtd

When I attempted to start tomcat I got the following message:

resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
1.0//EN', 'file://.')  Resolving to alternate DTD
'jar:file:/C:/dev/jbproject/TMate/tmate/WEB-INF/lib/struts.jar!/org/apache/s
truts/resources/struts-config_1_0.dtd'

and then my app worked correctly.  Simarly, you could change the http path
to point to a null object. ex:
http://this.domain.does.not.exist.org/struts/dtds/struts-config_1_0.dtd;

It seems that if the file can't be found where specified, struts resorts to
a struts-config_1_0.dtd file embedded within struts jar. This may only work
in struts_1.0.

David




-Original Message-
From: Liang Li [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 11:43 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Running Tomcat+Struts w/o internet connection


Of course you can use relative directory, and put the DTD file into your
war.

-Original Message-
From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 22, 2001 11:52 AM
To: [EMAIL PROTECTED]
Subject: Re: Running Tomcat+Struts w/o internet connection


Hi,

I think that problem has been fixed since Struts 1.0, but I'm not sure.
Do you have a new release from Struts?

The solution with file://c:/... is IMHO a problem if you want to
deploy your Application (e.g. in a war-File).
Who guarantees you, Tomcat or JRun or ... will be installed on Drive C?

Currently I have a similar problem: I have a XML-File (retrieved by
SOAP) and do parse it with Digester.
That is no problem. If I want to validate that Document, I do it by
writing the DTD-Reference into the XML-File
( !DOCTYPE root SYSTEM xy.dtd ) and by calling
digester.validate(true).
The Drawback is, that I must put that DTD in the tomcat/bin Directory,
otherwise it would **not** be found.

Then I tried to use the digester.register method. But it seems, I does
not work, as I want.
What I want is: To put the DTD file in some custom directory and use it
to validate the XML-File (that I get wrapped in in a SOAP Document).

Who knows, how to do that?

Cheers
Hartmut



Liang Li schrieb:

 Open the struts-config.xml, change the head

 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

 To:

 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
   file://c:/{where_your_DTD_is}/struts-config_1_0.dtd

 I think that will work.

 -Original Message-
 From: James Howe [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 22, 2001 10:30 AM
 To: [EMAIL PROTECTED]
 Subject: Running Tomcat+Struts w/o internet connection

 We are trying to run Tomcat + Struts to run our web application without an
 external internet connection.  We are running into a problem because our
 struts-config.xml has an external reference to the struts-config DTD.
What
 is the proper way to modify struts-config.xml to reference a locally
 defined DTD and where would that file normally reside in a standard Tomcat
 installation?

 Thanks.




Re: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread Craig R. McClanahan



On Fri, 22 Jun 2001, James Howe wrote:

 We are trying to run Tomcat + Struts to run our web application without an 
 external internet connection.  We are running into a problem because our 
 struts-config.xml has an external reference to the struts-config DTD.  What 
 is the proper way to modify struts-config.xml to reference a locally 
 defined DTD and where would that file normally reside in a standard Tomcat 
 installation?
 
 Thanks.
 
 

Which version of Tomcat?  Which XML parser?

This works for me (with Tomcat 4 and JAXP/1.1) all the time on my laptop
when I am disconnected from the net.

Craig





Re: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread Dan Miser

You shouldn't have to change the XML. There are local copies of the DTD in
struts.jar, and should be registered and loaded when you start Tomcat up.
Which build are you using (source vs binary, and release vs beta)? This
should be working just fine in the later builds.
--
Dan Miser
http://www.distribucon.com

- Original Message -
From: Liang Li [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, June 22, 2001 10:02 AM
Subject: RE: Running Tomcat+Struts w/o internet connection


 Open the struts-config.xml, change the head

 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
   http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

 To:

 !DOCTYPE struts-config PUBLIC
   -//Apache Software Foundation//DTD Struts Configuration
1.0//EN
   file://c:/{where_your_DTD_is}/struts-config_1_0.dtd

 I think that will work.

 -Original Message-
 From: James Howe [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 22, 2001 10:30 AM
 To: [EMAIL PROTECTED]
 Subject: Running Tomcat+Struts w/o internet connection


 We are trying to run Tomcat + Struts to run our web application without an
 external internet connection.  We are running into a problem because our
 struts-config.xml has an external reference to the struts-config DTD.
What
 is the proper way to modify struts-config.xml to reference a locally
 defined DTD and where would that file normally reside in a standard Tomcat
 installation?

 Thanks.




Re: Running Tomcat+Struts w/o internet connection

2001-06-22 Thread James W. Howe

I believe we are using Tomcat 3.2.1.

At 11:04 AM 06/22/2001 -0700, you wrote:


On Fri, 22 Jun 2001, James Howe wrote:

  We are trying to run Tomcat + Struts to run our web application without an
  external internet connection.  We are running into a problem because our
  struts-config.xml has an external reference to the struts-config 
 DTD.  What
  is the proper way to modify struts-config.xml to reference a locally
  defined DTD and where would that file normally reside in a standard Tomcat
  installation?
 
  Thanks.
 
 

Which version of Tomcat?  Which XML parser?

This works for me (with Tomcat 4 and JAXP/1.1) all the time on my laptop
when I am disconnected from the net.

Craig


James Howe  internet: mailto:[EMAIL PROTECTED]
Allen Creek Software, Inc.pgpkey: 
http://ic.net/~jwh/pgpkey.html
Ann Arbor, MI  48103