strange error when processing stylesheets: tomcat, jdk1.4, windows, xalan

2004-07-01 Thread Martin Monsorno
Hi *,

I get the following error when trying to transform a xml document with
a XSLT stylesheet:

; SystemID: jndi:/localhost/ipas/xsl/minutes_pdf.xsl; Line#: 298; Column#: 66
javax.xml.transform.TransformerException: Unknown error in XPath
at org.apache.xpath.XPath.bool(XPath.java:411)
at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:198)
...

In the stylesheet, I test for an empty string:

xsl:if test=not(string(./title))

The error occurs:

- with ANY test condition that tests for an empty string
  (e.g. with string-length(./entry) = 0
- with having xalan.jar, xml-apis.jar and xercesImpl.jar in my
  WEB-INF/lib from any xalan versions of 2.5.0, 2.5.2, 2.6.0
- with Tomcat 4.1.29 on Windows 2000 and JDK 1.4x
- NOT with JDK 1.3
- NOT on Linux
- NOT with resin

It's these kind of errors that makes being a programmer a real fun!

Does anyone have a tip on what to do?  

-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: strange error when processing stylesheets: tomcat, jdk1.4, windows, xalan

2004-07-01 Thread Martin Monsorno
Martin Monsorno [EMAIL PROTECTED] writes:

 Hi *,

 I get the following error when trying to transform a xml document with
 a XSLT stylesheet:

 ; SystemID: jndi:/localhost/ipas/xsl/minutes_pdf.xsl; Line#: 298; Column#: 66
 javax.xml.transform.TransformerException: Unknown error in XPath
 at org.apache.xpath.XPath.bool(XPath.java:411)
 at org.apache.xalan.templates.ElemIf.execute(ElemIf.java:198)
 ...

 In the stylesheet, I test for an empty string:

 xsl:if test=not(string(./title))

 The error occurs:

 - with ANY test condition that tests for an empty string
   (e.g. with string-length(./entry) = 0
 - with having xalan.jar, xml-apis.jar and xercesImpl.jar in my
   WEB-INF/lib from any xalan versions of 2.5.0, 2.5.2, 2.6.0
 - with Tomcat 4.1.29 on Windows 2000 and JDK 1.4x
 - NOT with JDK 1.3
 - NOT on Linux
 - NOT with resin

Ah, yes, and it does NOT occur when running the transforming by
directly calling xalan from the command line and not via TomCat!


-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



XSLT transformations with tomcat

2004-06-30 Thread Martin Monsorno
Hi *,

I have some questions about XSLT transformations with tomcat (4 and 5).

1.) There doesn't seem to be a XSLT-processor included in TomCat.
Isn't this mandatory for a J2EE web container?  Isn't this needed for
the transform taglibs?

2.) When removing the xalan.jar-package from my web-app, I get the
following error: 

 javax.xml.transform.TransformerFactoryConfigurationError: Provider 
org.apache.xalan.processor.TransformerFactoryImpl not found

Why does tomcat looks after the
org.apache.xalan.processor.TransformerFactoryImpl class?  I didn't
configured this implementation for being used.

Thanks for your help,

-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Context mapping and war

2004-03-23 Thread Martin Monsorno
Jesse Vitrone [EMAIL PROTECTED] writes:

 So in TC5, the conext is part of the war file, and I don't need to do
 anything separate?  All that info can be in the war file?

In TC5, you can define the context in a special file 
in conf/Catalina/localhost/webapp.xml.  With this, everything
works as wanted.

-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to deploy a war-file to tomcat 4?

2004-03-09 Thread Martin Monsorno
Hi all,

I have a war-file containing my application, and the application needs
a data source.  A not too unusual situation, I suppose.

Now, when I install my application (by copying the war to the
webapp-dir by using the manager app), it won't run, because it has no
data source available.  To provide a data source, I must define a
context for my web-app, thus specify the docBase directory where my
jsp-files are, which does not exist because I didn't have the
application installed at the time.  And tomcat will not accept my
war-file after defining the context and complains, that the
application already exists at this path.  What was first, the hen or
the egg?

How do you all make this?  I just want to be able to configure a data
source one times, and then just install a war-file from time to time.

-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: cannot access my web application (resource is not available)

2003-11-20 Thread Martin Monsorno
(Hmm, the mailing list server seems to have swallowed the message text
part of my posting - here it is:)


Hi *,

after managing to install my web-app, I cannot access it with my
browser.  

The installation is as follows:
- I set CATALINA_BASE to a directory
- created a conf/server.xml with the following entries:
...
Context
  path=/myapp 
  docBase=myapp
  debug=0
  reloadable=true
  crossContext=true
...
  (complete file is attached)
- put my application (the whole WAR directory tree) under
  webapps/myapp
- (and, yes, I created a temp dir there after getting some errors
  about jar-file processing)

Starting tomcat works well, in the logfile says that various files of
my app are deployed:

,
| 2003-11-19 17:53:30 WebappLoader[/myapp]: Deploying class repositories to work 
directory /home/monsorno/proj/myapp/intrapas/build/run/work/Standalone/localhost/myapp
| 2003-11-19 17:53:30 WebappLoader[/myapp]: Deploy class files /WEB-INF/classes to 
/home/monsorno/proj/myapp/intrapas/build/run/webapps/myapp/WEB-INF/classes
| 2003-11-19 17:53:30 WebappLoader[/myapp]: Deploy JAR /WEB-INF/lib/common.jar to 
/home/monsorno/proj/myapp/intrapas/build/run/webapps/myapp/WEB-INF/lib/common.jar
| ...
| 2003-11-19 17:53:30 WebappLoader[/myapp]: Deploy JAR 
/WEB-INF/lib/xalan-j_2_5_0-xml-apis.jar to 
/home/monsorno/proj/myapp/intrapas/build/run/webapps/myapp/WEB-INF/lib/xalan-j_2_5_0-xml-apis.jar
| 2003-11-19 17:53:30 WebappLoader[/myapp]: Reloading checks are enabled for this 
Context
| 2003-11-19 17:53:30 ContextConfig[/myapp]: Missing default web.xml, using 
application web.xml only
| 2003-11-19 17:53:31 StandardManager[/myapp]: Seeding random number generator class 
java.security.SecureRandom
| 2003-11-19 17:53:31 StandardManager[/myapp]: Seeding of random number generator has 
been completed
`

But when I try to access http://localhost:8090/myapp/ with my browser,
I get:

,
| HTTP Status 404 - /ipas/
| 
| type Status report
| 
| message /ipas/
| 
| description The requested resource (/ipas/) is not available.
`

Any ideas why it does not work?  It's most likely not the
application's fault as it runs with no problems in resin on the same
directory tree.

-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cannot access my web application (resource is not available)

2003-11-19 Thread Martin Monsorno
!-- -*- xml -*- --
!-- Example Server Configuration File --

Server port=8005 shutdown=SHUTDOWN debug=0

  !-- Global JNDI resources --
  GlobalNamingResources
!-- Test entry for demonstration purposes --
Environment name=simpleValue type=java.lang.Integer value=30/
  /GlobalNamingResources

  Service name=Tomcat-Standalone

!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --
Connector className=org.apache.coyote.tomcat4.CoyoteConnector
   port=8090 minProcessors=5 maxProcessors=75
   enableLookups=true redirectPort=8443
   acceptCount=100 debug=0 connectionTimeout=2
   useURIValidationHack=false disableUploadTimeout=true /

!-- Define the top level container in our container hierarchy --
Engine name=Standalone defaultHost=localhost debug=0

  !-- Define the default virtual host --
  Host name=localhost debug=0 appBase=webapps
unpackWARs=true autoDeploy=true

Context
	  path=/myapp 
	  docBase=myapp
	  debug=0
	  reloadable=true
	  crossContext=true

	  !-- where (server-) logging goes to --
  Logger
	className=org.apache.catalina.logger.FileLogger
	prefix=myapphost 
	suffix=.log
	timestamp=true/

	  !-- properties for the app available over JNDI --
	  Environment name=simpleValue type=java.lang.Integer value=30/

	  !-- datasource for intraPAS --
  Resource
	name=jdbc/myappdb
	auth=Container
	type=javax.sql.DataSource/
  ResourceParams name=jdbc/myappdb
parameter
	  nameusername/name
	  valuemonsorno/value
	/parameter
parameter
	  namepassword/name
	  valuexxx/value
	/parameter
parameter
	  namedriverClassName/name
	  valueorg.postgresql.Driver/value
	/parameter
parameter
	  nameurl/name
	  valuejdbc:postgresql:myappdb/value
	/parameter
  /ResourceParams

	/Context

  /Host
/Engine
  /Service
/Server



-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

JNDI-lookup fails with GlobalResources

2003-11-14 Thread Martin Monsorno
Hi *,

I recently installed tomcat 4.1.29 and deployed a web application on
it via a war-file.  The provided server.xml contains the following
lines: 

,
|...
|   !-- Global JNDI resources --
|   GlobalNamingResources
| 
| !-- Test entry for demonstration purposes --
| Environment name=simpleValue type=java.lang.Integer value=30/
| 
|   ...
`

My application tries to read this value through a JNDI lookup with
this code:

,
| LOG.debug(testing jndi lookup ...);
| try {
|   Context initCtx = new InitialContext();
|   Context envCtx = (Context) initCtx.lookup(java:comp/env);
| 
|   String jndikey = simpleValue;
| 
|   LOG.debug(envCtx.lookup(\+jndikey+\)=+envCtx.lookup(jndikey));
| } catch (NamingException exc) {
|   LOG.warn(cannot init from JNDI context, exc);
| }
| LOG.debug(jndi test end.);
`

which leads to the log output:

,
|   2003-11-14 10:33:06,237 DEBUG 
(myapp.InitializationServlet.testJNDI(InitializationServlet.java:67)) - testing jndi 
lookup ...
|   2003-11-14 10:33:06,245 WARN  
(myapp.InitializationServlet.testJNDI(InitializationServlet.java:76)) - cannot init 
from JNDI context
|   javax.naming.NameNotFoundException: Name simpleValue is not bound in this Context
| at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
| at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
| at myapp.InitializationServlet.testJNDI(InitializationServlet.java:74)
| at myapp.InitializationServlet.init(InitializationServlet.java:29)
|   ...
`

So obviously, putting values into JNDI context fails.  (If I set the
value in web.xml instead as an env-entry, everything goes well.)

Have I forgotten to do some additional initialization or configuration
or something else?  Any ideas?

Thanks in advance,

Martin.



-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JNDI-lookup fails with GlobalResources

2003-11-14 Thread Martin Monsorno
Christopher Schultz [EMAIL PROTECTED] writes:

 Martin,
 I recently installed tomcat 4.1.29 and deployed a web application on
 it via a war-file.  The provided server.xml contains the following
 lines:

 Have I forgotten to do some additional initialization or configuration
 or something else?  Any ideas?

 I think you have. When you have a global resource, it doesn't actually mean that
 it's available for all contexts. It just means that it's available /to be
 available/ for all contexts :)

 In order to actually give it to a context, you need a resource link in
 server.xml:

   ResourceLink name=jdbc/myDataSource
   global=jdbc/myDataSourceRef
  type=javax.sql.DataSource /

So, that means, that I have to add a Context-entry to my server.xml
for my web app.  I hoped I could do without this to make automatic
deployment possible, but it seems that this 2 things won't go
together, correct?


-- 
Martin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]