no 404? (only 500)

116 views
Skip to first unread message

Robert Koberg

unread,
Jan 28, 2009, 4:50:58 PM1/28/09
to ope...@googlegroups.com
Hi,

just starting -- not in too deep, yet...

If I run the example/test webapps and try to access a page that does
not exist, I get a status code of 500. But, why would a page not found
result in a server error? I assume, if I set an error page in the
web.xml, it would work(??). But, I believe it should return a status
code of 404, right?

Also, is there any documentation available at this point? for example,
configuration outside of the spec.

best,
-Rob

LondonMike

unread,
Jan 29, 2009, 2:48:59 AM1/29/09
to OpenGSE
Hi Robert,

Thanks for letting us know, I'll try and have a look at that today. By
the way, what did you mean by
"configuration outside of the spec"?

-Mike

Robert Koberg

unread,
Jan 29, 2009, 4:28:47 AM1/29/09
to ope...@googlegroups.com

On Jan 29, 2009, at 2:48 AM, LondonMike wrote:

>
> Hi Robert,
>
> Thanks for letting us know, I'll try and have a look at that today. By
> the way, what did you mean by
> "configuration outside of the spec"?

Basically setting up and running the server with instructions (java or
xml or ?) other than in the /WEB-INF/web.xml.

Basically, just more information to read without having to wade
through the source. For example, "developers need to ensure the proper
HTTP response code is sent"

thanks,
-Rob

LondonMike

unread,
Jan 29, 2009, 5:16:17 AM1/29/09
to OpenGSE
Hi Robert,

The end of the "Getting Started" wiki page has the following:

java -jar minigse/opengse.jar --webapps=./testing/server-side/webapps
--port=8080

which generically is just:
/path/to/my/java -jar /path/to/my/opengse.jar --webapps=/path/to/where/
my/warfiles/are --port=8243

(which assumes port 8243 is the desired port)

Is this the kind of thing you are looking for?

Robert Koberg

unread,
Jan 29, 2009, 10:58:20 AM1/29/09
to ope...@googlegroups.com

On Jan 29, 2009, at 5:16 AM, LondonMike wrote:

>
> Hi Robert,
>
> The end of the "Getting Started" wiki page has the following:
>
> java -jar minigse/opengse.jar --webapps=./testing/server-side/webapps
> --port=8080
>
> which generically is just:
> /path/to/my/java -jar /path/to/my/opengse.jar --webapps=/path/to/
> where/
> my/warfiles/are --port=8243
>
> (which assumes port 8243 is the desired port)
>
> Is this the kind of thing you are looking for?

I did get that :) Rather I was looking for something like Tomcat's
server.xml and Context files/elements (even if you configure it in
java code). For example, how can I set up a context without dropping a
directory in the webapps dir? Lets say I am using Tomcat, Jetty and
GSE. I want to keep some static assets in their own context that I
share between the containers. I follow some javascript libraries like
dojo, jquery and yui. I have them in my eclipse workspace and svn
update them there. In tomcat, I create a $TOMCAT/conf/Catalina/
dojo.xml that points the /dojo context's docbase to my workspace's
dojo location.

best,
-Rob

LondonMike

unread,
Jan 29, 2009, 12:10:51 PM1/29/09
to OpenGSE
Okay, what if you have a file called opengse.properties and it looks
as follows:

port=8080
webapp=${basedir}/path/to/dojo/context
context=dojo

Then you issue the following command line:
java -jar /path/to/opengse.jar --props=/path/to/opengse.properties

It should deploy your dojo webapp under the context "/dojo" (the $
{basedir} property is translated into the directory where
opengse.properties is)

Is that more along the lines of what you are looking for?

Robert Koberg

unread,
Jan 29, 2009, 12:32:01 PM1/29/09
to ope...@googlegroups.com

On Jan 29, 2009, at 12:10 PM, LondonMike wrote:

>
> Okay, what if you have a file called opengse.properties and it looks
> as follows:
>
> port=8080
> webapp=${basedir}/path/to/dojo/context
> context=dojo
>
> Then you issue the following command line:
> java -jar /path/to/opengse.jar --props=/path/to/opengse.properties
>
> It should deploy your dojo webapp under the context "/dojo" (the $
> {basedir} property is translated into the directory where
> opengse.properties is)
>
> Is that more along the lines of what you are looking for?

Kind of. But, I might also have:

/images
/app1
/app2
/whatev

What about:

---

port = 8080

webapp.ROOT.docroot = /some/path

webapp.dojo.contextPath = /dojo
webapp.dojo.docroot = /path/to/dojo

webapp.myapp.contextPath = /my-app
webapp.myapp.docroot = /pathx/to/myapp

---

one of the nice things about Tomcat's context files are you can just
drop one in the engine directory and your off and running.

best,
-Rob


>
>

LondonMike

unread,
Jan 29, 2009, 12:42:18 PM1/29/09
to OpenGSE
Okay, so it sounds to me like you want to be able to deploy multiple
webapps with each docroot not necessarily sharing the same parent
directory, and each webapp's context not necessarily derived from the
docroot directory name. Is that it? How inconvenient is it to have all
of your deployed webapps share the same parent directory?

Robert Koberg

unread,
Jan 29, 2009, 12:45:53 PM1/29/09
to ope...@googlegroups.com
Or, perhaps better, just use the tomcat configurations files to load
up GSE. This way someone could just drop in (or even point to) a
$tomcat/conf and you are off and running

best,
-Rob

Robert Koberg

unread,
Jan 29, 2009, 1:18:49 PM1/29/09
to ope...@googlegroups.com

On Jan 29, 2009, at 12:42 PM, LondonMike wrote:

>
> Okay, so it sounds to me like you want to be able to deploy multiple
> webapps with each docroot not necessarily sharing the same parent
> directory, and each webapp's context not necessarily derived from the
> docroot directory name. Is that it? How inconvenient is it to have all
> of your deployed webapps share the same parent directory?

Just a lot of duplication. And in the case of version managed
context's, lots of copying whenever an update comes down with changes.

LondonMike

unread,
Jan 29, 2009, 3:52:58 PM1/29/09
to OpenGSE
Okay, I'll see what I can whip up. Right now my priority is
investigating the original problem you posted (500 versus 404).

Thanks a lot for your feedback!
-Mike

LondonMike

unread,
Jan 30, 2009, 5:22:51 AM1/30/09
to OpenGSE
Okay, I've added a new deployment feature; you can now do this:

java -jar opengse.jar --webapp.foo=/path/to/bar.war --webapp.bar=/path/
to/elsewhere/foo

where /path/to/elsewhere/foo is an already-deployed webapp which will
be deployed as the context "bar"
and /path/to/bar.war is a war file that will be deployed to /path/to/
foo/ under the context of "foo"

You should also be able to do this:
java -jar opengse.jar --props=myprops.properties

with myprops.properties looking like this:
pathto=/path/to
webapp.foo=${pathto}/bar.war
webapp.bar=${pathto}/elsewhere/foo

How does that sound?

Robert Koberg

unread,
Jan 30, 2009, 9:01:50 AM1/30/09
to ope...@googlegroups.com

Hi,

thanks for the quick turnaround on the changes!

I just updated, built and deployed with a properties file, which looks
like:

port=8081

docs=/Users/me/Documents
workspace=${docs}/workspace

webapp.yui=${docs}/yui3
webapp.fscore=${workspace}/myapp/docroot

The yui webapp is simply static files. It has no dynamic nature. To be
able to start opengse, I had to create an empty WEB-INF/web.xml. Must
that be required for a static context? (perhaps, like tomcat, there is
a default web.xml??)

I went to my /fscore (as opposed to /fscore/index.html) webapp which
has an index.html as a child. I received the exception below (status
code 500). I edited my web.xml to add the index.html as a welcome file
(in tomcat this is picked up from the default conf/web.xml). I needed
to restart to pick up the change (which is fine) and it worked fine.

best,
-Rob

rkmbp:minigse rkobergmac$ java -jar opengse.jar --props=gse.properties
Jan 30, 2009 8:46:23 AM com.google.opengse.core.NetSelector listen
INFO: listening on 8081
Jan 30, 2009 8:46:47 AM com.google.opengse.webapp.WebAppContextImpl log
INFO:
java.lang.NullPointerException
at
com
.google
.opengse.webapp.FileServingServlet.service(FileServingServlet.java:83)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
com.google.opengse.webapp.ServletHandler.doFilter(ServletHandler.java:
63)
at
com
.google
.opengse
.filters
.RegularExpressionRequestHandler
.doFilter(RegularExpressionRequestHandler.java:126)
at com.google.opengse.webapp.WebAppImpl.doFilter(WebAppImpl.java:566)
at
com
.google
.opengse
.webapp.WebAppCollectionImpl.doFilter(WebAppCollectionImpl.java:266)
at
com
.google
.opengse
.HttpRequestHandlerAdapter
.handleRequest(HttpRequestHandlerAdapter.java:42)
at
com.google.opengse.core.HttpConnection.runServlet(HttpConnection.java:
503)
at com.google.opengse.core.HttpConnection.run(HttpConnection.java:452)
at
com
.google
.opengse.util.QueueExtractor.runUntilInterrupted(QueueExtractor.java:33)
at com.google.opengse.util.QueueExtractor.run(QueueExtractor.java:39)
at java.lang.Thread.run(Thread.java:637)
Reply all
Reply to author
Forward
0 new messages