You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Thomas Hill <Th...@t-online.de> on 2009/11/02 18:56:29 UTC

Managing the Derby Network Server remotely by using the servlet interface

Hi,

I am trying to deploy derby network server as a web app under tomcat5.5 
on a debian server. The server admin guide talks about this on page 40, 
but not in enough detail for me to understand what I might be missing or
doing wrong.

What I have done/tried/achieved so far:
1) the derby packages have been unpacked to /var/lib/tomcat5.5/webapps/derby
2) the file owner has been set to tomcat55 on all files in this folder 
and it's sub folders
3) the environment variables PATH, CLASSPATH, DERBY_HOME, JAVA_HOME have been set
and the following tests have been run successfully on the command line, so the
server could be started and stopped as intended:
-> java -jar -D/../derbydata $DERBY_HOME/lib/derbyrun.jar server start
(and java -jar $DERBY_HOME/lib/derbyrun.jar server shutdown)
and also
-> java org.apache.derby.drda.NetworkServerControl start
(and java org.apache.derby.drda.NetworkServerControl shutdown).
4) I could connect to the server using ij either from localhost or
(after adding -h 0.0.0.0 to the start command) from a client machine on my
network
5) I have also deployed the war file in to tomcat (not sure if this 
was needed)
6) in tomcat manager derby is listed as an application in the 'List 
Applications' section
7) the start command hyperlink is not underlined in tomcat initially, so I
assume this means the application is considered started and starts when
tomcat starts
8a) when using the 'Stop' command I am receiving a message 
'OK -Stopped application at conext path /derby'
8b) when then using the 'Start' command, I am receiving a message
'OK - Started application at context path /derby'
9) when trying to follow the hyperlink under path /derby on the same
screen which issues http://localhost:8180/derby/, I am getting http 404
the requested resource is not available.
10) when typing http://localhost:8180/derby/derbynet into the browser instead
I am getting HTTP 500 'Wrapper can not find servlet
org.apache.drda.NetServlet or a class it depends on'

Can someone please advise what is still needed or what I do wrong?

Thanks
Thomas



Re: Managing the Derby Network Server remotely by using the servlet interface

Posted by Thomas <Th...@t-online.de>.
Bryan 

you are right - I typed the wrong port in my write up; it should have been 
what you stated and documented in the wiki: 
==> http://localhost:8080/derby/derbynet ?

Regards
Thomas




Re: Managing the Derby Network Server remotely by using the servlet interface

Posted by Bryan Pendleton <bp...@amberpoint.com>.
Thomas Hill wrote:
>  I finally managed to get this running.

Great!

I took your notes and edited them into a page on the Derby wiki
http://wiki.apache.org/db-derby/NetworkServerServletInterface
so that hopefully it will be useful to others in the future.

One question:

> 3) Restarting Tomcat and then opening URL http://localhost:1527/derby/derbynet

Was this actually http://localhost:8080/derby/derbynet ?

Again, glad to hear it's working for you.

bryan



Re: Managing the Derby Network Server remotely by using the servlet interface

Posted by Thomas Hill <Th...@t-online.de>.
Bryan,

thanks for your advise. With your guidance and some further reading how to
deploy apps under Tomcat I finally managed to get this running.

As a short summary:
1) Deploying the war file into tomcat using the tomcat manager application
placed the war file 'derby.war' into tomcat's webapps folder
(/var/lib/tomcat5.5/webapps/ on my debian system) and also created a folder
within webapps called 'derby'. Initially the derby folder created only contained
one subfolder 'WEB-INF' in which only one file 'web.xml' was found.
2) Within the WEB-INF folder I then manually created an additional folder 'lib'
into which I placed 'derby.jar', 'derbynet.jar' and 'derbytools.jar'. (Note: I
made user 'tomcat55' the owner of the folders created and of all derby jar files
which I copied over, and specified 'nogroup' as group.
(so I actually did not need to place anything in ../common/lib).
3) Restarting Tomcat and then opening URL http://localhost:1527/derby/derbynet
returned a screen confirming that the 'Derby Netwrok Server has been started'
and the screen also offers some buttons, e.g. one 'Stop' button which can be
used to stop the server again.

The last thing I did was to add line 
derby.system.home=/var/lib/derby/derbydata as the last entry in file
'catalina.properties' (found under /usr/share/tomcat5.5/conf) so that database
files are created and stored in a separate location and not within the tomcat
hierarchy.

Hope this write up helps people looking for some guidance (beyond what is
documented in the admin guide) on topic.

Regards
Thomas


Re: Managing the Derby Network Server remotely by using the servlet interface

Posted by Bryan Pendleton <bp...@amberpoint.com>.
> 10) when typing http://localhost:8180/derby/derbynet into the browser instead
> I am getting HTTP 500 'Wrapper can not find servlet
> org.apache.drda.NetServlet or a class it depends on'

Hi Thomas,

I'm not a big user of derby.war so I'm not sure what's wrong here, but
the first thing to know is that the way derby.war works, you are expected
to put the other derby*.jar files into the Tomcat server's class path.

That is, derby.war just contains a web.xml, which says the name of
a class file, but derby.war doesn't provide that class file. The class
file (org.apache.drda.NetServlet) lives in derbynet.jar.

SO make sure that derbynet.jar is somewhere that is in the Tomcat server's classpath.

For example, try copying the derby jar files into /var/lib/tomcat5.5/common/lib.

Then see if the servlet runs any better.

thanks,

bryan