You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Davide Bruzzone <da...@yahoo.com> on 2004/08/26 02:06:11 UTC

Problems deploying an example application

Greetings all...

I'm trying to deploy OJB's example servlet to test
end-to-end connectivity between the browser and the
database via OJB. I successfully built ojb-servlet.war
(BTW, I'm using OJB 1.0 RC 7) but am having trouble
running it on Tomcat 5.0.27...

I've configured Tomcat as follows:

- I dropped ojb-servlet.war into Tomcat's webapps
directory. When Tomcat starts up, it explodes the WAR
into webapps/ojb-servlet.
- I added the following context to Tomcat's server.xml

<Context path="" docBase="ojb-servlet"
debug="0"></Context>

- I added the following to Tomcat's web.xml (For some
reason, there's no web.xml in ojb-servlet/WEB_INF):

<servlet>
  <servlet-name>ojb-servlet</servlet-name>
 
<servlet-class>org.apache.ojb.servlet.TestServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>

...

<servlet-mapping>
  <servlet-name>ojb-servlet</servlet-name>
  <url-pattern>*.tst</url-pattern>
</servlet-mapping>

When I fire Tomcat up and enter
http://localhost:8080/foo.tst into my browser, I get
the following exception:

java.io.IOException: Can't read repository file
'/Users/davide/Desktop/jakarta-tomcat-5.0.27/webapps/ojb-servlet/WEB-INF/classes/repository.xml'

org.apache.ojb.servlet.TestServlet.getTableIterator(Unknown
Source)
	org.apache.ojb.servlet.TestServlet.doGet(Unknown
Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I've attached Tomcat's log file to this message...

My OJB.properties and repository.xml files (both of
which are required for OJB's runtime configuration)
are in
the ojb-servlet/WEB-INF/classes directory. I've tried
using either a relative or absolute path to
repository.xml in the OJB.properties file. No luck...

However, Tomcat's log file seems to be indicating that
Tomcat can't even find the test servlet. I presume
that this is having a knock-on effect that's
preventing the Web app's context, classpath, etc. from
being set up properly...

Any suggestions/ideas would be greatly appreciated at
this point as I've run out of ideas...

Cheers...

Dave Bruzzone


		
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush