You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Torgeir Veimo <to...@vertech.no> on 2002/01/30 12:26:37 UTC

serving jsp pages from slide repository

This is probably a faq.

I'm trying to server jsp pages from a webdav repository. All files with 
the *.jsp url are catched by JspServlet, but it seems that jspServlet 
only looks for the jsp as a file under the web applications directory.

Isn't the JspServlet supposed to follow the rules specified in the 
web.xml file in tomcat 4.0.*?

Log extract;

2002-01-30 12:15:30 StandardContext[/repository]: Mapping 
contextPath='/repository' with requestURI='/repository/test.jsp' and 
relativeURI='/test.jsp'
2002-01-30 12:15:30 StandardContext[/repository]: Decoded 
relativeURI='/test.jsp'
2002-01-30 12:15:30 StandardContext[/repository]:   Trying exact match
2002-01-30 12:15:30 StandardContext[/repository]:   Trying prefix match
2002-01-30 12:15:30 StandardContext[/repository]:   Trying extension match
2002-01-30 12:15:30 StandardContext[/repository]:  Mapped to servlet 
'jsp' with servlet path '/test.jsp' and path info 'null' and update=true

Then a 404.

If I put the test.jsp file under webapps/repository/test.jsp as a file 
it works.

-- 
-Torgeir


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Building Slide

Posted by Akil <as...@swbell.net>.
When trying to build the wrappers part of Slide
i.e. ant wrappers,

I get errors that say

cannot extent final class org.apache.catalina.startup.HostConfig ( In file
Jakarta-Slide/src/wrappers/catalina/BaseHostConfig.java:112 )
Also it cannot find methods getContextClass() and getConfigClass() in
wrappers.catalina.AdminHostConfig and a few other errors.

Could anyone render in any help? What am I missing?

I am tried using the catalina.jar file from the 1.0.16 release as well as
from the latest Tomcat build. I get the same error.
What am I doing wrong?

Thanks
Akil


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Building Slide

Posted by Akil <as...@swbell.net>.
This is for anyone who faces the previous problem. (
TestXMLResponseMethodBase is not instantiable, etc )

Need to Use the commons-httpclient.jar that is available at
jakarta-slide/dist/client/lib instead of the latest one.

Also need xalan.jar in the ANT_HOME/lib directory.

Akil
----- Original Message -----
From: "Akil" <as...@swbell.net>
To: "Slide Users List" <sl...@jakarta.apache.org>
Sent: Thursday, January 31, 2002 11:27 AM
Subject: Re: Building Slide


> Thanks for that!
>
> but now,
>
> tests:
>     [javac] Compiling 2 source files to
> E:\SlideIntegration\jakarta-slide\build\tests
>     [javac] Note: sun.tools.javac.Main has been deprecated.
>     [javac]
>
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
> .java:81: class org.apache.webdav.lib.methods.XMLResponseMethodBase is an
> abstract class. It can't be instantiated.
>     [javac]   XMLResponseMethodBase test1 = new XMLResponseMethodBase();
>     [javac]                                 ^
>     [javac]
>
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
> .java:83: Method setStatusCode(int) not found in class
> org.apache.webdav.lib.methods.XMLResponseMethodBase.
>     [javac]   test1.setStatusCode(WebdavStatus.SC_MULTI_STATUS);
>     [javac]                      ^
>     [javac]
>
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
> .java:85: Method setUsed() not found in class
> org.apache.webdav.lib.methods.XMLResponseMethodBase.
>     [javac]   test1.setUsed();
>     [javac]                ^
>     [javac]
>
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
> .java:86: Method setState(org.apache.commons.httpclient.State) not found
in
> class org.apache.webdav.lib.methods.XMLResponseMethodBase.
>     [javac]   test1.setState(new State());
>     [javac]                 ^
>     [javac]
>
E:\SlideIntegration\jakarta-slide\src\tests\transaction\PutTestCase.java:241
> : interface org.apache.commons.httpclient.Credentials is an interface. It
> can't be instantiated.
>     [javac]    client.setCredentials(new Credentials("guest", "guest"));
>     [javac]                          ^
>     [javac]
>
E:\SlideIntegration\jakarta-slide\src\tests\transaction\PutTestCase.java:243
> : Method sendData(java.io.ByteArrayInputStream) not found in class
> org.apache.commons.httpclient.methods.PutMethod.
>     [javac]    pm.sendData( new
> ByteArrayInputStream(fileContent.getBytes()));
>     [javac]               ^
>     [javac] 6 errors, 1 warning
>
> Any Ideas on this?
>
> Thanks
> Akil
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Building Slide

Posted by Akil <as...@swbell.net>.
Thanks for that!

but now,

tests:
    [javac] Compiling 2 source files to
E:\SlideIntegration\jakarta-slide\build\tests
    [javac] Note: sun.tools.javac.Main has been deprecated.
    [javac]
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
.java:81: class org.apache.webdav.lib.methods.XMLResponseMethodBase is an
abstract class. It can't be instantiated.
    [javac]   XMLResponseMethodBase test1 = new XMLResponseMethodBase();
    [javac]                                 ^
    [javac]
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
.java:83: Method setStatusCode(int) not found in class
org.apache.webdav.lib.methods.XMLResponseMethodBase.
    [javac]   test1.setStatusCode(WebdavStatus.SC_MULTI_STATUS);
    [javac]                      ^
    [javac]
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
.java:85: Method setUsed() not found in class
org.apache.webdav.lib.methods.XMLResponseMethodBase.
    [javac]   test1.setUsed();
    [javac]                ^
    [javac]
E:\SlideIntegration\jakarta-slide\src\tests\client\TestXMLResponseMethodBase
.java:86: Method setState(org.apache.commons.httpclient.State) not found in
class org.apache.webdav.lib.methods.XMLResponseMethodBase.
    [javac]   test1.setState(new State());
    [javac]                 ^
    [javac]
E:\SlideIntegration\jakarta-slide\src\tests\transaction\PutTestCase.java:241
: interface org.apache.commons.httpclient.Credentials is an interface. It
can't be instantiated.
    [javac]    client.setCredentials(new Credentials("guest", "guest"));
    [javac]                          ^
    [javac]
E:\SlideIntegration\jakarta-slide\src\tests\transaction\PutTestCase.java:243
: Method sendData(java.io.ByteArrayInputStream) not found in class
org.apache.commons.httpclient.methods.PutMethod.
    [javac]    pm.sendData( new
ByteArrayInputStream(fileContent.getBytes()));
    [javac]               ^
    [javac] 6 errors, 1 warning

Any Ideas on this?

Thanks
Akil


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Building Slide

Posted by Christopher Lenz <cm...@gmx.de>.
That's a pretty annoying problem with the antlr task (probably)...
You'll need to put antlr.jar into your system CLASSPATH before building Slide, 
for some obscure reason.

31.01.2002 17:54:15, Akil <as...@swbell.net> wrote:
>I just went thru the FAQ and got all the packages needed for building slide
>as well as the source-code from the CVS repository.
>
>I set up my build.properties file as best I could and started ant.
>
>I get an error message although antlr.jar  is in ${ANT_HOME}/lib as
>requested by the message. while processing Client.g
>I can process Client.g from the command line using java -Classpath .... etc
>to get me the files.
>
>What I am missing?
>
>If I compile Client.g by hand and copy it to the appropriate build
>directory, it does work.
>
>Could any of you please point me in the right direction?
>
>Thanks
>Akil
>

-chris
_______________________________________________
 /=/ cmlenz at gmx.de





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Building Slide

Posted by Akil <as...@swbell.net>.
I just went thru the FAQ and got all the packages needed for building slide
as well as the source-code from the CVS repository.

I set up my build.properties file as best I could and started ant.

I get an error message although antlr.jar  is in ${ANT_HOME}/lib as
requested by the message. while processing Client.g
I can process Client.g from the command line using java -Classpath .... etc
to get me the files.

What I am missing?

If I compile Client.g by hand and copy it to the appropriate build
directory, it does work.

Could any of you please point me in the right direction?

Thanks
Akil


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: serving jsp pages from slide repository

Posted by Torgeir Veimo <to...@vertech.no>.
Remy Maucherat wrote:
>>Remy Maucherat wrote:
>>
>>>You can do that, but it's a lot more complex than that to do. Basically,
>>>
> you
> 
>>>need an implementation of a Tomcat 4 Resources written to access a Slide
>>>namespace (instead of, for example, the filesystem).
>>>I just wrote (yesterday) some docs on that:
>>>http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/resources.html
>>>
>>Bottom line; Tomcat 4.* makes use of the Resource impl through the
>>JspServlet, but there is no default Resource implementation that have
>>the "loopback mount" effect I'm looking for?
>>
> 
> Sorry, I think I misunderstood your question. What you want is serve the
> webapp which would be stored on a WebDAV server somewhere else, right ?
> I translated webdav -> slide; sorry.

No it would be slide or something similar running in the same container.

What I was thinking about was a mapper that did like this;

server gets request for /.../blabla.jsp -> uses mapper which finds 
JspServlet

JspServlet looks up /.../blabla.jsp with a Resource impl

The resource impl uses the mapper to find /.../blabla.jsp, which find 
JspServlet again

Since JspServlet was found the first time, it looks further in its 
mapping list, and now finds the next match, the generic mapping from / 
to the webdav servlet, so the webdav servlet looks up /.../blabla.jsp 
internally and returns the content.

I guess such a recursive lookup would be difficult, since the mapper 
would need to store resursivly what it  has allready mapped to.


But anyway, I'll go the easy route of writing a Resource impl that uses 
our internal api.


-- 
-Torgeir


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: serving jsp pages from slide repository

Posted by Remy Maucherat <re...@apache.org>.
> Remy Maucherat wrote:
> >
> > You can do that, but it's a lot more complex than that to do. Basically,
you
> > need an implementation of a Tomcat 4 Resources written to access a Slide
> > namespace (instead of, for example, the filesystem).
> > I just wrote (yesterday) some docs on that:
> > http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/resources.html
>
> Bottom line; Tomcat 4.* makes use of the Resource impl through the
> JspServlet, but there is no default Resource implementation that have
> the "loopback mount" effect I'm looking for?

Sorry, I think I misunderstood your question. What you want is serve the
webapp which would be stored on a WebDAV server somewhere else, right ?
I translated webdav -> slide; sorry.

> I guess it might be dangerous to have a Resource impl use the mapper
> recursively, since it might invoke the JspServlet which invokes the
> JspServlets.... etc.

No, you can write a JNDI directory context which would use WebDAV, and that
would allow Catalina to run the webapp stored in the WebDAV server.

> > The standalone Slide server uses that to do what you want.
> > You can look at the source in wrappers/jndi/SlideDirContext.java. It's
not
> > trivial to configure, however, so the easiest is to just use (and maybe
> > tweak) the standalone server.
>
> Ok. We have a webdav servlet based on the simple tomcat webdav servlet,
> so it's not quite slide. But I will take a look at the slide Resource
> interface to adapt it to our needs.

The SlideDirContext isn't WebDAV based at all. Instead, it just uses the
Slide Java API. So you can use it as sample code on how to write the
directory context, but not much more.
If you get it to work (or at least get it in a useable state), and you were
willing to donate the code to Slide, I think it would be a useful addition.

You can also have a look in org.apache.naming.resources inside the Tomcat 4
source tree. It has a WAR based directory context, as well as the
"reference" filesystem based directory context. It also describe the special
object types you should use (for better performance mainly; you can write a
100% generic JNDI dir context, and it should work, but Catalina would then
create lots of wrapper objects to manipulate it).

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: serving jsp pages from slide repository

Posted by Torgeir Veimo <to...@vertech.no>.
Remy Maucherat wrote:
>>This is probably a faq.
>>
>>I'm trying to server jsp pages from a webdav repository. All files with
>>the *.jsp url are catched by JspServlet, but it seems that jspServlet
>>only looks for the jsp as a file under the web applications directory.
>>
>>Isn't the JspServlet supposed to follow the rules specified in the
>>web.xml file in tomcat 4.0.*?
>>
>>Log extract;
>>
>>2002-01-30 12:15:30 StandardContext[/repository]: Mapping
>>contextPath='/repository' with requestURI='/repository/test.jsp' and
>>relativeURI='/test.jsp'
>>2002-01-30 12:15:30 StandardContext[/repository]: Decoded
>>relativeURI='/test.jsp'
>>2002-01-30 12:15:30 StandardContext[/repository]:   Trying exact match
>>2002-01-30 12:15:30 StandardContext[/repository]:   Trying prefix match
>>2002-01-30 12:15:30 StandardContext[/repository]:   Trying extension match
>>2002-01-30 12:15:30 StandardContext[/repository]:  Mapped to servlet
>>'jsp' with servlet path '/test.jsp' and path info 'null' and update=true
>>
>>Then a 404.
>>
>>If I put the test.jsp file under webapps/repository/test.jsp as a file
>>it works.
>>
> 
> You can do that, but it's a lot more complex than that to do. Basically, you
> need an implementation of a Tomcat 4 Resources written to access a Slide
> namespace (instead of, for example, the filesystem).
> I just wrote (yesterday) some docs on that:
> http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/resources.html

Bottom line; Tomcat 4.* makes use of the Resource impl through the 
JspServlet, but there is no default Resource implementation that have 
the "loopback mount" effect I'm looking for?

I guess it might be dangerous to have a Resource impl use the mapper 
recursively, since it might invoke the JspServlet which invokes the 
JspServlets.... etc.

> The standalone Slide server uses that to do what you want.
> You can look at the source in wrappers/jndi/SlideDirContext.java. It's not
> trivial to configure, however, so the easiest is to just use (and maybe
> tweak) the standalone server.

Ok. We have a webdav servlet based on the simple tomcat webdav servlet, 
so it's not quite slide. But I will take a look at the slide Resource 
interface to adapt it to our needs.


-- 
-Torgeir


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: serving jsp pages from slide repository

Posted by Remy Maucherat <re...@apache.org>.
> This is probably a faq.
>
> I'm trying to server jsp pages from a webdav repository. All files with
> the *.jsp url are catched by JspServlet, but it seems that jspServlet
> only looks for the jsp as a file under the web applications directory.
>
> Isn't the JspServlet supposed to follow the rules specified in the
> web.xml file in tomcat 4.0.*?
>
> Log extract;
>
> 2002-01-30 12:15:30 StandardContext[/repository]: Mapping
> contextPath='/repository' with requestURI='/repository/test.jsp' and
> relativeURI='/test.jsp'
> 2002-01-30 12:15:30 StandardContext[/repository]: Decoded
> relativeURI='/test.jsp'
> 2002-01-30 12:15:30 StandardContext[/repository]:   Trying exact match
> 2002-01-30 12:15:30 StandardContext[/repository]:   Trying prefix match
> 2002-01-30 12:15:30 StandardContext[/repository]:   Trying extension match
> 2002-01-30 12:15:30 StandardContext[/repository]:  Mapped to servlet
> 'jsp' with servlet path '/test.jsp' and path info 'null' and update=true
>
> Then a 404.
>
> If I put the test.jsp file under webapps/repository/test.jsp as a file
> it works.

You can do that, but it's a lot more complex than that to do. Basically, you
need an implementation of a Tomcat 4 Resources written to access a Slide
namespace (instead of, for example, the filesystem).
I just wrote (yesterday) some docs on that:
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/resources.html

The standalone Slide server uses that to do what you want.
You can look at the source in wrappers/jndi/SlideDirContext.java. It's not
trivial to configure, however, so the easiest is to just use (and maybe
tweak) the standalone server.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>